:root {
  --brand-900: #0e2f24;
  --brand-800: #154433;
  --brand-700: #1b5a44;
  --brand-600: #1f6b4f;
  --brand-500: #2c8462;
  --brand-100: #e6f1eb;
  --brand-50: #f1f7f3;
  --accent-600: #b8791f;
  --accent-500: #c8912f;
  --accent-100: #f8efdc;
  --ink-900: #16241d;
  --ink-700: #2c3b33;
  --ink-500: #5b6b62;
  --ink-400: #7d8b83;
  --line: #e2e8e3;
  --line-strong: #cfd8d1;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --danger: #b0403a;
  --danger-bg: #fbeeed;
  --warn: #a9761c;
  --warn-bg: #fbf3e2;
  --ok: #217a52;
  --ok-bg: #e9f4ee;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 40, 30, 0.05);
  --shadow-md: 0 8px 24px rgba(16, 40, 30, 0.10);
  --font: "Microsoft YaHei", "PingFang SC", "Source Han Sans SC", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand-600); text-decoration: none; }

/* ---------- 布局 ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  grid-template-rows: 100vh;
}

.sidebar {
  background: var(--brand-900);
  color: #dfece5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
.brand .mark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .seal {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(150deg, var(--brand-500), var(--brand-700));
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  flex: none;
}
.brand h1 {
  font-size: 14px;
  margin: 0;
  line-height: 1.35;
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
}
.brand .sub {
  margin-top: 6px;
  font-size: 11.5px;
  color: rgba(223, 236, 229, 0.62);
  letter-spacing: 0.6px;
}

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(231, 243, 237, 0.78);
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 16px; height: 16px; opacity: 0.8; flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-item.active {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  box-shadow: inset 2px 0 0 var(--accent-500);
}
.nav-group-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(223, 236, 229, 0.42);
  padding: 14px 12px 6px;
}

.side-foot {
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 11.5px;
  color: rgba(223, 236, 229, 0.6);
  line-height: 1.7;
}
.side-foot .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #52c48c; margin-right: 6px; vertical-align: 1px; }

.side-declare {
  padding: 10px 16px 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 10.5px;
  line-height: 1.6;
  color: rgba(223, 236, 229, 0.58);
}
.side-declare p { margin: 0; }
.side-declare p + p { margin-top: 3px; }
.side-declare .warn { color: rgba(255, 255, 255, 0.78); }

.main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  flex: none;
}
.topbar .page-title { font-size: 16px; font-weight: 600; color: var(--ink-900); }
.topbar .page-desc { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.topbar .spacer { flex: 1; }

.year-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--ink-700);
}
.year-picker select {
  border: none;
  background: transparent;
  font-weight: 600;
  color: var(--brand-700);
  outline: none;
  padding-right: 4px;
}
.year-picker #year-add {
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--brand-200);
  background: #fff;
  color: var(--brand-700);
}

.lan-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-500);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  background: #fff;
}
.lan-badge strong { color: var(--ink-900); font-weight: 600; }

.content { flex: 1; overflow: auto; padding: 20px 24px 32px; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: var(--ink-700);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: var(--brand-50); }
.btn.primary { background: var(--brand-600); color: #fff; }
.btn.primary:hover { background: var(--brand-700); }
.btn.ghost { border-color: var(--line-strong); background: #fff; }
.btn.ghost:hover { border-color: var(--brand-500); color: var(--brand-700); }
.btn.danger { color: var(--danger); border-color: #eccfcd; background: var(--danger-bg); }
.btn.danger:hover { background: #f6dfdc; }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn.icon-only { padding: 6px; border-radius: 6px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 10px;
  height: 36px;
  min-width: 260px;
}
.search-box svg { width: 15px; height: 15px; color: var(--ink-400); }
.search-box input {
  border: none;
  outline: none;
  background: transparent;
  padding: 0 8px;
  width: 100%;
  height: 100%;
  font-size: 13px;
}
.filter-select {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  font-size: 13px;
  color: var(--ink-700);
  outline: none;
  min-width: 120px;
}
.filter-select:focus, .search-box:focus-within { border-color: var(--brand-500); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head .hint { font-size: 12px; color: var(--ink-500); }
.card-body { padding: 16px 18px; }

.table-wrap { overflow: auto; max-height: calc(100vh - 250px); border-radius: 0 0 var(--radius) var(--radius); }
table.data { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.data thead th {
  position: sticky;
  top: 0;
  background: var(--brand-50);
  color: var(--ink-700);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
  z-index: 1;
}
table.data tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-700);
  line-height: 1.55;
}
table.data tbody tr:hover { background: #fbfdfb; }
table.data tbody tr.clickable { cursor: pointer; }
.cell-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.code-cell { font-family: "Consolas", "SFMono-Regular", monospace; font-size: 12px; color: var(--brand-700); white-space: nowrap; }
.actions-cell { white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.actions-cell .btn { padding: 4px 8px; font-size: 11.5px; }

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-500);
  font-size: 13px;
}
.empty-state svg { width: 34px; height: 34px; color: var(--line-strong); display: block; margin: 0 auto 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 1.7;
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip.gray { background: #f0f2f1; color: var(--ink-500); border-color: #e3e7e4; }
.chip.green { background: var(--ok-bg); color: var(--ok); border-color: #cfe5da; }
.chip.amber { background: var(--warn-bg); color: var(--warn); border-color: #eeddbd; }
.chip.red { background: var(--danger-bg); color: var(--danger); border-color: #ecd0ce; }
.chip.blue { background: #edf2fa; color: #2f5d9c; border-color: #d6e1f2; }

/* ---------- 弹窗 / 抽屉 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(14, 32, 25, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 28px;
  animation: fade 0.12s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  width: min(880px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.sm { width: min(460px, 100%); }
.modal.md { width: min(680px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-head .sub { display: block; margin-top: 3px; font-size: 11.5px; color: var(--ink-500); font-weight: 400; }
.modal-body { padding: 18px 20px; overflow: auto; }
/* 表单页脚左侧的说明文字，占满剩余空间把按钮推到右边 */
.form-hint {
  margin-right: auto;
  align-self: center;
  font-size: 11.5px;
  color: var(--ink-400);
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fcfdfc;
}

.drawer-mask { position: fixed; inset: 0; background: rgba(14, 32, 25, 0.30); z-index: 55; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(600px, 96vw);
  background: #fff;
  z-index: 58;
  box-shadow: -8px 0 28px rgba(16, 40, 30, 0.14);
  display: flex;
  flex-direction: column;
}
.drawer-head { padding: 18px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-head .kicker { font-size: 11.5px; color: var(--ink-500); letter-spacing: 0.5px; }
.drawer-head h3 { margin: 6px 0 0; font-size: 16px; font-weight: 600; line-height: 1.45; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 22px 28px; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
  margin: 22px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.section-title:first-child { margin-top: 0; }

.kv-list { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.kv-list .k {
  background: #f8faf8;
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--ink-500);
}
.kv-list .v {
  background: #fff;
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--ink-900);
  white-space: pre-wrap;
  word-break: break-word;
}

.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fcfdfc;
}
.file-item .meta { flex: 1; min-width: 0; }
.file-item .name { font-size: 12.5px; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .sub { font-size: 11px; color: var(--ink-400); margin-top: 2px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--ink-500); }
.field label .req { color: var(--danger); margin-left: 2px; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  background: #fff;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(44, 132, 98, 0.10);
}
.form-group-title {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-700);
  padding: 6px 0 2px;
  border-bottom: 1px dashed var(--line);
  margin-top: 4px;
}

/* ---------- 概览 ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.kpi .label { font-size: 12px; color: var(--ink-500); }
.kpi .value { font-size: 30px; font-weight: 600; color: var(--ink-900); margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .unit { font-size: 12px; color: var(--ink-400); margin-left: 4px; font-weight: 400; }
.kpi .foot { font-size: 11.5px; color: var(--ink-400); margin-top: 8px; }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%; background: var(--brand-500); opacity: 0.55; }
.kpi.accent::after { background: var(--accent-500); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 14px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.panel h3 { margin: 0 0 4px; font-size: 13.5px; font-weight: 600; }
.panel .lead { font-size: 11.5px; color: var(--ink-400); margin-bottom: 14px; }

.bar-row { display: grid; grid-template-columns: 108px minmax(0, 1fr) 78px; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-row .name { font-size: 12px; color: var(--ink-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 8px; background: #eef2ef; border-radius: 999px; overflow: hidden; position: relative; display: flex; }
.bar-rest { height: 100%; background: linear-gradient(90deg, var(--accent-400), var(--accent-500)); opacity: .85; }
.bar-fill { height: 100%; position: relative; background: linear-gradient(90deg, var(--brand-500), var(--brand-600)); border-radius: 999px; }
.bar-fill .bar-inner { position: absolute; left: 0; top: 0; height: 100%; background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); border-radius: 999px; }
.bar-fill.accent { background: linear-gradient(90deg, var(--accent-500), var(--accent-600)); }
.bar-row .val { font-size: 11.5px; color: var(--ink-500); text-align: right; font-variant-numeric: tabular-nums; }

.stage-flow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.stage-item {
  flex: 1 1 88px;
  min-width: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fcfdfc;
}
.stage-item .n { font-size: 20px; font-weight: 600; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.stage-item .t { font-size: 11px; color: var(--ink-500); margin-top: 2px; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th { text-align: left; color: var(--ink-500); font-weight: 500; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.mini-table td { padding: 8px; border-bottom: 1px solid var(--line); color: var(--ink-700); }
.mini-table td.num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- 档案中心 ---------- */
.tree { display: flex; flex-direction: column; gap: 10px; }
.tree-node { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.tree-node-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  background: #fbfcfb;
}
.tree-node-head:hover { background: var(--brand-50); }
.tree-node-head .t { font-size: 13px; font-weight: 600; }
.tree-node-head .c { font-size: 11.5px; color: var(--ink-400); margin-left: auto; }
.tree-node-body { border-top: 1px solid var(--line); }
.archive-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; flex-wrap: wrap; }
.archive-row:last-child { border-bottom: none; }
.archive-row .code { font-family: Consolas, monospace; color: var(--brand-700); font-size: 11.5px; }
.archive-row .nm { flex: 1; min-width: 160px; color: var(--ink-900); }
.archive-row .cnt { font-size: 11px; color: var(--ink-400); }
.archive-row .ops { display: flex; gap: 6px; }

/* ---------- 模板 / 导出 ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tpl-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.tpl-card .head { display: flex; align-items: flex-start; gap: 10px; }
.tpl-card .doc-ico { width: 34px; height: 40px; border-radius: 5px; background: var(--brand-50); border: 1px solid var(--brand-100); display: grid; place-items: center; color: var(--brand-700); flex: none; font-size: 11px; font-weight: 600; }
.tpl-card .name { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.tpl-card .desc { font-size: 11.5px; color: var(--ink-500); }
.tpl-card .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tpl-card .tags .chip { font-size: 11px; }
.tpl-card .foot { display: flex; gap: 8px; margin-top: auto; }

.placeholder-panel {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fcfdfc;
  font-size: 12px;
  color: var(--ink-500);
  max-height: 220px;
  overflow: auto;
}
.placeholder-panel code {
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--brand-700);
  font-size: 11.5px;
  margin: 0 2px 6px 0;
  display: inline-block;
}

.export-block { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 16px 18px; margin-bottom: 14px; }
.export-block h3 { margin: 0 0 4px; font-size: 13.5px; font-weight: 600; }
.export-block .lead { font-size: 11.5px; color: var(--ink-500); margin-bottom: 14px; line-height: 1.7; }
.export-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.export-controls .ctrl { display: flex; flex-direction: column; gap: 5px; }
.export-controls .ctrl span { font-size: 11.5px; color: var(--ink-500); }
.export-controls input, .export-controls select {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 10px;
  outline: none;
  font-size: 13px;
  background: #fff;
}
.export-controls input:focus, .export-controls select:focus { border-color: var(--brand-500); }
.export-controls .grow { flex: 1 1 320px; min-width: 240px; }
.hint-line { font-size: 11.5px; color: var(--ink-400); margin-top: 10px; line-height: 1.7; }

.result-box {
  margin-top: 14px;
  border-radius: 8px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--ink-700);
  word-break: break-all;
}
.result-box.error { background: var(--danger-bg); border-color: #ecd0ce; color: var(--danger); }

/* ---------- 提示 ---------- */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--brand-500);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--ink-900);
  max-width: 520px;
  animation: fade 0.15s ease-out;
}
.toast.error { border-left-color: var(--danger); color: var(--danger); }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; height: 56px; align-items: center; }
  .brand, .side-foot, .side-declare, .nav-group-label { display: none; }
  .nav { display: flex; gap: 4px; padding: 8px; overflow-x: auto; }
  .nav-item { white-space: nowrap; padding: 8px 10px; }
  .content { padding: 14px; }
  .topbar { padding: 0 14px; gap: 8px; height: 56px; }
  .lan-badge { display: none; }
}

/* ------------------------------ 登录页 ------------------------------ */
body.login-mode { background: #0d2a1e; }
.login-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(circle at 18% 12%, #1d5239 0%, #14392a 44%, #0c261a 100%); padding: 28px 18px;
}
.login-card {
  width: 384px; max-width: 100%; background: #fff; border-radius: 14px; padding: 30px 32px 24px;
  box-shadow: 0 26px 64px rgba(4, 20, 13, .38);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand .seal {
  width: 44px; height: 44px; border-radius: 10px; flex: none; color: #fff; font-size: 21px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #23744c, #14432e);
}
.login-brand h2 { margin: 0; font-size: 14.5px; font-weight: 600; color: #16301f; letter-spacing: .2px; }
.login-brand p { margin: 3px 0 0; font-size: 12px; color: #7d8d84; }
.login-field { display: block; margin-bottom: 13px; }
.login-field span { display: block; font-size: 12px; color: #5d6f66; margin-bottom: 6px; }
.login-field input {
  width: 100%; height: 36px; border: 1px solid #d7e0da; border-radius: 8px; padding: 0 10px;
  font-size: 13px; color: #16301f; outline: none; background: #fbfdfb;
}
.login-field input:focus { border-color: #23744c; background: #fff; box-shadow: 0 0 0 3px rgba(35, 116, 76, .12); }
.login-err { min-height: 18px; color: #c0392b; font-size: 12px; margin: 2px 0 8px; }
.login-btn { width: 100%; height: 38px; font-size: 13.5px; letter-spacing: 2px; justify-content: center; text-align: center; }
.login-tip { margin-top: 16px; font-size: 11.5px; color: #8a9a91; line-height: 1.75; }
.login-foot { font-size: 11.5px; color: rgba(255, 255, 255, .5); }

/* ------------------------------ 侧栏当前用户 ------------------------------ */
.user-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; margin-bottom: 10px; border-radius: 10px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .08);
}
.user-chip .uc-name { font-size: 12.5px; color: #ecf5ef; font-weight: 600; }
.user-chip .uc-role { font-size: 11px; color: rgba(236, 245, 239, .62); margin-top: 2px; }
.user-chip .btn { color: #d8e8de; border-color: rgba(255, 255, 255, .18); }

/* 登录状态下取消主框架的双栏网格 */.login-mode #app { display: block; grid-template-columns: none; grid-template-rows: none; }

/* ------------------------------ 考勤视图切换与逐日考勤 ------------------------------ */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.tabs .tab {
  border: 0; background: transparent; padding: 9px 14px; font-size: 13px;
  color: var(--ink-500); cursor: pointer; border-bottom: 2px solid transparent;
}
.tabs .tab:hover { color: var(--ink-800); }
.tabs .tab.active { color: #1f5138; font-weight: 600; border-bottom-color: #2f6b4f; }

.status-picker {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.status-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
  font-size: 11.5px; color: var(--ink-600); cursor: pointer;
}
.status-chip .mark {
  display: inline-flex; width: 17px; height: 17px; align-items: center; justify-content: center;
  border-radius: 4px; background: var(--st-color, #eee); color: var(--st-font, #333);
  font-weight: 700; font-size: 11px;
}
.status-chip.active { border-color: #2f6b4f; box-shadow: inset 0 0 0 1px #2f6b4f; background: #f3f8f5; }
.status-tip { margin-left: 8px; font-size: 11px; color: var(--ink-400); }

.att-daily-wrap { overflow: auto; max-height: calc(100vh - 320px); }
.att-daily th, .att-daily td { padding: 2px 2px; font-size: 11px; white-space: nowrap; }
.att-daily .stick-1, .att-daily .stick-2 { position: sticky; background: #fff; }
.att-daily { table-layout: fixed; }
.att-daily .stick-1 { left: 0; z-index: 2; width: 34px; }
.att-daily .stick-2 { left: 34px; z-index: 2; width: 76px; }
.att-daily .name-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-daily thead .stick-1, .att-daily thead .stick-2 { z-index: 4; background: #f6f8f7; }
.att-daily tfoot .stick-1, .att-daily tfoot .stick-2 { z-index: 3; }
.att-daily .day-head { cursor: default; text-align: center; width: 38px; min-width: 0; background: #f6f8f7; }
.att-daily .day-head:hover { background: #f6f8f7; }
.att-daily .day-head.weekend { background: #fafafa; color: var(--ink-400); }
.att-daily .dnum { display: block; font-size: 10.5px; }
.att-daily .dweek { display: block; font-size: 9px; color: var(--ink-400); }
.att-daily .half-heads { display: flex; gap: 1px; justify-content: center; margin-top: 2px; }
.att-daily .half-head {
  border: 0; background: transparent; padding: 0; font-size: 8px; line-height: 1.2;
  color: var(--ink-500); cursor: pointer; white-space: nowrap;
}
.att-daily .half-head:hover { color: #1f6b4f; text-decoration: underline; }
.att-daily .cell-td { padding: 2px; text-align: center; }
.att-daily .half-pair { display: flex; gap: 1px; justify-content: center; align-items: center; }
.att-cell {
  width: 16px; height: 19px; padding: 0; border: 1px solid #e3e7e4; border-radius: 3px;
  background: #fff; font-size: 10px; line-height: 1; cursor: pointer;
}
.att-cell.st-none { color: transparent; }
.att-cell.st-work { background: #eef7f1; color: #186a3b; border-color: #cfe5da; }
.att-cell.st-rest { background: #f5f7f6; color: #8a9691; }
.att-cell.st-holiday { background: #fff3d6; color: #9a6412; border-color: #eeddbd; }
.att-cell.st-trip { background: #edf2fa; color: #2f5d9c; border-color: #d6e1f2; }
.att-cell.st-village { background: #e8f3ec; color: #2f6b4f; border-color: #cfe3d6; }
.att-cell.st-personal, .att-cell.st-sick, .att-cell.st-marriage,
.att-cell.st-maternity, .att-cell.st-annual, .att-cell.st-home { background: #fff7e3; color: #8a6a24; }
.att-cell.st-absent { background: #fbe7e6; color: #b23b34; border-color: #ecd0ce; }
.att-cell.st-late, .att-cell.st-early { background: #fef0e4; color: #c26a1c; }
.att-cell:disabled { cursor: default; opacity: .75; }
.att-daily .sum-head {
  font-size: 9px; color: var(--ink-500); width: 30px; min-width: 0; text-align: center; background: #f6f8f7; line-height: 1.25;
}
.att-daily .sum-td { text-align: center; color: var(--ink-700); width: 30px; min-width: 0; }
.att-daily tfoot td { background: #fbfdfb; font-weight: 600; border-top: 1px solid var(--line); }