/* ============================================================
   诺驰资料回传 · 管理后台
   设计语言：暖中性色 + 陶土色强调 + 细描边（不用阴影堆叠）
   纯原生 CSS，无外部字体 / 图标 / CDN 依赖。
   类名与 app.js / index.html 一字不差，只换皮不换结构。
   ============================================================ */

:root {
  /* --- 底色：暖纸感，不是冷灰 --- */
  --bg:          #f5f4ef;
  --panel:       #ffffff;
  --panel-2:     #faf9f6;
  --panel-3:     #f0eee6;
  --line:        #e7e4db;
  --line-2:      #d7d3c6;

  /* --- 文字 --- */
  --text:        #1c1b19;
  --text-2:      #5d5a53;
  --text-3:      #8f8b82;

  /* --- 强调色：陶土 --- */
  --accent:      #b85c38;
  --accent-h:    #a04e2d;
  --accent-soft: #f8ece6;
  --accent-band: rgba(184, 92, 56, .14);

  /* --- 语义色（都压低饱和度，跟暖底不打架） --- */
  --green:       #3f7a52;
  --green-soft:  #e8f1e9;
  --green-line:  #c9e0cd;
  --red:         #b0392f;
  --red-soft:    #f9ebe8;
  --red-line:    #eecdc7;
  --orange:      #9a6b1f;
  --orange-soft: #f7f0df;
  --orange-line: #e8d9b6;
  --blue:        #35618f;
  --blue-soft:   #e9eff6;
  --blue-line:   #cadcec;
  --purple:      #64548c;
  --purple-soft: #efebf6;
  --purple-line: #d9d1ea;
  --gray-soft:   #f1f0eb;

  --radius:      10px;
  --radius-sm:   7px;
  --sidebar-w:   224px;
  --shadow-1:    0 1px 2px rgba(28, 27, 25, .04);
  --shadow-2:    0 10px 30px -8px rgba(28, 27, 25, .18), 0 2px 6px rgba(28, 27, 25, .06);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", "PingFang SC", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #171614;
    --panel:       #201f1c;
    --panel-2:     #1b1a18;
    --panel-3:     #26241f;
    --line:        #322f2a;
    --line-2:      #443f37;
    --text:        #ece9e2;
    --text-2:      #a9a49a;
    --text-3:      #7d786f;
    --accent:      #d97757;
    --accent-h:    #e2866a;
    --accent-soft: #34241d;
    --accent-band: rgba(217, 119, 87, .2);
    --green:       #7fb894;
    --green-soft:  #1d2a20;
    --green-line:  #33503c;
    --red:         #e08a80;
    --red-soft:    #2e1e1c;
    --red-line:    #573531;
    --orange:      #d8ae6b;
    --orange-soft: #2b2417;
    --orange-line: #4e4128;
    --blue:        #8fb4d8;
    --blue-soft:   #1a232c;
    --blue-line:   #2f4055;
    --purple:      #b3a5d6;
    --purple-soft: #241f2f;
    --purple-line: #3d3552;
    --gray-soft:   #26241f;
    --shadow-1:    0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2:    0 14px 36px -10px rgba(0, 0, 0, .6), 0 2px 8px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.005em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
::selection { background: var(--accent-band); }

.boot-loading {
  padding: 96px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* ============================================================
   登录 / 强制改密码
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 50% -180px, var(--accent-band) 0%, rgba(0, 0, 0, 0) 72%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 372px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 28px 22px;
  box-shadow: var(--shadow-2);
}

.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; }

.login-logo {
  width: 40px; height: 40px; border-radius: 10px; flex: 0 0 40px;
  background: var(--text); color: var(--panel);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 600;
}
.login-logo.warn { background: var(--orange); color: #fff; }

.login-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.login-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-note {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--text-3); line-height: 1.7;
}

.btn-block { width: 100%; margin-top: 6px; }
.btn-block + .btn-block { margin-top: 8px; }
.login-card .btn-block:last-child { margin-bottom: 0; }

/* ============================================================
   表单元素
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12px; color: var(--text-2); font-weight: 500; letter-spacing: .01em; }
.field-hint { font-size: 12px; color: var(--text-3); }

input[type="text"], input[type="password"], input[type="date"],
input[type="number"], input[type="search"], select, textarea {
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  width: 100%;
  min-width: 0;
  transition: border-color .12s ease, box-shadow .12s ease;
}
/* 单行控件统一成同一个高度：select 默认比 input 矮、date 又比 text 高，
   不钉死高度的话同一行的输入框上下沿全是对不齐的 */
input[type="text"], input[type="password"], input[type="date"],
input[type="number"], input[type="search"], select {
  height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1.4;
}
/* 文件选择框也拉齐到同一高度，否则它只有 25px，孤零零一行显得特别小 */
input[type="file"] { font: inherit; font-size: 13px; color: var(--text-2); height: 36px; padding: 0; width: 100%; }
input[type="file"]::file-selector-button {
  font: inherit;
  font-size: 12.5px;
  height: 26px;
  margin: 0 10px 0 0;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--panel-3); border-color: var(--text-3); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover:not(:disabled), select:hover:not(:disabled) { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-band);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--panel-3); color: var(--text-3); cursor: not-allowed;
}
textarea { resize: vertical; min-height: 68px; line-height: 1.6; }
select { cursor: pointer; }

input[type="checkbox"], input[type="radio"] {
  width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer; vertical-align: -2px;
  margin: 0;
}
.check {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none;
}
.check:hover { color: var(--text); }
.check input:disabled { cursor: not-allowed; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 13px; font-weight: 500;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover:not(:disabled) { background: var(--panel-2); border-color: var(--text-3); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-band); }
.btn:active:not(:disabled) { background: var(--panel-3); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }

.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-h); border-color: var(--accent-h); }
.btn-primary:active:not(:disabled) { background: var(--accent-h); }

.btn-danger { color: var(--red); border-color: var(--red-line); background: var(--panel); }
.btn-danger:hover:not(:disabled) { background: var(--red-soft); border-color: var(--red); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--panel-3); border-color: transparent; color: var(--text); }

.btn-link {
  background: none; border: none; padding: 0; font: inherit; font-size: 13px;
  color: var(--accent); cursor: pointer;
}
.btn-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.btn-link:disabled { opacity: .45; cursor: not-allowed; }
.btn-link.danger { color: var(--red); }

/* ============================================================
   主布局
   ============================================================ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--panel-3);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line);
}
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px;
  background: var(--text); color: var(--panel);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
}
.brand-text { min-width: 0; }
.brand-name { font-size: 13.5px; font-weight: 600; color: var(--text); letter-spacing: -.005em; }
.brand-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

.nav { flex: 1 1 auto; overflow-y: auto; padding: 8px 10px 16px; }
.nav-group {
  font-size: 11px; color: var(--text-3); font-weight: 600;
  letter-spacing: .07em;
  padding: 16px 8px 6px;
  user-select: none;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--text-2);
  font: inherit; font-size: 13px;
  text-align: left; cursor: pointer;
  margin-bottom: 1px;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: rgba(28, 27, 25, .05); color: var(--text); }
.nav-item.active {
  background: var(--panel); color: var(--text);
  border-color: var(--line); font-weight: 500;
  box-shadow: var(--shadow-1);
}
@media (prefers-color-scheme: dark) {
  .nav-item:hover { background: rgba(255, 255, 255, .05); }
}
.nav-icon {
  width: 16px; text-align: center; font-size: 13px; flex: 0 0 16px;
  color: var(--text-3);
}
.nav-item.active .nav-icon { color: var(--accent); }
.nav-text { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.side-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--text-3); line-height: 1.6;
}

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 0 26px;
  height: 56px;
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.top-right { display: flex; align-items: center; gap: 4px; }
.who { text-align: right; margin-right: 10px; line-height: 1.25; }
.who-name { font-size: 12.5px; font-weight: 500; }
.who-role { font-size: 11.5px; color: var(--text-3); }

.content {
  padding: 22px 26px 64px;
  flex: 1 1 auto; min-width: 0;
  max-width: 1440px; width: 100%;
}

.no-perm {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--orange-soft);
  border: 1px solid var(--orange-line);
  border-radius: var(--radius-sm);
  color: var(--orange);
  font-size: 13px;
}

/* ============================================================
   卡片
   ============================================================ */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.card-title {
  font-size: 13.5px; font-weight: 600; letter-spacing: -.005em;
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.card-desc { font-size: 12px; color: var(--text-3); font-weight: 400; }
.card-body { padding: 16px; }
.card-body.tight { padding: 12px 16px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); }

/* ============================================================
   数字卡片
   ============================================================ */
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 15px;
}
.stat-label {
  font-size: 11.5px; color: var(--text-3); font-weight: 500;
  letter-spacing: .03em;
  display: flex; align-items: center; gap: 6px;
}
.stat-value {
  font-size: 26px; font-weight: 600; letter-spacing: -.025em;
  line-height: 1.2; margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.stat-value .unit { font-size: 12.5px; font-weight: 500; color: var(--text-3); margin-left: 3px; letter-spacing: 0; }
.stat-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }

.stat.gap-danger { border-color: var(--red-line); background: var(--red-soft); }
.stat.gap-danger .stat-value { color: var(--red); }
.stat.gap-danger .stat-label { color: var(--red); }
.stat.gap-warn { border-color: var(--orange-line); background: var(--orange-soft); }
.stat.gap-warn .stat-value { color: var(--orange); }
.stat.gap-warn .stat-label { color: var(--orange); }
.stat.plain-blue { border-color: var(--blue-line); background: var(--blue-soft); }
.stat.plain-blue .stat-value { color: var(--blue); }

/* ============================================================
   表格
   ============================================================ */
.scroll-x { width: 100%; overflow-x: auto; }
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 100%;
}
table.tbl th, table.tbl td {
  padding: 9px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
table.tbl th {
  background: var(--panel-2);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--text-3);
  position: sticky; top: 0; z-index: 1;
}
table.tbl tbody tr { transition: background .1s ease; }
table.tbl tbody tr:hover { background: var(--panel-2); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.wrap, table.tbl th.wrap { white-space: normal; min-width: 190px; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .row-actions { display: flex; gap: 14px; align-items: center; }

td.muted, .muted { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -.01em; }
.strong { font-weight: 600; color: var(--text); }
.nowrap { white-space: nowrap; }
.small { font-size: 12px; }
.center { text-align: center; }
.right { text-align: right; }
.ellipsis {
  max-width: 260px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; display: inline-block; vertical-align: bottom;
}
.kind { font-family: var(--mono); font-size: 12px; color: var(--text-3); }

.empty {
  padding: 44px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.9;
}

/* ============================================================
   状态标签
   ============================================================ */
.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11.5px;
  line-height: 17px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tag-green  { background: var(--green-soft);  color: var(--green);  border-color: var(--green-line); }
.tag-red    { background: var(--red-soft);    color: var(--red);    border-color: var(--red-line); }
.tag-blue   { background: var(--blue-soft);   color: var(--blue);   border-color: var(--blue-line); }
.tag-orange { background: var(--orange-soft); color: var(--orange); border-color: var(--orange-line); }
.tag-gray   { background: var(--gray-soft);   color: var(--text-2); border-color: var(--line); }
.tag-purple { background: var(--purple-soft); color: var(--purple); border-color: var(--purple-line); }

.tag-row { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }

/* ============================================================
   进度条
   ============================================================ */
.progress {
  position: relative;
  height: 6px;
  min-width: 92px;
  background: var(--panel-3);
  border-radius: 3px;
  overflow: hidden;
}
.progress > i {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .3s ease;
}
.progress.done > i { background: var(--green); }
.progress-line { display: flex; align-items: center; gap: 9px; }
.progress-num {
  font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums;
  min-width: 46px; font-family: var(--mono);
}

/* ============================================================
   工具条 / 筛选
   ============================================================ */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.toolbar .tb-item { display: flex; flex-direction: column; gap: 5px; min-width: 136px; }
.toolbar .tb-item.wide { min-width: 196px; }
.toolbar .tb-label {
  font-size: 11.5px; color: var(--text-3); font-weight: 500; letter-spacing: .03em;
}
.toolbar .tb-actions { display: flex; gap: 8px; align-items: center; }
.toolbar .tb-spacer { flex: 1 1 auto; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ============================================================
   提示条
   ============================================================ */
.alert {
  display: flex; gap: 9px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.7;
  border: 1px solid transparent;
  margin-bottom: 14px;
}
.alert:last-child { margin-bottom: 0; }
.alert-info   { background: var(--blue-soft);   border-color: var(--blue-line);   color: var(--blue); }
.alert-warn   { background: var(--orange-soft); border-color: var(--orange-line); color: var(--orange); }
.alert-danger { background: var(--red-soft);    border-color: var(--red-line);    color: var(--red); }
.alert-ok     { background: var(--green-soft);  border-color: var(--green-line);  color: var(--green); }
.alert strong { font-weight: 600; }
.alert-icon { flex: 0 0 auto; opacity: .85; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; }

/* ============================================================
   对话框
   ============================================================ */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(28, 27, 25, .5);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 52px 16px 24px;
  overflow-y: auto;
  animation: mask-in .12s ease-out;
}
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 100%;
  max-width: 468px;
  box-shadow: var(--shadow-2);
  animation: modal-in .14s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-6px) scale(.995); }
  to { opacity: 1; transform: none; }
}
.modal.modal-wide { max-width: 700px; }
.modal.modal-xwide { max-width: 960px; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-title { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.modal-x {
  border: 0; background: none; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--text-3);
  padding: 3px 6px; border-radius: 6px;
}
.modal-x:hover { background: var(--panel-3); color: var(--text); }
.modal-body { padding: 18px; max-height: calc(100vh - 220px); overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 0 0 12px 12px;
}
.modal .field + .field, .modal .field + .alert, .modal .alert + .field, .modal .alert + .alert { margin-top: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 13px; }
.form-grid .span-2 { grid-column: 1 / -1; }
/* 网格里的间距交给 gap，别再叠一层 .field + .field 的 margin，
   否则同一行第一个字段贴着顶、后面几个统统下沉 13px，看着就是歪的 */
.modal .form-grid > .field { margin-top: 0; }
/* 宽弹窗里强制两列，比 auto-fit 挤出来的三列更好看（四列字段刚好排成井字） */
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ============================================================
   授权编辑
   ============================================================ */
.grant-box { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.grant-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) minmax(190px, 1.6fr) minmax(150px, 1fr) 76px;
  gap: 10px;
  align-items: center;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.grant-row:last-child { border-bottom: 0; }
.grant-row:nth-child(even) { background: var(--panel-2); }
.grant-head {
  background: var(--panel-3) !important;
  font-size: 11.5px; color: var(--text-3); font-weight: 500; letter-spacing: .04em;
}
.grant-shop { font-weight: 500; }
.grant-off { opacity: .5; }

/* ============================================================
   一次性密码
   ============================================================ */
.onetime {
  border: 1px solid var(--orange-line);
  background: var(--orange-soft);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  margin-bottom: 14px;
}
.onetime-title { font-size: 12.5px; font-weight: 600; color: var(--orange); margin-bottom: 9px; letter-spacing: .02em; }
.onetime-pw {
  font-family: var(--mono);
  font-size: 19px; font-weight: 600; letter-spacing: .06em;
  color: var(--text);
  background: var(--panel); border: 1px dashed var(--orange-line); border-radius: 7px;
  padding: 9px 13px; display: inline-block;
  user-select: all;
}

/* ============================================================
   Toast
   ============================================================ */
.toast-root {
  position: fixed; top: 16px; right: 16px; z-index: 300;
  display: flex; flex-direction: column; gap: 9px;
  max-width: 372px;
}
.toast {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--panel);
  background: var(--text);
  box-shadow: var(--shadow-2);
  animation: toast-in .16s ease-out;
  word-break: break-word;
  line-height: 1.6;
}
.toast.ok   { background: var(--green); }
.toast.err  { background: var(--red); }
.toast.warn { background: var(--orange); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   小工具
   ============================================================ */
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); margin: 15px 0; }
.pager {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-2);
}
.pager .tb-spacer { flex: 1 1 auto; }
.file-list { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.loading { padding: 36px; text-align: center; color: var(--text-3); font-size: 13px; }

/* 滚动条：细、暖色，别抢眼 */
.scroll-x::-webkit-scrollbar, .modal-body::-webkit-scrollbar, .nav::-webkit-scrollbar { height: 10px; width: 10px; }
.scroll-x::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb, .nav::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 5px; border: 3px solid transparent; background-clip: content-box;
}
.scroll-x::-webkit-scrollbar-thumb:hover, .nav::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

@media (max-width: 900px) {
  :root { --sidebar-w: 196px; }
  .content { padding: 18px 16px 48px; }
  .topbar { padding: 0 16px; }
  .grant-row { grid-template-columns: 1fr 1fr; }
}
