/* 资料下载站 —— 参照 Notion 设计系统（awesome-design-md / notion）
 * 白底、近黑文字、Notion 蓝主按钮（4px 圆角）、暖白区块、极淡边框 + 多层柔和阴影、药丸徽章。
 */
:root {
  color-scheme: light;
  --text: rgba(0, 0, 0, .95);
  --white: #ffffff;
  --warm: #f6f5f4;
  --warm-dark: #31302e;
  --gray-500: #615d59;
  --gray-300: #a39e98;
  --blue: #0075de;
  --blue-active: #005bab;
  --focus: #097fe8;
  --badge-bg: #f2f9ff;
  --badge-text: #097fe8;
  --teal: #2a9d99;
  --green: #1aae39;
  --orange: #dd5b00;
  --red: #e03e3e;
  --line: rgba(0, 0, 0, .1);
  --line-soft: rgba(0, 0, 0, .06);
  --hover: rgba(0, 0, 0, .04);
  --ghost: rgba(0, 0, 0, .05);
  --ghost-hover: rgba(0, 0, 0, .1);
  --shadow-card: rgba(0, 0, 0, .04) 0 4px 18px 0, rgba(0, 0, 0, .027) 0 2.025px 7.85px 0, rgba(0, 0, 0, .02) 0 .8px 2.93px 0, rgba(0, 0, 0, .01) 0 .175px 1.04px 0;
  --shadow-deep: rgba(0, 0, 0, .01) 0 1px 3px 0, rgba(0, 0, 0, .02) 0 3px 7px 0, rgba(0, 0, 0, .02) 0 7px 15px 0, rgba(0, 0, 0, .04) 0 14px 28px 0, rgba(0, 0, 0, .05) 0 23px 52px 0;
  --font: "Inter", -apple-system, BlinkMacSystemFont, system-ui, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--white); color: var(--text);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}
body.warm { background: var(--warm); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: rgba(0, 117, 222, .18); }

/* ================================================================ 顶栏 */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 10px 32px;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(180%) blur(10px); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo {
  flex: none; width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center;
  background: var(--warm-dark); color: #fff;
}
.logo svg { width: 15px; height: 15px; }
.navlinks { display: flex; align-items: center; gap: 20px; }
.navlink { font-size: 15px; font-weight: 500; color: var(--gray-500); }
.navlink:hover { color: var(--text); }

/* ================================================================ 按钮、徽章 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border: 0; border-radius: 4px; cursor: pointer;
  background: var(--blue); color: #fff; font-size: 15px; font-weight: 600; line-height: 1.33;
  white-space: nowrap; text-decoration: none; transition: background .15s, opacity .15s;
}
.btn:hover { background: var(--blue-active); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--ghost); color: var(--text); }
.btn.ghost:hover { background: var(--ghost-hover); }
.btn.danger { background: transparent; color: var(--red); }
.btn.danger:hover { background: rgba(224, 62, 62, .08); }
.btn.sm { padding: 5px 10px; font-size: 13.5px; font-weight: 500; }
.btn.lg { padding: 11px 24px; }
.btn svg { width: 16px; height: 16px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 9999px;
  background: var(--badge-bg); color: var(--badge-text);
  font-size: 12.5px; font-weight: 600; line-height: 1.33; white-space: nowrap;
}
.pill.gray { background: var(--ghost); color: var(--gray-500); }
.pill.teal { background: rgba(42, 157, 153, .1); color: var(--teal); }
.pill.green { background: rgba(26, 174, 57, .1); color: var(--green); }
.pill.orange { background: rgba(221, 91, 0, .1); color: var(--orange); }

/* ================================================================ 用户页 */
.hero { text-align: center; padding: 88px 24px 40px; }
.hero h1 {
  margin: 0 auto; max-width: 900px;
  font-size: 56px; font-weight: 700; line-height: 1.12; letter-spacing: -1px; word-break: break-word;
}
.hero .subtitle { margin: 16px auto 0; max-width: 600px; color: var(--gray-500); font-size: 20px; line-height: 1.5; }
.hero .subtitle b { color: var(--text); font-weight: 600; }
.view-list .hero { padding: 64px 24px 32px; }
.view-list .hero h1 { font-size: 44px; }

.narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

.callout {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 auto 16px;
  background: var(--warm); border-radius: 8px; padding: 14px 16px;
  color: var(--warm-dark); font-size: 15px; line-height: 1.6; white-space: pre-wrap; text-align: left;
}
.callout .ic { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--gray-500); }
.callout.warn { background: rgba(221, 91, 0, .08); color: #7a3300; white-space: normal; }
.callout.warn .ic { color: var(--orange); }
.callout.warn b { color: #5c2600; }

/* 访问码 */
.gate { max-width: 440px; margin: 0 auto; padding: 0 24px 24px; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-card); padding: 28px;
}
.gate .card { padding: 28px; }
.label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; padding: 8px 12px; border: 1px solid #dddddd; border-radius: 4px; background: var(--white);
  color: var(--text); font-size: 15px; line-height: 1.5; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--gray-300); }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(0, 117, 222, .2); }
.input.error { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(221, 91, 0, .2); }
textarea.input { resize: vertical; min-height: 84px; }
.codeinput {
  height: 48px; font-size: 20px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.codeinput::placeholder { font-size: 16px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.gate .btn { width: 100%; margin-top: 14px; }
.errmsg { color: var(--orange); font-size: 14px; margin-top: 8px; }
.errmsg:empty { display: none; }
.gate .hint { margin: 14px 0 0; color: var(--gray-300); font-size: 14px; text-align: center; }
.view-gate .callout:not(.warn) { max-width: 392px; margin-top: 20px; background: none; padding: 0; justify-content: center; text-align: center; color: var(--gray-500); font-size: 14px; }
.view-gate .callout:not(.warn) .ic { display: none; }

/* 列表 */
.band { background: var(--warm); border-top: 1px solid var(--line-soft); padding: 32px 0 72px; min-height: 50vh; }
.search-wrap { position: relative; margin-bottom: 24px; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--gray-300); pointer-events: none; }
.search { height: 46px; padding-left: 42px; font-size: 16px; border-color: var(--line); box-shadow: var(--shadow-card); }

.group { margin-bottom: 20px; }
.group-head { display: flex; align-items: center; gap: 8px; margin: 0 4px 10px; }
.group-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.125px; }
.sheet { background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-card); overflow: hidden; }

.file { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.file + .file { border-top: 1px solid var(--line-soft); }
.file:hover { background: rgba(0, 0, 0, .015); }
.finfo { flex: 1; min-width: 0; }
.fname { font-size: 16px; font-weight: 600; line-height: 1.4; word-break: break-all; }
.fdesc { margin-top: 2px; color: var(--gray-500); font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.fmeta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 4px; color: var(--gray-300); font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums; }

.ficon {
  flex: none; width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 10%, #fff); color: var(--c);
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
}
.file .btn { flex: none; }
.file .btn:hover { background: var(--blue); color: #fff; }

.empty { padding: 48px 20px; text-align: center; color: var(--gray-500); font-size: 15px; }
.empty b { display: block; margin-bottom: 4px; color: var(--text); font-size: 17px; font-weight: 600; }
.foot { margin: 28px 0 0; text-align: center; color: var(--gray-300); font-size: 13.5px; text-wrap: balance; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translate(-50%, 16px);
  max-width: 90vw; padding: 10px 18px; border-radius: 8px;
  background: var(--warm-dark); color: #fff; font-size: 14px; box-shadow: var(--shadow-deep);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--orange); }

/* ================================================================ 管理后台 */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px 80px; }
.top { padding: 48px 0 28px; }
.top h1 { margin: 0; font-size: 40px; font-weight: 700; line-height: 1.15; letter-spacing: -1px; }
.top p { margin: 8px 0 0; color: var(--gray-500); font-size: 18px; }

.panel + .panel { margin-top: 20px; }
.panel { padding: 24px 28px; }
.phead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.phead h2 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.27; letter-spacing: -.25px; }
.phead .sub { color: var(--gray-500); font-size: 14px; font-weight: 500; }
.phead .grow { flex: 1; }
.phead .input { width: 220px; }

.admin-gate { max-width: 420px; margin: 12vh auto 0; }
.admin-gate .card { box-shadow: var(--shadow-deep); }
.admin-gate h2 { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -.625px; }
.admin-gate p { margin: 0 0 22px; color: var(--gray-500); font-size: 15px; }
.admin-gate .btn { width: 100%; margin-top: 14px; }

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.field small { margin-left: 6px; color: var(--gray-300); font-size: 13px; font-weight: 500; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 160px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.muted { color: var(--gray-500); font-size: 14px; }
.faint { color: var(--gray-300); font-size: 13.5px; }

/* 访问码选择小方块 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 10px; border-radius: 9999px;
  border: 1px solid var(--line); background: var(--white); cursor: pointer; font-size: 14px; font-weight: 500;
  transition: background .15s, border-color .15s; user-select: none;
}
.chip:hover { background: var(--hover); }
.chip input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }
.chip:has(input:checked) { border-color: rgba(0, 117, 222, .45); background: var(--badge-bg); color: var(--blue-active); }
.chip.locked { cursor: default; opacity: .75; }
.chip .note { color: var(--gray-300); font-weight: 500; font-size: 12.5px; }

.drop {
  display: block; margin-top: 16px; padding: 34px 16px; border-radius: 12px; text-align: center; cursor: pointer;
  border: 1.5px dashed rgba(0, 0, 0, .16); background: var(--warm); color: var(--gray-500);
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--blue); background: var(--badge-bg); }
.drop strong { color: var(--blue); font-weight: 600; }
.drop svg { display: block; width: 30px; height: 30px; margin: 0 auto 8px; color: var(--blue); }

.queue { margin-top: 8px; }
.qitem { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.qitem:first-child { border-top: 0; }
.qhead { display: flex; gap: 10px; align-items: center; font-size: 14.5px; }
.qhead .qname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.qstat { color: var(--gray-500); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qstat.ok { color: var(--green); }
.qstat.bad { color: var(--orange); }
.bar { height: 4px; margin-top: 8px; border-radius: 2px; background: var(--ghost); overflow: hidden; }
.bar > i { display: block; width: 0; height: 100%; border-radius: 2px; background: var(--blue); transition: width .2s; }

.tablewrap { overflow-x: auto; margin: 0 -10px; padding: 0 10px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { padding: 8px 10px; text-align: left; white-space: nowrap; color: var(--gray-500); font-size: 13px; font-weight: 500; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: rgba(0, 0, 0, .015); }
.tbl tr.dim .ncell, .tbl tr.dim .num { opacity: .5; }
.tbl .ncell { display: flex; gap: 12px; align-items: center; min-width: 220px; }
.tbl .ncell .ficon { width: 34px; height: 34px; border-radius: 6px; font-size: 9.5px; }
.tbl .fname { font-size: 15px; }
.tbl .fdesc { font-size: 13px; }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl .acts .btn + .btn { margin-left: 2px; }
.tbl td.empty { padding: 40px 10px; }
.tbl .pills { display: flex; flex-wrap: wrap; gap: 4px; max-width: 240px; }
.codecell { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; font-weight: 600; letter-spacing: .1em; }
.cname { font-weight: 600; }
.cnote { color: var(--gray-500); font-size: 13px; margin-top: 2px; }

dialog {
  width: min(520px, 94vw); max-height: 90vh; padding: 0; border: 1px solid var(--line); border-radius: 12px;
  background: var(--white); color: var(--text); box-shadow: var(--shadow-deep);
}
dialog.wide { width: min(680px, 94vw); }
dialog::backdrop { background: rgba(15, 15, 15, .45); }
dialog form { padding: 26px 28px; }
dialog h3 { margin: 0 0 20px; font-size: 22px; font-weight: 700; letter-spacing: -.25px; }
dialog .dacts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 15px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }

/* 可见范围选择 */
.scope { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.opt {
  display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.opt:hover { background: var(--hover); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt b { display: block; font-size: 15px; font-weight: 600; }
.opt span { display: block; margin-top: 2px; color: var(--gray-500); font-size: 13px; line-height: 1.45; }
.opt:has(input:checked) { border-color: var(--blue); background: var(--badge-bg); box-shadow: 0 0 0 1px var(--blue); }
.picker { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; }
.pgroup { border-top: 1px solid var(--line-soft); }
.pgroup:first-child { border-top: 0; }
.prow { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; font-size: 14.5px; }
.prow:hover { background: var(--hover); }
.prow input { flex: none; width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }
.prow.g { background: var(--warm); font-weight: 600; }
.prow.g .faint { font-weight: 500; }
.prow.f { padding-left: 38px; }
.prow.f.solo { padding-left: 14px; }
.prow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow.locked { cursor: default; color: var(--gray-500); }
.picker .empty { padding: 28px 16px; font-size: 14px; }

details.more summary { cursor: pointer; font-size: 22px; font-weight: 700; letter-spacing: -.25px; }
details.more[open] summary { margin-bottom: 18px; }

/* ================================================================ 小屏 */
@media (max-width: 720px) {
  .nav { padding: 10px 16px; }
  .hero { padding: 52px 18px 28px; }
  .hero h1 { font-size: 36px; letter-spacing: -.5px; }
  .hero .subtitle { font-size: 16px; margin-top: 12px; }
  .view-list .hero { padding: 40px 18px 24px; }
  .view-list .hero h1 { font-size: 30px; }
  .narrow, .gate { padding: 0 14px; }
  .band { padding: 22px 0 56px; }
  .file { padding: 12px 14px; gap: 12px; align-items: flex-start; }
  .file .btn { align-self: center; padding: 7px 10px; }
  .file .btn .t { display: none; }
  .ficon { width: 36px; height: 36px; font-size: 9.5px; }
  .wrap { padding: 0 14px 56px; }
  .top { padding: 30px 0 20px; }
  .top h1 { font-size: 30px; }
  .panel { padding: 20px 16px; }
  .grid2, .scope { grid-template-columns: 1fr; }
  .phead .input { width: 100%; }
  dialog form { padding: 22px 18px; }
}

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