﻿/* ============================================================
   admin.css · 管理后台（与工作台共用 style.css 的配色变量）
   ============================================================ */

.admin-app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ---------------- 顶栏 ---------------- */
.admin-topbar {
  height: 62px; flex: 0 0 62px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 30;
}
.admin-topbar-center { display: flex; align-items: center; gap: 10px; margin: 0 auto; }
.tier-badge {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 13px;
  font-size: 12.5px; font-weight: 600;
  background: var(--surface-2);
  color: var(--text-2);
}
.tier-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.tier-badge.server { background: var(--success-soft); border-color: #bfe8cf; color: var(--success); }
.tier-badge.server .tier-dot { background: var(--success); }
.tier-badge.local { background: var(--brand-soft); border-color: #dbe3ff; color: var(--brand); }
.tier-badge.local .tier-dot { background: var(--brand); }
.tier-badge.defaults { background: var(--surface-3); color: var(--text-2); }
.server-hint { font-size: 11.5px; color: var(--text-3); }
.admin-topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

/* ---------------- 布局 ---------------- */
.admin-layout { flex: 1; display: flex; min-height: 0; }

/* ---------------- 左侧导航 ---------------- */
.admin-sidebar {
  width: 232px; flex: 0 0 232px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  overflow-y: auto;
}
.nav-group { margin-bottom: 20px; }
.nav-group-title {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  letter-spacing: 1.2px; padding: 0 8px 8px;
}
.nav-sections, .nav-pages { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: var(--text-2);
  cursor: pointer; border: 1px solid transparent;
  transition: all .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-link .n-ico { width: 15px; height: 15px; flex: 0 0 auto; }
.nav-link.section-link { font-size: 12.5px; padding: 6px 10px 6px 14px; }
.nav-link .n-count { margin-left: auto; font-size: 11px; color: var(--text-3); background: var(--surface-3); border-radius: 99px; padding: 0 7px; }

/* ---------------- 内容区 ---------------- */
.admin-main { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 24px 90px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 20px; font-weight: 800; }
.page-head p { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* ---------------- 分节卡片 ---------------- */
.section-card { margin-bottom: 18px; }
.section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.section-head .sh-title { font-size: 14.5px; font-weight: 700; }
.section-head .sh-desc { font-size: 12px; color: var(--text-3); margin-left: 4px; font-weight: 400; }
.section-head .ctx-spacer { flex: 1; }

/* ---------------- 表单控件 ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; line-height: 1.6; }
.field .err { font-size: 11.5px; color: var(--danger); margin-top: 4px; }
.field textarea { min-height: 110px; }
.field textarea.role { min-height: 130px; font-size: 13px; }
.field .char-count { text-align: right; font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* ---------------- 占位符清单 ---------------- */
.ph-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all .15s;
  max-width: 100%;
}
.ph-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.ph-chip code {
  font-family: var(--mono); font-size: 11.5px; color: var(--brand); font-weight: 700;
  background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px;
}
.ph-chip span { font-size: 12px; color: var(--text-2); }
.ph-chip small { font-size: 10.5px; color: var(--text-3); display: block; }
.ph-group-title { font-size: 12px; font-weight: 700; color: var(--text-2); margin: 10px 0 6px; }

/* ---------------- 预览 ---------------- */
.preview-blocks { display: flex; flex-direction: column; gap: 12px; }
.preview-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.preview-block-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px; font-weight: 700;
}
.preview-block-head .pb-count { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.preview-block-body {
  padding: 14px;
  font-size: 13px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-word;
  background: #fff;
  max-height: 360px; overflow-y: auto;
  color: var(--text);
}
.preview-block-body .htag { color: var(--brand); font-weight: 600; }
.preview-block-body .unk { color: var(--danger); background: var(--danger-soft); border-radius: 4px; padding: 0 3px; }

/* ---------------- 试运行 ---------------- */
.trial-result { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.trial-result .tr-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 13px; font-weight: 700; }
.trial-result .tr-body { padding: 14px; font-size: 13px; line-height: 1.8; white-space: pre-wrap; background: #fff; max-height: 320px; overflow-y: auto; }
.trial-result .tr-meta { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.trial-result.ok { border-color: #bfe8cf; }
.trial-result.err { border-color: #fecaca; }
.trial-result.err .tr-body { color: var(--danger); }
.trial-note { font-size: 11.5px; color: var(--warning); background: var(--warning-soft); border: 1px solid #fcd9a8; border-radius: 8px; padding: 8px 12px; margin-top: 10px; }
/* ---------------- 创作风格 ---------------- */
.style-item {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--surface);
}
.style-item .si-order { display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.style-item .si-order button {
  width: 24px; height: 22px; border-radius: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  font-size: 12px; cursor: pointer;
}
.style-item .si-order button:hover:not(:disabled) { color: var(--brand); border-color: var(--brand); }
.style-item .si-order button:disabled { opacity: .35; cursor: not-allowed; }
.style-item .si-main { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.style-item .si-actions { display: flex; gap: 6px; padding-top: 2px; }
.tones-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tone-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid #dbe3ff;
  border-radius: 99px;
  padding: 4px 10px 4px 12px;
  font-size: 12.5px; font-weight: 600;
}
.tone-tag button { border: none; background: transparent; color: var(--text-3); cursor: pointer; font-size: 13px; }
.tone-tag button:hover { color: var(--danger); }

/* ---------------- 模型参数 ---------------- */
.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.model-grid .span-2 { grid-column: 1 / -1; }
.key-input-wrap { position: relative; }
.key-input-wrap .toggle-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: var(--text-3); cursor: pointer; font-size: 14px;
}
.temp-row { display: flex; align-items: center; gap: 12px; }
.temp-row input[type=range] { flex: 1; }
.key-warn {
  font-size: 11.5px; color: var(--warning);
  background: var(--warning-soft);
  border: 1px solid #fcd9a8;
  border-radius: 8px;
  padding: 7px 11px;
  line-height: 1.6;
}
.temp-tip { font-size: 11.5px; color: var(--text-3); line-height: 1.6; }

/* ---------------- 商品库 ---------------- */
.prod-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.batch-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--brand-soft);
  border: 1px solid #dbe3ff;
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: 13px; color: var(--brand); font-weight: 600;
}
.prod-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prod-table th, .prod-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.prod-table th { font-size: 12px; color: var(--text-3); background: var(--surface-2); font-weight: 700; }
.prod-table tr:hover td { background: var(--surface-2); }
.prod-table tr.selected td { background: var(--brand-soft); }
.prod-table .p-name { font-weight: 600; }
.prod-table .p-tags { font-size: 11.5px; color: var(--text-3); }
.prod-table .p-price { color: var(--hot); font-weight: 800; }
.prod-table .p-origin { color: var(--text-3); text-decoration: line-through; font-size: 11.5px; }
.prod-table .cell-actions { white-space: nowrap; }
.prod-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.prod-card-cell { position: relative; }
.prod-card-cell .sel-check {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer;
}
.prod-card-cell.selected .product-card { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(59,109,246,.25); }
.view-toggle { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.view-toggle button { border: none; background: transparent; padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--text-2); border-radius: 7px; cursor: pointer; }
.view-toggle button.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }

/* 编辑弹窗 */
.prod-edit-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; }
.prod-edit-fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.emoji-panel { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.emoji-panel button {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; font-size: 19px; cursor: pointer;
}
.emoji-panel button.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(59,109,246,.2); }
.grad-panel { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.grad-swatch { width: 34px; height: 34px; border-radius: 8px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.grad-swatch.active { box-shadow: 0 0 0 2px var(--brand); }
.tag-input-row { display: flex; gap: 8px; align-items: center; }
.live-preview { position: sticky; top: 0; }
.live-preview .lp-label { font-size: 12px; font-weight: 700; color: var(--text-3); margin-bottom: 8px; }
.discount-live { font-size: 13px; font-weight: 700; color: var(--brand); }

/* 导入问题清单 */
.issue-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.issue-item { font-size: 12.5px; color: var(--danger); background: var(--danger-soft); border-radius: 6px; padding: 6px 10px; }

/* ---------------- 新闻来源 ---------------- */
.src-item {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 10px;
  background: var(--surface);
}
.src-item .si-name { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.src-item .si-url { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }
.src-item .si-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.test-results { display: flex; flex-direction: column; gap: 8px; }
.test-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
}
.test-item.ok { border-color: #bfe8cf; background: var(--success-soft); }
.test-item.fail { border-color: #fecaca; background: var(--danger-soft); }
.test-item .t-ico { width: 16px; height: 16px; flex: 0 0 auto; }
.test-item.ok .t-ico { color: var(--success); }
.test-item.fail .t-ico { color: var(--danger); }
.test-item .t-name { font-weight: 600; }
.test-item .t-detail { margin-left: auto; font-size: 11.5px; color: var(--text-2); text-align: right; }

/* ---------------- 底部操作栏 ---------------- */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 58px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px 0 254px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 18px rgba(16,24,40,.06);
  z-index: 40;
}
.dirty-indicator { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.dirty-indicator .di-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.dirty-indicator.dirty { color: var(--warning); font-weight: 700; }
.dirty-indicator.dirty .di-dot { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); animation: pulse 1.6s ease infinite; }
.kbd {
  font-family: var(--font); font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,.25); border: 1px solid rgba(255,255,255,.4);
  border-radius: 5px; padding: 1px 6px; margin-left: 4px;
}

/* 概览 */
.overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tier-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface); }
.tier-card .tc-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.tier-card .tc-desc { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.7; }
.tier-card.current { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(59,109,246,.18); }


/* ---------------- 评测台 ---------------- */
.eval-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.eval-tabs button { border: 1px solid var(--border); background: var(--surface); border-radius: 9px; padding: 7px 18px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.eval-tabs button.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(59,109,246,.3); }
.eval-score { font-weight: 800; }
.eval-score.high { color: var(--success); }
.eval-score.mid { color: var(--warning); }
.eval-score.low { color: var(--danger); }
tr.row-worse td { background: var(--danger-soft); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num.up { color: var(--success); font-weight: 700; }
td.num.down { color: var(--danger); font-weight: 700; }
td.num.gray { color: var(--text-3); }
.btn-voted { background: var(--brand-soft); color: var(--brand); border-color: #dbe3ff; }

@media (max-width: 1100px) {
  .form-grid, .model-grid, .prod-edit-grid { grid-template-columns: 1fr; }
  .action-bar { padding-left: 22px; }
}
