/* ============ 设计令牌 ============ */
:root {
  --bg: #f8f6f5;
  --surface: #ffffff;
  --surface-2: #fbfaf9;
  --ink: #1e1a19;
  --ink-2: #514b49;
  --ink-3: #8b8481;
  --line: #e8e3e1;
  --line-strong: #d8d1ce;
  --primary: #b93a3a;
  --primary-hover: #9c2f2f;
  --primary-soft: #f9eae9;
  --primary-deep: #8f2626;
  --gold: #a9823f;
  --ok: #2c6285;
  --ok-soft: #e8f1f6;
  --warn: #a9741f;
  --warn-soft: #fbf2e0;
  --danger: #8f2b24;
  --danger-soft: #f9e8e5;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(27, 33, 30, .04);
  --shadow-md: 0 6px 24px rgba(27, 33, 30, .08);
  --shadow-lg: 0 24px 60px rgba(27, 33, 30, .16);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--ink); }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0; }
::selection { background: #f7d8d5; }

.serif { font-family: var(--serif); }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 14px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 38px; height: 38px;
  object-fit: contain;
  display: block;
  flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-family: var(--serif); font-size: 16px; letter-spacing: .5px; }
.brand-sub { font-size: 11px; color: var(--ink-3); letter-spacing: .8px; }

.topbar-spacer { flex: 1; }

.top-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px; color: var(--ink-2);
  background: var(--surface);
}
.top-chip b { font-weight: 500; color: var(--ink); }

.top-divider { width: 1px; height: 22px; background: var(--line); }

.user-box { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 500;
  border: 1px solid #f0dbd9;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.3; }
.user-name { font-size: 13px; }
.user-role { font-size: 11px; color: var(--ink-3); }

.link-btn {
  border: 0; background: none; padding: 4px 6px;
  color: var(--ink-3); font-size: 12px;
}
.link-btn:hover { color: var(--ink); }

/* ============ 布局 ============ */
.layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 32px;
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 32px 80px;
  align-items: start;
}

.sidebar { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.side-title {
  font-size: 11px; letter-spacing: 1.4px; color: var(--ink-3);
  text-transform: uppercase; margin: 2px 4px 10px;
}

.cat-nav { display: flex; flex-direction: column; gap: 2px; }
.cat-nav a {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 6px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  border-left: 2px solid transparent;
  transition: background .15s;
}
.cat-nav a:hover { background: var(--surface-2); color: var(--ink); }
.cat-nav a.active { background: var(--primary-soft); color: var(--primary); border-left-color: var(--primary); }
.cat-nav .idx { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cat-nav a.active .idx { color: var(--primary); }
.cat-nav .num { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.side-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 8px; border-radius: 8px; font-size: 13px; color: var(--ink-2);
}
.side-link:hover { background: var(--surface-2); }
.side-link.active { background: var(--primary-soft); color: var(--primary); }
.side-link .count { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.side-note {
  font-size: 11.5px; color: var(--ink-3); line-height: 1.7;
  padding: 0 6px;
}

/* ============ 页头 / 统计 ============ */
.page-head { margin-bottom: 22px; }
.eyebrow {
  font-size: 11px; letter-spacing: 2px; color: var(--gold);
  text-transform: uppercase; margin-bottom: 8px;
}
.page-title {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: 1px;
  line-height: 1.3;
}
.page-sub { color: var(--ink-3); font-size: 13px; margin-top: 8px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--line-strong);
}
.stat.ok::before { background: var(--ok); }
.stat.warn::before { background: var(--warn); }
.stat.danger::before { background: var(--danger); }
.stat.primary::before { background: var(--primary); }
.stat-label { font-size: 12px; color: var(--ink-3); }
.stat-value {
  font-family: var(--serif);
  font-size: 30px; line-height: 1.2; margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.stat-value small { font-size: 13px; color: var(--ink-3); font-family: var(--sans); margin-left: 3px; }
.stat-foot { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

.overall {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  align-items: center;
  margin-bottom: 22px;
}
.overall h3 { font-size: 14px; }
.overall p { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.progress { height: 6px; background: #f1ecea; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s ease; }
.progress-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ============ 工具栏 ============ */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  height: 30px; padding: 0 12px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; font-size: 12.5px; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.chip-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.chip-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-btn .n { font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }

.search {
  margin-left: auto; position: relative;
}
.search input {
  height: 32px; width: 220px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12.5px;
  outline: none;
  transition: border-color .15s, width .2s;
}
.search input:focus { border-color: var(--primary); width: 260px; }
.search svg { position: absolute; left: 10px; top: 9px; opacity: .45; }

/* ============ 栏目区块 ============ */
.cat-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: clip;
  scroll-margin-top: 84px;
}
.cat-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 150px auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
}
.cat-head:hover { background: var(--surface-2); }
.cat-no {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.cat-title { font-family: var(--serif); font-size: 19px; letter-spacing: .5px; }
.cat-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.cat-meta .meta-deadline { color: var(--ink-2); }
.cat-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); align-self: center; }
.cat-progress { min-width: 140px; }
.cat-progress .progress-meta { margin-top: 4px; }
.cat-actions { display: flex; gap: 6px; align-items: center; }
.cat-toggle {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; color: var(--ink-3);
  transition: transform .2s;
}
.cat-section.open .cat-toggle { transform: rotate(180deg); }

.cat-body { display: none; border-top: 1px solid var(--line); }
.cat-section.open .cat-body { display: block; }

.spec-panel {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 18px 24px 20px;
  font-size: 13px;
  color: var(--ink-2);
}
.spec-panel h4 {
  font-size: 12px; letter-spacing: 1.2px; color: var(--ink-3);
  margin-bottom: 8px; text-transform: uppercase;
}
.spec-panel pre {
  margin: 0; white-space: pre-wrap; word-break: break-word;
  font-family: var(--sans); font-size: 13px; line-height: 1.85; color: var(--ink-2);
}
.spec-note {
  margin-top: 14px; padding: 10px 12px;
  background: var(--warn-soft); border-left: 2px solid var(--warn);
  border-radius: 0 6px 6px 0; font-size: 12px; color: #6d4a12;
}

.group { border-bottom: 1px solid var(--line); }
.group:last-child { border-bottom: 0; }
.group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 24px;
  background: #fbf9f7;
  font-size: 12.5px; color: var(--ink-2);
  position: sticky; top: 64px; z-index: 5;
  backdrop-filter: blur(6px);
}
.group-head .g-count { font-size: 11px; color: var(--ink-3); }

.item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 78px 96px 92px;
  gap: 14px;
  align-items: center;
  padding: 11px 24px;
  border-top: 1px solid #f3efed;
  transition: background .12s;
}
.item:hover { background: #fbf9f7; }
.item-no {
  font-size: 11.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  text-align: right; padding-right: 4px;
}
.item-title { font-size: 13.5px; line-height: 1.5; }
.item-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.item-flag { color: var(--danger); }

.vol {
  display: inline-flex; align-items: center; justify-content: center;
  height: 22px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 11px; color: var(--ink-3); background: var(--surface-2);
  white-space: nowrap;
}

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px;
  white-space: nowrap;
}
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip.pending { background: var(--warn-soft); color: var(--warn); }
.chip.approved { background: var(--ok-soft); color: var(--ok); }
.chip.rejected { background: var(--danger-soft); color: var(--danger); }
.chip.missing { background: #f2f0ee; color: var(--ink-3); }
.chip.missing::before { background: var(--line-strong); }

.comment {
  grid-column: 2 / 6;
  margin: 0 0 2px;
  padding: 8px 12px;
  background: var(--danger-soft);
  border-radius: 6px;
  font-size: 12px; color: #7d2b24;
  display: flex; gap: 6px;
}
.comment b { font-weight: 500; flex: none; }

/* ============ 按钮 ============ */
.btn {
  height: 32px; padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 12.5px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--line-strong); color: var(--ink); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #f3dbd8; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #244f6c; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #f7ddd9; }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #741f19; }
.btn-sm { height: 28px; padding: 0 11px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============ 表格（管理端） ============ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: clip;
}
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left; font-weight: 400;
  font-size: 11.5px; color: var(--ink-3);
  letter-spacing: .4px;
  padding: 11px 16px;
  background: #fbf9f7;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky; top: 64px; z-index: 6;
}
table.data td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3efed;
  font-size: 13px;
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: #fbf9f7; }
table.data td.num { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12px; }
.cell-title { font-size: 13px; }
.cell-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 16px; border: 0; background: none;
  font-size: 13.5px; color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .badge {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--danger-soft); color: var(--danger);
  border-radius: 999px; font-size: 10.5px; margin-left: 6px;
}

/* ============ 表单 / 弹窗 / 抽屉 ============ */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(185, 58, 58, .10); }
textarea.input { resize: vertical; min-height: 92px; line-height: 1.7; }
.hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }

.overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20, 27, 24, .44);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%; max-width: 540px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop .18s ease;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
}
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head {
  padding: 18px 22px 0;
  display: flex; align-items: flex-start; gap: 12px;
}
.modal-head h3 { font-family: var(--serif); font-size: 19px; }
.modal-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot {
  padding: 14px 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--surface-2);
}
.close-x {
  margin-left: auto; width: 28px; height: 28px; border: 0;
  background: none; color: var(--ink-3); font-size: 20px; line-height: 1;
  border-radius: 6px; flex: none;
}
.close-x:hover { background: #f3efed; color: var(--ink); }

.drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  padding: 26px 18px;
  text-align: center;
  background: var(--surface-2);
  transition: all .15s;
  cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop-title { font-size: 13.5px; color: var(--ink-2); }
.drop-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.file-pick {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface);
  font-size: 12.5px;
}
.file-pick .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick .size { color: var(--ink-3); font-size: 11.5px; }

.drawer-overlay {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(20, 27, 24, .35);
  animation: fade .16s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 96;
  width: 520px; max-width: 100vw;
  background: var(--surface);
  box-shadow: -20px 0 50px rgba(20, 27, 24, .12);
  display: flex; flex-direction: column;
  animation: slide .22s cubic-bezier(.22, .8, .3, 1);
}
@keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; background: var(--surface-2); }

.kv { display: grid; grid-template-columns: 84px 1fr; gap: 8px 12px; font-size: 12.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }

.timeline { margin-top: 8px; }
.tl-item { display: grid; grid-template-columns: 12px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: 5px; top: 14px; bottom: 0;
  width: 1px; background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); margin-top: 7px; }
.tl-item.ok .tl-dot { background: var(--ok); }
.tl-item.bad .tl-dot { background: var(--danger); }
.tl-item.warn .tl-dot { background: var(--warn); }
.tl-title { font-size: 12.5px; }
.tl-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.tl-comment { font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-radius: 6px; padding: 7px 10px; margin-top: 6px; }

.version-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid #f3efed; font-size: 12.5px;
}
.version-row:last-child { border-bottom: 0; }
.version-row .vno { font-size: 11px; color: var(--primary); background: var(--primary-soft); padding: 1px 6px; border-radius: 4px; }

/* ============ 空态 / 提示 ============ */
.empty {
  padding: 56px 20px; text-align: center; color: var(--ink-3); font-size: 13px;
}
.empty .big { font-family: var(--serif); font-size: 17px; color: var(--ink-2); margin-bottom: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: #fff;
  padding: 9px 18px; border-radius: 999px; font-size: 12.5px;
  opacity: 0; pointer-events: none; transition: all .2s; z-index: 120;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #7d2b24; }

/* ============ 登录页 ============ */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 46% 1fr; }
.login-art {
  background: var(--primary-deep);
  color: #fff;
  padding: 56px 56px 44px;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
.login-art::after {
  content: "";
  position: absolute; right: -120px; bottom: -160px;
  width: 420px; height: 420px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12);
}
.login-art::before {
  content: "";
  position: absolute; right: -60px; bottom: -220px;
  width: 520px; height: 520px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .08);
}
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 13px; letter-spacing: 1px; opacity: .92; }
.login-logo {
  width: 34px; height: 34px;
  background: #fff;
  border-radius: 50%;
  padding: 2px;
  object-fit: contain;
}
.login-art h1 {
  font-family: var(--serif);
  font-size: 38px; line-height: 1.45;
  letter-spacing: 2px;
  margin-top: auto;
  margin-bottom: 18px;
  position: relative; z-index: 1;
}
.login-rule { width: 48px; height: 2px; background: var(--gold); margin-bottom: 20px; }
.login-desc { font-size: 12.5px; line-height: 2; color: rgba(255, 255, 255, .62); max-width: 430px; }
.login-cats {
  margin-top: 34px; display: flex; flex-wrap: wrap; gap: 8px; max-width: 470px;
  margin-bottom: auto;
}
.login-cats span {
  font-size: 11.5px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .72);
}

.login-form-wrap { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.login-form { width: 100%; max-width: 344px; }
.login-form .eyebrow { color: var(--ink-3); }
.login-form h2 { font-family: var(--serif); font-size: 27px; margin-bottom: 6px; }
.login-form .sub { color: var(--ink-3); font-size: 12.5px; margin-bottom: 28px; }
.login-form .input { height: 42px; }
.login-form .btn { height: 42px; font-size: 13.5px; margin-top: 6px; }
.login-err {
  margin-top: 12px; font-size: 12.5px; color: var(--danger);
  background: var(--danger-soft); padding: 8px 12px; border-radius: 7px;
}

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 216px minmax(0, 1fr); gap: 24px; padding: 24px 24px 60px; }
  .cat-head { grid-template-columns: 46px minmax(0, 1fr) 120px auto; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .cat-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .cat-nav a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; grid-template-columns: auto auto; }
  .cat-nav a.active { border-bottom-color: var(--primary); }
  .cat-nav .num { display: none; }
  .overall { grid-template-columns: 1fr; gap: 12px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
}

@media (max-width: 680px) {
  .topbar { padding: 0 16px; gap: 8px; }
  .brand-sub { display: none; }
  .user-meta { display: none; }
  .top-chip { display: none; }
  .layout { padding: 18px 16px 60px; }
  .page-title { font-size: 24px; }
  .stat-grid { gap: 8px; }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 24px; }
  .cat-head {
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-areas:
      "no title"
      "prog prog"
      "acts acts";
    padding: 14px 16px;
    gap: 10px 12px;
  }
  .cat-no { grid-area: no; }
  .cat-head > div:nth-child(2) { grid-area: title; min-width: 0; }
  .cat-title { font-size: 17px; }
  .cat-progress { grid-area: prog; min-width: 0; }
  .cat-actions { grid-area: acts; flex-wrap: wrap; }
  .cat-actions .cat-toggle { margin-left: auto; }
  .top-divider { display: none; }
  .item {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px 10px; padding: 10px 16px;
  }
  .item .vol { display: none; }
  .item .chip { grid-column: 2; justify-self: start; }
  .item .item-action { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  .comment { grid-column: 1 / 4; }
  .group-head { padding: 8px 16px; position: static; }
  .toolbar .search { margin-left: 0; width: 100%; }
  .search input, .search input:focus { width: 100%; }
  .drawer { width: 100vw; }
  .table-wrap { overflow-x: auto; }
  table.data { min-width: 760px; }
}

/* ============ 管理端布局 ============ */
.page {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}

.panel { animation: fade .16s ease; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .9fr);
  gap: 16px;
  align-items: start;
}

.side-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.side-panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbf9f7;
  font-size: 11.5px;
  letter-spacing: 1px;
  color: var(--ink-3);
}
.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid #f3efed;
  cursor: pointer;
}
.mini-row:last-child { border-bottom: 0; }
.mini-row:hover { background: #fbf9f7; }
.mini-row > div:first-child { flex: 1; min-width: 0; }

@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .page { padding: 18px 16px 60px; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; padding: 10px 12px; }
}

.site-foot {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 32px 34px;
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  gap: 10px;
  align-items: center;
}
.site-foot::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--line-strong);
}

@media (max-width: 680px) {
  .site-foot { padding: 0 16px 28px; }
}

/* ============ 栏目档案 / 年度切换 / 原件预览 ============ */
.year-sel {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  outline: none;
  cursor: pointer;
  padding: 0 2px;
}
.year-sel option { background: var(--surface); color: var(--ink); }

.notice {
  background: var(--primary-soft);
  border-left: 2px solid var(--primary);
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.8;
  color: #7a2b28;
  margin-bottom: 16px;
}
.notice b { font-weight: 500; color: var(--primary); }

.ver-toggle {
  border: 0;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.ver-toggle:hover { color: var(--primary); }
.ver-toggle .caret {
  display: inline-flex;
  color: var(--ink-3);
  transition: transform .15s ease;
}
.ver-toggle .caret.up { transform: rotate(180deg); }

.arch-detail > td {
  background: #fbf9f7;
  padding: 8px 16px 14px 48px !important;
  border-bottom: 1px solid var(--line);
}
.ver-line {
  display: grid;
  grid-template-columns: 40px minmax(0, 1.5fr) minmax(0, 1.2fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.ver-line:last-child { border-bottom: 0; }
.ver-line .vno {
  justify-self: start;
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 1px 7px;
  border-radius: 4px;
}
.ver-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ver-meta { color: var(--ink-3); font-size: 11.5px; }
.row-open { background: #fbf9f7; }

.preview-modal { max-width: 900px; }
.preview-frame {
  display: block;
  width: 100%;
  height: 66vh;
  border: 0;
  background: #f3efed;
}
.preview-img {
  display: block;
  max-width: 100%;
  max-height: 66vh;
  margin: 0 auto;
  background: #f3efed;
}

@media (max-width: 680px) {
  .ver-line { grid-template-columns: 36px minmax(0, 1fr) auto; row-gap: 4px; }
  .ver-line .ver-meta { grid-column: 2 / 4; }
  .arch-detail > td { padding: 6px 12px 12px 12px !important; }
}

@media (max-width: 680px) {
  .brand { gap: 8px; min-width: 0; }
  .brand-name { font-size: 14px; letter-spacing: 0; white-space: nowrap; }
  .topbar .link-btn { white-space: nowrap; font-size: 11.5px; padding: 2px 4px; }
  .export-link { display: none; }
  .tabs { scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
}

/* ============ 栏目结构编辑器 ============ */
.struct-layout {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.struct-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px;
  position: sticky;
  top: 84px;
}
.struct-cats { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.struct-cat {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 0;
  background: none;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
}
.struct-cat:hover { background: var(--surface-2); }
.struct-cat.active { background: var(--primary-soft); color: var(--primary); }
.struct-cat .no { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.struct-cat.active .no { color: var(--primary); }
.struct-cat .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.struct-cat .cnt { font-size: 11px; color: var(--ink-3); }
.struct-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.struct-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.struct-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.struct-head h3 { font-size: 16px; font-family: var(--serif); letter-spacing: .5px; }
.struct-head .row-actions { margin-left: auto; }
.struct-head .input { flex: 1; min-width: 0; }
.sec-idx {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 7px; background: var(--primary-soft);
  color: var(--primary); font-size: 11px;
}
.struct-grid { display: grid; grid-template-columns: 1.8fr 1fr .7fr; gap: 12px; }
.mini-label { display: block; font-size: 11.5px; color: var(--ink-3); margin-bottom: 6px; }
.struct-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.sec-items { margin-top: 12px; border-top: 1px solid var(--line); }
.sec-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 64px auto auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f3efed;
  font-size: 12.5px;
}
.sec-item:last-child { border-bottom: 0; }
.ii-no { color: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.ii-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-item .vol { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.icon-btn {
  width: 24px; height: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  color: var(--ink-3);
  font-size: 11px; line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.struct-side .btn-block { margin-top: 6px; }
.group-body {
  padding: 10px 24px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: pre-wrap;
}

@media (max-width: 1100px) {
  .struct-layout { grid-template-columns: minmax(0, 1fr); }
  .struct-side { position: static; min-width: 0; overflow: hidden; }
  .struct-cats { flex-direction: row; overflow-x: auto; min-width: 0; padding-bottom: 2px; }
  .struct-cat { white-space: nowrap; grid-template-columns: auto auto auto; flex: none; }
}
@media (max-width: 680px) {
  .struct-grid { grid-template-columns: 1fr; }
  .struct-head { flex-wrap: wrap; }
  .sec-item { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .sec-item .vol { display: none; }
  .group-body { padding: 9px 16px; }
}

/* ============ 行内编辑 ============ */
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }

.ie-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--primary-soft);
  border-left: 2px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.7;
  color: #7a2b28;
  margin-bottom: 10px;
}
.ie-bar b { font-weight: 500; }
.ie-bar .muted { margin-left: 8px; color: var(--ink-3); }
.ie-status {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-3);
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.ie-status.ok { color: var(--ok); border-color: #cfe0ea; }
.ie-status.busy { color: var(--gold); border-color: #eadfc9; }
.ie-status.err { color: var(--danger); border-color: #efd3cf; }

.ie-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ie-legend span {
  font-size: 10.5px;
  color: var(--ink-3);
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  padding: 1px 8px;
  background: var(--surface);
}

.ie {
  display: block;
  width: 100%;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 2px 7px;
  margin: 1px 0;
  outline: none;
  transition: background .12s, border-color .12s, box-shadow .12s;
  text-overflow: ellipsis;
}
.ie:hover { background: var(--surface-2); border-color: var(--line); }
.ie:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ie.dirty { border-color: var(--gold); background: #fffdf7; }
.ie.just-saved { animation: ieOk .9s ease; }
@keyframes ieOk {
  0% { box-shadow: 0 0 0 3px rgba(44, 98, 133, .18); }
  100% { box-shadow: 0 0 0 0 rgba(44, 98, 133, 0); }
}
textarea.ie { resize: none; overflow: hidden; line-height: 1.85; min-height: 26px; }
.ie::placeholder { color: #b6aeaa; }

.ie-cat-name { font-family: var(--serif); font-size: 19px; letter-spacing: .5px; padding-top: 1px; padding-bottom: 1px; }
.ie-cat-desc { font-size: 12px; color: var(--ink-3); }
.ie-cat-deadline { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ie-cat-spec { font-size: 12.5px; line-height: 1.85; color: var(--ink-2); }

.ie-sec-title { font-size: 14px; font-weight: 500; }
.ie-sec-body { font-size: 12.5px; color: var(--ink-2); padding-left: 6px; }
.sec-body-wrap { margin: 4px 0 6px; padding-left: 2px; }

.ie-item-title { font-size: 13.5px; }
.ii-main { min-width: 0; }
.ii-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.ii-vol { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.ie-vol { display: inline-block; width: 42px; text-align: center; font-size: 11.5px; padding: 1px 4px; }
.ie-dept { display: inline-block; width: 138px; font-size: 11.5px; padding: 1px 4px; }
.ii-state { display: inline-flex; align-items: center; gap: 6px; }
.ii-n { color: var(--ink-3); }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); flex: none; }

.sec-item {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
}
.sec-item .row-actions { display: flex; align-items: center; gap: 6px; }
.ii-no { padding-top: 5px; }

@media (max-width: 680px) {
  .sec-item { grid-template-columns: 24px minmax(0, 1fr); }
  .sec-item .row-actions { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .ie-dept { width: 108px; }
  .ie-bar .muted { display: block; margin-left: 0; }
  .ie-status { margin-left: 0; }
  .ii-meta .dot { display: none; }

  .struct-card > .struct-head .grow { flex: 1 1 100%; }
  .struct-card > .struct-head .row-actions { margin-left: auto; }

  .sec-card .struct-head {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    grid-template-areas:
      "idx title"
      "count actions";
    gap: 8px 10px;
    align-items: center;
  }
  .sec-card .struct-head .sec-idx { grid-area: idx; }
  .sec-card .struct-head .grow { grid-area: title; }
  .sec-card .struct-head .cell-sub { grid-area: count; }
  .sec-card .struct-head .row-actions { grid-area: actions; justify-self: end; }
}

/* ============ 账号管理 ============ */
.self-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  height: 18px;
  line-height: 18px;
  font-size: 10px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 4px;
  vertical-align: 1px;
}
.row-off .cell-title,
.row-off td { color: var(--ink-3); }
.link-btn.danger:hover { color: var(--danger); }
.link-btn.is-disabled { color: var(--line-strong); cursor: not-allowed; }
.link-btn.is-disabled:hover { color: var(--line-strong); }
.input:disabled,
select.input:disabled {
  background: var(--surface-2);
  color: var(--ink-3);
  cursor: not-allowed;
}

@media (max-width: 680px) {
  /* 账号表在手机上少一列，减少横向滚动距离 */
  #panel-users table.data { min-width: 620px; }
  #panel-users table.data th:nth-child(6),
  #panel-users table.data td:nth-child(6) { display: none; }
}
