/* ==========================================================
   耐撕BaBa梯子升学 · 自媒体运营平台 — 全局样式
   设计基调：现代 SaaS 风 · 深色侧栏 · 靛紫品牌色 · 玻璃拟态点缀
   ========================================================== */
:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --line: #e5e9f2;
  --line-2: #eef1f7;
  --brand: #6366f1;
  --brand-dark: #4f46e5;
  --brand-deep: #4338ca;
  --brand-soft: #eef2ff;
  --brand-line: #d6dcff;
  --violet: #6d5ae0;
  --blue: #3b82f6;
  --blue-soft: #eff6ff;
  --orange: #f59e0b;
  --orange-soft: #fff7ed;
  --red: #ef4444;
  --red-soft: #fef2f2;
  --purple: #6d5ae0;
  --purple-soft: #f1effe;
  --green: #10b981;
  --green-soft: #ecfdf5;
  --sidebar-bg: #0d1426;
  --sidebar-bg-2: #111a30;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, .09);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, .18);
  --sidebar-w: 224px;
}

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

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

h1, h2, h3, h4, h5 { letter-spacing: -.015em; }

::selection { background: rgba(99, 102, 241, .18); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #ccd3e3; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #aeb8cf; }
::-webkit-scrollbar-track { background: transparent; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 14px; outline: none; }

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

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar-bg-2) 0%, var(--sidebar-bg) 100%);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 100;
}
.sidebar-brand {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1 0%, #6d5ae0 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .4);
}
.sidebar-brand h1 {
  font-size: 14.5px; font-weight: 700; color: #f1f5f9; line-height: 1.3;
}
.sidebar-brand .sub {
  font-size: 11px; color: #64748b; margin-top: 2px; letter-spacing: .04em;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); }
.nav-group-title {
  font-size: 11px; color: #5a6b8c; font-weight: 600;
  padding: 12px 8px 6px; letter-spacing: .08em;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: #9aa8c3; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: all .15s;
  margin-bottom: 2px; position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #e2e8f0; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, .30), rgba(99, 102, 241, .10));
  color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 0 #818cf8;
}
.nav-item .ico { width: 16px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-item.active .ico { color: #a5b4fc; }
.nav-item .badge {
  margin-left: auto; font-size: 11px; background: rgba(255, 255, 255, .10);
  color: #9aa8c3; padding: 1px 7px; border-radius: 20px; font-weight: 600;
}
.nav-item.active .badge { background: var(--brand); color: #fff; }

.sidebar-foot {
  padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 12px; color: #64748b;
}
.sidebar-foot .who {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.sidebar-foot .who > div:last-child > div:first-child { color: #e2e8f0; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #6d5ae0); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.avatar.blue { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.avatar.purple { background: linear-gradient(135deg, #6d5ae0, #4f46e5); }
.avatar.orange { background: linear-gradient(135deg, #f59e0b, #f97316); }
.sidebar-foot .btn {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .12); color: #9aa8c3;
}
.sidebar-foot .btn:hover {
  background: rgba(255, 255, 255, .10); color: #fff; border-color: rgba(255, 255, 255, .2);
}

.main {
  flex: 1; margin-left: var(--sidebar-w);
  min-width: 0; display: flex; flex-direction: column;
}
.topbar {
  height: 58px; background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 26px;
  position: sticky; top: 0; z-index: 50;
}
.topbar h2 { font-size: 16px; font-weight: 700; }
.topbar .desc { font-size: 12.5px; color: var(--text-3); margin-left: 12px; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.content { padding: 22px 26px 60px; flex: 1; }

/* ---------------- 组件 ---------------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head {
  padding: 15px 18px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 10px;
}
.card-head h3 { font-size: 14.5px; font-weight: 700; }
.card-head .sub { font-size: 12px; color: var(--text-3); }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; transition: all .15s;
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  white-space: nowrap;
}
.btn:hover { border-color: #c9d0de; color: var(--text); box-shadow: var(--shadow); }
.btn-primary {
  background: linear-gradient(135deg, #5b6cf0 0%, #6d5ae0 100%);
  border: none; color: #fff;
  box-shadow: 0 2px 10px rgba(91, 108, 240, .35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4f5de8 0%, #5d4cd6 100%);
  color: #fff; box-shadow: 0 4px 16px rgba(91, 108, 240, .45);
  transform: translateY(-1px);
}
.btn-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); border: none; color: #fff; box-shadow: 0 2px 10px rgba(59, 130, 246, .3); }
.btn-blue:hover { filter: brightness(1.06); color: #fff; box-shadow: 0 4px 14px rgba(59, 130, 246, .4); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
.btn-ghost:hover { background: var(--line-2); box-shadow: none; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 14px; border-radius: 11px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-danger { color: var(--red); border-color: #fbd5d2; }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }

.input, .textarea, .select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3.5px rgba(99, 102, 241, .14);
}
.textarea { resize: vertical; min-height: 88px; line-height: 1.7; }
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 6px; color: var(--text);
}
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 5px; line-height: 1.6; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
  background: var(--line-2); color: var(--text-2);
}
.tag-green { background: var(--green-soft); color: #059669; }
.tag-blue { background: var(--blue-soft); color: #2563eb; }
.tag-orange { background: var(--orange-soft); color: #c2410c; }
.tag-red { background: var(--red-soft); color: #dc2626; }
.tag-purple { background: var(--purple-soft); color: #5b4ad0; }
.tag-brand { background: var(--brand-soft); color: var(--brand-dark); }
/* 未指派占位：故意做得比正常标签淡，不抢眼但看得出"这里没人" */
.tag-ghost { background: transparent; color: var(--text-3); border: 1px dashed var(--line); font-weight: 500; }

.empty {
  text-align: center; padding: 48px 20px; color: var(--text-3);
}
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: .5; }
.empty p { font-size: 13px; margin-bottom: 4px; }

.muted { color: var(--text-3); font-size: 12.5px; }
.row { display: flex; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex1 { flex: 1; min-width: 0; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* ---------------- 工作台 ---------------- */
.hero {
  background: linear-gradient(115deg, #24304a 0%, #2e4062 46%, #3d5a7d 88%, #46708f 100%);
  border-radius: 18px; padding: 24px 26px; color: #fff;
  margin-bottom: 20px; position: relative; overflow: hidden;
  box-shadow: 0 8px 24px rgba(30, 41, 59, .22);
}
.hero::before {
  content: ""; position: absolute; right: -70px; top: -90px;
  width: 280px; height: 280px; border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.hero::after {
  content: ""; position: absolute; left: 42%; bottom: -140px;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(148, 179, 209, .14);
}
.hero > * { position: relative; z-index: 1; }
.hero h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.hero p { font-size: 13px; opacity: .92; }
.hero .meta { margin-top: 16px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .meta div {
  font-size: 12px; opacity: 1;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 12px; padding: 9px 16px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  min-width: 86px;
}
.hero .meta strong { font-size: 18px; font-weight: 700; display: block; margin-top: 1px; }

/* 工作台首屏：banner 左 + 榜单右，同高并排 */
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px;
  gap: 16px; align-items: stretch; margin-bottom: 20px;
}
.hero-grid .hero { margin-bottom: 0; display: flex; flex-direction: column; }
.hero-grid .hero .meta { margin-top: auto; padding-top: 16px; }

/* banner 内嵌榜单：毛玻璃暗卡，与 banner 同高 */
.hero-rank {
  border-radius: 18px; padding: 16px 18px;
  background: linear-gradient(150deg, rgba(30, 41, 59, .58), rgba(46, 64, 98, .46));
  border: 1px solid rgba(255, 255, 255, .20);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(30, 41, 59, .18);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  color: #fff;
}
.hr-head { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hr-title { font-size: 13.5px; font-weight: 600; letter-spacing: .2px; }
.hr-range {
  font-size: 11.5px; opacity: .78; padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); white-space: nowrap;
}
.hr-tabs { margin-left: auto; display: flex; gap: 4px; }
.hr-tab {
  font-size: 12px; line-height: 1; padding: 4px 11px; cursor: pointer;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22);
  background: transparent; color: rgba(255, 255, 255, .78);
  transition: all .16s; font-family: inherit;
}
.hr-tab:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.hr-tab.active {
  background: #fff; color: #24304a; border-color: #fff; font-weight: 600;
}
.hr-body {
  margin-top: 11px; overflow-y: auto; flex: 1; min-height: 0;
  max-height: 178px; padding-right: 4px;
}
.hr-body::-webkit-scrollbar { width: 4px; }
.hr-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .26); border-radius: 4px;
}
.hr-body::-webkit-scrollbar-track { background: transparent; }
.hr-loading { padding: 26px 0; text-align: center; }
.hr-note { font-size: 11px; opacity: .7; line-height: 1.55; margin-bottom: 9px; }

.hr-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 10px; transition: background .16s;
}
.hr-row + .hr-row { margin-top: 2px; }
.hr-row:hover { background: rgba(255, 255, 255, .09); }
.hr-no {
  width: 20px; height: 20px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; font-style: italic;
  background: rgba(255, 255, 255, .16); color: #fff;
}
.hr-no.top1 { background: linear-gradient(135deg, #ffd24d, #f0a020); color: #4a2c00; }
.hr-no.top2 { background: linear-gradient(135deg, #dfe7ef, #b3c1d1); color: #34404f; }
.hr-no.top3 { background: linear-gradient(135deg, #f0bd8e, #d99253); color: #4a2c00; }
.hr-ava {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #5b8def, #3f6fd8);
}
.hr-info { flex: 1; min-width: 0; }
.hr-name {
  font-size: 12.5px; font-weight: 600; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hr-detail {
  font-size: 10.5px; opacity: .72; line-height: 1.35; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hr-score { font-size: 14px; font-weight: 700; flex-shrink: 0; font-variant-numeric: tabular-nums; }


.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.module-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; cursor: pointer; transition: all .18s;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.module-card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, #6366f1, #6d5ae0);
  opacity: 0; transition: opacity .18s;
}
.module-card:hover {
  box-shadow: var(--shadow-md); transform: translateY(-3px);
  border-color: var(--brand-line);
}
.module-card:hover::after { opacity: 1; }
.module-card .ico-wrap {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; margin-bottom: 12px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff); color: #4f46e5;
}
.module-card .ico-wrap.blue { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #2563eb; }
.module-card .ico-wrap.orange { background: linear-gradient(135deg, #fff7ed, #ffedd5); color: #c2410c; }
.module-card .ico-wrap.purple { background: linear-gradient(135deg, #f1effe, #e4e1fb); color: #5b4ad0; }
.module-card h4 { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; }
.module-card p { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.module-card .count {
  position: absolute; top: 18px; right: 18px;
  font-size: 20px; font-weight: 700; color: var(--text);
}
.module-card .count span { font-size: 11px; font-weight: 500; color: var(--text-3); margin-left: 2px; }

.theme-card {
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--orange);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px;
}
.theme-card.current { border-left-color: var(--brand); }
.theme-card h5 { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.theme-card p { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }

/* 本周重点推广计划：关联选题（每条带形式状态） */
.theme-topics { margin-top: 9px; display: flex; flex-direction: column; gap: 7px; }
.tt-label { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.tt-row { display: flex; flex-direction: column; gap: 4px; }
.tt-title {
  font-size: 12.5px; color: var(--text-1); cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tt-title:hover { color: var(--brand); }
/* 需求 3a：标题行右侧的完成日期（原先那块是空白）。加了左边框，
   即使没有日期，标题行的视觉重心也仍然靠左，不会散。 */
.tt-head { display: flex; align-items: center; gap: 8px; }
.tt-head .tt-title { flex: 1; min-width: 0; }
.tt-due {
  flex: none; font-size: 11px; font-weight: 600; padding: 1px 7px;
  border-radius: 20px; background: var(--orange-soft); color: #c2410c;
  white-space: nowrap;
}
.tt-due.is-overdue { background: var(--red-soft); color: #dc2626; }
.tt-due.is-done { background: var(--green-soft); color: #059669; }
/* 负责人 + 形式标签那一行 */
.tt-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.tt-foot .tag { font-size: 11px; padding: 2px 7px; }
.tt-ops { margin-top: 9px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ==========================================================
   「所有计划」弹窗（含已结束）
   ========================================================== */
.ap-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; }
.ap-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm); background: #fff;
}
/* 已结束：整行压暗、左边框转灰，和进行中的计划一眼能分开 */
.ap-row.is-closed { border-left-color: var(--line); background: #fafafa; }
.ap-row.is-closed .ap-theme { color: var(--text-3); }
.ap-main { flex: 1; min-width: 0; }
.ap-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ap-theme { font-size: 13.5px; font-weight: 600; color: var(--text-1); }
.ap-detail {
  font-size: 12.5px; color: var(--text-2); line-height: 1.55;
  margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ap-meta { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.ap-ops { flex: none; }

/* 形式状态标签组（计划内选题的完成 / 逾期） */
.plan-forms { display: flex; flex-wrap: wrap; gap: 5px; }
.plan-forms .tag { font-size: 11px; padding: 2px 7px; }

/* 选题列表里的「所属计划」区块 */
.plan-block {
  margin: 6px 0 8px; padding: 8px 10px; border-radius: 8px;
  background: var(--line-2); border: 1px solid var(--line);
}
.pb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }

/* 推广计划弹窗：形式多选 chip */
.plan-form-box {
  padding: 10px 12px; border-radius: 8px;
  background: var(--line-2); border: 1px solid var(--line);
}
.pfb-label { font-size: 12px; color: var(--text-2); font-weight: 500; margin-bottom: 6px; }
.plan-chip {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  padding: 5px 11px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-1); transition: .12s;
}
.plan-chip:hover { border-color: var(--brand); }
.plan-chip:has(input:checked) {
  background: #eef2ff; border-color: var(--brand); color: var(--brand); font-weight: 500;
}
.plan-chip input { margin: 0; }

/* 弹窗里「逐条设置形式与日期」 */
.plan-picked { display: flex; flex-direction: column; gap: 10px; }
.plan-picked-row {
  padding: 10px 12px; border-radius: 8px;
  background: #fff; border: 1px solid var(--line);
}
/* 只勾了形式没填日期时给个提醒色，避免用户漏填后提交被拦 */
.plan-picked-row.need-due { border-color: #f6c26b; background: #fffaf0; }

/* 完成日期徽标（选题列表 / 工作台通用）。和 .tt-due 同色系，
   但用于普通 .tag 语境，所以单独一个类名。 */
.due-badge { background: var(--orange-soft); color: #c2410c; }

/* 海外热点还没译出来时，回落显示英文原文。
   用斜体 + 略淡的颜色暗示"这是原文、不是我们没渲染"，
   跟已经有中文译文的条目一眼能区分开。 */
.hot-sum.is-src { font-style: italic; color: var(--text-3); }
a.is-src { font-style: italic; }

/* 推送弹窗里的「封面大字」编辑区。
   用户反馈"没注意到哪里能改封面文字" —— 所以这里刻意用暖橙底色 + 左侧
   品牌色竖条把它从周围的白色表单里拎出来，视觉上先说"这里可以改"。
   配色沿用 need-due 那套提醒语言（橙 = 需要你注意），保持一致。 */
.cover-word-field {
  background: #fff8ef;
  border: 1px solid #f6c26b;
  border-left: 3px solid var(--orange);
  border-radius: 8px;
  padding: 12px 14px;
}
/* 左竖条已经承担了强调职责，输入框本身不必再抢视觉 */
.cover-word-field .hint { margin-top: 6px; }
.ppr-title {
  font-size: 13px; font-weight: 500; margin-bottom: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plan-pick .pick-title { flex: 1; }

/* 图片上传区（素材） */
.upload-zone {
  border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--line-2); padding: 22px 16px; text-align: center;
  cursor: pointer; transition: .15s;
}
.upload-zone:hover, .upload-zone.dragging {
  border-color: var(--brand); background: #eef2ff;
}
.upload-zone .uz-icon { font-size: 22px; color: var(--brand); margin-bottom: 6px; }
.upload-zone .uz-text { font-size: 13px; color: var(--text-1); font-weight: 500; }
.upload-zone .uz-hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.upload-preview { margin-top: 10px; }
.upload-preview img {
  max-width: 100%; max-height: 180px; border-radius: 8px;
  border: 1px solid var(--line); display: block;
}
.upload-preview .up-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 6px; font-size: 12px;
}
/* 多图上传：缩略图网格。
   每格自带序号角标和删除按钮 —— 批量选图时难免混进一张不想要的，
   能单独剔除就不用全部重选。 */
.upload-preview .up-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
}
.upload-preview .up-cell {
  position: relative; aspect-ratio: 1 / 1;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); background: var(--line-2);
}
.upload-preview .up-cell img {
  width: 100%; height: 100%; max-height: none;
  object-fit: cover; border: none; border-radius: 0;
}
.upload-preview .up-idx {
  position: absolute; left: 4px; bottom: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: rgba(0, 0, 0, .62); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center;
}
.upload-preview .up-del {
  position: absolute; right: 3px; top: 3px;
  width: 18px; height: 18px; padding: 0; border: none;
  border-radius: 50%; background: rgba(0, 0, 0, .62); color: #fff;
  font-size: 13px; line-height: 18px; text-align: center;
  cursor: pointer; opacity: .88; transition: opacity .12s, background .12s;
}
.upload-preview .up-del:hover { opacity: 1; background: var(--red, #e5484d); }

/* 封面大字输入框：textarea 而不是 input，因为要支持手动分行。
   高度必须自己压 —— `.textarea` 的 min-height 是 88px，那是给正文用的，
   挪到标题框上会白占掉弹窗半屏，还把「预览」挤出视口，
   用户改完字看不到效果，等于白改。两行的行高刚好够 3-4 行标题。 */
.cover-word-ta {
  min-height: 0;
  height: auto;
  padding: 8px 12px;
  line-height: 1.55;
  font-size: 15px;
  font-weight: 600;
  resize: none;          /* 高度由内容决定，不让用户拖乱版面 */
  overflow-y: auto;
}
.mat-thumb {
  width: 26px; height: 26px; object-fit: cover;
  border-radius: 4px; border: 1px solid var(--line); flex-shrink: 0;
}

/* 弹窗内的选题勾选区 */
.pick-box {
  max-height: 210px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--line-2); padding: 6px 8px;
}
.pick-row {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 6px; border-radius: 6px; transition: background .12s;
}
.pick-row:hover { background: #fff; }
.pick-title {
  flex: 1; font-size: 13px; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------------- 列表 ---------------- */
.list-item {
  padding: 14px 16px; border-bottom: 1px solid var(--line-2);
  transition: background .12s; cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #f8f9fe; }
.list-item h4 { font-size: 13.5px; font-weight: 600; margin-bottom: 5px; line-height: 1.45; }
.list-item .meta {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  font-size: 12px; color: var(--text-3);
}

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600;
  color: var(--text-3); border-bottom: 1px solid var(--line);
  background: #f8faff; position: sticky; top: 0;
}
.data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.data-table tr:hover td { background: #f8f9fe; }
.data-table .t-title { font-weight: 600; color: var(--text); }
.data-table .t-title:hover { color: var(--brand-dark); }

/* ---------------- 生成工作区 ---------------- */
.gen-layout { display: grid; grid-template-columns: 400px 1fr; gap: 16px; align-items: start; }
.gen-form { position: sticky; top: 74px; max-height: calc(100vh - 96px); overflow-y: auto; }
.gen-output { min-height: 400px; }

.chip-group { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px; border: 1px solid var(--line); border-radius: 20px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  background: #fff; cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: #c3cade; }
.chip.active {
  background: var(--brand-soft); border-color: var(--brand);
  color: var(--brand-dark); font-weight: 600;
  box-shadow: 0 1px 6px rgba(99, 102, 241, .18);
}
.chip.small { padding: 4px 10px; font-size: 12px; }

.style-card-opt {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; cursor: pointer; transition: all .15s; margin-bottom: 8px;
  background: #fff;
}
.style-card-opt:hover { border-color: #c3cade; background: #f8f9fe; }
.style-card-opt.active {
  border-color: var(--brand); background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand) inset;
}
.style-card-opt .name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.style-card-opt .d { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }

.output-body {
  padding: 24px 28px; line-height: 1.85; font-size: 14.5px;
  color: #1e2430; max-height: 620px; overflow-y: auto;
  background: #fff; border-radius: 0 0 var(--radius) var(--radius);
}
.output-body h1 { font-size: 21px; font-weight: 700; margin: 0 0 18px; line-height: 1.45; }
.output-body h2 {
  font-size: 16.5px; font-weight: 700; margin: 26px 0 12px;
  padding-left: 11px; border-left: 3px solid var(--brand);
}
.output-body h3 { font-size: 15px; font-weight: 700; margin: 20px 0 10px; }
.output-body p { margin: 0 0 14px; }
.output-body ul, .output-body ol { margin: 0 0 14px 22px; }
.output-body li { margin-bottom: 6px; }
.output-body strong { font-weight: 700; color: #0f172a; }
.output-body blockquote {
  border-left: 3px solid var(--line); padding: 4px 0 4px 14px;
  color: var(--text-2); margin: 14px 0; background: #f8f9fe;
}
.output-body table {
  border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 13px;
}
.output-body th, .output-body td {
  border: 1px solid var(--line); padding: 8px 11px; text-align: left;
}
.output-body th { background: #f8faff; font-weight: 600; }
.output-body img { max-width: 100%; border-radius: var(--radius-sm); }
.output-body code {
  background: var(--line-2); padding: 2px 5px; border-radius: 4px;
  font-size: 12.5px; font-family: ui-monospace, Menlo, monospace;
}
/* 正文里的配图：带边框和说明文字，跟文字段落区分开 */
.md-img {
  margin: 18px 0;
  padding: 10px;
  background: var(--line-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
}
.md-img img {
  max-width: 100%;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}
.md-img figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.6;
}

.suggest-panel {
  background: var(--blue-soft); border: 1px solid #cfe0ff;
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 14px;
  font-size: 13px; line-height: 1.75;
}
.suggest-panel h5 { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: #1d4ed8; }
.suggest-panel ul { margin-left: 18px; }

.round-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: #5b4ad0;
  background: var(--purple-soft); padding: 3px 9px; border-radius: 20px;
}

/* ---------------- 图片网格 ---------------- */
.img-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.img-cell {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: #fff;
}
.img-cell .ph {
  aspect-ratio: 3/4; background: linear-gradient(150deg, #f6f8fc, #eaeef6);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; text-align: center; position: relative;
}
.img-cell .ph .txt {
  font-size: 15px; font-weight: 700; color: #1e2430; line-height: 1.5;
}
.img-cell .ph .idx {
  position: absolute; top: 8px; left: 8px; font-size: 10.5px;
  background: rgba(15, 23, 42, .55); color: #fff; padding: 2px 7px; border-radius: 10px;
  font-weight: 600;
}
.img-cell .cap {
  padding: 9px 11px; font-size: 11.5px; color: var(--text-3);
  line-height: 1.55; border-top: 1px solid var(--line-2);
}

/* ---------------- 生成中进度面板 ---------------- */
.gen-progress {
  padding: 40px 34px 34px;
  text-align: left;
}
.gen-progress .gp-head {
  display: flex; align-items: center; gap: 9px; margin-bottom: 14px;
}
.gen-progress .gp-head b { font-size: 14.5px; font-weight: 700; color: var(--text); }
.gen-progress .gp-sec {
  margin-left: auto; font-size: 12px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.gen-progress .gp-bar {
  height: 6px; background: var(--line-2); border-radius: 6px;
  overflow: hidden; margin-bottom: 20px;
}
.gen-progress .gp-bar > i {
  display: block; height: 100%; width: 8%;
  background: linear-gradient(90deg, #5b7cfa, #8b5cf6);
  border-radius: 6px; transition: width .9s linear;
}
.gen-progress .gp-steps { list-style: none; margin: 0; padding: 0; }
.gen-progress .gp-steps li {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--text-3); line-height: 2.15;
  transition: color .2s;
}
.gen-progress .gp-steps li .gp-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--line); flex-shrink: 0;
}
.gen-progress .gp-steps li.active { color: var(--text); font-weight: 600; }
.gen-progress .gp-steps li.active .gp-dot {
  background: #5b7cfa; box-shadow: 0 0 0 4px rgba(91, 124, 250, .16);
}
.gen-progress .gp-steps li.done { color: var(--text-2); }
.gen-progress .gp-steps li.done .gp-dot { background: #22c55e; }
.gen-progress .gp-tip {
  margin-top: 18px; font-size: 12px; color: var(--text-3); line-height: 1.7;
}
.gen-progress.fail .gp-head b { color: var(--red); }
.gen-progress .gp-err {
  font-size: 13px; color: var(--red); line-height: 1.75;
  background: var(--red-soft, #fef2f2); border: 1px solid #fecaca;
  border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 4px;
}

/* ---------------- 首页最近产出（贴图封面） ---------------- */
.rw-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}
.rw-cell {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: #fff; cursor: pointer;
  transition: box-shadow .15s, transform .15s; position: relative;
}
.rw-cell:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.rw-cell > img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block;
  background: var(--line-2);
}
.rw-cell .rw-badge {
  position: absolute; top: 7px; right: 7px;
  background: rgba(15, 23, 42, .62); color: #fff;
  font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 10px;
}
.rw-cell .rw-ph {
  aspect-ratio: 3/4; padding: 13px; display: flex; flex-direction: column;
  gap: 8px; background: linear-gradient(150deg, #f6f8fc, #eaeef6);
}
.rw-cell .rw-txt {
  font-size: 14px; font-weight: 700; color: #1e2430; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}
.rw-cell .rw-sum {
  font-size: 11.5px; color: var(--text-3); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.rw-cell .rw-cap {
  padding: 8px 10px; border-top: 1px solid var(--line-2);
}
.rw-cell .rw-t {
  font-size: 12px; font-weight: 600; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.rw-cell .rw-m { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ---------------- 首页创作者榜单 ---------------- */
/* 榜单紧凑化（需求 10 修复）：整体限高 + 更小的行距，
   避免把右侧栏撑高、连带把色块 banner 拉长。 */
.rk-body { padding: 4px 12px 10px !important; }
.rk-scroll { max-height: 316px; overflow-y: auto; overscroll-behavior: contain; }
.rk-scroll::-webkit-scrollbar { width: 4px; }
.rk-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

.rk-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 2px; border-bottom: 1px solid var(--line-2);
}
.rk-row:last-child { border-bottom: none; }
.rk-row.top1 .rk-name { color: var(--brand); font-weight: 700; }
.rk-no {
  width: 18px; text-align: center; font-size: 12px; font-weight: 700;
  color: var(--text-3); flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.rk-no.hot { color: #d97706; }
.rk-name {
  font-size: 12.5px; font-weight: 600; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rk-types {
  font-size: 11px; display: flex; gap: 7px; flex-wrap: wrap;
  white-space: nowrap; overflow: hidden;
}
.rk-count {
  font-size: 15px; font-weight: 700; flex-shrink: 0;
  font-variant-numeric: tabular-nums; min-width: 22px; text-align: right;
}

/* ---------------- 选题指派勾选框 ---------------- */
.as-cb {
  display: inline-flex; align-items: center; cursor: pointer;
  margin-right: 4px; flex-shrink: 0; padding-top: 2px;
}
.as-cb input { width: 15px; height: 15px; cursor: pointer; }

/* ---------------- 结果页「直接提修改意见」条 ---------------- */
.refine-bar {
  background: #fbfcff; border: 1px solid #dde5f5;
  border-radius: var(--radius-sm); padding: 13px 15px;
}
.refine-bar .rb-head {
  display: flex; align-items: baseline; gap: 10px;
  flex-wrap: wrap; margin-bottom: 9px;
}
.refine-bar .rb-head b { font-size: 13px; font-weight: 700; color: #1d4ed8; }
.refine-bar .rb-head .muted { font-size: 12px; }

/* ---------------- 模态框 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(10, 15, 30, .5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal {
  background: #fff; border-radius: 16px; width: 100%;
  max-width: 520px; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal.wide { max-width: 780px; }
.modal-head {
  padding: 17px 20px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center;
}
.modal-head h3 { font-size: 15.5px; font-weight: 700; }
.modal-head .x {
  margin-left: auto; font-size: 20px; color: var(--text-3);
  cursor: pointer; line-height: 1; padding: 0 4px;
}
.modal-head .x:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--line-2);
  display: flex; gap: 9px; justify-content: flex-end;
}

/* ---------------- 外网资讯：中英逐段对照 ----------------
   左边竖线把每段圈成一个「对子」，原文在上、译文在下，
   不用表格也不用两栏：外文段落普遍较长，窄屏两栏会挤成条状。 */
.para-pair {
  padding: 0 0 0 13px;
  border-left: 3px solid var(--line-2);
  margin-bottom: 18px;
}
.modal-body .para-pair:last-child { margin-bottom: 0; }
.para-en {
  font-size: 13px; line-height: 1.75; color: var(--text-2);
  font-family: Georgia, "Times New Roman", serif;
  white-space: pre-wrap; word-break: break-word;
}
.para-zh {
  font-size: 13.5px; line-height: 1.85; color: var(--text);
  margin-top: 7px; padding-top: 7px;
  border-top: 1px dashed var(--line-2);
  white-space: pre-wrap; word-break: break-word;
}
.para-zh-empty { color: var(--text-3); font-style: italic; }
.para-note {
  padding: 9px 12px; border-radius: 8px; margin-bottom: 15px;
  background: var(--orange-bg, #fff7ed); font-size: 12px; line-height: 1.65;
  color: var(--text-2);
}

/* ---------------- 登录 ---------------- */
.login-wrap {
  width: 100%; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; overflow: hidden;
  background:
    radial-gradient(640px 460px at 12% 18%, rgba(99, 102, 241, .40), transparent 62%),
    radial-gradient(560px 420px at 88% 82%, rgba(139, 92, 246, .34), transparent 62%),
    radial-gradient(460px 340px at 74% 10%, rgba(14, 165, 233, .20), transparent 60%),
    #0a0f1f;
}
.login-wrap::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(720px 520px at 50% 44%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(720px 520px at 50% 44%, #000 30%, transparent 78%);
}
.login-card {
  background: rgba(255, 255, 255, .98); border-radius: 20px; width: 100%; max-width: 402px;
  padding: 34px 32px; box-shadow: 0 24px 64px rgba(2, 6, 23, .5);
  border: 1px solid rgba(255, 255, 255, .6);
  position: relative; z-index: 1;
}
.login-card .logo {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #6366f1 0%, #6d5ae0 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; margin-bottom: 18px;
  box-shadow: 0 8px 22px rgba(99, 102, 241, .42);
}
.login-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 5px; }
.login-card .sub { font-size: 13px; color: var(--text-3); margin-bottom: 24px; }
.tabs { display: flex; gap: 4px; background: var(--line-2); padding: 3px;
  border-radius: var(--radius-sm); margin-bottom: 20px; }
.tabs button {
  flex: 1; padding: 7px; border-radius: 7px; font-size: 13px;
  font-weight: 600; color: var(--text-3); transition: all .15s;
}
.tabs button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }

/* ---------------- 提示 ---------------- */
.toast-wrap {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 2000; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 11px 18px; border-radius: var(--radius-sm); font-size: 13.5px;
  font-weight: 500; box-shadow: var(--shadow-md); background: #fff;
  border: 1px solid var(--line); display: flex; align-items: center; gap: 9px;
  animation: slideDown .22s ease; max-width: 520px;
}
.toast.ok { border-color: #a7f3d0; background: #f0fdf6; color: #047857; }
.toast.err { border-color: #fecaca; background: #fef5f5; color: #b91c1c; }
.toast.warn { border-color: #fde68a; background: #fffbeb; color: #b45309; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } }

.loading {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
.loading.dark { border-color: rgba(99, 102, 241, .22); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, #eef1f6 25%, #e4e9f1 50%, #eef1f6 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------- 步骤条 ---------------- */
.steps { display: flex; gap: 0; margin-bottom: 20px; }
.step {
  flex: 1; padding: 10px 14px; border-bottom: 2px solid var(--line);
  font-size: 12.5px; color: var(--text-3); font-weight: 500;
  transition: all .18s;
}
.step.done { border-bottom-color: var(--brand); color: var(--brand-dark); }
.step.active { border-bottom-color: var(--brand); color: var(--brand-dark); font-weight: 700; }
.step .n {
  display: inline-flex; width: 18px; height: 18px; border-radius: 50%;
  background: var(--line); color: var(--text-2); font-size: 11px;
  align-items: center; justify-content: center; margin-right: 6px; font-weight: 700;
}
.step.active .n, .step.done .n { background: var(--brand); color: #fff; }

/* ---------------- 分享页 ---------------- */
.share-wrap { max-width: 860px; margin: 0 auto; padding: 30px 20px 70px; }
.share-banner {
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px;
  font-size: 13px; color: var(--brand-dark); display: flex; align-items: center; gap: 10px;
}

@media (max-width: 1200px) {
  .gen-layout { grid-template-columns: 1fr; }
  .gen-form { position: static; max-height: none; }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .hr-body { max-height: 150px; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .module-grid, .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .img-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 16px; }
  .hero { padding: 20px 18px; }
  .hero-grid .hero .meta { margin-top: 16px; }
}
/* ==========================================================
   图表素材上传图片（需求 3）
   ========================================================== */
.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.thumb-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px; margin-top: 10px;
}
.thumb-cell {
  position: relative; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; background: var(--line-2);
}
.thumb-cell img {
  width: 100%; height: 88px; object-fit: cover; display: block;
}
.thumb-cell .thumb-n {
  font-size: 10.5px; color: var(--text-3); padding: 4px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb-x {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  border-radius: 50%; border: none; cursor: pointer; line-height: 1;
  background: rgba(0, 0, 0, .58); color: #fff; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.thumb-x:hover { background: rgba(0, 0, 0, .8); }

/* ==========================================================
   配色选择器（贴图页 / 推送）
   ========================================================== */
.pal-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}
.pal-cell {
  border: 1.5px solid var(--line); border-radius: 8px; padding: 6px;
  cursor: pointer; text-align: center; background: var(--bg, #fff);
  transition: border-color .15s, transform .12s;
}
.pal-cell:hover { transform: translateY(-1px); border-color: var(--text-3); }
.pal-cell.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(20,160,96,.16); }
.pal-sw {
  position: relative; height: 40px; border-radius: 5px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.pal-sw .pal-ac { width: 26px; height: 6px; border-radius: 3px; display: block; }
.pal-n { font-size: 11.5px; margin-top: 5px; color: var(--text-2); }
.pal-cell.active .pal-n { color: var(--brand); font-weight: 600; }

/* ==========================================================
   封面背景图选择器（推送弹窗 / 草稿箱封面）
   ----------------------------------------------------------
   缩略图走 16:9 左右的比例，因为封面本身是 900×383（≈2.35:1）
   的横图。用正方形裁切会让用户看到的构图和实际封面完全不同 ——
   选中的那张「看着挺好看」，铺到 2.35:1 上却被裁掉了主体。
   保持接近真实比例，所见即所得。
   ========================================================== */
.bg-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.bg-cell {
  position: relative; border: 2px solid var(--line); border-radius: 8px;
  overflow: hidden; cursor: pointer; background: var(--line-2);
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.bg-cell:hover { transform: translateY(-1px); border-color: var(--text-3); }
/* 选中态：加粗边框 + 外发光 + 右上角对勾，三重信号 ——
   只靠边框变色在浅色缩略图上几乎看不出来。 */
.bg-cell.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(20,160,96,.20);
}
.bg-cell.active::after {
  content: "✓"; position: absolute; top: 5px; right: 5px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 12px; line-height: 20px;
  text-align: center; font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.bg-cell img {
  display: block; width: 100%; aspect-ratio: 16 / 9;
  object-fit: cover; background: var(--line-2);
}
.bg-name {
  font-size: 11.5px; padding: 5px 8px; color: var(--text-2);
  background: #fff; border-top: 1px solid var(--line-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bg-cell.active .bg-name { color: var(--brand); font-weight: 600; }

/* ==========================================================
   图片灯箱（草稿箱浏览贴图效果 / 生成页看大图）
   ----------------------------------------------------------
   为什么单独一段：贴图草稿在草稿箱里原本只能看到正文文字，
   看不到生成的图。数据一直在草稿的 image_urls 里，缺的是展示。
   这里用纯 CSS + 一点 JS 做放大器，不引入第三方灯箱库。
   追加在 app.css 末尾，靠独立类名（.lightbox-*）避免和既有样式冲突。
   ========================================================== */
.lightbox-mask {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(8, 12, 24, .88);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  animation: lbIn .16s ease;
}
@keyframes lbIn { from { opacity: 0; } }

.lb-head {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 22px; color: #fff;
}
.lb-title {
  font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 62vw;
}
.lb-count {
  font-size: 12.5px; color: rgba(255, 255, 255, .62);
  font-variant-numeric: tabular-nums;
}
.lb-x {
  margin-left: auto; cursor: pointer; font-size: 30px; line-height: 1;
  color: rgba(255, 255, 255, .75); padding: 0 6px;
  transition: color .15s;
}
.lb-x:hover { color: #fff; }

.lb-stage {
  flex: 1; min-height: 0; width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 62px 76px 74px;
}
.lb-stage img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  background: #fff;
}

.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 76px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: #fff;
  font-size: 34px; line-height: 1; border-radius: 10px;
  transition: background .15s;
}
.lb-nav:hover { background: rgba(255, 255, 255, .22); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-foot {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 16px;
}
.btn-dark {
  background: rgba(255, 255, 255, .14); color: #fff;
  border: 1px solid rgba(255, 255, 255, .2);
}
.btn-dark:hover { background: rgba(255, 255, 255, .24); }

/* 草稿箱里的贴图缩略网格：可点开看大图
   注意：类名用 .shot-* 而不是 .thumb-*，
   因为 .thumb-grid/.thumb-cell 已被「视频脚本 → 图表素材上传」占用，
   复用会改掉那边的缩略图高度和鼠标指针。 */
.shot-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px; margin-top: 10px;
}
.shot-cell {
  position: relative; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; cursor: zoom-in; background: #f1f2f5;
  padding: 0; display: block;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.shot-cell:hover {
  transform: translateY(-2px); border-color: var(--brand);
  box-shadow: var(--shadow-md);
}
.shot-cell img {
  width: 100%; display: block; aspect-ratio: 3/4;
  /* 用 contain 不用 cover：贴图的排版效果（标题位置、留白）
     是用户要看的重点，裁掉两边就白看了。 */
  object-fit: contain; background: #f1f2f5;
}
.shot-cell .tc-idx {
  position: absolute; top: 6px; left: 6px;
  font-size: 10px; font-weight: 600; color: #fff;
  background: rgba(15, 23, 42, .58);
  padding: 1px 6px; border-radius: 9px;
}

@media (max-width: 768px) {
  .lb-stage { padding: 56px 14px 68px; }
  .lb-nav { width: 38px; height: 62px; font-size: 26px; }
  .lb-prev { left: 6px; } .lb-next { right: 6px; }
  .shot-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}

/* ==========================================================
   通知「可见化」：告警条 + 最近通知列表（2026-10-07 加）
   ----------------------------------------------------------
   背景：webhook 被写成死地址后，通知连续两次静默失败（9-30 / 10-06），
   界面上什么都没有 —— 用户只能靠"群里怎么没消息"反过来怀疑。
   这两块样式就是为了让"发不出去"这件事自己跳出来。
   ========================================================== */

/* 告警条：只在确实有问题时由 JS 渲染出来，正常情况不占位 */
.nf-alert {
  background: var(--orange-soft);
  border: 1px solid #fed7aa;
  border-left: 3px solid var(--orange);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #9a3412;
  margin-bottom: 14px;
}
.nf-alert b { color: #7c2d12; }
.nf-alert code {
  background: rgba(255, 255, 255, .7);
  padding: 1px 5px; border-radius: 4px;
  font-size: 11.5px; color: #7c2d12;
}

.nf-logs { display: flex; flex-direction: column; gap: 6px; }

.nf-log {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 7px 10px;
  font-size: 12.5px;
}
/* 失败项：左侧红边 + 浅红底，扫一眼就能从一列里挑出来 */
.nf-log.bad {
  border-color: #fecaca;
  border-left: 3px solid var(--red);
  background: var(--red-soft);
}

.nf-log-row {
  display: flex; align-items: center; gap: 8px;
}
.nf-log-dot {
  width: 16px; height: 16px; flex: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; line-height: 1;
  background: var(--green-soft, #ecfdf5); color: #059669;
}
.nf-log.bad .nf-log-dot { background: #fee2e2; color: #dc2626; }

.nf-log-kind {
  flex: none;
  font-size: 11px; font-weight: 600;
  color: var(--text-2);
  background: var(--line-2);
  padding: 1px 7px; border-radius: 9px;
}
.nf-log.bad .nf-log-kind { background: #fee2e2; color: #b91c1c; }

.nf-log-target {
  color: var(--text-1, #0f172a);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nf-log-time {
  flex: none; font-size: 11.5px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* 失败原因整行铺开、等宽字体 —— 这种报错就是要看清原文 */
.nf-log-err {
  margin-top: 5px; padding-top: 5px;
  border-top: 1px dashed #fecaca;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; line-height: 1.6;
  color: #b91c1c;
  word-break: break-all;
}

/* ===== 本周工作看板 ===== */

/* ==========================================================
   本周工作看板
   ----------------------------------------------------------
   布局：三栏 —— 我主责(大卡) | 我协作(小卡) | 其他同事(列表)

   ★ 「一张大卡片高度 = 两张小卡片」怎么保证：
     不在 JS 里量高度，那会在窗口缩放/字体加载后失准。
     这里用一个统一变量 --bd-h 作为「一行」的高度：
       小卡片 = 1 行     → height: var(--bd-h)
       大卡片 = 2 行     → height: calc(var(--bd-h) * 2)
     三栏都是 1fr 宽度、都在同一个 grid 里，行高一致，
     所以无论屏多宽，2 个小卡片纵向永远正好顶一个大卡片。
     （小卡片网格两列排布，所以同屏能放 4 个小卡 = 2 个大卡的位置）

   颜色：主责用品牌绿高亮，逾期转红，完成转灰 —— 一眼看出该干什么。
   ========================================================== */

.bd-wrap {
  --bd-h: 96px;                 /* 卡片统一高度：大卡片 == 小卡片，三栏顶边齐平 */
  --bd-gap: 12px;
  display: grid;
  /* 中栏改单列后内容变宽，权重给到 1.25fr，视觉上跟左栏分量相当 */
  grid-template-columns: 1.3fr 1.25fr 0.85fr;
  gap: 16px;
  padding: 14px 16px 16px;
  align-items: start;
}

/* 三栏各自的表头 */
.bd-col-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  margin-bottom: 9px; letter-spacing: .2px;
}
.bd-col-head i {
  font-style: normal; font-size: 11px; font-weight: 600;
  background: var(--line-2); color: var(--text-3);
  padding: 1px 7px; border-radius: 9px; line-height: 1.5;
}
/* 「我协作」列头的「跨周」说明：这一栏范围跟别栏不同，
   不标出来用户切周次时看它不动会以为是 bug。 */
.bd-col-head .bd-scope {
  margin-left: 5px; padding: 0 5px; border-radius: 3px;
  font-size: 10px; font-weight: 500; font-style: normal;
  background: #eef2ff; color: #4338ca; opacity: .85;
}

/* ---------- 周翻页控件 ----------
   用户原话：「已经完成的也需要一个查看历史工作的地方，
             可以直接工作页左右翻页的方式。」
   所以周次不是一个下拉，而是一组 ‹ [周次] › 的翻页条：
   下拉负责「跳到某一周」（周多了翻页太慢），箭头负责「一周一周看」。 */
.bd-nav { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; }
.bd-nav-btn {
  height: 30px; min-width: 30px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; line-height: 1;
  color: var(--text-2); background: #fff;
  border: 1px solid var(--line-2); border-radius: 8px;
  cursor: pointer;
  /* ★ 必须 nowrap：.bd-nav 是 inline-flex，父容器在窄屏下会挤压子项，
     「本周」两个字被压成「本」+「周」上下两行，按钮变成竖长条。 */
  white-space: nowrap; flex: none;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.bd-nav-btn:hover:not(:disabled) { background: #f8fafc; border-color: #cbd5e1; color: var(--text); }
.bd-nav-btn:disabled { opacity: .35; cursor: default; }
.bd-nav-btn.is-today {
  font-size: 12px; font-weight: 600; padding: 0 10px; min-width: 44px;
  color: #047857; background: #ecfdf5; border-color: #a7f3d0;
}
.bd-nav-btn.is-today:hover { background: #d1fae5; border-color: #6ee7b7; color: #047857; }

/* 历史视图的标记：让用户清楚「我现在看的不是本周」，
   否则会奇怪为什么新建的任务不在这儿。 */
.bd-hist-tag {
  margin-left: 6px; padding: 0 6px; border-radius: 4px;
  font-size: 10.5px; font-weight: 600;
  color: #92400e; background: #fef3c7;
  box-shadow: inset 0 0 0 1px #fde68a;
}

/* ---------- 大卡片（我主责） ---------- */
.bd-big-list {
  display: flex; flex-direction: column; gap: var(--bd-gap);
}
.bd-big {
  /* ★ 原来是 calc(var(--bd-h) * 2)，两张小卡片那么高。单个任务时
     一小块内容悬在 192px 的框里，空白太多、左栏视觉也过重。
     现在跟小卡片同高（96px），三栏顶边天然齐平，不必再补占位格。 */
  height: var(--bd-h);
  box-sizing: border-box;
  display: flex; flex-direction: column;
  padding: 9px 12px;
  border-radius: 12px;
  /* 高亮：左侧粗色条 + 浅绿底，是整块看板视觉重心 */
  background: linear-gradient(135deg, #f0fdf6 0%, #f7fefb 100%);
  border: 1px solid #bbf0d3;
  border-left: 4px solid #10b981;
  box-shadow: 0 1px 3px rgba(16, 185, 129, .07);
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
  position: relative;
  overflow: hidden;
}
.bd-big:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, .15);
}
/* 逾期：红边框 + 浅红底（用户要的规格）。
   原来只有 1px 淡粉边，实测截图里几乎看不出来 —— 一屏绿卡片中
   只有左色条红了，很容易漏。这里把边框加到 1.5px、底色压深一档，
   并在右上角点一个红点，让「逾期」在不读字的情况下也能被扫到。 */
.bd-big.is-overdue {
  background: linear-gradient(135deg, #fff1f1 0%, #fff8f8 100%);
  border: 1.5px solid #fca5a5; border-left: 4px solid #ef4444;
  box-shadow: 0 1px 4px rgba(239, 68, 68, .12);
}
.bd-big.is-overdue::after {
  content: ''; position: absolute; top: 7px; right: 7px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}
.bd-big.is-blocked {
  background: linear-gradient(135deg, #fffaf0 0%, #fffdf8 100%);
  border-color: #fde3b0; border-left-color: #f59e0b;
}
.bd-big.is-done {
  background: #fafbfc; border-color: var(--line-2); border-left-color: #cbd5e1;
  opacity: .78;
}

.bd-big-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.bd-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  color: #047857; background: #d1fae5;
  padding: 2px 8px; border-radius: 6px; line-height: 1.6;
}
.bd-badge.ghost { color: var(--text-2); background: var(--line-2); font-weight: 600; }

.bd-state {
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
  margin-left: auto; white-space: nowrap;
}
.bd-state.s-doing   { color: #059669; }
.bd-state.s-done    { color: #64748b; }
.bd-state.s-blocked { color: #d97706; }

/* 主责任务的标题仍比小卡片大一号，但卡片压到 96px 后
   16.5px/2 行 + 2 行备注装不下，收到 14.5px/1 行 + 备注 1 行。 */
.bd-big-title {
  font-size: 14px; font-weight: 700; line-height: 1.28;
  color: var(--text, #0f172a);
  margin: 0 0 1px;
  /* 1 行。96px 的框里要同时放顶行/标题/备注/底行，标题给 2 行会溢出
     7px，底部「明天到期」直接被切掉（实测，不是估算）。 */
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
  flex: none;                 /* 大卡片同样是 column flex，标题不能被压 */
}
.bd-big.is-done .bd-big-title { text-decoration: line-through; text-decoration-color: #cbd5e1; }
.bd-big-note {
  font-size: 11.5px; color: var(--text-2); line-height: 1.3;
  margin: 0;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
  flex: none;
}
.bd-big-foot {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  font-size: 11.5px; line-height: 1.35; color: var(--text-3);
  padding-bottom: 0;
}
.bd-helpers { margin-left: auto; }

.bd-due { font-weight: 600; font-variant-numeric: tabular-nums; }
.bd-due.bad { color: #dc2626; }
.bd-big .bd-due { white-space: nowrap; }

/* 操作区：hover 才浮出，平时不占视觉 */
.bd-big-ops {
  position: absolute; right: 12px; bottom: 10px;
  opacity: 0; transition: opacity .14s ease;
}
.bd-big:hover .bd-big-ops { opacity: 1; }

/* ---------- 小卡片（我协作） ---------- */
.bd-small-grid {
  display: grid;
  /* ★ 单列：一行一张。原来两列，一条协作任务只占左半边、
     右边空一个格子，横向空间全浪费了。 */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--bd-gap);
  /* 行高锁死为 --bd-h，超出的标题会截断而不是把卡片撑高 */
  grid-auto-rows: var(--bd-h);
}
.bd-small {
  height: var(--bd-h); box-sizing: border-box;
  display: flex; flex-direction: column;
  padding: 9px 11px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid var(--line-2);
  cursor: pointer;
  transition: border-color .14s ease, box-shadow .14s ease;
  overflow: hidden;
}
.bd-small:hover {
  border-color: #a7f3d0;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .06);
}
.bd-small.is-overdue {
  border: 1.5px solid #fca5a5; background: #fff5f5;
  box-shadow: 0 1px 3px rgba(239, 68, 68, .1);
}
.bd-small.is-done { opacity: .7; background: #fafbfc; }

/* 占位格已废弃：三栏卡片同高后不需要补空了。
   留一条兜底（防历史 DOM 残留），别渲染成实心卡片。 */
.bd-small.is-blank { display: none !important; }

.bd-small-top { display: flex; align-items: center; margin-bottom: 4px; }
.bd-small-top .bd-badge { font-size: 10px; padding: 1px 6px; }
.bd-small-top .bd-state { font-size: 12px; font-weight: 700; margin-left: auto; }

/* 「我协作」组是跨周的（后端拉全部未完成），非本周的任务挂个周次角标。
   下周的用蓝灰提示，旧周/过期的用浅灰弱化。 */
.bd-wk {
  margin-left: 5px; padding: 0 5px;
  font-size: 10px; font-weight: 600; line-height: 1.6;
  border-radius: 3px; white-space: nowrap;
  background: #f1f5f9; color: #64748b;
}
.bd-wk.is-next { background: #eef2ff; color: #4338ca; }
.bd-wk.is-past { background: #f8fafc; color: #94a3b8; }
/* 遗留角标：这一条不是当前视图周的活，是从更早的周拖着没做完的。
   用琥珀色 —— 跟逾期的正红区分开：遗留 ≠ 逾期，只是「不属于这周」。 */
.bd-wk.is-carry {
  background: #fff7ed; color: #b45309;
  box-shadow: inset 0 0 0 1px #fed7aa;
}

.bd-small-title {
  font-size: 13px; font-weight: 600; line-height: 1.4;
  color: var(--text, #0f172a); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  /* ★ 必须关掉 flex 收缩：卡片是 column flex，-webkit-box 的标题
     会被当成可压缩项，实测被压到只有 5px 高 —— 标题就成了半截。
     同理下面 foot 的 margin-top:auto 才有正常效果。 */
  flex: none;
}
.bd-small.is-done .bd-small-title { text-decoration: line-through; text-decoration-color: #cbd5e1; }

.bd-small-foot {
  /* ★ margin-top:auto 会在「标题短、卡片高」时把这一行顶到卡片最底部。
     实测一张 96px 的小卡片，标题只占一行时 owner / 逾期被推到离标题
     40px 远的地方，中间一大片空白；逾期天数还正好落在右下角、
     紧贴「标记完成」按钮出现的那个位置，看着像错位。
     改成固定贴住标题下方，整组内容从顶部自然往下排。 */
  margin-top: 2px; margin-bottom: auto; padding-top: 2px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-3);
  min-width: 0;
  flex: none;                 /* 别让 flex 把这一行压扁 */
  line-height: 1.5;
}
.bd-small-foot .bd-owner {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* ★ 小卡片宽度只有大卡片一半，owner 名字通常很短，
   margin-left:auto 会把「逾期 N 天」一路顶到卡片右边缘，
   跟左边的 owner 隔开半个卡片 —— 视觉上像两个不相干的信息，
   也容易和 hover 时出现的「标记完成」按钮在同一角落打架。
   这里让它紧跟 owner，中间只留一个普通间距。 */
.bd-small-foot .bd-due { margin-left: 0; white-space: nowrap; }

.bd-small-ops {
  /* ★ 96px 的卡片里塞不下「top + 两行标题 + foot + 按钮」四行。
     原来用 opacity:0 隐藏，元素仍占着 22px + 4px 的位置，
     把整列撑到 96px 之外；父级 overflow:hidden 又吃掉了溢出，
     于是 flex 反向压缩，foot 被顶到离标题 53px 的中间位置，
     看起来像「逾期 11 天」飘在卡片中央。
     改用 display:none 退出布局，hover 再插回来（此时卡片略增高，
     但三栏顶边对齐靠的是 --bd-h 的 min-height，不会跳动）。 */
  display: none;
  margin-top: 4px;
}
.bd-small:hover .bd-small-ops { display: block; }
.bd-small-ops .btn { padding: 2px 8px; font-size: 11px; height: 22px; }

/* ---------- 最右列表（其他同事） ---------- */
.bd-rows {
  display: flex; flex-direction: column;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  overflow: hidden;
  background: #fff;
}
.bd-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  transition: background .12s ease;
}
.bd-row:last-child { border-bottom: none; }
.bd-row:hover { background: #f8fafc; }
.bd-row.is-done { opacity: .65; }

.bd-row-main { min-width: 0; flex: 1; }
.bd-row-title {
  display: block;
  font-size: 12.5px; font-weight: 500; line-height: 1.4;
  color: var(--text, #0f172a);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bd-row.is-done .bd-row-title { text-decoration: line-through; text-decoration-color: #cbd5e1; }
.bd-row-meta {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text-3); margin-top: 2px;
}
.bd-row-state {
  flex: none; font-size: 12px; font-weight: 700; color: var(--text-3);
}
.bd-row-state.s-doing   { color: #059669; }
.bd-row-state.s-blocked { color: #d97706; }

/* ---------- 空态 ---------- */
.bd-empty {
  padding: 26px 14px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: 12px;
  background: #fcfdfe;
}
.bd-empty.sm { padding: 16px 10px; }
.bd-empty .big { font-size: 22px; color: #cbd5e1; margin-bottom: 6px; }
.bd-empty p { font-size: 12.5px; color: var(--text-2); margin: 0 0 3px; }
.bd-empty p.muted { color: var(--text-3); font-size: 11.5px; }

/* ---------- 弹窗里的协作人多选 ---------- */
.bd-people { display: flex; flex-wrap: wrap; gap: 7px; }
.bd-chip {
  font-size: 12.5px; padding: 4px 11px; border-radius: 15px;
  border: 1px solid var(--line-2); background: #fff;
  color: var(--text-2); cursor: pointer; user-select: none;
  transition: all .12s ease;
}
.bd-chip:hover { border-color: #a7f3d0; }
.bd-chip.on {
  background: #d1fae5; border-color: #6ee7b7;
  color: #047857; font-weight: 600;
}
/* 「我」角标：自己固定在协作人第一位，标出来才不会被误当普通同事 */
.bd-me {
  display: inline-block; margin-left: 5px; padding: 0 4px;
  font-size: 10px; line-height: 1.5; border-radius: 3px;
  background: #eef2ff; color: #4338ca; vertical-align: 1px;
}
.bd-chip.on .bd-me { background: #c7d2fe; color: #3730a3; }

/* ---------- 窄屏：三栏塌成一条 ---------- */
@media (max-width: 1180px) {
  .bd-wrap { grid-template-columns: 1.3fr 1.25fr; }
  /* 最右列表掉到下一整行 */
  .bd-col-other { grid-column: 1 / -1; }
  .bd-rows { flex-direction: row; flex-wrap: wrap; }
  .bd-row { width: 50%; border-bottom: 1px solid var(--line-2); }
}
@media (max-width: 760px) {
  .bd-wrap { grid-template-columns: 1fr; --bd-h: auto; }
  /* 单栏后不再并排比较高度，但两者 min-height 要一致，
     否则一个 120 一个 88，视觉上还是「大卡更高」。 */
  .bd-big { height: auto; min-height: 88px; }
  .bd-small-grid { grid-auto-rows: auto; }
  .bd-small { height: auto; min-height: 88px; }
  .bd-row { width: 100%; }
  .bd-big-ops, .bd-small-ops { opacity: 1; }
}

/* ============ 改稿面板：试查结果与零命中诊断 ============ */
.rfd-res {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7f9fc;
  border: 1px solid #e3e9f2;
  font-size: 12px;
  line-height: 1.7;
}
.rfd-res.is-zero {
  background: #fffbf0;
  border-color: #f3e2bd;
}
.rfd-res-h {
  margin-bottom: 4px;
  font-weight: 600;
  color: #33415c;
}
.rfd-res.is-zero .rfd-res-h { color: #7a5a00; }
.rfd-res-n {
  margin: 3px 0;
  color: #5a4a28;
}
.rfd-res-n b { color: #7a4b00; }
/* 最后一句「只能不写分数」是后果提醒，要和上面的原因区分开 */
.rfd-res-warn {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #ecd9ac;
  color: #8a5a00;
}

/* ---------- 数据源多选：耗时提示 ----------
   用户原话：「同时引用数据可以做到选择一个或多个」，选完又问「可以提示」。
   背景是实测数据：单库 170~195 秒，双库 300~383 秒 —— 翻倍。
   不提示的话，用户勾完两个库点生成，等五分钟会以为卡死了。 */
.am-slow {
  display: flex; align-items: center; gap: 5px;
  margin-top: 5px; padding: 5px 9px;
  font-size: 11.5px; line-height: 1.5;
  color: #92400e; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 7px;
}
/* 图标用 CSS 画，不写 emoji ——「⏱」在 Windows/部分 Chrome 上是
   彩色 emoji 字体，跟这行棕色小字放一起像贴纸，且基线不齐。 */
.am-slow-ico {
  flex: none; width: 7px; height: 7px; border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 2.5px rgba(245, 158, 11, .22);
  margin: 0 3px 0 1px;
}

/* 面板里的版本：空间大，可以多说两句 */
.am-slow-inline {
  margin: 2px 0 6px; padding: 7px 9px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px;
  color: #92400e; line-height: 1.65;
}
.am-slow-inline b { color: #b45309; font-weight: 700; }

/* ==========================================================
   手绘视频（铅笔火柴人竖版动画）
   ========================================================== */
.pv-warn {
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 14px;
  background: var(--orange-soft); border: 1px solid #fde3ba;
  border-radius: var(--radius-sm);
  font-size: 12.5px; color: #92400e; line-height: 1.6;
}
.pv-warn b { color: #b45309; }

/* 「必须出现的文字」提示：和橙色告警区分开，用金色系，
   它不是警告而是「这是你要求的东西」，别让用户以为出错了 */
.pv-warn.pv-must {
  background: #fbf6e8; border-color: #ecdcb4; color: #7c5a12;
}
.pv-warn.pv-must b { color: #92650b; }

/* 左侧表单在 gen-layout 里已经是 sticky + 内部滚动 */
.pv-wrap .gen-layout { grid-template-columns: 400px 1fr; }

/* 分镜编辑：字数徽标 */
.pv-count {
  font-size: 11px; font-weight: 500; color: var(--text-3);
  background: var(--line-2); padding: 1px 7px; border-radius: 9px;
  margin-left: 6px; vertical-align: 1px;
}
.pv-count.over { background: var(--red-soft); color: #dc2626; }

/* 画面标签：两列，名字固定宽，输入框吃满 */
.pv-labels {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.pv-label-row { display: flex; align-items: center; gap: 6px; }
.pv-label-name {
  flex: 0 0 78px; font-size: 11.5px; color: var(--text-2);
  text-align: right; line-height: 1.3;
}
.pv-label-row .input { flex: 1; min-width: 0; padding: 5px 8px; font-size: 12.5px; }

.pv-timeline-note {
  margin-top: 6px; padding: 9px 12px;
  background: var(--brand-soft); border-radius: var(--radius-sm);
  font-size: 12px; color: var(--brand-deep); line-height: 1.6;
}

/* 进度 */
.pv-progress-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px;
}
.pv-stage-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.pv-pct { font-size: 20px; font-weight: 700; color: var(--brand-dark); letter-spacing: -.02em; }

.pv-bar {
  height: 8px; border-radius: 8px; background: var(--line-2); overflow: hidden;
}
.pv-bar i {
  display: block; height: 100%; width: 0; border-radius: 8px;
  background: linear-gradient(90deg, #818cf8, var(--brand-dark));
  transition: width .6s ease;
}

.pv-steps {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px;
}
.pv-step {
  font-size: 11.5px; padding: 3px 9px; border-radius: 9px;
  background: var(--line-2); color: var(--text-3);
}
.pv-step.past { background: var(--green-soft); color: #059669; }
.pv-step.now { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

/* 进度预览占位：竖版比例，别用固定高度，否则不同屏高下会跳 */
.pv-preview {
  margin-top: 16px; display: flex; justify-content: center;
}
.pv-preview-inner {
  width: 100%; max-width: 260px; aspect-ratio: 9/16;
  border: 1px dashed var(--line); border-radius: 12px;
  background: #f8f9fe;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 20px;
}
.pv-preview-inner p { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }

/* 成片区：竖版播放器 + 右侧元信息 */
.pv-done {
  display: grid; grid-template-columns: 300px 1fr; gap: 20px;
  padding: 18px; align-items: start;
}
.pv-player {
  border-radius: 12px; overflow: hidden; background: #0f172a;
  border: 1px solid var(--line);
}
.pv-player video {
  display: block; width: 100%; aspect-ratio: 9/16; background: #000;
}
.pv-done-side { padding-top: 4px; }
.pv-kv {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 0; border-bottom: 1px dashed var(--line-2); font-size: 13px;
}
.pv-kv:last-of-type { border-bottom: none; }
.pv-kv b { font-weight: 500; color: var(--text-3); font-size: 12.5px; }
.pv-kv span { color: var(--text); font-weight: 600; }

/* 失败态 */
.pv-fail b { display: block; font-size: 13.5px; color: var(--red); margin-bottom: 8px; }
.pv-fail pre {
  font-size: 11.5px; line-height: 1.6; color: var(--text-2);
  background: #f8f9fe; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 12px; max-height: 220px; overflow: auto;
  white-space: pre-wrap; word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* 历史任务 */
.pv-loading { padding: 16px; text-align: center; }
.pv-hist-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-bottom: 1px solid var(--line-2);
  cursor: pointer; transition: background .12s;
}
.pv-hist-item:last-child { border-bottom: none; }
.pv-hist-item:hover { background: #f8f9fe; }
.pv-hist-item.active { background: var(--brand-soft); }
.pv-hist-main { min-width: 0; flex: 1; }
.pv-hist-title {
  font-size: 12.5px; font-weight: 600; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pv-hist-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 4px; font-size: 11px; color: var(--text-3);
}
.pv-hist-meta .tag { font-size: 10.5px; padding: 1px 6px; }
.pv-hist-dl { flex: 0 0 auto; padding: 2px 7px; }

/* ---------- 镜头卡片（自由画面模式）----------
   自由画面的元素坐标不好用表单编辑，所以只给三件事：
   看缩略图、改画面标注、单独重画这一镜。
   缩略图用 9:16 竖图，宽 96px 足够看出「画的是什么」。 */
.pv-shots {
  display: flex; flex-direction: column; gap: 10px;
}
.pv-shot {
  display: grid; grid-template-columns: 96px 1fr; gap: 12px;
  padding: 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-soft, #faf9f6);
}
.pv-shot-thumb {
  position: relative; width: 96px; aspect-ratio: 9 / 16;
  border-radius: 7px; overflow: hidden; background: #fff;
  border: 1px solid var(--line);
}
.pv-shot-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-shot-empty {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
}
.pv-shot-empty p { font-size: 10.5px; color: var(--text-3); margin: 0; text-align: center; }
.pv-shot-no {
  position: absolute; left: 4px; top: 4px; min-width: 18px; height: 18px;
  border-radius: 9px; background: rgba(48, 44, 39, .72); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; padding: 0 5px;
}
.pv-shot-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pv-shot-head {
  display: flex; align-items: baseline; gap: 8px; justify-content: space-between;
}
.pv-shot-head b {
  font-size: 13px; font-weight: 600; line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pv-shot-head .muted { font-size: 11px; flex: 0 0 auto; }
.pv-shot-texts { display: flex; flex-direction: column; gap: 5px; }
.pv-shot-text-row { display: flex; gap: 5px; align-items: center; }
.pv-shot-text-row .input { flex: 1; height: 30px; font-size: 12.5px; }
.pv-shot-text-row .btn { flex: 0 0 auto; padding: 2px 8px; line-height: 1.5; }
.pv-shot-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 渲染进度页的镜头小图，让用户看到正在画哪一镜 */
.pv-shots-mini {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px;
}
.pv-shot-mini { flex: 0 0 auto; width: 66px; }
.pv-shot-mini .pv-shot-thumb { width: 66px; }
.pv-shot-mini p {
  margin: 4px 0 0; font-size: 10.5px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 缩略图放大 ----------
   卡片里的缩略图只有 96px 宽，1080 的画面缩到这个尺寸，标注上的字
   基本是一团墨点。而用户恰恰要「照着画面上的字」去改字 ——
   看不清就等于没法改。点开走 core.js 那套灯箱，能左右翻页看完全部镜头。 */
.pv-shot-thumb.can-zoom { cursor: zoom-in; }
.pv-zoom-tip {
  position: absolute; right: 4px; bottom: 4px;
  padding: 1px 6px; border-radius: 5px;
  background: rgba(48, 44, 39, .72); color: #fff;
  font-size: 10.5px; line-height: 16px; letter-spacing: .02em;
  opacity: 0; transition: opacity .15s;
  pointer-events: none;
}
.pv-shot-thumb.can-zoom:hover .pv-zoom-tip { opacity: 1; }
.pv-shot-thumb.can-zoom:hover { border-color: var(--ink-3, #b9b1a4); }

/* ---------- 底部操作条 ----------
   保存按钮原本只在卡片顶部。镜头一多，滚到下面改字时它早就出屏了，
   用户以为「没有保存按钮」，改完就去点渲染。这里在镜头列表末尾再放一组，
   让按钮永远在手边。 */
.pv-edit-foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: 18px; padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.pv-edit-foot .btn:last-child { margin-left: 0; }
/* BGM 选择：塞在保存/渲染左边，一行放下 */
.pv-bgm {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px;
}
.pv-bgm .select { max-width: 180px; font-size: 12.5px; padding: 5px 8px; }
.pv-dirty-tip {
  margin-right: auto;
  font-size: 12.5px; color: #b08a2e;
  display: none;
}
/* 「改动还没保存」：只在真有改动时出现，保存后整块重渲染，自然消失 */
.pv-dirty-tip.on { display: inline; }
.pv-dirty-tip.on::before {
  content: '●'; margin-right: 5px; font-size: 9px; vertical-align: 1px;
}
/* 有未保存改动时，保存按钮描个金边提醒一下 —— 不改成红/黄警告色，
   改字是常规操作，不该看着像出错 */
.btn.is-dirty {
  border-color: #d9b86a;
  box-shadow: 0 0 0 3px rgba(217, 184, 106, .16);
}

@media (max-width: 1080px) {
  .pv-wrap .gen-layout { grid-template-columns: 340px 1fr; }
  .pv-done { grid-template-columns: 240px 1fr; }
}
@media (max-width: 860px) {
  .pv-wrap .gen-layout { grid-template-columns: 1fr; }
  .pv-wrap .gen-form { position: static; max-height: none; }
  .pv-done { grid-template-columns: 1fr; }
  .pv-labels { grid-template-columns: 1fr; }
  .pv-label-name { flex-basis: 66px; }
  .pv-shot { grid-template-columns: 76px 1fr; }
  .pv-shot-thumb { width: 76px; }
}
