/* ============================================================================
   FCOSS —— 视觉方向：存单 / 账页
   纸白底、发丝线、等宽路径与数字；唯一的强调色是靛蓝，警示用琥珀。
   刻意不用：卡片矩阵、渐变、圆角套件、全大写小标签、圆点分隔符。
   ========================================================================= */

:root {
  --paper: #f2f1ec;
  --surface: #fbfaf7;
  --ink: #22252a;
  --ink-soft: #4a4f56;
  --muted: #6d7075;
  --rule: #dcdbd3;
  --rule-strong: #c3c2b9;
  --accent: #2b3a8f;
  --accent-ink: #1d2a6e;
  --accent-soft: #e7e9f5;
  --warn: #9c6b12;
  --warn-soft: #f6ecd8;
  --danger: #a33a2f;
  --danger-soft: #f7e6e3;
  --ok: #2f6f4f;
  --shadow: 0 18px 50px -22px rgba(34, 37, 42, 0.35);

  --mono: ui-monospace, "Cascadia Mono", "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;

  --spine: 236px;
  --radius: 5px;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  /* 面向小学生：基准字号与行高都比常规后台大一号 */
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

.boot {
  padding: 48px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

/* ------------------------------------------------------------------ 骨架 */

.app-root {
  min-height: 100%;
}

.shell {
  display: grid;
  grid-template-columns: var(--spine) minmax(0, 1fr);
  min-height: 100vh;
}

.spine {
  border-right: 1px solid var(--rule);
  padding: 26px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--paper);
}

.wordmark {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.wordmark span {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}

.spine-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.spine-label {
  font-size: 12px;
  color: var(--muted);
}

.spine-figure {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  word-break: break-all;
  line-height: 1.5;
}

.spine-figure b {
  color: var(--ink);
  font-weight: 600;
}

nav.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  appearance: none;
  border: 0;
  background: none;
  text-align: left;
  padding: 7px 10px;
  margin-left: -10px;
  font: inherit;
  color: var(--ink-soft);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.nav-item:hover {
  background: rgba(34, 37, 42, 0.045);
  color: var(--ink);
}

.nav-item[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.nav-count {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.nav-item[aria-current="true"] .nav-count {
  color: var(--accent-ink);
}

.spine-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}

.quota {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.quota-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
}

.quota-head em {
  font-style: normal;
  color: var(--muted);
}

.quota-figure {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
}

.meter {
  height: 2px;
  background: var(--rule);
  position: relative;
  overflow: hidden;
}

.meter i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
  transition: width 0.35s ease;
}

.meter.is-warn i {
  background: var(--warn);
}

.meter.is-over i {
  background: var(--danger);
}

/* ------------------------------------------------------------------ 主区 */

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 18px 28px 0;
}

.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: -0.01em;
  padding-bottom: 14px;
  min-height: 34px;
}

.crumb {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink-soft);
  padding: 2px 6px;
  border-radius: var(--radius);
  cursor: pointer;
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumb:hover {
  background: rgba(34, 37, 42, 0.05);
  color: var(--ink);
}

.crumb.is-last {
  color: var(--ink);
  font-weight: 600;
}

.crumb-sep {
  color: var(--rule-strong);
  user-select: none;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 14px;
}

.toolbar .grow {
  flex: 1 1 160px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0 10px;
  max-width: 320px;
}

.search input {
  border: 0;
  background: none;
  font: inherit;
  padding: 7px 0;
  width: 100%;
  color: var(--ink);
}

.search input:focus {
  outline: none;
}

.search:focus-within {
  border-color: var(--accent);
}

.search svg {
  flex: none;
  color: var(--muted);
}

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

.btn {
  appearance: none;
  font: inherit;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: #fff;
  border-color: var(--ink-soft);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
}

.btn-quiet {
  border-color: transparent;
  background: none;
  color: var(--muted);
  padding: 6px 9px;
}

.btn-quiet:hover {
  background: rgba(34, 37, 42, 0.05);
  border-color: transparent;
  color: var(--ink);
}

.btn-danger {
  color: var(--danger);
  border-color: rgba(163, 58, 47, 0.35);
}

.btn-danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.btn-sm {
  padding: 5px 11px;
  font-size: 14px;
}

/* 主要动作：更大、更好点 */
.btn-big {
  padding: 13px 24px;
  font-size: 17px;
  font-weight: 600;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field > label {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.field input,
.field select {
  font: inherit;
  font-size: 16px;
  padding: 12px 13px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}

.field .hint {
  font-size: 12px;
  color: var(--muted);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ------------------------------------------------------------------ 账页表格 */

.content {
  padding: 0 28px 64px;
  flex: 1;
}

.ledger-scroll {
  overflow-x: auto;
  margin: 0 -28px;
  padding: 0 28px;
}

.ledger {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.ledger thead th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 10px;
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}

.ledger td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

.ledger tbody tr:hover {
  background: rgba(34, 37, 42, 0.028);
}

.ledger .num {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ledger .when {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.ledger .col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.name-cell .glyph {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.name-cell.is-folder .glyph {
  color: var(--accent);
}

.name-link {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 16px;
  color: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 52ch;
}

.name-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 52ch;
}

.row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.ledger tbody tr:hover .row-actions,
.ledger tbody tr:focus-within .row-actions {
  opacity: 1;
}

@media (hover: none) {
  .row-actions {
    opacity: 1;
  }
}

.empty {
  border: 1px dashed var(--rule-strong);
  padding: 54px 28px;
  text-align: center;
  color: var(--muted);
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.empty p {
  margin: 0;
}

.section {
  margin-top: 40px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.section-head h2 {
  font-size: 15px;
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.kv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 16px;
}

.kv > div {
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kv dt {
  font-size: 12px;
  color: var(--muted);
}

.kv dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  word-break: break-all;
}

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
  font-family: var(--mono);
}

.tag-admin {
  border-color: rgba(43, 58, 143, 0.4);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.tag-off {
  border-color: rgba(163, 58, 47, 0.35);
  background: var(--danger-soft);
  color: var(--danger);
}

.tag-warn {
  border-color: rgba(156, 107, 18, 0.4);
  background: var(--warn-soft);
  color: var(--warn);
}

.log {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  font-size: 13px;
}

.log li {
  display: grid;
  grid-template-columns: 168px 140px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.log .t {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.log .a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-ink);
}

.log .d {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: 16px;
}

.inline-form .field {
  margin-bottom: 0;
  min-width: 150px;
}

/* ------------------------------------------------------------------ 上传托盘 */

.tray {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 336px;
  max-height: 56vh;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.tray-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}

.tray-head b {
  font-weight: 600;
}

.tray-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
}

.tray-list li {
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
}

.tray-list .fname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.tray-list .fmeta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.tray-list .fstate {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.tray-list .fstate.is-err {
  color: var(--danger);
}

.tray-list .fstate.is-ok {
  color: var(--ok);
}

.tray-list .bar {
  grid-column: 1 / -1;
  height: 2px;
  background: var(--rule);
  position: relative;
}

.tray-list .bar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
  transition: width 0.2s ease;
}

/* ------------------------------------------------------------------ 拖放遮罩 */

.dropzone {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(242, 241, 236, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent-ink);
  border: 2px dashed var(--accent);
  pointer-events: none;
}

/* ------------------------------------------------------------------ 弹窗 */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(34, 37, 42, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 80;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  box-shadow: var(--shadow);
  width: min(460px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 22px 22px 18px;
}

.modal h3 {
  margin: 0 0 4px;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.modal .sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12.5px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.modal-actions .spread {
  margin-right: auto;
}

/* ------------------------------------------------------------------ 登录页 */

.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.login-inner {
  width: min(430px, 100%);
}

.login h1 {
  font-size: 21px;
  margin: 0 0 6px;
  letter-spacing: -0.015em;
}

.login .hero-path {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 10px 0;
  margin: 18px 0 26px;
  word-break: break-all;
}

.login .hero-path b {
  color: var(--accent-ink);
  font-weight: 600;
}

.login form {
  display: flex;
  flex-direction: column;
}

.notice {
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.notice.is-warn {
  border-color: rgba(156, 107, 18, 0.45);
  background: var(--warn-soft);
  color: #6d4a0c;
}

.notice.is-danger {
  border-color: rgba(163, 58, 47, 0.4);
  background: var(--danger-soft);
  color: #7d2a22;
}

.notice code {
  font-family: var(--mono);
  font-size: 12px;
}

/* ------------------------------------------------------------------ 提示条 */

.toast-stack {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: #f2f1ec;
  padding: 8px 15px;
  font-size: 13px;
  max-width: 74vw;
  box-shadow: var(--shadow);
  animation: toast-in 0.18s ease;
}

.toast.is-err {
  background: var(--danger);
}

/* 提醒（不是错误）：琥珀色，比报错温和 */
.toast.is-warn {
  background: var(--warn-bg, #8a5a12);
  color: #fff8ea;
  max-width: min(86vw, 620px);
  line-height: 1.5;
}

/* 手机上：提示条别挤在底部被裁掉 */
@media (max-width: 640px) {
  .toast-stack {
    left: 12px;
    right: 12px;
    transform: none;
    bottom: 14px;
  }

  .toast {
    max-width: none;
    font-size: 13.5px;
    line-height: 1.5;
    padding: 10px 14px;
  }
}

.toast.is-ok {
  background: var(--ok);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ------------------------------------------------------------------ 窄屏 */

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .spine {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 18px 18px 16px;
    gap: 18px;
  }

  .spine-foot {
    margin-top: 0;
  }

  .topbar,
  .content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .ledger-scroll {
    margin: 0 -18px;
    padding: 0 18px;
  }

  .search {
    max-width: none;
    flex: 1 1 100%;
  }

  .log li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .tray {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 12px;
  }

  .name-link,
  .name-text {
    max-width: 40vw;
  }
}

/* 极窄屏：隐藏"修改时间"列，优先保证名称与操作可用 */
@media (max-width: 640px) {
  .ledger th:nth-child(3),
  .ledger td:nth-child(3) {
    display: none;
  }

  .ledger {
    min-width: 380px;
  }

  .name-link,
  .name-text {
    max-width: 46vw;
  }
}

/* --------------------------------------------------- 面向小学生的补充样式 */

.login-sub {
  color: var(--muted);
  margin: 0 0 22px;
  font-size: 15px;
}

.login-foot {
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
}

/* 侧栏"我是 XX" */
.spine-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
  word-break: break-all;
}

.spine-me::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

/* 根目录上的引导块：一句话 + 一个大按钮 */
.kid-hint {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--accent-soft);
  border: 1px solid rgba(43, 58, 143, 0.22);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 18px 0 6px;
  font-size: 15.5px;
  color: var(--accent-ink);
}

.kid-hint .btn {
  margin-left: auto;
}

@media (max-width: 640px) {
  .kid-hint .btn {
    margin-left: 0;
    width: 100%;
  }
}

.quota-warn {
  font-size: 12px;
  color: var(--warn);
}

/* 置顶的文件夹（位置即标记，不依赖 emoji 字体） */
.ledger tbody tr.is-pinned .name-link {
  font-weight: 650;
}

/* 下载准备中：给一点视觉反馈（同时禁止重复点击） */
.btn.is-pending,
.name-link.is-pending {
  color: var(--muted) !important;
  cursor: progress;
}

.btn.is-pending {
  position: relative;
  padding-left: 26px;
}

.btn.is-pending::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -6px;
  border: 1.6px solid var(--rule-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: fcoss-spin 0.7s linear infinite;
}

@keyframes fcoss-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .btn.is-pending::before { animation: none; }
}

/* 文件名旁的轻量标记：只提示，不阻止点击 */
.name-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.file-tag {
  flex: none;
  font-size: 11.5px;
  line-height: 1.5;
  padding: 1px 7px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
}

/* 顶部环境横幅：提醒用电脑浏览器（只提醒，不阻止任何操作） */
.env-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #fdf6e6;
  border: 1px solid #e6d3a3;
  border-left: 3px solid #c9922a;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.55;
  color: #5a4413;
}

.env-banner.is-strong {
  background: #fdf0e4;
  border-color: #e8c9a8;
  border-left-color: #c2703a;
  color: #5c3618;
}

.env-banner-text {
  flex: 1 1 320px;
  min-width: 0;
}

@media (max-width: 640px) {
  .env-banner {
    font-size: 13.5px;
    padding: 10px 12px;
  }

  .env-banner .btn {
    flex: 1 1 auto;
  }
}

/* 电脑 + 现代浏览器：最轻的一档，不打扰 */
.env-banner.is-quiet {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule-strong);
  color: var(--muted);
  font-size: 13px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.env-banner.is-quiet .btn {
  padding: 5px 12px;
  font-size: 13px;
}

/* 下载进度条 */
.dl-tray .tray-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
}

.dl-tray .fname {
  grid-column: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dl-tray .fstate {
  grid-column: 2;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dl-tray .fmeta {
  grid-column: 1 / -1;
}

.dl-bar {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 4px;
  background: var(--rule);
  overflow: hidden;
}

.dl-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.22s ease;
}

.dl-tray .btn {
  grid-column: 2;
  justify-self: end;
}

/* 下载面板里的按钮组 */
.dl-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* 复选框行（管理员的看所有人的） */
.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
}

/* --------------------------------------------------- 预览弹窗 */
.pv-backdrop { display: flex; align-items: center; justify-content: center; }
.pv { background: var(--surface); border: 1px solid var(--rule-strong); box-shadow: var(--shadow); width: min(94vw, 1000px); max-height: 92vh; display: flex; flex-direction: column; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.pv-sub { color: var(--muted); font-size: 12.5px; }
.pv-body { padding: 14px; overflow: auto; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.pv-img { max-width: 100%; max-height: 62vh; background: #fff; border: 1px solid var(--rule); }
.pv-frame { width: 100%; height: 64vh; border: 1px solid var(--rule); }
.pv-media { max-width: 100%; max-height: 62vh; }
.pv-canvas { max-width: 100%; border: 1px solid var(--rule); cursor: grab; touch-action: none; }
.pv-text { width: 100%; max-height: 62vh; overflow: auto; margin: 0; padding: 12px; background: #fbfaf7; border: 1px solid var(--rule); font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }
.pv-note { color: var(--muted); font-size: 13px; text-align: center; }
.pv-note.is-err { color: var(--danger); }
.pv-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
