/* GMSign 设计系统 · 「朱砂与宣纸」
   宣纸底色 + 墨色文字 + 朱砂印泥：电子合同的数字签章，回到"白纸黑字、盖章为凭"的契约语境。
   令牌 → 基础 → 版式 → 组件 → 页面 → 响应式。支持浅色（宣纸）/ 深色（墨夜）两套主题。 */
:root {
  /* 纸与墨 */
  --bg: #f3ede1;
  --surface: #fffcf6;
  --surface-2: #f7f1e6;
  --border: #e2d7c2;
  --border-strong: #cbbb9c;
  --rule: #b9a582;
  --text: #1e1a15;
  --muted: #7b6f5e;
  /* 动作色：墨；强调色：朱砂；链接：黛蓝 */
  --primary: #221d17;
  --primary-hover: #3a3229;
  --primary-weak: #ece3d2;
  --on-primary: #fbf6ec;
  --link: #2b4a6b;
  --seal: #b5361f;
  --seal-deep: #8f2714;
  --seal-weak: #f6e2da;
  --ok: #2f6b4c;
  --ok-weak: #e4eee3;
  --warn: #9a5d14;
  --warn-weak: #f5e8cf;
  --err: #a3242c;
  --err-weak: #f6dfdd;
  --info: #2b4a6b;
  --info-weak: #e1e8ef;
  --shadow: 0 1px 0 rgba(90, 64, 24, .06), 0 10px 24px -18px rgba(70, 45, 10, .35);
  --shadow-lg: 0 24px 48px -20px rgba(50, 32, 8, .38), 0 2px 6px rgba(50, 32, 8, .08);
  --radius: 4px;
  --grain-opacity: .5;
  /* 字体：西文衬线在前、中文宋体兜底；正文黑体；印章楷体；哈希等宽 */
  --display: "Noto Serif", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia,
             "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", "STSong", "SimSun", serif;
  --kai: "STKaiti", "KaiTi", "Kaiti SC", "BiauKai", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", "SFMono-Regular", Consolas, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #13110e;
    --surface: #1b1814;
    --surface-2: #221e19;
    --border: #322c24;
    --border-strong: #463e33;
    --rule: #5c5142;
    --text: #ece4d4;
    --muted: #a3967f;
    --primary: #ece4d4;
    --primary-hover: #fff8ea;
    --primary-weak: #2a251e;
    --on-primary: #17140f;
    --link: #93b4d6;
    --seal: #e2654c;
    --seal-deep: #c24c35;
    --seal-weak: #3a1f18;
    --ok: #79b691;
    --ok-weak: #1a2a20;
    --warn: #dca457;
    --warn-weak: #33260f;
    --err: #ec7f7f;
    --err-weak: #3b1c1d;
    --info: #93b4d6;
    --info-weak: #1c2632;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 24px -18px rgba(0, 0, 0, .7);
    --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, .75);
    --grain-opacity: .18;
    color-scheme: dark;
  }
}

/* ================================================================ 基础 */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; position: relative;
  background: var(--bg); color: var(--text); font: 14px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
/* 宣纸纤维纹理：SVG 噪声，叠加在底色之上 */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: var(--grain-opacity); mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .36  0 0 0 0 .22  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@media (prefers-color-scheme: dark) { body::before { mix-blend-mode: screen; } }
body > * { position: relative; z-index: 1; }
::selection { background: var(--seal); color: #fff; }

a { color: var(--link); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; text-decoration-color: var(--seal); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; font-family: var(--display); font-weight: 700; letter-spacing: .01em; }
h1 { font-size: 30px; letter-spacing: .02em; }
h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
h2 > .icon { color: var(--seal); }
h3 { font-size: 15px; }
p { margin: 0 0 .8em; }
code, .hash { font-family: var(--mono); font-size: 12px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.pre { white-space: pre-wrap; word-break: break-all; }
.nowrap { white-space: nowrap; }
.pad { padding: 16px 20px; }
.pad-lg { padding: 24px 28px; }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }
.icon.big { width: 34px; height: 34px; stroke-width: 1.3; }

/* 页面载入：自上而下依次显现 */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page > * { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.page > *:nth-child(2) { animation-delay: .06s; }
.page > *:nth-child(3) { animation-delay: .12s; }
.page > *:nth-child(4) { animation-delay: .18s; }
.page > *:nth-child(5) { animation-delay: .24s; }
.page > *:nth-child(n+6) { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ================================================================ 顶栏：文书"天头" */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 3px 0 -2px var(--border);
}
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-family: var(--kai); font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: .5em; margin-top: -2px; }
.brand-mark { width: 34px; height: 34px; transform: rotate(-4deg); transition: transform .3s; }
.brand:hover .brand-mark { transform: rotate(0); }
.brand-mark rect { fill: var(--seal); }
.brand-mark .inner { fill: none; stroke: #fff; stroke-width: 1; opacity: .75; }
.brand-mark text { fill: #fff; font-family: var(--kai); font-size: 19px; font-weight: 700; }
#nav { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.nav-links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav-link {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px; color: var(--muted); white-space: nowrap; font-weight: 500;
  position: relative; transition: color .15s;
}
.nav-link .icon { width: 16px; height: 16px; opacity: .8; }
.nav-link::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -13px; height: 2px; background: var(--seal); transform: scaleX(0); transition: transform .2s; }
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--text); font-weight: 600; }
.nav-link.active::after { transform: scaleX(1); }
.nav-link.active .icon { color: var(--seal); opacity: 1; }
.nav-right { display: flex; align-items: center; gap: 10px; flex: none; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--text); padding: 3px 12px 3px 3px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); }
.user-chip:hover { text-decoration: none; border-color: var(--rule); }
.key-state { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; border: 1px solid transparent; }
.key-state .icon { width: 15px; height: 15px; }
.key-state.on { color: var(--ok); background: var(--ok-weak); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.key-state.off { color: var(--muted); background: var(--surface-2); border-color: var(--border); }

.banner { max-width: 1240px; margin: 14px auto 0; padding: 10px 16px; border-radius: var(--radius); display: flex; gap: 8px; align-items: center; }
.banner.err { background: var(--err-weak); color: var(--err); border: 1px solid var(--err); border-left-width: 4px; }
.banner .btn { margin-left: auto; flex: none; }

.page { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 36px 24px 64px; }
.boot { padding: 80px 0; text-align: center; color: var(--muted); }
.footer {
  border-top: 1px solid var(--border); padding: 22px 24px 26px; display: flex; justify-content: center; gap: 10px 28px; flex-wrap: wrap;
  color: var(--muted); font-size: 12px; letter-spacing: .06em;
}
.footer span:first-child::before { content: "签"; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: 8px; border-radius: 2px; background: var(--seal); color: #fff; font-family: var(--kai); font-size: 12px; vertical-align: -4px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; position: relative; }
.page-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 2px; background: var(--seal); }
.page-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.page-head p { margin: 0; max-width: 760px; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 8px; letter-spacing: .04em; }
h2.section { margin: 36px 0 14px; font-size: 19px; }

/* ================================================================ 基础组件 */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card > h2:first-child, .card .pad-lg > h2:first-child { padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; letter-spacing: .04em; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .06s;
}
.btn:hover { border-color: var(--rule); background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, .tab:focus-visible, input:focus-visible, textarea:focus-visible, .dropzone:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--primary-weak); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger-ghost { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, var(--border)); background: transparent; }
.btn.danger-ghost:hover { background: var(--err-weak); border-color: var(--err); }
/* 签署按钮：印泥朱红 + 内衬细框，如同一方印 */
.btn.seal-btn {
  background: var(--seal); border-color: var(--seal-deep); color: #fff; font-family: var(--display); letter-spacing: .12em;
  box-shadow: inset 0 0 0 2px var(--seal), inset 0 0 0 3px rgba(255, 255, 255, .45), 0 6px 16px -8px var(--seal);
}
.btn.seal-btn:hover { background: var(--seal-deep); box-shadow: inset 0 0 0 2px var(--seal-deep), inset 0 0 0 3px rgba(255, 255, 255, .55), 0 8px 20px -8px var(--seal); }
.btn.link { border: 0; background: none; color: var(--link); padding: 0; height: auto; font-weight: 500; letter-spacing: 0; }
.btn.link:hover { text-decoration: underline; background: none; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; letter-spacing: .02em; }
.btn.lg { height: 46px; padding: 0 24px; font-size: 15px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: var(--radius); background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--primary-weak); color: var(--text); }
.icon-btn .icon { width: 16px; height: 16px; }

/* 状态徽章：小方印 */
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 2px; font-size: 12px; font-weight: 600; letter-spacing: .08em;
  color: var(--muted); border: 1px solid currentColor; background: transparent; white-space: nowrap; vertical-align: middle;
}
.badge.ok { color: var(--ok); background: var(--ok-weak); }
.badge.warn { color: var(--warn); background: var(--warn-weak); }
.badge.err { color: var(--err); background: var(--err-weak); }
.badge.info { color: var(--info); background: var(--info-weak); }
.badge.muted { color: var(--muted); }
.page-head h1 .badge { font-family: var(--kai); font-size: 15px; height: 28px; padding: 0 10px; letter-spacing: .2em; transform: rotate(-3deg); border-width: 1.5px; }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); align-items: baseline; }
.kv:last-of-type { border-bottom: 0; }
.kv .k { color: var(--muted); font-size: 13px; letter-spacing: .04em; }
.kv .v { word-break: break-all; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.hash { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 2px; }
.hash.wrap { word-break: break-all; display: inline-block; }

.alert { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius); margin: 10px 0; border-left: 3px solid currentColor; }
.alert.ok { background: var(--ok-weak); color: var(--ok); }
.alert.err { background: var(--err-weak); color: var(--err); }
.warn-text { color: var(--warn); background: var(--warn-weak); padding: 10px 12px; border-radius: var(--radius); font-size: 13px; border-left: 3px solid currentColor; }

.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--seal); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================ 表单 */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field .label { font-weight: 600; font-size: 13px; letter-spacing: .04em; }
.field .hint, .hint { color: var(--muted); font-size: 12px; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 10px 12px; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:focus, textarea:focus { border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--seal) 14%, transparent); outline: none; }
textarea { resize: vertical; min-height: 76px; }
input[type=password] { font-family: Verdana, "Segoe UI", sans-serif; letter-spacing: .14em; }
.form-error { color: var(--err); font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }
.form-links { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.meter { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: -10px; }
.meter span { display: block; height: 100%; width: 0; background: var(--err); transition: width .2s; }
.meter[data-level=mid] span { background: var(--warn); }
.meter[data-level=strong] span { background: var(--ok); }
details.more summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.more[open] summary { margin-bottom: 10px; }

/* ================================================================ 流程步骤 */
.stepper { list-style: none; margin: 20px 0 0; padding: 0; counter-reset: step; }
.step { position: relative; display: flex; gap: 14px; padding: 0 0 16px; counter-increment: step; }
.step::before { content: ""; position: absolute; left: 10px; top: 24px; bottom: 2px; width: 1px; background: var(--border-strong); }
.step:last-child::before { display: none; }
.step .dot {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); flex: none; margin-top: 1px;
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; font: 600 11px/1 var(--display); color: var(--muted);
}
.step .dot::before { content: counter(step); }
.step.active .dot { border-color: var(--seal); border-top-color: transparent; animation: spin .8s linear infinite; }
.step.active .dot::before { content: ""; }
.step.done .dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.step.done .dot::before { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.step.failed .dot { border-color: var(--err); background: var(--err); color: #fff; }
.step.failed .dot::before { content: "!"; }
.step-title { font-weight: 600; }
.step:not(.done):not(.active):not(.failed) .step-title { color: var(--muted); }
.step-info { font-size: 12px; color: var(--muted); font-family: var(--mono); word-break: break-all; }
.step.failed .step-info { color: var(--err); font-family: var(--sans); }
.success-box { margin-top: 20px; padding: 20px 22px; border-radius: var(--radius); background: var(--ok-weak); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); border-top: 3px solid var(--ok); }
.success-box h3 { color: var(--ok); display: flex; gap: 6px; align-items: center; font-size: 17px; }
.success-box .btn { margin-top: 16px; }

/* ================================================================ 首页（访客） */
.hero { display: grid; grid-template-columns: 44px 1.1fr 1fr; gap: 36px; align-items: center; padding: 12px 0 48px; }
.hero-scroll {
  writing-mode: vertical-rl; font-family: var(--kai); font-size: 13px; letter-spacing: .06em; line-height: 1; color: var(--muted);
  border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); padding: 16px 10px; align-self: center; justify-self: center;
}
.hero-scroll b { color: var(--seal); font-weight: 400; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--seal); font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .3em; margin-bottom: 20px; }
.eyebrow::before { content: ""; width: 32px; height: 1px; background: var(--seal); }
.hero h1 { font-size: 50px; line-height: 1.22; letter-spacing: .04em; margin-bottom: 22px; }
.hero h1 em { font-style: normal; color: var(--seal); position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 8px; background: color-mix(in srgb, var(--seal) 16%, transparent); z-index: -1; }
.hero p { font-size: 16px; color: var(--muted); max-width: 560px; line-height: 1.9; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

/* 首页右侧：一纸契书 */
.deed {
  position: relative; padding: 34px 36px 30px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); transform: rotate(1.2deg); max-width: 460px; justify-self: center; width: 100%;
}
.deed::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--border); pointer-events: none; }
.deed::after { content: ""; position: absolute; inset: 11px; border: 1px solid color-mix(in srgb, var(--border) 60%, transparent); pointer-events: none; }
.deed-title { text-align: center; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .6em; padding-left: .6em; margin-bottom: 4px; }
.deed-no { text-align: center; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 18px; }
.deed-line { height: 7px; border-radius: 4px; background: var(--primary-weak); margin: 11px 0; }
.deed-line.s { width: 62%; } .deed-line.m { width: 84%; }
.deed-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 26px; padding-top: 14px; border-top: 1px dashed var(--border-strong); position: relative; }
.deed-sign > div { font-size: 12px; color: var(--muted); font-family: var(--kai); letter-spacing: .1em; min-height: 92px; position: relative; }
.deed-sign .seal { position: absolute; left: 4px; top: 22px; }
.deed-sign > div:nth-child(1) .seal { animation: stamp .55s .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.deed-sign > div:nth-child(2) .seal { animation: stamp .55s .9s cubic-bezier(.2, 1.4, .4, 1) both; }
.deed-sign > div:nth-child(3) .seal { animation: stamp .55s 1.3s cubic-bezier(.2, 1.4, .4, 1) both; }
.deed-hash { margin-top: 12px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); word-break: break-all; line-height: 1.5; }
.deed-hash b { color: var(--seal); font-weight: 600; }

/* 六道工序：壹贰叁肆伍陆 */
.process { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 8px 0 40px; }
.process-step { padding: 18px 16px 16px; border-left: 1px solid var(--border); position: relative; }
.process-step:first-child { border-left: 0; }
.process-step .num { font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--seal); line-height: 1; margin-bottom: 10px; display: block; }
.process-step b { display: block; font-size: 14px; margin-bottom: 2px; }
.process-step small { color: var(--muted); font-size: 12px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); min-width: 0; position: relative; }
.stat.wide { grid-column: span 2; }
.stat-v { font-family: var(--display); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums lining-nums; line-height: 1.2; }
.stat-l { color: var(--muted); font-size: 12px; letter-spacing: .08em; margin-bottom: 4px; }
/* 首页统计：一条横向数据带 */
.stats.band { gap: 0; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); margin-bottom: 44px; }
.stats.band .stat { border: 0; border-left: 1px solid var(--border); box-shadow: none; background: transparent; border-radius: 0; padding: 20px 24px; }
.stats.band .stat:first-child { border-left: 0; }
.stats.band .stat-v { font-size: 36px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 12px; border-top: 1px solid var(--rule); }
.features .card + .card { margin-top: 0; }
.feature { padding: 26px 26px 28px 0; background: transparent; border: 0; box-shadow: none; border-bottom: 1px solid var(--border); border-radius: 0; }
.features .feature:not(:nth-child(3n+1)) { padding-left: 26px; border-left: 1px solid var(--border); }
.feature h3 { font-size: 17px; margin: 0 0 8px; display: flex; align-items: baseline; gap: 10px; }
.feature h3 .num { font-family: var(--kai); color: var(--seal); font-size: 15px; }
.feature p { color: var(--muted); margin: 0; font-size: 13.5px; line-height: 1.85; }
.feature-icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--seal); border: 1px solid color-mix(in srgb, var(--seal) 35%, transparent); margin-bottom: 16px; }
.section-title { display: flex; align-items: baseline; gap: 14px; margin: 0 0 4px; }
.section-title h2 { font-size: 24px; margin: 0; }
.section-title span { color: var(--muted); font-size: 13px; letter-spacing: .06em; }

/* ================================================================ 认证页 */
.auth-wrap { display: grid; grid-template-columns: 1fr 470px; gap: 36px; max-width: 1000px; margin: 8px auto; align-items: start; }
.auth-side {
  padding: 34px 32px; border-radius: var(--radius); position: sticky; top: 96px; overflow: hidden;
  background: #1f1a15; color: #ece4d4; box-shadow: var(--shadow-lg);
}
.auth-side::before {
  content: "签"; position: absolute; right: -28px; bottom: -60px; font-family: var(--kai); font-size: 260px; line-height: 1;
  color: var(--seal); opacity: .16; transform: rotate(-8deg); pointer-events: none;
}
.auth-side::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(236, 228, 212, .14); pointer-events: none; }
.auth-brand > .icon { color: var(--seal); }
.auth-brand h2 { font-size: 24px; margin-top: 14px; color: #fbf6ec; }
.auth-brand p { color: #b4a68f; font-family: var(--kai); letter-spacing: .12em; font-size: 15px; }
.auth-points { list-style: none; padding: 22px 0 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 16px; border-top: 1px solid rgba(236, 228, 212, .14); position: relative; }
.auth-points li { display: flex; gap: 10px; font-size: 13px; color: #d9cfbd; word-break: break-all; line-height: 1.7; }
.auth-points .icon { color: #e2a08f; margin-top: 3px; }
.auth-main { padding: 34px; }
.auth-main > h1 { font-size: 28px; }
.auth-main > p.muted { margin-bottom: 24px; }

/* ================================================================ 列表与标签页 */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 10px 6px; margin-right: 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 8px; align-items: center; white-space: nowrap; letter-spacing: .04em; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--seal); }
.tab .count { font: 600 11px/18px var(--display); min-width: 20px; text-align: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 2px; padding: 0 5px; color: var(--muted); }
.tab.active .count { background: var(--seal); border-color: var(--seal); color: #fff; }
.list { display: flex; flex-direction: column; gap: 12px; }
.list .card + .card { margin-top: 0; }
.row { display: flex; gap: 18px; padding: 18px 20px; color: var(--text); align-items: center; transition: border-color .15s, box-shadow .2s, transform .2s; position: relative; }
.row::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; background: var(--seal); transform: scaleY(0); transition: transform .2s; }
.row:hover { text-decoration: none; border-color: var(--rule); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.row:hover::before { transform: scaleY(1); }
.row-icon { width: 44px; height: 52px; border-radius: 2px; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--muted); display: flex; align-items: center; justify-content: center; flex: none; box-shadow: 3px 3px 0 -1px var(--surface), 3px 3px 0 0 var(--border-strong); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-family: var(--display); font-weight: 700; font-size: 17px; display: flex; gap: 10px; align-items: center; }
.row-sub { color: var(--muted); font-size: 12px; margin: 3px 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.parties { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 9px 2px 6px; border-radius: 2px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.chip .icon { width: 13px; height: 13px; }
.chip.signed { color: var(--ok); background: var(--ok-weak); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.chip.rejected { color: var(--err); background: var(--err-weak); border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.progress { width: 100px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--seal); }
.empty { text-align: center; padding: 64px 20px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty .icon { margin-bottom: 10px; color: var(--rule); }
.empty .btn { margin-top: 12px; }

/* ================================================================ 发起合同 */
.new-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.new-grid .card + .card { margin-top: 0; }
.new-grid .card h2 { margin-bottom: 16px; }
.new-grid .field { margin-top: 16px; }
.submit-card { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.submit-card > div:last-child { width: 100%; }
.dropzone {
  border: 1px dashed var(--rule); border-radius: var(--radius); padding: 34px 20px; text-align: center; cursor: pointer;
  background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--border) 35%, transparent) 10px 11px), var(--surface-2);
  transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--seal); border-style: solid; }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-weak); }
.dropzone.small { padding: 24px; }
.drop-info { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.drop-info .icon.big { color: var(--seal); }
.dropzone.has-file .drop-info .icon.big { color: var(--ok); }
.drop-info b { color: var(--text); word-break: break-all; font-family: var(--display); font-size: 15px; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0 12px; background: var(--surface); }
.search-box:focus-within { border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--seal) 14%, transparent); }
.search-box input { border: 0; box-shadow: none !important; padding-left: 0; background: transparent; }
.search-box .icon { color: var(--muted); }
.search-results { display: flex; flex-direction: column; margin: 6px 0; }
.result { display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; background: none; font: inherit; color: var(--text); text-align: left; border-radius: var(--radius); cursor: pointer; }
.result:hover { background: var(--primary-weak); }
.result > .icon:last-child { color: var(--seal); }
.result > span { flex: 1; min-width: 0; }
.block-line { display: block; font-family: var(--mono); word-break: break-all; }
.signer-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.signer, .party { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.party { background: none; border: 0; border-bottom: 1px dashed var(--border); border-radius: 0; padding: 12px 0; }
.party:last-child { border-bottom: 0; }
.signer-main, .party-main { flex: 1; min-width: 0; }
.signer-main .small { margin-top: 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); font-family: var(--kai); font-size: 17px; flex: none; }
.avatar.ok { background: var(--seal); border-color: var(--seal-deep); color: #fff; }
.avatar.sm { width: 26px; height: 26px; font-size: 13px; }

/* ================================================================ 合同详情 */
.detail-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.col .card + .card { margin-top: 0; }
.preview:empty { display: none; }
.preview { margin-top: 10px; }
.pdf-frame { width: 100%; height: 680px; border: 1px solid var(--border-strong); border-radius: 2px; background: #fff; }
.img-preview { max-width: 100%; border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); background: #fff; display: block; margin: 0 auto; }
.text-preview { max-height: 560px; overflow: auto; background: var(--surface); padding: 22px 26px; border: 1px solid var(--border-strong); white-space: pre-wrap; word-break: break-word; font: 14px/2 var(--display); box-shadow: var(--shadow); }
.checks { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.checks.inline { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.checks.inline .check { font-size: 12px; padding: 3px 10px 3px 7px; border-radius: 2px; background: var(--ok-weak); border: 1px solid color-mix(in srgb, var(--ok) 22%, transparent); }
.check { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.check .icon { margin-top: 2px; }
.check.ok > .icon { color: var(--ok); }
.check.warn > .icon { color: var(--warn); }
.check.bad { color: var(--err); }
.check.bad > .icon { color: var(--err); }
.timeline { list-style: none; padding: 0; margin: 0; }
.tl { position: relative; padding: 0 0 20px 26px; }
.tl::before { content: ""; position: absolute; left: 3px; top: 7px; width: 11px; height: 11px; border-radius: 1px; background: var(--seal); transform: rotate(45deg); box-shadow: 0 0 0 3px var(--seal-weak); }
.tl.err::before { background: var(--err); box-shadow: 0 0 0 3px var(--err-weak); }
.tl.muted::before { background: var(--muted); box-shadow: 0 0 0 3px var(--surface-2); }
.tl::after { content: ""; position: absolute; left: 8px; top: 22px; bottom: 2px; width: 1px; background: var(--border-strong); }
.tl:last-child::after { display: none; }
.tl-head { display: flex; align-items: center; gap: 8px; font-family: var(--display); }
.tl-comment { font-size: 13px; margin: 6px 0; padding: 8px 12px; background: var(--surface-2); border-left: 2px solid var(--rule); font-family: var(--kai); font-size: 14px; }
.tl-more summary { cursor: pointer; color: var(--link); font-size: 12px; margin-top: 4px; }
.tl-more .kv { grid-template-columns: 96px 1fr; font-size: 12px; }
.seals { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; margin-top: 10px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
.blocks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.block-mini { padding: 9px 12px; border: 1px solid var(--border); border-left: 3px solid var(--rule); border-radius: 2px; font-size: 13px; background: var(--surface-2); }

/* 电子印章 */
.seal { transform: rotate(-12deg); opacity: .9; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { .seal { mix-blend-mode: normal; } }
.seal circle, .seal path:not(.seal-star) { stroke: var(--seal); }
.seal-star { fill: var(--seal); }
.seal text { fill: var(--seal); font-family: var(--kai); }
.seal-arc { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; }
.seal-name { font-size: 15px; font-weight: 800; }
.seal-sub { font-size: 8px; }
.stamp-in { animation: stamp .55s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes stamp { from { transform: rotate(-12deg) scale(1.8); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: .9; } }

/* 验证结果 */
.verify-result { margin-top: 18px; border-top-width: 3px; }
.verify-result.ok { border-top-color: var(--ok); }
.verify-result.bad { border-top-color: var(--err); }
.verify-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.verify-result.ok .verify-head > .icon { color: var(--ok); }
.verify-result.bad .verify-head > .icon { color: var(--err); }
.verify-head h2 { margin: 0; font-size: 20px; }
.verify-head p { margin: 2px 0 0; }
.check-group { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.check-group h4 { margin: 0 0 4px; font-size: 13px; color: var(--seal); letter-spacing: .12em; }

/* ================================================================ 表格 / 存证链 */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-family: var(--display); font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .1em; padding: 11px 14px; border-bottom: 1px solid var(--rule); background: var(--surface-2); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table tr:last-child td { border-bottom: 0; }
.table.compact td { padding: 7px 12px; font-size: 13px; }
.table .row-fail td { background: color-mix(in srgb, var(--err-weak) 70%, transparent); }
.ellipsis { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card:has(> .table) { overflow-x: auto; }
.toolbar { display: flex; gap: 10px; padding: 12px 14px; align-items: center; border-bottom: 1px solid var(--border); }
.toolbar .search-box { flex: 1; max-width: 420px; }
.card > .alert { margin: 12px 14px; }
.ledger { display: flex; flex-direction: column; }
.block-row { border-bottom: 1px solid var(--border); }
.block-row:last-child { border-bottom: 0; }
.block-row summary { display: flex; align-items: center; gap: 14px; padding: 12px 18px; cursor: pointer; list-style: none; flex-wrap: wrap; transition: background .15s; }
.block-row summary::-webkit-details-marker { display: none; }
.block-row summary:hover, .block-row[open] summary { background: var(--surface-2); }
.block-idx { font-family: var(--display); font-weight: 700; font-size: 15px; min-width: 52px; color: var(--seal); }
.block-body { padding: 8px 18px 16px 84px; border-left: 3px solid var(--seal-weak); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }

/* ================================================================ 对话框与提示 */
.overlay { position: fixed; inset: 0; background: rgba(24, 18, 10, .5); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 460px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .2s ease-out; border-top: 3px solid var(--seal); }
.modal.wide { max-width: 760px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 14px 22px; overflow: auto; }
.modal-body .center { overflow: hidden; padding: 8px 0; }
.modal-body .center .seal { margin: 6px auto 12px; display: block; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 4px 22px 20px; }
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: calc(100vw - 40px); }
.toast { display: flex; gap: 8px; align-items: center; padding: 12px 18px; border-radius: var(--radius); background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-lg); animation: pop .2s; max-width: 420px; border-left: 3px solid var(--seal); }
.toast.err { background: var(--err); color: #fff; border-left-color: rgba(255, 255, 255, .5); }
.toast.warn { background: var(--warn); color: #fff; border-left-color: rgba(255, 255, 255, .5); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .3s; }

/* ================================================================ 响应式 */
@media (max-width: 1180px) {
  .topbar-inner { gap: 18px; }
  .brand > span { display: none; }
  .nav-link { padding: 8px 7px; }
  .nav-link::after { left: 7px; right: 7px; }
  .user-chip span:last-child { display: none; }
  .user-chip { padding: 3px; }
}
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .hero-scroll { display: none; }
  .detail-grid, .new-grid, .auth-wrap { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .features .feature:not(:nth-child(3n+1)) { padding-left: 0; border-left: 0; }
  .features .feature:nth-child(2n) { padding-left: 24px; border-left: 1px solid var(--border); }
  .process { grid-template-columns: repeat(3, 1fr); }
  .process-step:nth-child(4) { border-left: 0; }
  .process-step:nth-child(n+4) { border-top: 1px solid var(--border); }
  .auth-side { position: static; }
  .hero h1 { font-size: 40px; }
  .deed { transform: none; }
}
@media (max-width: 720px) {
  .topbar-inner { gap: 10px; padding: 0 12px; height: 58px; }
  .nav-link span { display: none; }
  .nav-link::after { bottom: -11px; }
  .page { padding: 22px 16px 44px; }
  h1 { font-size: 25px; }
  .hero h1 { font-size: 32px; }
  .hero { padding-top: 4px; }
  .deed { padding: 26px 22px; }
  .features, .two-col { grid-template-columns: 1fr; }
  .features .feature:nth-child(n) { padding-left: 0; border-left: 0; padding-right: 0; }
  .process { grid-template-columns: repeat(2, 1fr); }
  .process-step:nth-child(n) { border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
  .process-step:nth-child(odd) { border-left: 0; }
  .process-step:nth-child(-n+2) { border-top: 0; }
  .stats:not(.band) { grid-template-columns: 1fr 1fr; }
  .stat.wide { grid-column: 1 / -1; }
  .stats.band { grid-template-columns: repeat(2, 1fr); }
  .stats.band .stat { border-left: 0; border-top: 1px solid var(--border); padding: 14px 16px; }
  .stats.band .stat:nth-child(even) { border-left: 1px solid var(--border); }
  .stats.band .stat:nth-child(-n+2) { border-top: 0; }
  .stats.band .stat-v { font-size: 28px; }
  .row { flex-wrap: wrap; }
  .row-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .block-body { padding-left: 16px; }
  .pdf-frame { height: 460px; }
  .auth-main { padding: 24px 20px; }
  .auth-side { padding: 26px 22px; }
}
