/* ============== 基础 ============== */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* 全局 .hidden 工具类(对任何元素都生效) */
.hidden { display: none !important; }

:root {
  --bg: #f7f7f8;
  --bg-card: #ffffff;
  --bg-soft: #fafafa;
  --bg-hover: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #1f2328;
  --text-soft: #6b7280;
  --text-faint: #9ca3af;
  --primary: #ff2442;     /* 小红书红 */
  --primary-hover: #e01e3a;
  --primary-soft: #ffe8eb;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #dc2626;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
}

html, body { height: auto; min-height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto;
}

/* ============== 顶部 ============== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 10;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.2;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ============== 用户胶囊 + 下拉(大厂模式) ============== */
.user-menu {
  position: relative;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s ease;
}

.user-pill:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.user-pill[aria-expanded="true"] {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.user-pill .avatar {
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-pill .name {
  font-size: 13px;
  font-weight: 500;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-pill .caret {
  font-size: 10px;
  color: var(--text-faint);
  transition: transform 0.15s ease;
}

.user-pill[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 200;
  animation: dropdown-in 0.15s ease;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-dropdown-header .dd-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.user-dropdown-header .dd-sub {
  font-size: 11px;
  color: var(--text-soft);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  font-family: inherit;
  transition: background 0.1s;
}

.user-dropdown-item:hover {
  background: var(--bg-hover);
}

.user-dropdown-item.danger {
  color: var(--danger);
}

.user-dropdown-item.danger:hover {
  background: #fef2f2;
}

/* ============== 布局 ============== */
.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  flex: 1;
  min-height: 0;
}

.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: 100vh;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 8px;
}

.sidebar-header h2 { font-size: 15px; font-weight: 600; }

.search {
  margin: 0 16px 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg-soft);
}

.search:focus { outline: none; border-color: var(--primary); }

.post-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 16px;
}

.post-item {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 4px;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.post-item:hover { background: var(--bg-soft); }
.post-item.active { background: var(--primary-soft); border-color: var(--primary); }

.post-item .title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-item .date { font-size: 11px; color: var(--text-soft); margin-top: 4px; }

.empty {
  padding: 16px;
  text-align: center;
  color: var(--text-soft);
  font-size: 13px;
}

/* ============== 主区 ============== */
.workspace {
  padding: 16px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}

.card-header h3 { font-size: 14px; font-weight: 600; }
.card-header .meta { font-size: 12px; color: var(--text-soft); }
.header-actions { display: flex; align-items: center; gap: 12px; }

.card-body { padding: 16px; }

.original-content {
  font-size: 13px;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, monospace;
  background: var(--bg-soft);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  line-height: 1.6;
}

.original-content.empty { color: var(--text-soft); font-family: inherit; }

/* ============== 控制栏 ============== */
.control-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px;
  flex-wrap: wrap;
}

.control-bar label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-soft); }

#style-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg-card);
}

.status { font-size: 12px; color: var(--text-soft); }
.status.error { color: var(--danger); }
.status.success { color: var(--success); }

/* ============== 表单 ============== */
.field-label {
  display: block;
  font-size: 12px;
  color: var(--text-soft);
  margin: 12px 0 6px;
  font-weight: 500;
}

.field-label:first-child { margin-top: 0; }

#result-title, #result-tags, .prompt-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-card);
}

#result-title:focus, #result-tags:focus, .prompt-input:focus {
  outline: none; border-color: var(--primary);
}

#result-content {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.7;
  resize: vertical;
  background: var(--bg-card);
  min-height: 200px;
}

#result-content:focus { outline: none; border-color: var(--primary); }

.disclosure-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  font-size: 12px;
  color: #78350f;
}

.disclosure-row.hidden { display: none; }

.warn-badge {
  background: var(--warn);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ============== 按钮 ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover { background: var(--bg-soft); border-color: var(--text-soft); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-ghost { background: transparent; }
.btn-icon { padding: 4px 10px; font-size: 16px; }

.btn-mini {
  padding: 4px 8px;
  font-size: 11px;
}

/* ============== 图片 ============== */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.image-slot {
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 10px;
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slot-label { font-size: 12px; font-weight: 500; color: var(--text-soft); }

.slot-preview {
  aspect-ratio: 3/4;
  max-height: 160px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-soft);
  overflow: hidden;
  position: relative;
}

.slot-preview:not(.empty) { border-style: solid; }

.slot-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.slot-actions { display: flex; gap: 4px; }
.file-input { display: none; }

.prompt-input { font-size: 12px; padding: 6px 8px; }

/* ============== Modal 通用 ============== */
.modal {
  position: fixed; inset: 0;
  background: rgba(15, 18, 22, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: modal-bg-in 0.18s ease;
}

@keyframes modal-bg-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  width: 90%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-content-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-content-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-content h3 { font-size: 16px; }
.modal-tip { font-size: 12px; color: var(--text-soft); }

#paste-title, #paste-markdown {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-soft);
}

#paste-markdown { font-family: ui-monospace, monospace; resize: vertical; min-height: 200px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* 通用 modal 关闭按钮(右上角) */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--text-soft);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  font-family: inherit;
  padding: 0;
  z-index: 2;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.modal-close:active {
  transform: scale(0.95);
}

/* ============== Auth Modal(大厂风格) ============== */
.auth-modal {
  width: 92%;
  max-width: 420px;
  padding: 36px 36px 28px;
  gap: 0;
  align-items: stretch;
  text-align: center;
  background: var(--bg-card);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin: 0 auto 18px;
  display: block;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(255, 36, 66, 0.15);
}

.auth-modal h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

.auth-sub {
  font-size: 13px;
  color: var(--text-soft);
  margin: 6px 0 24px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.auth-field {
  position: relative;
  width: 100%;
}

.auth-field input {
  width: 100%;
  height: 46px;
  padding: 16px 14px 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  transition: all 0.15s;
  outline: none;
}

.auth-field input:hover {
  border-color: var(--border-strong);
}

.auth-field input:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.12);
}

.auth-field label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-soft);
  pointer-events: none;
  transition: all 0.15s ease;
  background: transparent;
  padding: 0 4px;
}

.auth-field input:focus + label,
.auth-field input:not(:placeholder-shown) + label {
  top: 8px;
  transform: translateY(0);
  font-size: 11px;
  color: var(--text-soft);
  background: var(--bg-card);
  padding: 0 4px;
}

.auth-field input:focus + label {
  color: var(--primary);
}

.auth-error {
  font-size: 12px;
  color: var(--danger);
  text-align: left;
  padding: 8px 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  line-height: 1.4;
}

.auth-error.hidden { display: none; }

.btn-auth-submit {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.15s;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.btn-auth-submit:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 36, 66, 0.25);
}

.btn-auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-auth-submit.loading::after {
  content: "...";
  animation: dots 1s infinite;
}

@keyframes dots {
  0%, 20%   { content: "."; }
  40%       { content: ".."; }
  60%, 100% { content: "..."; }
}

.auth-switch {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
}

.auth-switch a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  margin-left: 4px;
  cursor: pointer;
  transition: opacity 0.1s;
}

.auth-switch a:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* ============== 用户菜单旧版(已废弃) ============== */
.user-info { display: none; }

/* ============== Config Modal ============== */
.config-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-empty {
  padding: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: 6px;
}

.config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}
.config-item .config-info {
  flex: 1;
  min-width: 0;
}
.config-item .config-info strong {
  display: inline-block;
  margin-right: 8px;
}
.config-item .config-meta {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 2px;
}
.config-item .config-actions {
  display: flex;
  gap: 6px;
}

.badge-default {
  display: inline-block;
  padding: 1px 6px;
  background: var(--success);
  color: white;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}

.btn-set-default {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 8px;
}
.btn-set-default:hover { color: var(--primary); border-color: var(--primary); }

.btn-del {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 8px;
}
.btn-del:hover { color: var(--danger); border-color: var(--danger); }

.config-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-soft);
}

/* ============== Toast ============== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  transition: opacity 0.2s;
}

.toast.hidden { opacity: 0; pointer-events: none; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ============== 滚动条 ============== */
.post-list::-webkit-scrollbar,
.original-content::-webkit-scrollbar { width: 8px; }

.post-list::-webkit-scrollbar-thumb,
.original-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

/* ============== Sidebar 空状态(未登录/未配 Halo) ============== */
.sidebar-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  gap: 12px;
  color: var(--text-soft);
}

.sidebar-empty-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 4px;
  opacity: 0.7;
}

.sidebar-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.sidebar-empty-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-soft);
  max-width: 240px;
}

.sidebar-empty .btn {
  margin-top: 8px;
}

.sidebar-empty.hidden { display: none; }

/* ============== Auth 免责声明 + 确认 ============== */
.auth-modal-register {
  max-width: 540px;
  max-height: 92vh;
}

.auth-disclaimer {
  width: 100%;
  text-align: left;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.auth-disclaimer.hidden { display: none; }

.auth-disclaimer h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.auth-disclaimer ol {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-soft);
  padding-left: 18px;
  margin: 0;
}

.auth-disclaimer ol li {
  margin-bottom: 4px;
}

.auth-disclaimer ol li strong {
  color: var(--text);
  font-weight: 600;
}

.auth-disclaimer a {
  color: var(--primary);
  text-decoration: none;
}

.auth-disclaimer a:hover {
  text-decoration: underline;
}

.auth-confirm {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.auth-confirm p {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
  margin-bottom: 8px;
}

.auth-confirm code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, monospace;
  font-size: 12px;
  color: var(--primary);
  background: #fff5f6;
  border: 1px solid #ffd1d8;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
  user-select: all;
  word-break: break-all;
}

.auth-confirm input.valid {
  border-color: var(--success);
  background: #f0fdf4;
}

.auth-confirm input.invalid {
  border-color: var(--danger);
  background: #fef2f2;
}

/* ============== Config Modal 分块大厂风 ============== */
.config-modal {
  width: 92%;
  max-width: 680px;
  padding: 32px 36px;
  gap: 0;
}

.config-modal-header {
  margin-bottom: 24px;
}

.config-modal h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.config-section {
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

.config-section:first-of-type {
  border-top: none;
  padding-top: 8px;
}

.config-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.config-section-title .icon {
  font-size: 16px;
  line-height: 1;
}

.config-section-title h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  flex: 1;
}

.config-section-title .badge-required {
  font-size: 10px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.config-section-title .badge-optional {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--bg-hover);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.config-section-desc {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
  margin: 0 0 12px;
}

.btn-add {
  background: transparent;
  border: 1px dashed var(--border-strong);
  color: var(--text-soft);
  font-size: 13px;
  padding: 10px 14px;
  width: 100%;
  margin-top: 8px;
  border-radius: 8px;
  transition: all 0.15s;
}

.btn-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
  border-style: solid;
}

/* 现有 config-item 升级 */
.config-item {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 13px;
  margin-bottom: 8px;
  transition: all 0.15s;
}

.config-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-card);
}

.config-item .config-info {
  flex: 1;
  min-width: 0;
}

.config-item .config-info strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text);
}

.config-item .config-info .config-detail {
  font-size: 11px;
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, monospace;
  word-break: break-all;
  line-height: 1.4;
}

.config-item .config-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.config-item .badge-default {
  display: inline-block;
  padding: 1px 6px;
  background: var(--success);
  color: white;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
}

/* ============== Provider Form Modal(大输入框 + 浮动 label) ============== */
.provider-form-modal {
  width: 92%;
  max-width: 520px;
  padding: 32px 32px 24px;
  gap: 0;
}

.provider-form-header {
  margin-bottom: 24px;
}

.provider-form-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.provider-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.pf-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pf-field input {
  width: 100%;
  height: 50px;
  padding: 22px 16px 8px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  transition: all 0.15s;
  outline: none;
}

.pf-field input:hover {
  border-color: var(--border-strong);
}

.pf-field input:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.12);
}

.pf-field label {
  position: absolute;
  left: 16px;
  top: 16px;
  font-size: 15px;
  color: var(--text-faint);
  pointer-events: none;
  transition: all 0.15s ease;
  background: transparent;
  padding: 0 4px;
  font-weight: 400;
}

.pf-field input:focus + label,
.pf-field input:not(:placeholder-shown) + label {
  top: 8px;
  font-size: 11px;
  color: var(--text-soft);
  background: var(--bg-card);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.pf-field input:focus + label {
  color: var(--primary);
}

.pf-field .pf-hint {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.4;
  margin-top: 2px;
  padding-left: 2px;
}

.pf-field .pf-hint code {
  background: var(--bg-hover);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--text-soft);
}

.pf-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}

.pf-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

.pf-field.hidden { display: none; }

.post-list::-webkit-scrollbar-thumb,
.original-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

/* ============== 进度提示(2026-08-12:动态进度让用户知道在跑)============== */
.status-progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fff1f2, #ffe4e6, #fff1f2);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

/* 全局 spinner(可以独立用,例如 cover 按钮内) */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 36, 66, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: -2px;
}

.status-progress .progress-text {
  display: inline-block;
  min-width: 120px;
  transition: opacity 0.25s;
}

.status-progress .progress-dots::after {
  content: "";
  display: inline-block;
  width: 14px;
  text-align: left;
  animation: dots 1.4s steps(4, end) infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* indeterminate 进度条 */
.progress-bar {
  display: inline-block;
  width: 80px;
  height: 4px;
  background: rgba(255, 36, 66, 0.15);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.progress-bar .progress-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: var(--primary);
  border-radius: 2px;
  animation: progress-indeterminate 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes progress-indeterminate {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* 成功/失败状态保持简单 */
.status.success { color: #16a34a; font-weight: 500; }
.status.error   { color: #dc2626; font-weight: 500; }

/* ============== Lightbox 图片放大(2026-08-12)== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 80px;
  cursor: zoom-out;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: lightbox-fade-in 0.18s ease-out;
}
.lightbox.hidden { display: none; }

@keyframes lightbox-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-img {
  max-width: 96vw;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
  user-select: none;
  -webkit-user-drag: none;
  background: #fff; /* data: URL 半透明图也能看清 */
}

.lightbox-label {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 14px;
  border-radius: 999px;
  pointer-events: none;
  max-width: 70vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  pointer-events: none;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 10;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

.lightbox-download {
  position: absolute;
  top: 16px;
  right: 68px;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 20px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  z-index: 10;
}
.lightbox-download:hover { opacity: 0.85; }

/* 缩略图可点击的视觉提示 */
.slot-preview:not(.empty) img,
.slots .image-slot .slot-preview img {
  cursor: zoom-in;
  transition: transform 0.15s;
}
.slot-preview:not(.empty) img:hover,
.slots .image-slot .slot-preview img:hover {
  transform: scale(1.02);
}

/* ============== mini-select 小下拉(2026-08-12)== */
.mini-select {
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  max-width: 220px;
}
.mini-select:hover { border-color: var(--primary); }
