:root {
  --bg: #eef2f0;
  --bg-glow: #dfe8e4;
  --panel: #fbfcfc;
  --text: #14201c;
  --sub: #3a4a44;
  --muted: #6b7a73;
  --line: #d8e2dc;
  --primary: #0b5c52;
  --primary-deep: #084740;
  --primary-soft: #dceeea;
  --accent: #c45c26;
  --accent-soft: #f8ebe3;
  --danger: #a61b1b;
  --danger-soft: #f8e6e4;
  --warn: #9a6700;
  --warn-soft: #f7efd8;
  --ok: #1b6b3a;
  --ok-soft: #e3f2e9;
  --shadow: 0 1px 0 rgba(20, 32, 28, 0.04), 0 8px 24px rgba(20, 32, 28, 0.06);
  --radius: 10px;
  --radius-lg: 14px;
  --sidebar: 260px;
  --font-ui: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-display: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(11, 92, 82, 0.08), transparent 50%),
    radial-gradient(ellipse 60% 40% at -5% 30%, rgba(27, 75, 107, 0.06), transparent 45%),
    linear-gradient(165deg, var(--bg-glow), var(--bg) 40%, #f4f6f5);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }
::selection { background: var(--primary-soft); color: var(--primary-deep); }

body[data-role="platform"] {
  --primary: #1b4b6b;
  --primary-deep: #13384f;
  --primary-soft: #e2eef5;
}
body[data-role="secretary"] {
  --primary: #6D28D9;
  --primary-deep: #5B21B6;
  --primary-soft: #EDE9FE;
}
body[data-role="cadre"] {
  --primary: #0F766E;
  --primary-deep: #0B5A53;
  --primary-soft: #CCFBF1;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== 登录页：品牌先行 ===== */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(8, 71, 64, 0.88), rgba(20, 32, 28, 0.72)),
    radial-gradient(circle at 20% 80%, rgba(196, 92, 38, 0.25), transparent 40%),
    linear-gradient(160deg, #0b5c52, #1b4b6b);
}
.login-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  pointer-events: none;
}
.login-card {
  position: relative;
  width: min(440px, 100%);
  background: rgba(251, 252, 252, 0.96);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(8, 30, 26, 0.35);
  padding: 44px 40px 36px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: rise-in 0.55s var(--ease) both;
}
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-text strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
}
.brand-text span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(11, 92, 82, 0.28);
}
.login-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.sub {
  color: var(--muted);
  margin: 12px 0 28px;
  font-size: 13px;
  line-height: 1.75;
}
.role-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 26px;
  padding: 4px;
  background: #e8eeea;
  border-radius: 10px;
}
.role-tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 10px 0;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.role-tabs button:hover { color: var(--sub); }
.role-tabs button.on {
  background: var(--panel);
  color: var(--primary-deep);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(20, 32, 28, 0.08);
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--sub);
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  background: #f7f9f8;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #b8c9c1; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: #fff;
}
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding: 4px 0;
}
.check-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f8;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.check-item:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-deep);
}
.check-item input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; }
.village-box {
  max-height: 200px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  background: #f7f9f8;
}
.village-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #e8eeea;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.village-item:hover { background: #eef4f1; }
.village-item:last-child { border-bottom: 0; }
.village-item.on {
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-weight: 600;
}
.picked { font-size: 13px; color: var(--primary); font-weight: 600; margin-bottom: 14px; }
.err { color: var(--danger); min-height: 20px; font-size: 13px; }

/* ===== 整体框架 ===== */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
  animation: fade-in 0.35s var(--ease) both;
}
.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%),
    linear-gradient(185deg, #12352f 0%, #0a221e 55%, #081a17 100%);
  color: #c5d6d1;
  padding: 28px 16px 32px;
  max-height: 100vh;
  overflow-y: auto;
  position: sticky;
  top: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 3px; }
.sidebar .brand {
  color: #fff;
  margin-bottom: 28px;
  padding: 4px 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar .brand-text span { color: rgba(197, 214, 209, 0.65); }
.sidebar .logo {
  width: 44px;
  height: 44px;
  font-size: 20px;
  box-shadow: none;
  background: linear-gradient(145deg, #1a7a6c, #0b5c52);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-section {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 8px;
  margin: 0 2px 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}
.nav-group-mark {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #7ed6c4, #2f9e8c);
  flex-shrink: 0;
}
.nav-group-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #e8f4f0;
  line-height: 1.2;
}
.nav-list {
  position: relative;
  margin: 0 4px 0 12px;
  padding: 2px 0 2px 10px;
  border-left: 1px solid rgba(126, 214, 196, 0.22);
}
.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #9eb5ae;
  padding: 8px 10px 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  margin: 1px 0;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
}
.nav-item::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  width: 7px;
  height: 1px;
  background: rgba(126, 214, 196, 0.28);
  transform: translateY(-50%);
}
.nav-item-label { position: relative; z-index: 1; }
.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f2faf7;
  transform: translateX(2px);
}
.nav-item.on {
  background: rgba(94, 188, 173, 0.18);
  color: #fff;
  font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(126, 214, 196, 0.22);
}
.nav-item.on::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7ed6c4;
  left: -14px;
  box-shadow: 0 0 0 3px rgba(126, 214, 196, 0.18);
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 68px;
  background: rgba(251, 252, 252, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
}
.nav-backdrop { display: none; }
.topbar-title .eyebrow {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.topbar-title .page-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--text);
}
.who {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: right;
}
.who-meta { line-height: 1.35; }
.who b { display: block; font-size: 14px; font-weight: 650; }
.who span { color: var(--muted); font-size: 12px; }
.content {
  padding: 28px 32px 64px;
  animation: rise-in 0.4s var(--ease) both;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: -8px 0 22px;
  padding: 12px 0 10px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(180deg, #f4f7f5 72%, rgba(244, 247, 245, 0));
}
.page-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--text);
}
.page-head h2::before { display: none; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tools-secondary {
  width: 100%;
  margin-top: 4px;
  opacity: 0.96;
}
.tools select,
.tools input[type="text"],
.tools input:not([type]),
.tools input[placeholder] {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #f7f9f8;
  color: var(--text);
  min-height: 36px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.tools select:focus,
.tools input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: #fff;
}
.page-lead {
  margin: -8px 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  max-width: 52em;
}
.page-head-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.page-head-block .page-lead { margin: 0; }

/* ===== 指标卡 ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 18px 20px 20px;
  border: 1px solid rgba(216, 226, 220, 0.9);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  opacity: 0.85;
}
.stat:hover {
  transform: translateY(-3px);
  border-color: #b7cdc4;
}
.stat .k {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.stat .v {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  margin-top: 10px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--text);
}
.stat--alert::before { background: var(--danger); }
.stat--alert .v { color: var(--danger); }
.stat--warn::before { background: var(--warn); }
.stat--warn .v { color: var(--warn); }
.stat--ok::before { background: var(--ok); }
.stat--accent::before { background: var(--accent); }

/* ===== 驾驶舱（对齐书记端节奏） ===== */
.cockpit-brief {
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 16px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary-deep), var(--primary));
  box-shadow: var(--shadow);
  animation: rise-in 0.4s var(--ease) both;
}
.cockpit-brief.danger { background: linear-gradient(145deg, #991B1B, #B91C1C); }
.cockpit-brief.warn { background: linear-gradient(145deg, #9A3412, #C2410C); }
.cockpit-brief.ok { background: linear-gradient(145deg, var(--primary-deep), var(--primary)); }
.cockpit-brief-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.cockpit-brief-kicker { font-size: 12px; opacity: 0.85; letter-spacing: 0.12em; font-weight: 600; }
.cockpit-brief-text { margin-top: 8px; font-size: 18px; font-weight: 700; line-height: 1.45; max-width: 640px; font-family: var(--font-display); }
.cockpit-brief-cta {
  flex-shrink: 0; border: 0; cursor: pointer;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(255,255,255,0.2); color: #fff; font-weight: 600; font-size: 13px;
}
.cockpit-brief-cta:hover { background: rgba(255,255,255,0.3); }
.cockpit-primary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.cockpit-tile {
  border: 1px solid rgba(216, 226, 220, 0.9);
  background: var(--panel); border-radius: var(--radius-lg);
  padding: 18px 14px; text-align: center; cursor: pointer;
  box-shadow: var(--shadow); transition: transform 0.2s var(--ease);
}
.cockpit-tile:hover { transform: translateY(-2px); border-color: var(--primary); }
.cockpit-tile b {
  display: block; font-family: var(--font-display);
  font-size: 28px; font-weight: 700; color: var(--primary-deep); line-height: 1.1;
}
.cockpit-tile span { display: block; margin-top: 8px; font-size: 13px; color: var(--sub); font-weight: 600; }
.cockpit-tile.danger { background: #FEF2F2; border-color: #FECACA; }
.cockpit-tile.danger b { color: var(--danger); }
.stats-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
.stats-tile {
  border: 1px solid rgba(216, 226, 220, 0.9);
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.stats-tile:hover { border-color: var(--primary); }
.stats-tile.on {
  background: #ECFDF5;
  box-shadow: inset 0 0 0 2px var(--primary);
}
.stats-tile b {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-deep);
  line-height: 1.1;
}
.stats-tile span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--sub);
  font-weight: 600;
}
.cockpit-must .must-row {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 14px 4px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; cursor: pointer; text-align: left;
}
.cockpit-must .must-row:last-of-type { border-bottom: 0; }
.cockpit-must .must-row strong { display: block; font-size: 15px; color: var(--text); }
.cockpit-must .must-row em { display: block; margin-top: 2px; font-style: normal; font-size: 12px; color: var(--muted); }
.cockpit-must .must-row.danger { box-shadow: inset 3px 0 0 var(--danger); padding-left: 12px; }
.cockpit-must .must-row.warn { box-shadow: inset 3px 0 0 var(--warn); padding-left: 12px; }
.must-arrow { color: var(--muted); font-size: 18px; }
.must-ok {
  background: var(--ok-soft); color: var(--ok); border-radius: 10px;
  padding: 14px 16px; font-weight: 600; font-size: 14px;
}
.cockpit-brief-meta { margin-top: 8px; font-size: 12px; opacity: 0.8; }
.tl-row {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 10px;
  padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.tl-row:last-child { border-bottom: 0; }
.tl-row b { color: var(--primary-deep); }
.tl-row em { font-style: normal; color: var(--muted); }
.cockpit-links { display: flex; flex-direction: column; }
.link-row {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 14px 2px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; cursor: pointer; font-size: 14px; color: var(--text); font-weight: 500;
}
.link-row:last-child { border-bottom: 0; }
.link-row:hover { color: var(--primary-deep); }
.link-row .sub { color: var(--muted); font-size: 12px; font-weight: 400; }

/* ===== 台账分组目录 ===== */
.ledger-catalog { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.ledger-group {
  background: var(--panel); border-radius: var(--radius-lg);
  border: 1px solid rgba(216, 226, 220, 0.85); box-shadow: var(--shadow); overflow: hidden;
}
.ledger-group-hd {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border: 0; background: transparent; cursor: pointer; text-align: left;
}
.ledger-group-hd b { font-size: 15px; color: var(--text); margin-right: 10px; }
.ledger-group-hd em { font-style: normal; color: var(--primary); font-weight: 700; font-size: 13px; }
.ledger-group-hd .muted { color: var(--muted); font-size: 12px; }
.ledger-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 16px 16px;
}
.ledger-chip {
  border: 1px solid var(--line); background: #F3F4F6; color: #374151;
  border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.ledger-chip i { font-style: normal; color: var(--primary); font-weight: 700; }
.ledger-chip.on, .ledger-chip:hover {
  background: var(--primary-soft); color: var(--primary-deep); border-color: transparent; font-weight: 600;
}

.goods-cell { display: flex; align-items: center; gap: 10px; }
.goods-thumb {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  background: #EEF2F0; flex-shrink: 0;
}

/* ===== 面板与表格 ===== */
.panel {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  border: 1px solid rgba(216, 226, 220, 0.85);
  margin-bottom: 16px;
}
.panel > h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.panel > .table-wrap {
  margin: -6px -8px 0;
}
.panel > .table-wrap:first-child {
  margin-top: -10px;
}
.panel > .pager {
  margin: 8px -4px -6px;
}
.table-wrap { width: 100%; overflow-x: auto; }
.table-cap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}
.table-cap-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--primary), #5cbcad);
  flex-shrink: 0;
}
.table-cap-meta {
  margin-left: auto;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #e8efeb;
  font-size: 14px;
  vertical-align: middle;
}
th {
  color: var(--muted);
  font-weight: 650;
  font-size: 12px;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #f0f5f2, #eaf1ed);
  white-space: nowrap;
  border-bottom: 1px solid #d5e0da;
}
tbody tr {
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}
tbody tr:nth-child(even) { background: rgba(240, 247, 243, 0.55); }
tbody tr:hover {
  background: #e7f3ee;
}
tbody tr:last-child td { border-bottom: 0; }
td .cell-title {
  font-weight: 650;
  color: var(--text);
  letter-spacing: 0.01em;
}
td .cell-sub {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 400;
}
.cell-code {
  display: inline-flex;
  align-items: center;
  font-family: "Cascadia Mono", "Sarasa Mono SC", "Consolas", monospace;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 6px;
  background: #e8f1ed;
  color: var(--primary-deep);
  border: 1px solid #c9ddd4;
}
.cell-mute {
  color: #9aaba3;
  font-variant-numeric: tabular-nums;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.chip-party { background: #fde8e6; color: #9b2c2c; border-color: #f3c9c4; }
.chip-civil { background: #e7f0fb; color: #1d4f91; border-color: #c5d8f0; }
.chip-safe { background: #fff1df; color: #9a5b00; border-color: #efd4a8; }
.chip-agri { background: #e6f6ea; color: #1f6b3a; border-color: #b9dfc4; }
.chip-eco { background: #eef0ff; color: #3f3d9a; border-color: #cfd3f5; }
.chip-grid { background: #e8f7f4; color: #0b5c52; border-color: #b7ddd5; }
.chip-default { background: #eef2f0; color: #3a4a44; border-color: #d5dfd9; }

.panel-note {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: linear-gradient(120deg, #f3f8f5, #eef4f8);
  border: 1px dashed #c5d6cd;
  color: var(--sub);
  font-size: 13px;
  line-height: 1.7;
}

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
  background: #e8eeea;
  color: #3a4a44;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--danger-soft); color: var(--danger); }
.tag.pri { background: var(--primary-soft); color: var(--primary-deep); }

/* ===== 按钮 ===== */
.btn {
  border: 0;
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  background: #e5ece8;
  color: var(--sub);
  font-weight: 550;
  transition: background 0.18s var(--ease), transform 0.15s var(--ease), color 0.18s;
}
.btn:hover { background: #d5e0db; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--primary);
  color: #fff;
}
.btn.primary:hover { background: var(--primary-deep); }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--sub);
}
.btn.ghost:hover { border-color: #a9bfb6; background: rgba(255, 255, 255, 0.7); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover { background: #f0d4d0; }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }
.btn:disabled, .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn:focus-visible,
.tools select:focus-visible,
.tools input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty {
  color: var(--muted);
  padding: 48px 16px;
  text-align: center;
  font-size: 14px;
  border: 1px dashed #d5e0da;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7faf8, #fff);
}

/* ===== 分页 ===== */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 16px 10px;
  color: var(--muted);
  font-size: 13px;
}

/* ===== 浮层 ===== */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #14201c;
  color: #f4f7f5;
  padding: 13px 20px;
  border-radius: 10px;
  z-index: 30;
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: rise-in 0.3s var(--ease) both;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 28, 24, 0.45);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 16px;
  animation: fade-in 0.2s ease both;
}
.modal-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--panel);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 20px 48px rgba(10, 28, 24, 0.22);
  border: 1px solid var(--line);
  animation: rise-in 0.3s var(--ease) both;
}
.modal-card h3 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.03em;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 30;
  }
  body.nav-open .nav-backdrop { display: block; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(86vw, 300px);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    overflow-y: auto;
    max-height: 100vh;
    padding: 16px 14px 28px;
    background: #12352f;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar .brand {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }
  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
    padding-bottom: 12px;
  }
  .nav-section {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .nav-group { display: flex; }
  .nav-list {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .nav-item {
    width: 100%;
    white-space: nowrap;
    margin: 0 0 4px;
  }
  .nav-item::before { display: none; }
  .nav-item.on {
    box-shadow: none;
    background: rgba(220, 238, 234, 0.2);
  }
  .nav-item:hover { transform: none; }
  .cards { grid-template-columns: 1fr 1fr; }
  .cockpit-primary { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; height: auto; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
  .content { padding: 20px 16px 40px; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .cockpit-primary { grid-template-columns: 1fr 1fr; }
  .cockpit-brief-main { flex-direction: column; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .login-card { padding: 32px 24px 28px; }
  .who { flex-direction: column; align-items: flex-end; gap: 6px; }
}
