/* =========================================================================
   萤火博客 · 主题层（theme.css）—— 简约清新（默认浅色）+ 可选深色
   -------------------------------------------------------------------------
   视觉基调：白底、薄荷青（流萤青）点缀、暖金点缀；细边框、大留白、柔和阴影。
   全部由 CSS 绘制，不使用任何官方美术素材。
   两种主题共用同一批变量名，靠 html[data-theme] 切换。
   ========================================================================= */

/* 万能补丁：作者样式里的 display 会盖过 HTML 的 [hidden]，这里强制收回。
   之前的管理台"登录后看不到控制台"就是这个坑。 */
[hidden] { display: none !important; }

:root {
  /* 底色：极浅的薄荷灰白 */
  --bg: #f5faf8;
  --bg-grad-1: #eaf6f2;
  --bg-grad-2: #fdf7ec;
  --surface: #ffffff;
  --surface-2: #f3f8f6;
  --surface-3: #eaf3f0;

  /* 线 */
  --line: #e4eeeb;
  --line-strong: #cfe2dd;

  /* 文字 */
  --ink: #16302f;
  --ink-2: #3d5a58;
  --muted: #78908e;
  --faint: #a3b5b3;
  --on-accent: #ffffff;

  /* 流萤青 + 萤金 */
  --accent: #2fbfa0;
  --accent-strong: #1ba086;
  --accent-soft: #e6f7f2;
  --accent-line: rgba(47, 191, 160, 0.35);
  --warm: #dfa73f;
  --warm-soft: #fdf3e0;
  --danger: #d9635f;
  --danger-soft: #fdeeee;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-1: 0 1px 2px rgba(22, 48, 47, 0.04), 0 8px 24px rgba(22, 48, 47, 0.06);
  --shadow-2: 0 2px 6px rgba(22, 48, 47, 0.05), 0 18px 40px rgba(22, 48, 47, 0.09);
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  /* 背景媒体默认参数（管理员在后台改） */
  --bg-opacity: 0.25;
  --bg-blur: 0px;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b1418;
  --bg-grad-1: #10222a;
  --bg-grad-2: #16221c;
  --surface: #101d23;
  --surface-2: #152730;
  --surface-3: #1a303a;

  --line: rgba(160, 220, 205, 0.14);
  --line-strong: rgba(160, 220, 205, 0.3);

  --ink: #e8f4f1;
  --ink-2: #bcd3cf;
  --muted: #8ba5a2;
  --faint: #6d8583;
  --on-accent: #04211c;

  --accent: #4fd6b5;
  --accent-strong: #6fe3c4;
  --accent-soft: rgba(79, 214, 181, 0.12);
  --accent-line: rgba(79, 214, 181, 0.35);
  --warm: #f0cf8a;
  --warm-soft: rgba(240, 207, 138, 0.12);
  --danger: #f08a86;
  --danger-soft: rgba(240, 138, 134, 0.12);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.4), 0 18px 44px rgba(0, 0, 0, 0.45);

  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 620px at 82% -8%, var(--bg-grad-1) 0%, transparent 62%),
    radial-gradient(760px 560px at 4% 104%, var(--bg-grad-2) 0%, transparent 58%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.75;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------------------------------------------------------------- 背景层 */

.bg-layer { position: fixed; inset: 0; z-index: -3; overflow: hidden; }

.bg-media {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.bg-media.is-on { opacity: var(--bg-opacity, 0.25); }
.bg-media.blurred { filter: blur(var(--bg-blur, 0px)); transform: scale(1.06); }

/* 浅色下用白纱，深色下用黑纱，保证文字对比度。
   抽成变量是为了让**管理台预览**和访客页用同一块薄纱，避免两边各写一套而后走偏。 */
:root {
  --bg-scrim: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.55) 45%, rgba(255, 255, 255, 0.78) 100%);
}
html[data-theme="dark"] {
  --bg-scrim: linear-gradient(180deg, rgba(6, 12, 16, 0.88) 0%, rgba(6, 12, 16, 0.72) 45%, rgba(6, 12, 16, 0.9) 100%);
}
.bg-overlay {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: var(--bg-scrim);
}

/* 萤火：小而淡，只做氛围，不抢内容 */
.fireflies { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.firefly {
  position: absolute;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: drift linear infinite;
}
html[data-theme="dark"] .firefly {
  box-shadow: 0 0 10px 2px rgba(111, 227, 196, 0.7);
}
.firefly.warm { background: var(--warm); }

@keyframes drift {
  0%   { transform: translate3d(0, 10vh, 0) scale(0.6); opacity: 0; }
  15%  { opacity: 0.45; }
  70%  { opacity: 0.3; }
  100% { transform: translate3d(var(--dx, 40px), -100vh, 0) scale(1); opacity: 0; }
}

.meteor { display: none; }   /* 简约风：去掉流星装饰，保留选择器兼容 */

/* ---------------------------------------------------------------- 排版 */

a { color: var(--accent-strong); text-decoration: none; }
a:hover { filter: brightness(0.92); }

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.35; letter-spacing: 0.01em; color: var(--ink); }

.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

/* ---------------------------------------------------------------- 顶栏 */

.top {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; gap: 16px; padding: 13px 0; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink); }
.brand .spark {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.brand small { color: var(--faint); font-weight: 400; letter-spacing: 0.16em; font-size: 11px; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav a {
  padding: 6px 12px; border-radius: 999px; color: var(--ink-2); font-size: 14px;
  transition: background 0.16s ease, color 0.16s ease;
}
.nav a:hover { background: var(--accent-soft); color: var(--accent-strong); }
.nav a.admin-entry { color: var(--muted); }
.nav a.admin-entry:hover { background: var(--warm-soft); color: var(--warm); }

/* ---------------------------------------------------------------- 卡片 */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-1);
}
.section { margin: 30px 0; }
.section-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  width: 100%; margin: 0 0 14px; padding: 4px 6px 4px 0;
  background: none; border: 0; cursor: pointer;
  font-family: inherit; text-align: left; color: inherit;
  border-radius: 10px;
}
.section-head:hover h2 { color: var(--accent-strong); }
.section-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 折叠指示箭头 */
.section-head .chev {
  flex: 0 0 auto; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-1px, 1px);
  transition: transform .22s ease, border-color .22s ease;
}
.section-head:hover .chev { border-color: var(--accent); }
.section.collapsed .section-head .chev { transform: rotate(-45deg) translate(-1px, 1px); }
.section.collapsed .section-head { margin-bottom: 0; }
.section.collapsed .section-body { display: none; }
.section-body { animation: fade-in .18s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .section-body { animation: none; } }

.nav .nav-fold {
  font-family: inherit; font-size: 13px; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: var(--ink-2);
  transition: background .16s ease, color .16s ease;
}
.nav .nav-fold:hover { background: var(--accent-soft); color: var(--accent-strong); }
.section-head h2 { font-size: 19px; }
.section-head h2::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: 9px; vertical-align: middle;
}
.section-head .hint { color: var(--faint); font-size: 13px; }
.section-head .spacer { margin-left: auto; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px; font-size: 12.5px;
  color: var(--accent-strong); background: var(--accent-soft);
  border: 1px solid transparent;
}
.chip.warm { color: var(--warm); background: var(--warm-soft); }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 20px; color: var(--muted);
  background: var(--surface-2);
}
.empty strong { color: var(--ink-2); }

.roadmap { display: grid; gap: 12px; }
.roadmap-item { display: flex; gap: 12px; align-items: flex-start; }
.roadmap-item .phase {
  flex: 0 0 auto; min-width: 46px; text-align: center;
  font-family: var(--mono); font-size: 12px; padding: 3px 8px; border-radius: 8px;
  border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface-2);
}
.roadmap-item.done .phase { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.roadmap-item.doing .phase { color: var(--on-accent); background: var(--warm); border-color: var(--warm); }

/* ---------------------------------------------------------------- 课程表 */

.tt-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.tt-meta b { color: var(--ink-2); font-weight: 500; }

.tt-scroll { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
table.tt { border-collapse: collapse; width: 100%; min-width: 800px; font-size: 14px; }
table.tt th, table.tt td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.tt thead th {
  background: var(--surface-2);
  color: var(--ink-2); font-weight: 600; text-align: center; white-space: nowrap;
  border-bottom: 1px solid var(--line-strong);
  font-size: 13.5px;
}
table.tt thead th.today { color: var(--on-accent); background: var(--accent); }
table.tt tbody tr:last-child td { border-bottom: none; }
table.tt tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
table.tt td.period { white-space: nowrap; text-align: center; width: 96px; }
table.tt td.period .p-label { color: var(--ink-2); font-size: 13.5px; }
table.tt td.period .p-time { color: var(--faint); font-family: var(--mono); font-size: 12px; }
table.tt td.cell { min-width: 148px; color: var(--muted); font-size: 13.5px; }
table.tt td.cell.has { color: var(--ink-2); }
table.tt td.summary { text-align: center; color: var(--accent-strong); background: var(--accent-soft); font-size: 13.5px; }
table.tt td.summary + td.summary { border-left: 1px solid var(--line); }

.cell-box { display: flex; flex-direction: column; gap: 3px; }
.cell-badge {
  align-self: flex-start; font-size: 11px; padding: 0 7px; border-radius: 999px;
  color: var(--warm); background: var(--warm-soft);
}

/* 科目配色：只用左侧细色条 + 极浅底色，避免"古早课表"的花花绿绿 */
table.tt td.cell.has { box-shadow: inset 3px 0 0 var(--k-color, var(--line-strong)); }
.k-info-tech { --k-color: #2fbfa0; background: rgba(47, 191, 160, 0.055); }
.k-labor { --k-color: #dfa73f; background: rgba(223, 167, 63, 0.055); }
.k-comprehensive { --k-color: #6aa6e0; background: rgba(106, 166, 224, 0.055); }
.k-club { --k-color: #a78bdb; background: rgba(167, 139, 219, 0.055); }
.k-prep { --k-color: #9aa9ae; background: rgba(154, 169, 174, 0.05); }
.k-evening { --k-color: #5b8fd6; background: rgba(91, 143, 214, 0.05); }
.k-meeting { --k-color: #e08a52; background: rgba(224, 138, 82, 0.05); }
.k-other { --k-color: var(--line-strong); background: transparent; }

.break-row td {
  background: var(--surface-2);
  color: var(--muted); text-align: center; font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.break-row .hot { color: var(--danger); }

/* ---------------------------------------------------------------- 工具 / 新闻 */

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.sub-head { font-size: 14px; color: var(--muted); font-weight: 500; margin: 4px 0 10px; }
.idea-tile .tag-tag-building, .tile .tag-building { color: var(--accent-strong); background: var(--accent-soft); }
.tile .tag-kept { color: var(--warm); background: var(--warm-soft); }
.tile .tag-done { color: #4f8a5c; background: rgba(123, 191, 138, .14); }
.tile {
  display: block; padding: 16px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--accent-line); }
.tile h3 { font-size: 15px; margin-bottom: 4px; }
.tile p { margin: 0; color: var(--muted); font-size: 13px; }
.tile .tag { font-size: 11px; color: var(--warm); background: var(--warm-soft); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }

.news-list { display: grid; gap: 10px; }
.news-item {
  display: block; padding: 14px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: border-color .16s ease, transform .16s ease;
}
.news-item:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.news-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); margin-bottom: 5px; flex-wrap: wrap; }
.news-meta .src { color: var(--accent-strong); background: var(--accent-soft); padding: 1px 9px; border-radius: 999px; }
.news-meta .topic { color: var(--warm); background: var(--warm-soft); padding: 1px 9px; border-radius: 999px; }
.news-title { font-size: 15px; color: var(--ink); font-weight: 500; line-height: 1.55; }
.news-item:hover .news-title { color: var(--accent-strong); }
.news-zh { font-size: 13.5px; color: var(--ink-2); margin-top: 5px; }
.news-tags { margin-top: 7px; display: flex; gap: 6px; flex-wrap: wrap; }
.news-tags span { font-size: 11.5px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; }

.news-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.news-filters button {
  cursor: pointer; font-family: inherit; font-size: 13px;
  padding: 4px 13px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  transition: all .15s ease;
}
.news-filters button:hover { border-color: var(--accent-line); color: var(--accent-strong); }
.news-filters button.active { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-line); font-weight: 500; }

.digest {
  border: 1px solid var(--accent-line);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface) 78%);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 16px;
}
.digest h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.digest h3 .badge { font-size: 11px; color: var(--accent-strong); background: var(--surface); border: 1px solid var(--accent-line); border-radius: 999px; padding: 1px 8px; font-weight: 400; }
.digest ul { margin: 10px 0 0; padding-left: 20px; }
.digest li { margin: 5px 0; color: var(--ink-2); font-size: 14px; }
.digest .foot { margin-top: 10px; font-size: 12px; color: var(--faint); }

.news-status { margin-top: 14px; font-size: 12.5px; color: var(--faint); line-height: 1.9; }
.news-status .ok { color: var(--accent-strong); }
.news-status .bad { color: var(--danger); }

/* 教学 Agent */
.teaching-intro p { margin: 8px 0 12px; max-width: 70ch; font-size: 14px; line-height: 1.8; }
.teaching-lock {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px; border-radius: 999px; font-size: 12.5px;
  color: var(--warm); background: var(--warm-soft);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.section-head-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius);
  padding: 26px; text-align: center; color: var(--muted); background: var(--surface-2);
  transition: all .18s ease; cursor: pointer;
}
.dropzone.hot { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.dropzone strong { color: var(--ink-2); display: block; margin-bottom: 4px; }

footer.site {
  margin-top: 48px; padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--faint); font-size: 13px;
}
footer.site .wrap { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- 控件 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 11px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--on-accent); background: var(--accent);
  border: 1px solid var(--accent);
  transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(0.96); box-shadow: 0 6px 16px rgba(47, 191, 160, 0.24); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: var(--surface); color: var(--accent-strong); border-color: var(--line-strong); box-shadow: none; }
.btn.ghost:hover { background: var(--accent-soft); box-shadow: none; }
.btn.warm { background: var(--warm); border-color: var(--warm); color: #fff; }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--line-strong); box-shadow: none; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { padding: 5px 12px; font-size: 13px; border-radius: 9px; }

input[type="text"], input[type="password"], input[type="number"], input[type="url"], select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 11px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong);
  font-family: inherit; font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="range"] { width: 100%; accent-color: var(--accent); }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; }

.notice {
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
}
.notice.warn { border-color: #f0dcb0; background: var(--warm-soft); color: #8a6516; }
.notice.err { border-color: #f2cdcb; background: var(--danger-soft); color: #9c3b38; }
.notice.ok { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-strong); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(14px);
  padding: 11px 20px; border-radius: 12px; z-index: 90;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink);
  box-shadow: var(--shadow-2); font-size: 14px;
  opacity: 0; pointer-events: none; transition: all 0.24s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: #f2cdcb; color: #9c3b38; }

@media (prefers-reduced-motion: reduce) {
  .firefly { animation: none; display: none; }
}

/* 亮色下浏览器原生控件（日期/文件）文字颜色跟随 */
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { color-scheme: dark; }

/* ---------------------------------------------------------------- 我的工作台（登录后） */
.workbar { margin-top: 16px; }
.workbar[hidden] { display: none !important; }
.workbar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.workbar-who { font-size: 12.5px; color: var(--accent-strong); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; margin-right: 4px; }
.workbar .btn, .workbar .btn.ghost { text-decoration: none; display: inline-flex; align-items: center; }
.workbar-edit { margin-top: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.workbar-edit[hidden] { display: none !important; }
.workbar-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.workbar-fields input { flex: 1 1 160px; }
.workbar-edit input, .workbar-edit textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; font: inherit; margin-bottom: 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); color: var(--ink); }
.workbar-actions { display: flex; gap: 8px; }
/* ---------------------------------------------------------------- 教学工作台（主页上就地使用） */
.tool-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tool-row:last-child { border-bottom: none; }
.tool-main { flex: 1 1 380px; min-width: 0; }
.tool-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14.5px; }
.tool-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tool-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chk { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
.tag-mini { font-size: 11px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); }
.tag-mini.warn { background: #fdeceb; color: #8a2b2b; }
.tag-mini.off { background: var(--surface-2); color: var(--faint); }
.sub-head { font-size: 14px; margin: 16px 0 8px; color: var(--ink-2); }
.mat-picker { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 6px; max-height: 190px; overflow-y: auto; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.item-editor { margin: 6px 0 14px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.item-editor textarea { width: 100%; font: inherit; }
.notice { padding: 12px 14px; border-radius: var(--radius); font-size: 13.5px; line-height: 1.7; }
.notice.err { background: #fdeceb; color: #8a2b2b; border: 1px solid #f3c9c6; }
.tt-scroll { overflow-x: auto; }
.tt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tt th, .tt td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.tt th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.dropzone.hot { border-color: var(--accent); }
/* 右上角登出（只在登录后出现） */
.nav-logout {
  font: inherit; font-size: 13px; line-height: 1;
  color: var(--muted); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 5px 13px; cursor: pointer; transition: color .15s, border-color .15s;
}
.nav-logout:hover { color: var(--danger, #b4423c); border-color: currentColor; }
.nav-logout[disabled] { opacity: .6; cursor: default; }
.nav-logout[hidden] { display: none !important; }
/* 文件管理：面包屑（主页样式表里原本没有） */
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.crumbs .faint { color: var(--faint); }
/* 文件管理：工具栏与滚动容器
   ⚠️ 这些规则原本只在 admin.css 里；主页不加载它，导致原生 file 控件**裸露**在按钮上、
   工具栏也不换行 —— 看上去像"两个绿色按钮"，其实是样式缺失，不是设计如此。 */
.file-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
/* 原生控件透明铺满按钮：点按钮任意位置都能唤起选择框（恢复原本的设计意图） */
.file-toolbar input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-toolbar > span.faint { white-space: nowrap; }
.file-progress { min-height: 16px; font-size: 12.5px; color: var(--muted); }
.file-scroll { overflow-x: auto; }