/* ============================================================
   婚匠网 AI 运营工具 — 暖橙 + 极简 SaaS 主题
   ============================================================ */

:root {
  /* 主色：暖橙 */
  --brand:        #FF6B35;
  --brand-600:    #F25A21;
  --brand-700:    #D94A15;
  --brand-light:  #FFF1EA;
  --brand-lighter:#FFF8F5;
  --gold:         #FFB800;
  --gold-light:   #FFF7E0;
  --rose:         #E8467C;
  --rose-light:   #FDECF2;

  /* 中性色 */
  --ink:          #2D2A26;
  --ink-2:        #5C574F;
  --ink-3:        #8B847A;
  --line:         #EDE8E2;
  --line-2:       #F6F2EE;
  --bg:           #FAF8F6;
  --card:         #FFFFFF;

  /* 功能色（避开蓝绿主色，用暖色系表达状态） */
  --ok:           #C98A1B;
  --warn:         #E0891B;
  --danger:       #D9453B;

  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    16px;
  --shadow:       0 1px 2px rgba(45,42,38,.04), 0 4px 12px rgba(45,42,38,.05);
  --shadow-lg:    0 8px 32px rgba(45,42,38,.12);
  --sidebar-w:    216px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ 登录 / 安装页 ============ */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #FFF8F5 0%, #FFF1EA 45%, #FFE9DE 100%);
  padding: 20px;
}
.login-box {
  width: 100%; max-width: 400px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.login-brand {
  text-align: center;
  padding: 36px 24px 24px;
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-600) 100%);
  color: #fff;
}
.brand-logo-lg { width: 56px; height: 56px; margin-bottom: 12px; }
.login-brand h1 { font-size: 24px; letter-spacing: 2px; font-weight: 700; }
.login-brand p  { font-size: 13px; opacity: .88; margin-top: 4px; }
.login-form { padding: 28px 28px 24px; }

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block; font-size: 13px; color: var(--ink-2);
  margin-bottom: 6px; font-weight: 500;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--ink);
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255,107,53,.12);
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.7; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.form-err { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 8px; }
.login-hint { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 14px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 13px; font-family: inherit; font-weight: 500;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #5C3A00; }
.btn-gold:hover { background: #F0AC00; border-color: #F0AC00; color: #5C3A00; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--brand-light); border-color: var(--brand); }
.btn-danger { color: var(--danger); border-color: #F5D5D2; }
.btn-danger:hover { background: #FDF2F1; border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 6px; }

/* ============ 布局 ============ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px; border-bottom: 1px solid var(--line-2);
}
.brand-logo { width: 34px; height: 34px; }
.side-brand-txt strong { display: block; font-size: 15px; letter-spacing: 1px; }
.side-brand-txt small { color: var(--ink-3); font-size: 11px; }

.side-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  cursor: pointer; margin-bottom: 2px; transition: all .13s;
}
.nav-item:hover { background: var(--brand-lighter); color: var(--brand); text-decoration: none; }
.nav-item.active { background: var(--brand-light); color: var(--brand-700); font-weight: 600; }
.nav-ico { font-size: 15px; width: 18px; text-align: center; opacity: 1; color: var(--ink-3); font-weight: 400; }
.nav-item:hover .nav-ico { color: var(--brand); }
.nav-item.active .nav-ico { color: var(--brand-600); }

.side-foot { padding: 12px; border-top: 1px solid var(--line-2); }
.side-user { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; text-align: center; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }

.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 40;
}
.page-title { font-size: 17px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.cta-chip {
  font-size: 12px; background: var(--gold-light); color: #8A5A00;
  padding: 4px 10px; border-radius: 20px; border: 1px solid #FFE7B0;
  font-weight: 500;
}
.menu-toggle {
  display: none; background: none; border: none; font-size: 20px;
  color: var(--ink-2); cursor: pointer;
}

.content { padding: 20px 22px 40px; }

/* ============ 卡片 ============ */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 16px 18px; }
.card-body.pad0 { padding: 0; }

/* ============ KPI 卡 ============ */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.kpi {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brand);
}
.kpi.gold::before { background: var(--gold); }
.kpi.rose::before { background: var(--rose); }
.kpi-label { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; line-height: 1.15; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.kpi-foot { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.kpi-foot .up { color: var(--brand); font-weight: 600; }

/* ============ 表格 ============ */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 11px 14px; background: var(--brand-lighter);
  color: var(--ink-2); font-weight: 600; font-size: 12.5px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td {
  padding: 11px 14px; border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
table.tbl tbody tr:hover { background: var(--brand-lighter); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl .nowrap { white-space: nowrap; }
table.tbl .num { font-variant-numeric: tabular-nums; }

.empty {
  text-align: center; padding: 48px 20px; color: var(--ink-3); font-size: 13.5px;
}
.empty-ico { font-size: 32px; opacity: .3; display: block; margin-bottom: 10px; }

/* ============ 标签 ============ */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  background: var(--brand-light); color: var(--brand-700);
}
.tag.gold   { background: var(--gold-light); color: #8A5A00; }
.tag.rose   { background: var(--rose-light); color: #B22A57; }
.tag.gray   { background: #F2EFEC; color: var(--ink-2); }
.tag.line   { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
.tag.solid  { background: var(--brand); color: #fff; }

/* ============ 工具栏 ============ */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .grow { flex: 1; }
.toolbar input[type=text], .toolbar input[type=search], .toolbar input[type=month], .toolbar select, .toolbar input[type=date] {
  padding: 7px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: #fff; color: var(--ink);
}
.toolbar input:focus, .toolbar select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,107,53,.1);
}

/* ============ 选题看板 ============ */
.kanban {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.kb-col {
  background: var(--brand-lighter); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 12px; min-height: 140px;
}
.kb-col-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--ink-2);
}
.kb-count {
  background: #fff; border: 1px solid var(--line); color: var(--ink-3);
  font-size: 11px; padding: 1px 8px; border-radius: 20px; font-weight: 500;
}
.kb-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 12px; margin-bottom: 9px; cursor: pointer;
  transition: all .15s; box-shadow: 0 1px 2px rgba(45,42,38,.03);
}
.kb-card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.kb-card-title { font-size: 13px; font-weight: 500; line-height: 1.5; margin-bottom: 7px; }
.kb-card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.kb-card-meta .mini { font-size: 11px; color: var(--ink-3); }

/* v3.3.0：选题卡底部动作条（「去创作 →」）。
   默认半透明，悬停卡片时才完全显现，避免列表看起来太吵。 */
.kb-card-act { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; justify-content: flex-end; }
.kb-card-act .btn { opacity: .55; transition: opacity .15s; }
.kb-card:hover .kb-card-act .btn { opacity: 1; }

/* v3.3.0：生成页「当前选题」横幅 */
.topic-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(90deg, #FFF3EC 0%, #FFF9F5 100%);
  border: 1px solid #FFD9C4; border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px;
}
.topic-banner .tb-ico { font-size: 18px; color: var(--brand); flex-shrink: 0; }
.topic-banner .tb-main { flex: 1; min-width: 0; }
.topic-banner .tb-title { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.45; }
.topic-banner .tb-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 5px; }
.topic-banner .tb-meta .mini { font-size: 11px; color: var(--ink-3); }

/* ============ 日历 ============ */
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.cal-head {
  background: var(--brand-lighter); padding: 9px 4px; text-align: center;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.cal-cell {
  background: #fff; min-height: 108px; padding: 7px 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.cal-cell.other { background: #FCFAF9; }
.cal-cell.today { background: var(--brand-lighter); }
.cal-day {
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  display: flex; align-items: center; gap: 4px;
}
.cal-cell.today .cal-day { color: var(--brand-700); }
.cal-day .badge-today {
  background: var(--brand); color: #fff; font-size: 10px;
  padding: 0 5px; border-radius: 8px; font-weight: 500;
}
.cal-item {
  font-size: 11.5px; padding: 3px 7px; border-radius: 5px;
  background: var(--brand-light); color: var(--brand-700);
  cursor: pointer; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; line-height: 1.5;
}
.cal-item:hover { background: #FFE2D5; }
.cal-item.done { background: #F0FAF2; color: #2F7D4F; text-decoration: line-through; opacity: .75; }
/* 账号配色改为行内 style 动态生成（见 app.js accColor），此处不再硬编码 */

/* ============ 漏斗 ============ */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: flex; align-items: center; gap: 12px; }
.funnel-label { width: 76px; font-size: 12.5px; color: var(--ink-2); text-align: right; flex-shrink: 0; }
.funnel-bar-wrap { flex: 1; background: var(--line-2); border-radius: 20px; height: 26px; overflow: hidden; }
.funnel-bar {
  height: 100%; background: linear-gradient(90deg, var(--brand) 0%, #FF9166 100%);
  border-radius: 20px; display: flex; align-items: center; justify-content: flex-end;
  padding-right: 10px; color: #fff; font-size: 12px; font-weight: 600;
  min-width: 34px; transition: width .4s ease;
}
.funnel-rate { width: 62px; font-size: 12px; color: var(--ink-3); flex-shrink: 0; }

/* ============ 进度条 ============ */
.prog-item { margin-bottom: 14px; }
.prog-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.prog-top .v { color: var(--ink-3); }
.prog-top .v b { color: var(--ink); font-weight: 600; }
.prog-track { height: 8px; background: var(--line-2); border-radius: 20px; overflow: hidden; }
.prog-fill {
  height: 100%; background: var(--brand); border-radius: 20px; transition: width .5s ease;
}
.prog-fill.gold { background: var(--gold); }
.prog-fill.done { background: #E5A22E; }

/* ============ 提示词 / 稿件工作区 ============ */
.work-split { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.prompt-box {
  background: #FFFCFA; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px; font-size: 12.5px; line-height: 1.75; color: var(--ink-2);
  white-space: pre-wrap; word-break: break-word;
  max-height: 340px; overflow-y: auto; font-family: inherit;
  border-left: 3px solid var(--brand);
}
.editor-area {
  width: 100%; min-height: 400px; padding: 16px; font-size: 14px;
  line-height: 1.85; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; resize: vertical; color: var(--ink);
}
.editor-area:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,107,53,.1); }
.editor-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px; background: var(--brand-lighter);
  border: 1px solid var(--line); border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.editor-bar .sep { width: 1px; height: 16px; background: var(--line); }
.editor-bar .stat { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.editor-bar + .editor-area { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

/* ============ 话术卡片 ============ */
.script-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.script-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  background: #FFFCFA; display: flex; flex-direction: column;
}
.script-card h4 { font-size: 13.5px; margin-bottom: 9px; color: var(--brand-700); }
.script-card pre {
  font-family: inherit; font-size: 12.5px; line-height: 1.75; color: var(--ink-2);
  white-space: pre-wrap; word-break: break-word; flex: 1; margin-bottom: 10px;
}

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(45,42,38,.42);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px; backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal.wide { max-width: 800px; }
.modal-head {
  display: flex; align-items: center; padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}
.modal-head h3 { font-size: 15.5px; font-weight: 600; }
.modal-close {
  margin-left: auto; background: none; border: none; font-size: 24px;
  color: var(--ink-3); cursor: pointer; line-height: 1; padding: 0 4px;
}
.modal-close:hover { color: var(--brand); }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--line-2);
  display: flex; gap: 10px; justify-content: flex-end;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ============ Toast ============ */
.toast-wrap {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 24px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toastIn .25s ease;
  max-width: 80vw;
}
.toast.ok  { background: var(--brand-700); }
.toast.err { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ============ 工具类 ============ */
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt20{margin-top:20px}
.mb8{margin-bottom:8px}.mb12{margin-bottom:12px}.mb16{margin-bottom:16px}
.muted { color: var(--ink-3); font-size: 12.5px; }
.small { font-size: 12px; }
.right { margin-left: auto; }
.bold { font-weight: 600; }
.center { text-align: center; }
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }
.scroll-y { max-height: 420px; overflow-y: auto; }

/* 选中态 */
.pick-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pick-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px;
  border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 13px;
}
.pick-item:last-child { border-bottom: none; }
.pick-item:hover { background: var(--brand-lighter); }
.pick-item .info { flex: 1; min-width: 0; }
.pick-item .info strong { font-weight: 500; }
.pick-item .info small { display: block; color: var(--ink-3); font-size: 11.5px; }

/* 复选框 */
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

/* 打印 */
@media print {
  .sidebar, .topbar, .toolbar, .modal-foot, .btn { display: none !important; }
  .main { margin-left: 0; }
  body { background: #fff; }
}

/* ============ 移动端 ============ */
@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .content { padding: 14px 12px 40px; }
  .topbar { padding: 0 12px; }
  .cta-chip { display: none; }
  .work-split { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .cal-cell { min-height: 72px; padding: 4px; }
  .cal-item { font-size: 10px; padding: 2px 4px; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .kpi-value { font-size: 21px; }
  .kanban { grid-template-columns: 1fr; }
  .funnel-label { width: 62px; font-size: 11.5px; }
  .modal { max-width: 100%; }
}

/* ============================================================
   v2.0.0 新增：设置页 Tab / 变量说明 / 人员账号 / 图片工坊
   ============================================================ */

/* ----------  Tab  ---------- */
.tab-bar {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.tab-btn {
  padding: 9px 16px; border: 0; background: none; cursor: pointer;
  font-size: 13.5px; color: var(--ink-2); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  border-radius: 7px 7px 0 0; transition: all .15s;
  font-family: inherit;
}
.tab-btn:hover { background: var(--brand-lighter); color: var(--brand-700); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ----------  提示词变量说明  ---------- */
.var-box {
  background: var(--brand-lighter); border: 1px solid #FFE0CC;
  border-radius: 10px; padding: 12px 14px;
}
.var-box-title {
  font-size: 12.5px; font-weight: 600; color: var(--brand-700);
  margin-bottom: 9px; display: flex; align-items: center; gap: 6px;
}
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.var-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 14px; cursor: pointer;
  background: #fff; border: 1px solid #FFD8C2;
  font-size: 12px; color: var(--brand-700); font-family: ui-monospace, Menlo, monospace;
  transition: all .12s; user-select: none;
}
.var-chip:hover { background: var(--brand); color: #fff; border-color: var(--brand); transform: translateY(-1px); }
.var-chip:active { transform: translateY(0); }

.var-group { margin-bottom: 12px; }
.var-group:last-child { margin-bottom: 0; }
.var-group-h {
  font-size: 11.5px; font-weight: 600; color: var(--brand-700);
  margin-bottom: 6px; letter-spacing: .3px;
}
.var-legend { display: flex; flex-direction: column; gap: 5px; }
.var-item {
  display: flex; gap: 9px; align-items: baseline;
  font-size: 12px; line-height: 1.6;
}
.var-item code {
  background: #fff; border: 1px solid #FFD8C2; border-radius: 5px;
  padding: 1px 6px; font-size: 11.5px; color: var(--brand-700);
  font-family: ui-monospace, Menlo, monospace; flex-shrink: 0;
  min-width: 96px; text-align: center;
}
.var-item span { color: var(--ink-2); }

/* ----------  色板  ---------- */
.palette {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px 4px 5px; border-radius: 16px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-size: 12px; color: var(--ink-2); font-family: inherit;
  transition: all .12s;
}
.palette:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-lighter); }
.palette-dot {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-block; border: 1px solid rgba(0,0,0,.07);
}

/* ----------  人员 pills / 账号标签  ---------- */
.staff-pill {
  display: inline-block; padding: 2px 9px; border-radius: 11px;
  background: var(--brand-light); color: var(--brand-700);
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.acc-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 11px; font-size: 11.5px;
  white-space: nowrap; font-weight: 500;
}
/* 圆点由 accTag() 内联注入的 .color-dot 提供 */
/* accTag() 里显式传色的圆点（优先于 ::before 的 currentColor 兜底） */
.color-dot {
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.acc-tag .color-dot + * { margin-left: 0; }

/* 设置页 · 人员卡片 */
.su-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 12px; }
.su-card {
  border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px;
  background: #fff; position: relative; transition: all .15s;
}
.su-card:hover { border-color: #FFD8C2; box-shadow: 0 3px 14px rgba(255,107,53,.09); }
.su-card.off { opacity: .55; }
.su-name { font-weight: 600; font-size: 14px; margin-bottom: 3px; display: flex; align-items: center; gap: 7px; }
.su-role { font-size: 12px; color: var(--brand-700); margin-bottom: 7px; }
.su-meta { font-size: 11.5px; color: var(--ink-3); line-height: 1.75; }
.su-ops { margin-top: 10px; display: flex; gap: 6px; }

/* ----------  图片工坊  ---------- */
.img-preview {
  min-height: 210px; background: var(--bg-2); border-radius: 11px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px; border: 1px dashed var(--line);
}
.tpl-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px 5px 6px; border-radius: 16px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 12px; color: var(--ink-2);
  font-family: inherit; transition: all .12s;
}
.tpl-chip:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-lighter); }
.tpl-swatch { width: 17px; height: 17px; border-radius: 50%; display: inline-block; }

.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 13px; }
.img-cell { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fff; }
.img-thumb {
  width: 100%; aspect-ratio: 4 / 3; background-size: cover;
  background-position: center; background-color: var(--bg-2);
}
.img-meta { padding: 9px 11px 5px; }
.img-t {
  font-size: 12.5px; font-weight: 600; margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.img-ops { padding: 7px 11px 11px; display: flex; gap: 6px; }

@media (max-width: 720px) {
  .tab-btn { padding: 8px 11px; font-size: 12.5px; }
  .img-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .su-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   v3.0.0 新增：内容线 / 看板 / 吉日 / 周报
   ============================================================ */

/* ---- 侧栏分组标题 ---- */
.nav-group {
  padding: 16px 18px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink-3);
  text-transform: uppercase;
  opacity: .8;
}
.side-nav .nav-group:first-child { padding-top: 8px; }

/* ---- 内容线标签（2B / 2C 归属） ---- */
.line-tag,
.line-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
}
.line-tag.b2b,
.line-badge.b2b { background: var(--brand-light); color: var(--brand-700); }
.line-tag.b2c,
.line-badge.b2c { background: var(--rose-light); color: var(--rose); }

/* ---- 看板：四条内容线卡片 ---- */
.line-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.line-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: linear-gradient(155deg, #FFFDFB 0%, #FFF9F5 100%);
}
.line-top {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.line-top strong { font-size: 14px; }
.line-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
}
.line-stats > div {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line-2);
}
.line-stats > div:last-child,
.line-stats > div:nth-last-child(2) { border-bottom: 0; }
.line-stats b {
  font-size: 15px;
  color: var(--brand-700);
  font-variant-numeric: tabular-nums;
}

/* ---- 看板：待办提醒条 ---- */
.alert-strip {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}
.alert-item {
  background: var(--gold-light);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  color: #8A6410;
}

/* ---- 看板：日历状态行 ---- */
.stat-row {
  display: flex; flex-wrap: wrap; gap: 18px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.stat-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.dot.done  { background: var(--brand); }
.dot.doing { background: var(--gold); }
.dot.todo  { background: #D9D2C9; }

/* ---- 表单：行内复选框 ---- */
.chk {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.chk input { width: auto; margin: 0; }

/* ---- 标签补充 ---- */
.tag-gold { background: var(--gold-light); color: #8A6410; }

/* ---- 周报正文 ---- */
.report-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--line-2);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  max-height: 62vh;
  overflow: auto;
}

/* ---- 小屏：内容线卡片单列 ---- */
@media (max-width: 720px) {
  .line-grid { grid-template-columns: 1fr; }
  .stat-row { gap: 12px; }
}

/* ============================================================================
   婚嫁吉日 · 三档分级
   ----------------------------------------------------------------------------
   配色逻辑跟着业务含义走，全部落在暖色系内：
     好日子   → 金黄（最值钱、最抢手，视觉上最亮）
     普通日子 → 暖橙（品牌主色，中位）
     难卖的日子 → 褐灰（要花力气推，视觉上压暗）
   ============================================================================ */

:root {
  --tier1:      #B8860B;   /* 好日子 · 深金 */
  --tier1-bg:   #FFF8E1;
  --tier1-line: #F0D48A;
  --tier2:      #D9541F;   /* 普通日子 · 暖橙 */
  --tier2-bg:   #FFF1EA;
  --tier2-line: #F5C4AC;
  --tier3:      #7A6A5C;   /* 难卖的日子 · 褐灰 */
  --tier3-bg:   #F4F1ED;
  --tier3-line: #DDD4C9;
}

/* ---- 档位徽章 ---- */
.tier-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tier-badge.tier-1 {
  color: var(--tier1);
  background: var(--tier1-bg);
  border-color: var(--tier1-line);
  box-shadow: inset 0 0 0 1px rgba(184,134,11,.08);
}
.tier-badge.tier-2 {
  color: var(--tier2);
  background: var(--tier2-bg);
  border-color: var(--tier2-line);
}
.tier-badge.tier-3 {
  color: var(--tier3);
  background: var(--tier3-bg);
  border-color: var(--tier3-line);
}

/* ---- 建议佣金数值 ---- */
.comm {
  color: var(--brand-700);
  font-variant-numeric: tabular-nums;
  letter-spacing: .2px;
}

/* ---- 档位汇总条 ---- */
.aus-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.aus-sum-item {
  flex: 1 1 200px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}
.aus-sum-item.tier-1 { border-left: 4px solid var(--tier1); background: linear-gradient(180deg, var(--tier1-bg), #fff); }
.aus-sum-item.tier-2 { border-left: 4px solid var(--tier2); background: linear-gradient(180deg, var(--tier2-bg), #fff); }
.aus-sum-item.tier-3 { border-left: 4px solid var(--tier3); background: linear-gradient(180deg, var(--tier3-bg), #fff); }
.aus-sum-label { font-weight: 700; font-size: 13.5px; }
.aus-sum-item.tier-1 .aus-sum-label { color: var(--tier1); }
.aus-sum-item.tier-2 .aus-sum-label { color: var(--tier2); }
.aus-sum-item.tier-3 .aus-sum-label { color: var(--tier3); }
.aus-sum-count { font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.aus-sum-comm  { font-size: 12px; color: var(--ink-3); margin-left: auto; white-space: nowrap; }

/* ---- 避讳行 ---- */
tr.row-forbidden { background: repeating-linear-gradient(135deg, #FDF7F5, #FDF7F5 6px, #FAF4F2 6px, #FAF4F2 12px); }
tr.row-forbidden td { color: var(--ink-3); }
.tag-danger { background: #FBEAE8; color: var(--danger); border-color: #F2C9C5; }
.tag-ghost  { background: #F3EEF7; color: #7A5C93; border-color: #DFD2EA; }
.tag-red    { background: #FDECEA; color: #C0392B; border-color: #F3CCC6; }

/* ---- 提示条 ---- */
.notice {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.7;
  margin: 12px 16px;
}
.notice-warn   { background: var(--gold-light); border: 1px solid #F0DFA8; color: #8A6A12; }
.notice-danger { background: #FDECEA; border: 1px solid #F3CCC6; color: #A93226; }
.notice b { font-weight: 700; }

/* ---- 单日试算卡片 ---- */
.aus-judge-out { margin-top: 14px; }
.aus-judge-card {
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--card);
  position: relative;
  overflow: hidden;
}
.aus-judge-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
}
.aus-judge-card.tier-1 { background: linear-gradient(135deg, var(--tier1-bg), #fff 70%); border-color: var(--tier1-line); }
.aus-judge-card.tier-1::before { background: var(--tier1); }
.aus-judge-card.tier-2 { background: linear-gradient(135deg, var(--tier2-bg), #fff 70%); border-color: var(--tier2-line); }
.aus-judge-card.tier-2::before { background: var(--tier2); }
.aus-judge-card.tier-3 { background: linear-gradient(135deg, var(--tier3-bg), #fff 70%); border-color: var(--tier3-line); }
.aus-judge-card.tier-3::before { background: var(--tier3); }

.aus-judge-tier { font-size: 22px; font-weight: 800; line-height: 1.3; }
.aus-judge-card.tier-1 .aus-judge-tier { color: var(--tier1); }
.aus-judge-card.tier-2 .aus-judge-tier { color: var(--tier2); }
.aus-judge-card.tier-3 .aus-judge-tier { color: var(--tier3); }

.aus-judge-comm { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.aus-judge-comm b { font-size: 19px; color: var(--brand-700); font-variant-numeric: tabular-nums; }
.aus-judge-meta { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.aus-judge-reason {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--ink-2);
}

/* =========================================================================
 * v3.1.1 模型配置体验加固
 * 背景：用户把「通义万相地址」配「OpenAI 协议」，接口只回一个空白 404，
 *      看不出哪里错。现在改成一个字段级黄色警告 + 一张对照表。
 * ========================================================================= */

/* ---- 字段级警告（地址框下方） ---- */
.field-warn {
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: #FFF6E0;
  border: 1px solid #F0D89A;
  color: #8A6A12;
  font-size: 12.5px;
  line-height: 1.6;
}
.input-warn {
  border-color: #E0A93C !important;
  background: #FFFBF0 !important;
}
.input-warn:focus {
  box-shadow: 0 0 0 3px rgba(224, 169, 60, .18) !important;
}

/* ---- 紧凑型对照表（模型配置说明用） ---- */
.tbl-compact th,
.tbl-compact td { padding: 9px 12px; vertical-align: top; }
.tbl-compact td code {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-2);
  font-size: 12px;
  word-break: break-all;
}
.tbl-compact .muted.small { margin-top: 3px; line-height: 1.5; }

/* =========================================================================
   v3.2.0 · 质检台 / 知识库
   配色遵循品牌暖色系：通过用金（--ok），警示用橙（--warn），拦截用红（--danger）
   ========================================================================= */

/* ---- 质检台布局 ---- */
.q-grid { align-items: start; }
.q-grid .editor-area { min-height: 260px; }

/* ---- 分数环 ---- */
.q-score {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--brand-lighter);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.q-score.q-pass { background: var(--gold-light); border-color: #F0D89A; }
.q-score.q-warn { background: #FFF6EC; border-color: #F3D3B4; }
.q-score.q-fail { background: #FDF0EF; border-color: #F0C7C3; }

.q-ring {
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.q-ring::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--card);
}
.q-ring span {
  position: relative;
  z-index: 1;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}
.q-score-txt { display: flex; flex-direction: column; gap: 4px; }
.q-score-txt b { font-size: 16px; color: var(--ink); }

/* ---- 分项条 ---- */
.q-dims { display: flex; flex-direction: column; gap: 11px; }
.q-dim-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  margin-bottom: 4px;
}
.q-dim-head b { color: var(--ink); }
.q-dim-head .muted { font-weight: 400; font-size: 11.5px; }
.q-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--line-2);
  overflow: hidden;
}
.q-bar i { display: block; height: 100%; border-radius: 3px; transition: width .35s ease; }
.q-reason { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.55; }

/* ---- 问题清单 ---- */
.q-issues { display: flex; flex-direction: column; gap: 8px; }
.q-issue {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.6;
  background: var(--bg-2);
  border-left: 3px solid var(--line);
}
.q-issue.error { background: #FDF0EF; border-left-color: var(--danger); color: #8C2F28; }
.q-issue.warn  { background: #FFF6EC; border-left-color: var(--warn); color: #8A5410; }
.q-issue.info  { background: var(--brand-lighter); border-left-color: var(--brand); color: var(--ink-2); }
.q-tag {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .75);
  border: 1px solid rgba(0, 0, 0, .06);
  white-space: nowrap;
}

/* ---- 标签补充色 ---- */
.tag-green { background: #FFF7E0; color: #8A6A12; border: 1px solid #F0D89A; }
.tag-grey  { background: var(--line-2); color: var(--ink-3); border: 1px solid var(--line); }

/* ---- 提示条（知识库说明用） ---- */
.notice {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand-lighter);
  border: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-2);
}
.notice b { color: var(--ink); }
.notice-warn {
  background: #FFF6EC;
  border-color: #F3D3B4;
  color: #8A5410;
}
.notice-warn b { color: #7A3F08; }

/* ---- 小号下拉/输入（工具栏内联用） ---- */
.sel-sm {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  background: var(--card);
  color: var(--ink);
  max-width: 240px;
}
