/* 刊群稿件处理系统 · 设计令牌与组件 */
:root {
  --bg: #f4f6f8; --panel: #ffffff; --panel-2: #f8fafb; --line: #e3e8ec; --line-2: #cfd8de;
  --ink: #15232d; --ink-2: #44535e; --ink-3: #74838e;
  --brand: #124e66; --brand-2: #1b6f8f; --brand-soft: #e5f0f4; --accent: #e0892b; --accent-soft: #fdf1e3;
  --ok: #1f8a5b; --ok-soft: #e3f4ec; --warn: #b7791f; --warn-soft: #fbf1dc; --bad: #c0392b; --bad-soft: #fbe6e3; --info: #3b6ea8; --info-soft: #e6eef8;
  --radius: 10px; --radius-s: 6px; --shadow: 0 1px 2px rgba(16,32,44,.06), 0 4px 16px rgba(16,32,44,.05);
  --font: "PingFang SC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f171c; --panel: #16222a; --panel-2: #1b2932; --line: #26363f; --line-2: #33464f;
    --ink: #e6edf1; --ink-2: #b3c1ca; --ink-3: #82939d;
    --brand: #5cb2d1; --brand-2: #7cc6e0; --brand-soft: #173746; --accent: #f0a54f; --accent-soft: #3a2a17;
    --ok: #4cc58f; --ok-soft: #173a2b; --warn: #e3b25a; --warn-soft: #3a2f17; --bad: #f07565; --bad-soft: #3d1f1b; --info: #7fa9dc; --info-soft: #1c2d42;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f171c; --panel: #16222a; --panel-2: #1b2932; --line: #26363f; --line-2: #33464f;
  --ink: #e6edf1; --ink-2: #b3c1ca; --ink-3: #82939d;
  --brand: #5cb2d1; --brand-2: #7cc6e0; --brand-soft: #173746; --accent: #f0a54f; --accent-soft: #3a2a17;
  --ok: #4cc58f; --ok-soft: #173a2b; --warn: #e3b25a; --warn-soft: #3a2f17; --bad: #f07565; --bad-soft: #3d1f1b; --info: #7fa9dc; --info-soft: #1c2d42;
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* 图标基线：SVG 无固有尺寸，缺了这条就会被 flex/grid 容器撑满。
   更具体的容器规则（.btn svg / .nav a svg 等）specificity 更高，仍照旧生效。 */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.15em; }
.ic-lg { width: 20px; height: 20px; }
.ic-xl { width: 28px; height: 28px; }

html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 13px; color: var(--ink-2); }
p { margin: 0 0 .6em; }
code, .mono { font-family: var(--mono); font-size: 12px; }
button, input, select, textarea { font: inherit; color: inherit; }

/* 启动态 */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark { display: flex; gap: 6px; } .boot-mark span { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: pulse 1s infinite ease-in-out; }
.boot-mark span:nth-child(2) { animation-delay: .15s; } .boot-mark span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

/* 外壳 */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.brand b { display: block; font-size: 14px; } .brand small { color: var(--ink-3); font-size: 11px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 11px; color: var(--ink-3); padding: 10px 10px 4px; letter-spacing: .04em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); }
.nav a:hover { background: var(--panel-2); text-decoration: none; }
.nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav a svg { width: 16px; height: 16px; flex: none; }
.nav a .count { margin-left: auto; font-size: 11px; background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--ink-3); padding: 0 8px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.top .crumbs { font-size: 13px; color: var(--ink-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .spacer { flex: 1; }
.top select { border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 5px 8px; max-width: 220px; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.menu-btn { display: none; }
.content { padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* 通用组件 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head .hint { color: var(--ink-3); font-size: 12px; margin-left: auto; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--panel-2); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); border-color: var(--bad-soft); } .btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.small { padding: 4px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.field .help { font-size: 12px; color: var(--ink-3); }
.input, .field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 8px 10px; outline: none; }
.field textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--ink-3); } .small { font-size: 12px; } .right { margin-left: auto; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 10px; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:hover td { background: var(--panel-2); }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty svg { width: 40px; height: 40px; opacity: .5; margin-bottom: 8px; }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi .v { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; color: var(--ink-3); }
.kpi .d { font-size: 12px; color: var(--ink-2); }
.bar { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; transition: width .6s ease; }
.stack-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--ink-3); }
.stack-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 14px; cursor: pointer; color: var(--ink-3); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.notice { border-radius: 8px; padding: 10px 12px; font-size: 13px; background: var(--info-soft); color: var(--ink-2); border-left: 3px solid var(--info); margin-bottom: 12px; }
.notice.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.notice.bad { background: var(--bad-soft); border-left-color: var(--bad); }
.notice.ok { background: var(--ok-soft); border-left-color: var(--ok); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 12px; }
.timeline li::before { content: ""; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--brand); }
.timeline .t { font-size: 12px; color: var(--ink-3); }
.steps { display: flex; gap: 0; margin-bottom: 18px; overflow-x: auto; }
.steps .s { flex: 1; min-width: 90px; text-align: center; position: relative; font-size: 12px; color: var(--ink-3); padding-top: 26px; }
.steps .s::before { content: attr(data-n); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 11px; z-index: 1; }
.steps .s::after { content: ""; position: absolute; top: 11px; left: 50%; width: 100%; height: 2px; background: var(--line); }
.steps .s:last-child::after { display: none; }
.steps .s.done { color: var(--ink-2); } .steps .s.done::before { background: var(--brand); color: #fff; border-color: var(--brand); } .steps .s.done::after { background: var(--brand); }
.steps .s.cur { color: var(--brand); font-weight: 600; } .steps .s.cur::before { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.drop { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 36px 16px; text-align: center; background: var(--panel-2); cursor: pointer; transition: border-color .2s, background .2s; }
.drop.over { border-color: var(--brand-2); background: var(--brand-soft); }
.drop svg { width: 42px; height: 42px; color: var(--brand); }
.modal-mask { position: fixed; inset: 0; background: rgba(10, 20, 28, .45); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { background: var(--panel); border-radius: 12px; width: min(640px, 100%); max-height: 90vh; overflow-y: auto; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
@keyframes fade { from { opacity: 0; } }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
#toast .t { background: var(--ink); color: var(--panel); padding: 9px 16px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow); animation: rise .2s; }
#toast .t.bad { background: var(--bad); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.skeleton { background: linear-gradient(90deg, var(--panel-2), var(--line), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fade-in { animation: rise .25s ease both; }
.pill-toggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.pill-toggle button { border: 0; background: var(--panel); padding: 5px 12px; cursor: pointer; font-size: 12px; }
.pill-toggle button.on { background: var(--brand); color: #fff; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
details.fold > summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .g2, .g3, .g4, .g-side { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 16px; }
  .top { padding: 0 16px; }
  .top .crumbs { display: none; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .who .name { display: none; } .kv { grid-template-columns: 90px 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* 窄屏防溢出：网格与卡片子项允许收缩，表格只在自身容器内横滚 */
.card, .grid > *, .row > * { min-width: 0; }
select.input, .field select, .top select { max-width: 100%; }
.content { overflow-x: clip; }

/* 左侧多级菜单：第二级稿件步骤、第三级本页分节 */
.nav a.sub { padding: 6px 10px 6px 14px; font-size: 13px; }
.nav a.sub .dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; }
.nav a.sub.done .dot { background: var(--ok); border-color: var(--ok); }
.nav a.sub.on .dot { border-color: var(--brand); background: var(--brand-soft); }
.nav a.sub.sec { font-size: 12px; color: var(--ink-3); }
.nav a.sub.sec.folded { opacity: .7; }
.nav-group.row { display: flex; align-items: center; }
.linkish { border: 0; background: none; color: var(--brand-2); cursor: pointer; padding: 0; font-size: 11px; }
/* 分节折叠 */
.fold-btn { border: 0; background: none; cursor: pointer; color: var(--ink-3); font-size: 14px; width: 20px; padding: 0; transition: transform .15s; }
.card.collapsed > .card-head .fold-btn { transform: rotate(-90deg); }
.card.collapsed > :not(.card-head) { display: none !important; }
.card.collapsed > .card-head { margin-bottom: 0; }

/* V2：待办条、空状态下一步、截止徽标、动作卡分组 */
.todo-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.todo-bar.calm { background: var(--panel); border-left-color: var(--ok); color: var(--ink-2); }
.todo-bar > svg { width: 18px; height: 18px; flex: none; }
.todo-bar .todo-items { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.empty-next { margin-top: 6px; font-size: 13px; color: var(--ink-2); max-width: 560px; margin-left: auto; margin-right: auto; }
.vc-days.soon { color: var(--warn); }
.act-group { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.act-group h4 { margin: 0 0 6px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.next-step { background: var(--brand-soft); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 10px; }
.next-step b { color: var(--brand); }
.link-list { display: flex; flex-direction: column; gap: 4px; }
.link-list a { font-size: 13px; }
.dist-inline { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.manual-add { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr auto; gap: 8px; align-items: end; }
.prev-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.prev-row:last-child { border-bottom: 0; }
.guest-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 28px; background: var(--panel); border-bottom: 1px solid var(--line); }
.guest-top .brand { display: flex; align-items: center; gap: 10px; }
.guest-wrap { max-width: 1240px; margin: 0 auto; padding: 22px 28px 40px; }
