:root {
  --ink: #172033;
  --navy: #13233c;
  --navy-2: #1c3354;
  --seal: #9a2b2b;
  --brass: #9a7b49;
  --paper: #eef1f4;
  --card: #ffffff;
  --line: #d5dbe3;
  --muted: #5e6a7a;
  --ok: #1f6b4a;
  --warn: #8d5b18;
  --serif: "Songti SC", "STSong", "SimSun", "PMingLiU", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --num: "Palatino Linotype", "Times New Roman", "Songti SC", serif;
  color: var(--ink);
  font-family: var(--sans);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 28%),
    repeating-linear-gradient(90deg, transparent 0 27px, rgba(154, 123, 73, 0.14) 27px 28px),
    var(--navy);
  color: #f4f0e6;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
}
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }

.lot {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  padding: 24px;
}
.plate { width: 300px; color: #d5d8df; }
.plate-mark {
  font-family: var(--serif);
  font-size: 46px;
  letter-spacing: 0.28em;
  line-height: 1;
  color: #f4f0e6;
}
.plate-en {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.42em;
  color: var(--brass);
}
.plate-rule { width: 48px; height: 1px; margin: 22px 0; background: var(--brass); }
.plate h1 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.plate-lead { margin-top: 14px; font-size: 14px; line-height: 1.75; color: #b7bec8; }
.plate ul { margin: 22px 0 0; padding: 0; list-style: none; }
.plate li {
  position: relative;
  padding: 9px 0 9px 16px;
  border-top: 1px solid rgba(244, 240, 230, 0.1);
  font-size: 14px;
  letter-spacing: 0.04em;
}
.plate li:last-child { border-bottom: 1px solid rgba(244, 240, 230, 0.1); }
.plate li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  width: 6px;
  height: 1px;
  background: var(--brass);
}
.plate-foot {
  margin-top: 26px;
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.08em;
  color: #8e97a6;
}

.device-wrap { width: 392px; height: min(844px, calc(100vh - 40px)); flex: none; }
.device {
  width: 100%;
  height: 100%;
  padding: 10px;
  border-radius: 36px;
  background: linear-gradient(180deg, #31445f, #15263c 22%, #0d1828);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(154, 123, 73, 0.45);
}
.screen {
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  position: relative;
}

.wx-chrome {
  flex: none;
  position: relative;
  z-index: 20;
  background: var(--navy);
  color: #f4f0e6;
}
.wx-status, .wx-nav { display: flex; align-items: center; }
.wx-status { height: 28px; padding: 8px 16px 0 22px; justify-content: space-between; }
.wx-time { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.wx-sys { display: flex; align-items: center; gap: 6px; }
.wx-nav { height: 44px; position: relative; }
.wx-back, .wx-side { width: 44px; height: 44px; display: grid; place-items: center; position: relative; z-index: 2; }
.wx-back { border: 0; background: transparent; color: #f4f0e6; padding: 0; }
.wx-back:active { background: rgba(255, 255, 255, 0.06); }
.wx-title {
  position: absolute;
  left: 72px;
  right: 104px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.12em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wx-capsule {
  position: absolute;
  right: 8px;
  top: 6px;
  width: 87px;
  height: 32px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #f4f0e6;
  z-index: 6;
}
.wx-capsule > button {
  flex: 1;
  height: 100%;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}
.wx-capsule > button:first-of-type { border-radius: 16px 0 0 16px; }
.wx-capsule > button:last-of-type { border-radius: 0 16px 16px 0; }
.wx-capsule > button:active { background: rgba(255, 255, 255, 0.12); }
.wx-split { width: 1px; height: 18px; background: currentColor; opacity: 0.35; flex: none; }
.wx-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: #fff;
  color: var(--ink);
  border-radius: 2px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  padding: 6px;
  text-align: left;
  z-index: 8;
}
.wx-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 2px;
  padding: 11px 12px;
  font-size: 14px;
}
.wx-menu button:active { background: var(--paper); }
.wx-about {
  margin: 0 6px 6px;
  padding: 10px 12px;
  background: var(--paper);
  font-size: 12px;
  line-height: 1.7;
  color: #3d4a5c;
}
.wx-scrim {
  position: absolute;
  inset: 0;
  z-index: 15;
  border: 0;
  background: transparent;
  padding: 0;
}

.body { flex: 1; min-width: 0; min-height: 0; overflow: auto; background: var(--paper); }
.body::-webkit-scrollbar { width: 0; height: 0; }

.tabbar {
  flex: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  position: relative;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #8b93a0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 54px;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 6px 0 8px;
}
.tabbar button.on { color: var(--navy); }
.tabbar button.on::before {
  content: "";
  position: absolute;
  top: 0;
  width: 18px;
  height: 2px;
  background: var(--brass);
}
.tabbar svg { width: 22px; height: 22px; }
.tab-dot {
  position: absolute;
  top: 6px;
  right: calc(50% - 16px);
  width: 6px;
  height: 6px;
  background: var(--seal);
  border-radius: 50%;
}

.actionbar {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
}
.actionbar .btn { flex: 1; }

.page { padding: 16px 16px 22px; min-width: 0; max-width: 100%; }
.kicker {
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.18em;
  color: var(--brass);
}
h2.serif, .serif { font-family: var(--serif); font-weight: 600; }
.mast h2 { margin-top: 6px; font-size: 28px; letter-spacing: 0.12em; }
.sub { margin-top: 6px; color: var(--muted); font-size: 13px; letter-spacing: 0.04em; }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.metric { background: var(--card); border: 1px solid var(--line); padding: 12px 12px 10px; text-align: left; }
.metric b {
  display: block;
  font-family: var(--num);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.metric span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; letter-spacing: 0.12em; }
.metric.hot b { color: var(--seal); }
button.metric { width: 100%; }

.sec { margin-top: 20px; }
.sec-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.sec-h h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.sec-h h3::before { content: ""; width: 8px; height: 8px; background: var(--seal); flex: none; }
.sec-h button, .linkish {
  border: 0;
  background: transparent;
  color: var(--navy-2);
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 0;
}

.bar-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 22px;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  font-size: 13px;
  min-width: 0;
}
.bar-name { display: flex; flex-direction: column; line-height: 1.3; }
.bar-name small { color: var(--muted); font-size: 11px; }
.bar-track { height: 6px; background: #e1e6ee; }
.bar-track i { display: block; height: 100%; background: var(--navy); }
.bar-num { text-align: right; font-variant-numeric: tabular-nums; }

.alert {
  width: 100%;
  margin-top: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--seal);
  padding: 12px;
}
.alert b {
  font-family: var(--num);
  font-size: 28px;
  color: var(--seal);
  font-weight: 600;
  min-width: 28px;
}
.alert span { display: block; letter-spacing: 0.06em; }
.alert small { display: block; margin-top: 3px; color: var(--muted); letter-spacing: 0; font-size: 12px; }

.menu-list { margin-top: 14px; background: #fff; border: 1px solid var(--line); padding: 0 12px; }
.menu-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 2px;
  font-size: 15px;
  letter-spacing: 0.04em;
}
.menu-list .menu-row:last-child { border-bottom: 0; }
.menu-row i { color: #9aa3af; font-style: normal; }

.search input, .fld input, .fld select, .fld textarea, .filters select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 0;
  font-size: 16px;
}
.search input { padding: 11px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.filters { margin-top: 8px; }
.filters select, .fld select { padding: 11px 12px; background: #fff; }

.card {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-left-width: 3px;
  padding: 12px 12px 11px;
  margin-top: 10px;
}
.card.wait { border-left-color: var(--warn); }
.card.ing { border-left-color: var(--navy-2); }
.card.won { border-left-color: var(--ok); }
.card.lost { border-left-color: #b0b6bf; }
.card.pending { border-left-color: var(--seal); }
.card-top, .row-between { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card-top strong { font-size: 16px; letter-spacing: 0.06em; }
.meta { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.snippet {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: #2c3848;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pill {
  flex: none;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border: 1px solid currentColor;
}
.pill.wait, .st.wait { color: var(--warn); }
.pill.ing, .st.ing { color: var(--navy-2); }
.pill.won, .st.won { color: var(--ok); }
.pill.lost, .st.lost { color: #7d8692; }
.pill.pending, .st.pending { color: var(--seal); }

.kv { margin-top: 8px; background: #fff; border: 1px solid var(--line); }
.kv div { display: grid; grid-template-columns: 84px 1fr; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.kv div:first-child { border-top: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; word-break: break-all; }

.status-set { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.status-set button { border: 1px solid var(--line); background: #fff; padding: 7px 10px; font-size: 13px; color: var(--muted); }
.status-set button.on { border-color: var(--navy); color: var(--navy); background: #f4f7fb; }
.hint { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.form-error { margin-top: 8px; color: var(--seal); font-size: 13px; line-height: 1.5; }

.fld { display: block; margin-top: 12px; }
.fld > span, .lbl { display: block; margin-bottom: 6px; font-size: 12px; letter-spacing: 0.08em; color: var(--muted); }
.fld i { color: var(--seal); font-style: normal; margin-left: 2px; }
.fld input, .fld textarea { padding: 11px 12px; }
.fld textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.pre { white-space: pre-wrap; word-break: break-word; line-height: 1.65; }

.tl { list-style: none; margin: 10px 0 0; padding: 0; }
.tl li { position: relative; padding: 0 0 16px 14px; border-left: 1px solid var(--line); }
.tl li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 6px;
  width: 7px;
  height: 7px;
  background: var(--navy);
}
.tl b { font-weight: 600; font-size: 13px; }
.tl time { display: block; color: var(--muted); font-size: 12px; margin: 2px 0 4px; }
.shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.shot {
  position: relative;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
}
.shot img { width: 72px; height: 72px; object-fit: cover; }
.shot .x {
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  border: 0;
  background: rgba(19, 35, 60, 0.78);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  padding: 0;
}

.quote { margin-top: 12px; background: #fff; border: 1px solid var(--line); padding: 12px; }
.quote h3 { font-size: 14px; letter-spacing: 0.12em; }
.quote p { margin-top: 8px; font-size: 14px; line-height: 1.6; }
.quote .sum { margin-top: 8px; font-family: var(--num); font-size: 20px; }

.who { display: flex; gap: 12px; align-items: center; }
.who > b {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #f4f0e6;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  flex: none;
}
.who > b.navy { background: var(--navy); }
.who > b.brass { background: #6e5730; }
.who > b.seal { background: var(--seal); }
.who strong { display: block; font-size: 18px; letter-spacing: 0.08em; }
.who span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }

.gate { position: relative; overflow: hidden; }
.gate-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #f4f0e6;
  font-family: var(--serif);
  font-size: 26px;
}
.gate h2 { margin-top: 14px; font-size: 32px; letter-spacing: 0.2em; }
.roster {
  width: 100%;
  display: flex;
  gap: 12px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
  margin-top: 10px;
}
.roster i { width: 3px; flex: none; background: var(--navy); }
.roster i.field { background: var(--brass); }
.roster i.lawyer { background: var(--seal); }
.roster strong { display: block; font-size: 16px; letter-spacing: 0.08em; }
.roster em { display: block; margin-top: 2px; font-style: normal; color: var(--muted); font-size: 12px; }
.roster small { display: block; margin-top: 4px; color: #8b93a0; font-size: 12px; line-height: 1.45; }

.closed {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 24px;
}
.closed .gate-mark { margin-bottom: 16px; }
.closed h2 { letter-spacing: 0.2em; font-size: 32px; }
.closed p { margin: 10px 0 22px; color: var(--muted); letter-spacing: 0.08em; }
.closed .btn { min-width: 160px; }

.btn {
  height: 44px;
  border: 0;
  background: var(--navy);
  color: #f7f4ee;
  letter-spacing: 0.14em;
  font-size: 15px;
  padding: 0 12px;
}
.btn.ghost { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.btn.danger { background: #fff; color: var(--seal); box-shadow: inset 0 0 0 1px var(--seal); }
.btn:active { opacity: 0.86; }
.pair { display: flex; gap: 8px; }
.pair .btn { flex: 1; }

.paper {
  position: relative;
  margin-top: 12px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 18px 14px 96px;
  min-height: 240px;
}
.paper .firm { text-align: center; letter-spacing: 0.28em; color: var(--muted); font-size: 12px; }
.paper h3 { margin-top: 8px; text-align: center; font-family: var(--serif); font-size: 18px; letter-spacing: 0.18em; font-weight: 600; }
.paper .no { margin-top: 8px; text-align: right; color: var(--muted); font-size: 12px; }
.paper .prose { margin-top: 10px; font-family: var(--serif); font-size: 14px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.rule-grid { margin-top: 12px; background: #fff; border: 1px solid var(--line); }
.rule-grid div { display: grid; grid-template-columns: 1.15fr 0.9fr 0.9fr; gap: 8px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line); }
.rule-grid .rule-h { border-top: 0; color: var(--muted); font-size: 12px; letter-spacing: 0.06em; }
.rule-grid input { width: 100%; border: 1px solid var(--line); background: #fff; padding: 8px; font-size: 16px; }
.paper .chop { position: absolute; right: 8px; bottom: 8px; width: 92px; height: 92px; }
.stamp-slot { display: flex; justify-content: flex-end; min-height: 78px; }
.stamp-slot .chop { width: 78px; height: 78px; }
.chips.vars { margin-top: 8px; }
.reason {
  margin-top: 10px;
  border: 1px solid var(--seal);
  color: #7d2424;
  background: #fff;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
}
.file {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  padding: 10px 12px;
  font-size: 13px;
}
.file:first-child { border-top: 1px solid var(--line); }
.file small { color: var(--muted); }
.file button.x {
  border: 0;
  background: transparent;
  color: var(--seal);
  padding: 0 0 0 8px;
  flex: none;
}

.perm { border: 1px solid var(--line); background: #fff; margin-top: 12px; }
.perm div { display: grid; grid-template-columns: 1.25fr 0.8fr 0.95fr 0.75fr; }
.perm span { padding: 8px 6px; font-size: 12px; line-height: 1.4; border-top: 1px solid var(--line); }
.perm .perm-h span { border-top: 0; color: var(--muted); letter-spacing: 0.04em; }

.empty { padding: 36px 12px; text-align: center; color: var(--muted); }
.empty i { display: block; width: 28px; height: 1px; background: var(--seal); margin: 0 auto 12px; }
.empty p { font-family: var(--serif); letter-spacing: 0.08em; }

.toast {
  position: absolute;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%);
  z-index: 35;
  max-width: 86%;
  background: rgba(19, 35, 60, 0.94);
  color: #f4f0e6;
  padding: 10px 14px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.5;
}
.scrim {
  position: absolute;
  inset: 0;
  z-index: 21;
  border: 0;
  background: rgba(14, 23, 38, 0.48);
  padding: 0;
}
.modal {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 22;
  background: #fff;
  padding: 16px 16px 22px;
}
.modal h3 { font-family: var(--serif); letter-spacing: 0.12em; font-size: 18px; }
.modal p { margin-top: 8px; font-size: 14px; line-height: 1.65; color: #2c3848; }
.modal .pair, .modal .btn { margin-top: 14px; }
.modal.viewer {
  top: 40px;
  bottom: 40px;
  left: 16px;
  right: 16px;
  background: #0e1726;
  display: flex;
  flex-direction: column;
  padding: 12px;
}
.modal.viewer img { margin: auto; max-height: 100%; object-fit: contain; }
.seal-mask {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(14, 23, 38, 0.55);
  display: grid;
  place-items: center;
  color: #f4f0e6;
  text-align: center;
  padding: 24px;
  letter-spacing: 0.08em;
}
.seal-mask b { display: block; margin-top: 8px; font-family: var(--serif); font-size: 18px; font-weight: 500; }
.chop { transform: rotate(-8deg); transform-origin: 50% 50%; animation: chop-in 0.45s ease; }
@keyframes chop-in {
  from { transform: rotate(-18deg) scale(1.35); opacity: 0; }
  to { transform: rotate(-8deg) scale(1); opacity: 0.92; }
}

@media (max-width: 900px) {
  .lot { display: block; padding: 0; }
  .plate { display: none; }
  .device-wrap { width: 100%; height: 100vh; height: 100dvh; }
  .device { border-radius: 0; padding: 0; box-shadow: none; background: #000; }
  .screen { border-radius: 0; }
}
