/* ==========================================================================
   项目备案档案管理平台 —— 样式表
   结构：1 基础 / 2 布局壳 / 3 组件 / 4 内部页面 / 5 对外页面 / 6 响应式
   ========================================================================== */

/* ---------- 1. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--fs-md);
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* 纸纹：极淡的颗粒，给平铺底色一点物质感 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }
a { color: var(--brown); text-decoration: none; }
a:hover { color: var(--seal); }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection { background: rgba(156, 59, 46, 0.18); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.tiny { font-size: var(--fs-xs); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }

/* ---------- 2. 布局壳 ---------- */
.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* 书脊式侧栏：深棕、右侧烫金细线、底部竖排机构名 */
.spine {
  width: 232px;
  flex: 0 0 232px;
  background: var(--spine);
  color: var(--spine-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(201, 169, 97, 0.22);
  box-shadow: inset -12px 0 24px -18px rgba(0,0,0,.8);
}

.spine__brand {
  padding: 26px 22px 22px;
  border-bottom: 1px solid rgba(233, 223, 203, 0.10);
  position: relative;
}
.spine__brand::after {
  content: "";
  position: absolute; left: 22px; right: 22px; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent 70%);
  opacity: .55;
}
.spine__mark {
  display: flex; align-items: center; gap: 10px;
}
.spine__seal {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0;
  background: rgba(201, 169, 97, 0.06);
}
.spine__title {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0.06em;
  color: #F3EADA;
}
.spine__sub {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--spine-muted);
  text-transform: uppercase;
}

.spine__nav { padding: 18px 0; flex: 1; overflow-y: auto; }
.spine__group {
  padding: 14px 22px 6px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(168, 154, 128, 0.75);
}
.spine__link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 22px 9px 20px;
  color: rgba(233, 223, 203, 0.78);
  font-size: 13px;
  border-left: 2px solid transparent;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.spine__link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
.spine__link.is-active {
  color: #FFF6E4;
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(201, 169, 97, 0.13), transparent 85%);
}
.spine__link svg { width: 15px; height: 15px; flex: 0 0 15px; opacity: .8; }
.spine__link.is-active svg { opacity: 1; }
.spine__link .badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid rgba(233, 223, 203, 0.25);
  color: rgba(233, 223, 203, 0.8);
}

.spine__foot {
  padding: 16px 22px 22px;
  border-top: 1px solid rgba(233, 223, 203, 0.10);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.spine__org {
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.34em;
  color: rgba(168, 154, 128, 0.62);
  height: 108px;
  line-height: 1;
}
.spine__user { font-size: 11px; color: var(--spine-muted); }
.spine__user b { display: block; color: var(--spine-text); font-weight: 500; font-size: 12px; margin-bottom: 4px; letter-spacing: .04em; }
.spine__user a { color: rgba(233, 223, 203, 0.55); }
.spine__user a:hover { color: var(--gold); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main__inner { padding: 30px 40px 64px; max-width: 1400px; width: 100%; }
.main__inner--narrow { max-width: 960px; }

/* 页眉 */
.pagehead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s5);
  padding-bottom: 18px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--hairline-2);
  position: relative;
}
.pagehead::after {
  content: "";
  position: absolute; left: 0; bottom: -1px; width: 64px; height: 1px;
  background: var(--seal);
}
.pagehead__kicker {
  font-size: 10px; letter-spacing: 0.22em; color: var(--muted-2);
  margin-bottom: 6px;
}
.pagehead h1 { font-size: var(--fs-2xl); line-height: 1.2; }
.pagehead__desc { margin-top: 8px; font-size: var(--fs-sm); color: var(--muted); }
.pagehead__actions { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }

/* ---------- 3. 组件 ---------- */

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  font-size: var(--fs-md);
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
  white-space: nowrap;
}
.btn:hover { border-color: var(--brown-soft); color: var(--ink); background: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.btn--primary {
  background: var(--brown); border-color: var(--brown); color: #FBF6EA;
}
.btn--primary:hover { background: var(--brown-deep); border-color: var(--brown-deep); color: #fff; }

.btn--seal { background: var(--seal); border-color: var(--seal); color: #FFF4EC; }
.btn--seal:hover { background: var(--seal-deep); border-color: var(--seal-deep); color: #fff; }

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--brown-wash); }

.btn--danger { color: var(--seal); border-color: rgba(156,59,46,.35); }
.btn--danger:hover { background: var(--seal-wash); border-color: var(--seal); }

.btn--sm { height: 27px; padding: 0 10px; font-size: var(--fs-sm); }
.btn--block { width: 100%; }
.btn--lg { height: 44px; padding: 0 22px; font-size: var(--fs-base); }

/* 表单 */
.field { margin-bottom: var(--s4); }
.field > label, .label {
  display: block;
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.label .req { color: var(--seal); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  background: #FFFDF8;
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  color: var(--ink);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}
.textarea { height: auto; padding: 9px 11px; line-height: 1.7; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--brown-soft); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brown);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(107, 74, 42, 0.10);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input.mono { font-family: var(--mono); }
.input--sm { height: 30px; font-size: var(--fs-sm); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236E6154' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s5); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 var(--s4); }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 var(--s3); }

/* 卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  box-shadow: var(--sh1);
}
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
}
.card__title {
  font-family: var(--serif);
  font-size: var(--fs-base);
  letter-spacing: 0.06em;
  color: var(--ink);
}
.card__title span { font-family: var(--sans); font-size: var(--fs-xs); color: var(--muted-2); margin-left: 8px; letter-spacing: .08em; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card + .card { margin-top: var(--s4); }

/* 表格 */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.tbl th {
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.10em;
  color: var(--muted);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline-2);
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
.tbl td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
.tbl tbody tr { transition: background var(--dur-fast); }
.tbl tbody tr:hover { background: var(--brown-wash); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tbl .idx { font-family: var(--mono); color: var(--muted-2); font-size: var(--fs-xs); }
.tbl tfoot td {
  background: var(--surface-2);
  border-top: 1px solid var(--hairline-2);
  font-weight: 500;
}
.tbl--dense td { padding: 8px 10px; }
.tbl--dense th { padding: 8px 10px; }

.t-main { font-weight: 500; color: var(--ink); }
.t-sub { display: block; font-size: var(--fs-xs); color: var(--muted-2); margin-top: 2px; letter-spacing: .02em; }
.t-link { color: var(--ink); border-bottom: 1px solid transparent; transition: border-color var(--dur-fast), color var(--dur-fast); }
.t-link:hover { color: var(--seal); border-bottom-color: rgba(156,59,46,.4); }

/* 标签：印章式细边框，方角 */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--fs-xs);
  line-height: 1;
  padding: 4px 7px;
  border: 1px solid var(--hairline-2);
  border-radius: 2px;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: transparent;
}
.tag--ok { color: var(--ok); border-color: rgba(76,107,79,.4); background: var(--ok-wash); }
.tag--seal { color: var(--seal); border-color: rgba(156,59,46,.4); background: var(--seal-wash); }
.tag--warn { color: var(--warn); border-color: rgba(154,113,38,.4); background: var(--warn-wash); }
.tag--info { color: var(--info); border-color: rgba(62,90,114,.4); background: var(--info-wash); }
.tag--brown { color: var(--brown); border-color: rgba(107,74,42,.35); background: var(--brown-wash); }
.tag--solid { background: var(--brown); color: #FBF6EA; border-color: var(--brown); }

.dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: 0 0 5px; }

/* 进度步骤条 */
.steps { display: flex; align-items: flex-start; gap: 0; }
.steps__item { flex: 1; position: relative; text-align: center; padding-top: 26px; }
.steps__item::before {
  content: ""; position: absolute; top: 8px; left: 0; right: 0; height: 1px;
  background: var(--hairline-2);
}
.steps__item:first-child::before { left: 50%; }
.steps__item:last-child::before { right: 50%; }
.steps__dot {
  position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--hairline-2);
  z-index: 1;
}
.steps__item.is-done .steps__dot { background: var(--brown-soft); border-color: var(--brown-soft); }
.steps__item.is-done::before { background: var(--brown-soft); }
.steps__item.is-current .steps__dot {
  background: var(--surface); border: 2px solid var(--seal);
  box-shadow: 0 0 0 3px rgba(156,59,46,.12);
}
.steps__label { font-size: var(--fs-xs); color: var(--muted-2); letter-spacing: .04em; }
.steps__item.is-done .steps__label { color: var(--brown); }
.steps__item.is-current .steps__label { color: var(--seal); font-weight: 500; }

/* 时间线 */
.timeline { position: relative; padding-left: 18px; }
.timeline::before {
  content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px;
  background: var(--hairline-2);
}
.timeline__item { position: relative; padding: 0 0 16px 0; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute; left: -18px; top: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--brown-soft);
}
.timeline__item.is-last::before { background: var(--seal); border-color: var(--seal); }
.timeline__time { font-family: var(--mono); font-size: var(--fs-2xs); color: var(--muted-2); letter-spacing: .02em; }
.timeline__text { font-size: var(--fs-md); margin-top: 2px; }
.timeline__note { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }

/* 空态 */
.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted-2);
}
.empty__mark {
  width: 42px; height: 42px; margin: 0 auto 14px;
  border: 1px solid var(--hairline-2);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 18px; color: var(--brown-soft);
}
.empty__title { font-family: var(--serif); font-size: var(--fs-base); color: var(--muted); margin-bottom: 4px; }
.empty__desc { font-size: var(--fs-sm); }

/* 提示条 */
.flashes { margin-bottom: var(--s4); display: grid; gap: 8px; }
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px;
  font-size: var(--fs-md);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--brown);
  border-radius: var(--r-sm);
  animation: slideIn var(--dur-base) var(--ease) both;
}
.flash--ok { border-left-color: var(--ok); }
.flash--error { border-left-color: var(--seal); color: var(--seal-deep); }
.flash__close { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--muted-2); font-size: 16px; line-height: 1; padding: 0 2px; }

/* 数据块 */
.stat { padding: 16px 18px; border-right: 1px solid var(--hairline); }
.stat:last-child { border-right: none; }
.stat__label { font-size: var(--fs-xs); color: var(--muted); letter-spacing: .08em; }
.stat__value {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.25;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.stat__value small { font-size: 13px; font-family: var(--sans); color: var(--muted); margin-left: 3px; }
.stat__foot { font-size: var(--fs-xs); color: var(--muted-2); margin-top: 2px; }
.stat--seal .stat__value { color: var(--seal); }

.bar { height: 6px; background: var(--paper-deep); border-radius: 1px; overflow: hidden; }
.bar__fill { height: 100%; background: var(--brown-soft); border-radius: 1px; transition: width var(--dur-slow) var(--ease); }
.bar__fill--seal { background: var(--seal); }
.bar__fill--ok { background: var(--ok); }

/* 分页 */
.pager { display: flex; align-items: center; gap: 6px; padding: 14px 18px; border-top: 1px solid var(--hairline); }
.pager__info { font-size: var(--fs-sm); color: var(--muted); margin-right: auto; }
.pager a, .pager span.pg {
  min-width: 28px; height: 28px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: var(--fs-sm);
  border: 1px solid var(--hairline-2); border-radius: var(--r-sm);
  color: var(--ink-2); background: var(--surface);
}
.pager a:hover { border-color: var(--brown-soft); background: var(--brown-wash); }
.pager .is-current { background: var(--brown); border-color: var(--brown); color: #FBF6EA; }

/* 分区标题 */
.sect { margin: 30px 0 14px; display: flex; align-items: baseline; gap: 10px; }
.sect h2 { font-size: var(--fs-lg); letter-spacing: .04em; }
.sect .sect__line { flex: 1; height: 1px; background: var(--hairline); }
.sect .sect__hint { font-size: var(--fs-xs); color: var(--muted-2); }

/* 键值表 */
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 8px var(--s4); font-size: var(--fs-md); }
.kv dt { color: var(--muted); font-size: var(--fs-sm); }
.kv dd { margin: 0; }

/* 对话框（原生 details 简化交互） */
.modal {
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 0;
  box-shadow: var(--sh3);
  max-width: 460px;
  width: calc(100% - 32px);
}
.modal::backdrop { background: rgba(42, 33, 25, 0.42); backdrop-filter: blur(2px); }
.modal__head { padding: 16px 20px; border-bottom: 1px solid var(--hairline); display: flex; justify-content: space-between; align-items: center; }
.modal__head h3 { font-size: var(--fs-base); letter-spacing: .06em; }
.modal__body { padding: 20px; }
.modal__foot { padding: 14px 20px; border-top: 1px solid var(--hairline); display: flex; justify-content: flex-end; gap: 8px; }

/* 缩略图 */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.thumb {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  border: 1px solid var(--hairline-2); border-radius: var(--r-sm);
  background: var(--paper-deep);
  display: block;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-base) var(--ease); }
.thumb:hover img { transform: scale(1.04); }
.thumb__tag {
  position: absolute; left: 6px; bottom: 6px; z-index: 2;
  padding: 2px 8px; border-radius: 3px;
  font-size: 11px; letter-spacing: .08em;
  background: rgba(42, 33, 25, .78); color: #EFE6D2;
}

/* 文件行 */
.file {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--hairline);
  border-radius: var(--r-sm); background: var(--surface-2);
  font-size: var(--fs-sm);
}
.file + .file { margin-top: 6px; }
.file__ext {
  font-family: var(--mono); font-size: var(--fs-2xs);
  border: 1px solid var(--hairline-2); padding: 3px 5px; color: var(--muted);
  letter-spacing: .06em;
}
.file__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file__meta { color: var(--muted-2); font-family: var(--mono); font-size: var(--fs-2xs); }

/* 上传控件 */
.dropzone {
  border: 1px dashed var(--hairline-2);
  border-radius: var(--r-sm);
  padding: 16px;
  text-align: center;
  background: var(--surface-2);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.dropzone:hover { border-color: var(--brown-soft); background: #fff; }
.dropzone input[type="file"] { font-size: var(--fs-sm); max-width: 100%; }

/* 动画 */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.rise { animation: rise var(--dur-base) var(--ease) both; }
.rise:nth-child(1) { animation-delay: 40ms; }
.rise:nth-child(2) { animation-delay: 100ms; }
.rise:nth-child(3) { animation-delay: 160ms; }
.rise:nth-child(4) { animation-delay: 220ms; }
.rise:nth-child(5) { animation-delay: 280ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ---------- 4. 内部页面 ---------- */

/* 登录 */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  position: relative; z-index: 1;
}
.login__art {
  background: var(--spine);
  color: var(--spine-text);
  padding: 64px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login__art::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(201,169,97,0.10) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(0deg, rgba(233,223,203,0.045) 0 1px, transparent 1px 88px);
  mask-image: radial-gradient(120% 90% at 20% 10%, #000 30%, transparent 78%);
}
.login__art::after {
  content: "";
  position: absolute; right: -120px; top: -120px;
  width: 420px; height: 420px; border-radius: 50%;
  border: 1px solid rgba(201,169,97,0.16);
}
.login__brand { position: relative; }
.login__seal {
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 1px solid var(--gold); color: var(--gold);
  font-family: var(--serif); font-size: 22px;
}
.login__org {
  margin-top: 26px;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.35;
  letter-spacing: 0.10em;
  color: #F6EDDC;
}
.login__tagline {
  margin-top: 14px; font-size: var(--fs-sm); color: var(--spine-muted);
  letter-spacing: 0.16em;
}
.login__meta { position: relative; font-size: var(--fs-xs); color: rgba(168,154,128,.6); letter-spacing: .12em; }
.login__form-wrap { display: flex; align-items: center; justify-content: center; padding: 48px 40px; background: var(--paper); }
.login__card { width: 100%; max-width: 340px; }
.login__card h1 { font-size: var(--fs-xl); letter-spacing: .06em; margin-bottom: 6px; }
.login__card .login__hint { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 28px; }
.login__error {
  font-size: var(--fs-sm); color: var(--seal-deep);
  background: var(--seal-wash); border: 1px solid rgba(156,59,46,.28);
  padding: 8px 11px; border-radius: var(--r-sm); margin-bottom: 16px;
}
.login__foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--hairline); font-size: var(--fs-xs); color: var(--muted-2); display: flex; justify-content: space-between; gap: 8px; }

/* 工作台 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); box-shadow: var(--sh1); margin-bottom: var(--s5); }
.dash-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--s4); align-items: start; }
.dash-col { display: grid; gap: var(--s4); }

.trend { display: flex; align-items: flex-end; gap: 10px; height: 128px; padding-top: 8px; }
.trend__col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.trend__bar { width: 100%; max-width: 34px; background: var(--brown-soft); border-radius: 1px 1px 0 0; transition: height var(--dur-slow) var(--ease); min-height: 2px; }
.trend__col:hover .trend__bar { background: var(--brown); }
.trend__label { font-size: var(--fs-2xs); color: var(--muted-2); font-family: var(--mono); }
.trend__val { font-family: var(--mono); font-size: var(--fs-2xs); color: var(--muted); }

.dist-row { display: grid; grid-template-columns: 76px 1fr 34px; gap: 10px; align-items: center; margin-bottom: 9px; font-size: var(--fs-sm); }
.dist-row:last-child { margin-bottom: 0; }
.dist-row__name { color: var(--muted); }
.dist-row__num { font-family: var(--mono); font-size: var(--fs-sm); text-align: right; color: var(--ink-2); }

/* 筛选栏 */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-md); margin-bottom: var(--s4); box-shadow: var(--sh1);
}
.filters .input, .filters .select { height: 32px; width: auto; min-width: 112px; font-size: var(--fs-sm); }
.filters .input--search { min-width: 240px; flex: 1; max-width: 340px; }
.filters__sep { width: 1px; height: 20px; background: var(--hairline-2); margin: 0 2px; }

/* 详情页 */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: var(--s4); align-items: start; }
.detail-side { display: grid; gap: var(--s4); position: sticky; top: 20px; }

.headline {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 22px 24px;
  box-shadow: var(--sh1);
  margin-bottom: var(--s4);
  position: relative;
  overflow: hidden;
}
.headline::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brown);
}
.headline__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); }
.headline h1 { font-size: var(--fs-xl); line-height: 1.35; letter-spacing: .01em; }
.headline__no { font-family: var(--mono); font-size: var(--fs-sm); color: var(--muted); letter-spacing: .08em; margin-bottom: 8px; }
.headline__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.headline__amount { text-align: right; flex: 0 0 auto; }
.headline__amount .amt { font-family: var(--serif); font-size: 32px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.headline__amount .amt small { font-size: 13px; font-family: var(--sans); color: var(--muted); margin-left: 2px; }
.headline__amount .lbl { font-size: var(--fs-xs); color: var(--muted); letter-spacing: .08em; }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px var(--s4); }
.info-item .k { font-size: var(--fs-xs); color: var(--muted-2); letter-spacing: .06em; margin-bottom: 2px; }
.info-item .v { font-size: var(--fs-md); }
.info-item .v.mono { font-family: var(--mono); }

/* 费用明细表 */
.fee-total {
  display: flex; align-items: baseline; justify-content: flex-end; gap: 16px;
  padding: 12px 16px; border-top: 1px solid var(--hairline-2); background: var(--surface-2);
}
.fee-total .lbl { font-size: var(--fs-sm); color: var(--muted); letter-spacing: .06em; }
.fee-total .val { font-family: var(--serif); font-size: 22px; font-variant-numeric: tabular-nums; }
.fee-total .val--seal { color: var(--seal); }

/* 表单页 */
.form-card { max-width: 940px; }
.form-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding-top: var(--s4); margin-top: var(--s5);
  border-top: 1px solid var(--hairline);
}

/* 后台 */
.price-row td { vertical-align: middle; }
.price-row input[type="text"], .price-row input[type="number"] { height: 30px; font-size: var(--fs-sm); }
.price-row .input { border-color: transparent; background: transparent; }
.price-row .input:hover { border-color: var(--hairline-2); background: #fff; }
.price-row .input:focus { border-color: var(--brown); background: #fff; }

.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }

/* 403 / 404 */
.state-page {
  min-height: 100vh; display: grid; place-items: center;
  padding: 40px; text-align: center;
}
.state-page__code {
  font-family: var(--serif); font-size: 96px; line-height: 1;
  color: var(--brown-soft); letter-spacing: .04em;
}
.state-page h1 { font-size: var(--fs-xl); margin: 12px 0 8px; }
.state-page p { color: var(--muted); font-size: var(--fs-md); margin-bottom: 24px; }

/* ---------- 5. 对外页面（手机优先） ---------- */
.pub {
  min-height: 100vh;
  background: var(--paper);
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
}
.pub__top {
  background: var(--spine);
  color: var(--spine-text);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 12px;
}
.pub__seal {
  width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center;
  border: 1px solid var(--gold); color: var(--gold); font-family: var(--serif); font-size: 16px;
}
.pub__org { font-family: var(--serif); font-size: 15px; letter-spacing: .08em; line-height: 1.3; }
.pub__org small { display: block; font-family: var(--sans); font-size: 10px; letter-spacing: .14em; color: var(--spine-muted); margin-top: 2px; }
.pub__body { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 22px 18px 96px; }
.pub__foot {
  padding: 16px 20px 26px; text-align: center;
  font-size: 11px; color: var(--muted-2); letter-spacing: .06em;
}
.pub__hero { padding: 6px 2px 22px; }
.pub__hero h1 { font-size: 25px; line-height: 1.35; letter-spacing: .02em; }
.pub__hero p { margin-top: 8px; font-size: var(--fs-sm); color: var(--muted); line-height: 1.75; }

.pub__card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  box-shadow: var(--sh1);
  padding: 20px;
  margin-bottom: 14px;
}
.pub__card--flush { padding: 0; overflow: hidden; }
.pub__sect {
  font-family: var(--serif); font-size: var(--fs-base); letter-spacing: .06em;
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
}
.pub__sect .n {
  font-family: var(--mono); font-size: 10px; color: var(--surface);
  background: var(--brown); width: 17px; height: 17px; display: grid; place-items: center;
}

/* 单选卡（档案类型） */
.choices { display: grid; gap: 8px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice__box {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-sm);
  background: #FFFDF8;
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
  min-height: 48px;
  font-size: var(--fs-md);
}
.choice__box::before {
  content: ""; width: 14px; height: 14px; flex: 0 0 14px;
  border: 1px solid var(--hairline-2); border-radius: 50%;
  background: #fff;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.choice input:checked + .choice__box { border-color: var(--brown); background: var(--brown-wash); }
.choice input:checked + .choice__box::before {
  border-color: var(--seal); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 8px var(--seal);
}
.choice input:focus-visible + .choice__box { outline: 2px solid var(--seal); outline-offset: 2px; }

/* 数量输入组 */
.qty-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qty-field label { display: block; font-size: var(--fs-sm); color: var(--muted); margin-bottom: 5px; }
.qty-field .input { height: 44px; font-family: var(--mono); font-size: 16px; }

/* 费用行 */
.fee-line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--fs-md);
}
.fee-line:last-of-type { border-bottom: none; }
.fee-line .n { color: var(--muted); }
.fee-line .n b { color: var(--ink); font-weight: 500; }
.fee-line .amt { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

.pub__total {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--hairline-2);
}
.pub__total .lbl { font-size: var(--fs-sm); color: var(--muted); letter-spacing: .06em; }
.pub__total .val { font-family: var(--serif); font-size: 30px; line-height: 1; }
.pub__total .val small { font-size: 13px; font-family: var(--sans); color: var(--muted); margin-left: 2px; }

/* 编号牌 */
.ticket {
  text-align: center;
  padding: 26px 20px;
  background: var(--spine);
  color: var(--spine-text);
  border-radius: var(--r-md);
  position: relative; overflow: hidden;
}
.ticket::after {
  content: ""; position: absolute; inset: 8px;
  border: 1px solid rgba(201,169,97,.25);
  border-radius: 3px;
  pointer-events: none;
}
.ticket__label { font-size: 10px; letter-spacing: .3em; color: var(--spine-muted); }
.ticket__no {
  font-family: var(--mono); font-size: 30px; letter-spacing: .06em;
  margin: 10px 0 6px; color: #FBF2DF;
}
.ticket__hint { font-size: 11px; color: rgba(168,154,128,.85); }

/* 底部固定操作条 */
.pub__bar {
  position: sticky; bottom: 0;
  margin: 0 -18px -96px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: rgba(244, 239, 228, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--hairline-2);
  display: flex; gap: 10px;
  z-index: 20;
}
.pub__bar .btn { flex: 1; height: 46px; }

/* 手机端进度 */
.mini-steps { display: grid; gap: 0; }
.mini-step { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.mini-step:last-child { padding-bottom: 0; }
.mini-step::before {
  content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 1px;
  background: var(--hairline-2);
}
.mini-step:last-child::before { display: none; }
.mini-step__dot {
  width: 17px; height: 17px; flex: 0 0 17px; border-radius: 50%;
  border: 1px solid var(--hairline-2); background: var(--paper);
  margin-top: 3px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 9px; color: var(--muted-2);
}
.mini-step.is-done .mini-step__dot { background: var(--brown-soft); border-color: var(--brown-soft); color: #fff; }
.mini-step.is-done::before { background: var(--brown-soft); }
.mini-step.is-current .mini-step__dot { border-color: var(--seal); border-width: 2px; background: var(--surface); color: var(--seal); }
.mini-step__label { font-size: var(--fs-md); color: var(--muted); }
.mini-step.is-current .mini-step__label { color: var(--ink); font-weight: 500; }
.mini-step.is-done .mini-step__label { color: var(--ink-2); }
.mini-step__note { font-size: var(--fs-xs); color: var(--muted-2); }

/* 门户 */
.portal { min-height: 100vh; position: relative; z-index: 1; display: flex; flex-direction: column; }
.portal__hero {
  background: var(--spine); color: var(--spine-text);
  padding: 54px 24px 64px;
  position: relative; overflow: hidden;
}
.portal__hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(201,169,97,0.08) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(233,223,203,0.04) 0 1px, transparent 1px 96px);
  mask-image: radial-gradient(100% 80% at 30% 0%, #000 20%, transparent 80%);
}
.portal__inner { max-width: 880px; margin: 0 auto; position: relative; }
.portal__seal {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--gold); color: var(--gold); font-family: var(--serif); font-size: 20px;
}
.portal__title {
  font-family: var(--serif); font-size: 38px; line-height: 1.3;
  letter-spacing: .06em; margin-top: 24px; color: #F8F0DF;
}
.portal__sub { margin-top: 12px; font-size: var(--fs-md); color: var(--spine-muted); letter-spacing: .04em; line-height: 1.9; }
.portal__body { max-width: 880px; margin: -34px auto 0; padding: 0 24px 60px; width: 100%; }
.portal__cards { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.portal__card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 26px; box-shadow: var(--sh2);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.portal__card:hover { transform: translateY(-2px); box-shadow: var(--sh3); }
.portal__card h2 { font-size: var(--fs-lg); letter-spacing: .06em; }
.portal__card p { font-size: var(--fs-sm); color: var(--muted); line-height: 1.8; }
.portal__card .btn { margin-top: auto; align-self: flex-start; }
.portal__meta {
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--hairline-2);
  display: flex; flex-wrap: wrap; gap: 24px; font-size: var(--fs-xs); color: var(--muted-2);
  letter-spacing: .06em;
}

/* ---------- 6. 响应式 ---------- */
@media (max-width: 1180px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--hairline); }
}

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .spine {
    width: 100%; flex: none; height: auto; position: sticky; top: 0; z-index: 30;
    flex-direction: row; align-items: center; overflow-x: auto;
    border-right: none; border-bottom: 1px solid rgba(201,169,97,.22);
  }
  .spine__brand { padding: 12px 16px; border-bottom: none; flex: 0 0 auto; }
  .spine__brand::after { display: none; }
  .spine__sub { display: none; }
  .spine__nav { display: flex; padding: 0; flex: 1; overflow-x: auto; }
  .spine__group, .spine__org, .spine__foot { display: none; }
  .spine__link { padding: 12px 12px; border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 12px; }
  .spine__link.is-active { border-left: none; border-bottom-color: var(--gold); background: none; }
  .spine__link svg { display: none; }
  .main__inner { padding: 20px 18px 48px; }
  .pagehead { flex-direction: column; align-items: flex-start; gap: 12px; }
  .pagehead__actions { width: 100%; justify-content: flex-start; }
  .detail-side { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login__art { padding: 32px 28px 36px; }
  .login__org { font-size: 26px; margin-top: 18px; }
  .login__form-wrap { padding: 32px 24px 48px; }
  .portal__cards { grid-template-columns: 1fr; }
  .portal__title { font-size: 28px; }
  .stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .info-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat { border-right: none; border-bottom: 1px solid var(--hairline); }
  .stat:last-child { border-bottom: none; }
  .filters { padding: 10px 12px; }
  .filters .input--search { min-width: 100%; }
  .steps__label { display: none; }
  .pub__body { padding: 18px 14px 96px; }
  .pub__hero h1 { font-size: 22px; }
  .ticket__no { font-size: 26px; }
}
