/* ==========================================================
   研习资料库 · 设计系统
   ========================================================== */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --ink: #14161a;
  --ink-2: #5a6270;
  --ink-3: #8f97a4;
  --line: #e6e9ee;
  --line-2: #eef0f4;

  --brand: #4338ca;
  --brand-600: #4f46e5;
  --brand-soft: #eef0ff;
  --brand-ink: #312e81;

  --ok: #0f9d58;
  --ok-soft: #e8f7ef;
  --warn: #b45309;
  --warn-soft: #fef4e6;
  --danger: #d92d20;
  --danger-soft: #fef0ef;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 16px -4px rgba(16, 24, 40, .1), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-lg: 0 24px 60px -20px rgba(24, 20, 80, .28);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { font-size: 15px; line-height: 1.6; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.02em; line-height: 1.3; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all .16s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: #d8dce3; text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(67, 56, 202, .3), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn-primary:hover { background: #3a30b5; border-color: #3a30b5; }
.btn-primary:disabled { background: var(--brand); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #eceef2; color: var(--ink); }

.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn-block { width: 100%; }

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

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 7px;
  letter-spacing: .01em;
}
.input, .textarea, .select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color .16s, box-shadow .16s;
  outline: none;
}
.textarea { height: auto; padding: 11px 14px; resize: vertical; min-height: 76px; line-height: 1.55; }
.select { appearance: none; background-image: none; cursor: pointer; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3.5px rgba(79, 70, 229, .12);
}
.input-lg { height: 52px; font-size: 17px; letter-spacing: .04em; }

.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; }

/* ---------- 复选框 ---------- */
.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
  user-select: none;
}
.check input {
  appearance: none;
  width: 17px; height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
  border: 1.5px solid #cbd1da;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  transition: all .14s;
  position: relative;
}
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1.5px;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}

/* ---------- 提示条 ---------- */
.alert {
  display: flex;
  gap: 9px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-error { background: var(--danger-soft); color: #a1231a; border-color: #f8d9d5; }
.alert-ok { background: var(--ok-soft); color: #0a6b3d; border-color: #cdecdb; }
.alert-info { background: var(--brand-soft); color: var(--brand-ink); border-color: #dfe2ff; }
.alert[hidden] { display: none; }

/* ==========================================================
   登录页
   ========================================================== */
.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}

.gate-aside {
  position: relative;
  overflow: hidden;
  padding: 52px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background: radial-gradient(120% 90% at 15% 0%, #4c3fd4 0%, #2a2470 45%, #16133d 100%);
}
.gate-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 70% at 30% 20%, #000 30%, transparent 100%);
  pointer-events: none;
}
.gate-aside::after {
  content: "";
  position: absolute;
  width: 460px; height: 460px;
  right: -180px; bottom: -200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129, 140, 248, .38), transparent 68%);
  filter: blur(8px);
  pointer-events: none;
}
.gate-aside > * { position: relative; z-index: 1; }

.brand-row { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(6px);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.03em;
}
.brand-name { font-size: 15.5px; font-weight: 640; letter-spacing: -.01em; }
.brand-sub { font-size: 12px; opacity: .6; margin-top: -2px; }

.gate-headline {
  font-size: 40px;
  line-height: 1.15;
  font-weight: 680;
  letter-spacing: -.035em;
  margin-bottom: 18px;
}
.gate-headline em {
  font-style: normal;
  background: linear-gradient(100deg, #a5b4fc, #c7d2fe 60%, #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gate-desc {
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255,255,255,.72);
  max-width: 400px;
}

.gate-points { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 13px; }
.gate-points li {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: 14px; color: rgba(255,255,255,.82);
}
.gate-points .dot {
  width: 21px; height: 21px; flex: 0 0 21px;
  border-radius: 7px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #c7d2fe;
  margin-top: 1px;
}

.gate-foot { font-size: 12px; color: rgba(255,255,255,.42); }

.gate-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--surface);
}
.gate-form { width: 100%; max-width: 376px; }
.gate-form h2 { font-size: 25px; margin-bottom: 7px; letter-spacing: -.028em; }
.gate-form .lead { font-size: 14px; color: var(--ink-2); margin: 0 0 28px; }

.phone-wrap { position: relative; }
.phone-prefix {
  position: absolute;
  left: 15px; top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.phone-wrap .input { padding-left: 58px; font-variant-numeric: tabular-nums; }
.phone-wrap .input::placeholder { letter-spacing: 0; }

.gate-note {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
}

/* ==========================================================
   应用外壳
   ========================================================== */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 62px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}
.topbar .brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--brand); border: none;
  color: #fff; font-size: 14px;
}
.topbar .brand-name { font-size: 14.5px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.who {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 11px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.who .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; width: 100%; }

/* 页头 */
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 27px; letter-spacing: -.03em; margin-bottom: 6px; }
.page-head p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* 工具条 */
.toolbar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 22px; flex-wrap: wrap;
}
.search {
  position: relative; flex: 1; min-width: 220px; max-width: 360px;
}
.search .input { height: 40px; padding-left: 38px; font-size: 14px; border-radius: 10px; }
.search svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; stroke: var(--ink-3); fill: none; stroke-width: 2;
}

/* 检索区 */
.filter-bar { display: flex; gap: 10px; margin-bottom: 13px; }
.filter-bar .search { flex: 1; min-width: 0; max-width: none; }

.date-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 0 30px 0 34px;
  transition: border-color .16s, box-shadow .16s;
}
.date-picker:hover { border-color: #d5d9e0; }
.date-picker:focus-within { border-color: var(--brand-600); box-shadow: 0 0 0 3.5px rgba(79,70,229,.1); }
.date-picker .cal {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--ink-3); pointer-events: none;
}
.date-picker .chev {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px; color: var(--ink-3); pointer-events: none;
}
.date-picker select {
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  height: 100%;
  padding: 0;
  cursor: pointer;
  outline: none;
  max-width: 190px;
}

.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  height: 34px; padding: 0 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .14s;
  font-family: inherit;
}
.chip:hover { border-color: #d5d9e0; color: var(--ink); }
.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.chip .n {
  font-size: 11.5px;
  opacity: .55;
  font-variant-numeric: tabular-nums;
}

/* 资料列表 */
.file-list { display: grid; gap: 10px; }

/* 按直播日期分组 */
.date-groups { display: grid; gap: 32px; }
.date-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 11px;
  padding-left: 14px;
  position: relative;
}
.date-head::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 3px; height: 14px;
  border-radius: 2px;
  background: var(--brand);
  opacity: .85;
}
.date-main {
  font-size: 16.5px;
  font-weight: 660;
  letter-spacing: -.022em;
  color: var(--ink);
}
.date-week { font-size: 12.5px; color: var(--ink-3); }
.date-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all .16s ease;
}
.file-card:hover {
  border-color: #d5d9e2;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.file-icon {
  width: 44px; height: 44px;
  flex: 0 0 44px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #eef1f6;
  color: #5a6270;
}
.file-icon.pdf  { background: #fdeceb; color: #c0392b; }
.file-icon.ppt,
.file-icon.pptx { background: #fdefe6; color: #c05621; }
.file-icon.doc,
.file-icon.docx { background: #e9f0fd; color: #2b5fb8; }
.file-icon.xls,
.file-icon.xlsx { background: #e8f6ee; color: #12855a; }
.file-icon.mp4,
.file-icon.mov  { background: #f0ecfd; color: #6d3fc4; }
.file-icon.zip  { background: #f4f0e6; color: #8a6d1f; }
.file-icon.link { background: var(--brand-soft); color: var(--brand); }

.file-main { flex: 1; min-width: 0; }
.file-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 3px;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.file-desc {
  font-size: 13px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 560px;
}
.file-meta {
  display: flex; gap: 10px; align-items: center;
  font-size: 12px; color: var(--ink-3);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.file-meta .tag {
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
}
.file-actions { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }

/* 空态 */
.empty {
  text-align: center;
  padding: 70px 24px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty .ico {
  width: 52px; height: 52px;
  margin: 0 auto 16px;
  border-radius: 15px;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 24px;
}
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { margin: 0; color: var(--ink-2); font-size: 13.5px; }

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #eef0f4 25%, #f6f7f9 50%, #eef0f4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--radius);
  height: 76px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ==========================================================
   后台
   ========================================================== */
.admin { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }

.side {
  background: #16181f;
  color: #fff;
  padding: 20px 14px;
  display: flex; flex-direction: column;
  gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.side .brand-row { padding: 0 8px 18px; gap: 9px; }
.side .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
.side .brand-name { font-size: 14px; }
.side .brand-sub { font-size: 10.5px; opacity: .45; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 11px;
  border-radius: 9px;
  font-size: 14px;
  color: rgba(255,255,255,.6);
  cursor: pointer;
  transition: all .14s;
  font-family: inherit;
  border: none; background: none; text-align: left; width: 100%;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }
.nav-item.on { background: rgba(255,255,255,.1); color: #fff; font-weight: 550; }
.nav-item svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; opacity: .85; }
.nav-item .badge {
  margin-left: auto;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 20px;
  background: rgba(255,255,255,.12);
  font-variant-numeric: tabular-nums;
}
.side-foot { margin-top: auto; padding: 10px 8px 0; font-size: 11px; color: rgba(255,255,255,.3); line-height: 1.6; }

.admin-main { padding: 30px 34px 70px; background: var(--bg); min-width: 0; }
.admin-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-head h1 { font-size: 24px; letter-spacing: -.028em; }
.admin-head .sub { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }
.admin-head .right { margin-left: auto; display: flex; gap: 9px; }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .k { font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 27px; font-weight: 680; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-left: 3px; }

/* 面板 */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
}
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-2);
}
.panel-head h3 { font-size: 14.5px; }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; }
.panel-body { padding: 18px; }
.panel-body.tight { padding: 0; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fcfcfd; }
.table .phone {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: .01em;
}
.table .time { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; }
.table .num { font-variant-numeric: tabular-nums; }

/* 上传区 */
.drop {
  border: 1.5px dashed #d3d8e0;
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .16s;
  background: var(--surface-2);
}
.drop:hover, .drop.over { border-color: var(--brand-600); background: var(--brand-soft); }
.drop .ico {
  width: 44px; height: 44px; margin: 0 auto 12px;
  border-radius: 12px; background: #fff;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 20px;
}
.drop h4 { font-size: 14.5px; margin-bottom: 4px; }
.drop p { margin: 0; font-size: 12.5px; color: var(--ink-3); }

.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.row-21 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }

/* 进度条 */
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; border-radius: 3px; }

/* 模态 */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 22, 26, .44);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 24px;
  animation: fadeIn .16s ease;
}
.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%; max-width: 460px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: popIn .2s cubic-bezier(.2,.9,.3,1.2);
}
.modal-head { padding: 20px 22px 0; }
.modal-head h3 { font-size: 17px; }
.modal-head p { margin: 5px 0 0; font-size: 13px; color: var(--ink-2); }
.modal-body { padding: 18px 22px; }
.modal-foot {
  padding: 14px 22px;
  background: var(--surface-2);
  border-top: 1px solid var(--line-2);
  display: flex; gap: 9px; justify-content: flex-end;
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.97) translateY(6px); } }

/* 标签 */
.tag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 550;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
}
.tag-pill.on { background: var(--ok-soft); color: #0a6b3d; border-color: #cdecdb; }
.tag-pill.off { background: #f3f4f6; color: #8f97a4; }

/* 加载遮罩 */
.loading-line {
  position: fixed; top: 0; left: 0; right: 0; height: 2.5px;
  background: var(--brand);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 200;
  transition: transform .3s ease;
}

/* Toast */
.toast-host {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%);
  z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: #1a1c22;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.4);
  animation: toastIn .22s cubic-bezier(.2,.9,.3,1.2);
  max-width: 88vw;
}
.toast.err { background: #b42318; }
.toast.ok { background: #0a7d4f; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* 工具类 */
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.flex { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }
[hidden] { display: none !important; }

/* ==========================================================
   响应式
   ========================================================== */
@media (max-width: 900px) {
  .gate { grid-template-columns: 1fr; }
  .gate-aside { padding: 34px 28px; min-height: auto; }
  .gate-headline { font-size: 28px; }
  .gate-points, .gate-foot { display: none; }
  .gate-desc { font-size: 14px; }
  .gate-main { padding: 30px 24px 50px; }
  .gate-form { max-width: 100%; }

  .admin { grid-template-columns: 1fr; }
  .side {
    position: static; height: auto;
    flex-direction: row; align-items: center;
    padding: 10px 12px; gap: 6px;
    overflow-x: auto;
  }
  .side .brand-row { padding: 0 10px 0 4px; }
  .side .brand-sub, .side-foot { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  .nav-item span { display: none; }
  .admin-main { padding: 20px 16px 60px; }
  .stats { grid-template-columns: 1fr 1fr; }

  .row2, .row3 { grid-template-columns: 1fr; }
  .file-card { padding: 13px 14px; gap: 12px; }
  .file-desc { max-width: 100%; }
  .file-actions .btn { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
  .file-actions .btn span { display: none; }
  .table th, .table td { padding: 9px 12px; }
  .hide-sm { display: none !important; }
}

@media (max-width: 560px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .wrap { padding: 22px 14px 60px; }
  .page-head h1 { font-size: 22px; }
  .filter-bar { flex-wrap: wrap; gap: 9px; }
  .filter-bar .search { flex: 1 1 100%; }
  .date-picker { flex: 1 1 100%; }
  .date-picker select { max-width: none; width: 100%; font-size: 14px; }
  .date-groups { gap: 26px; }
  .date-main { font-size: 15.5px; }
  .file-card { gap: 11px; }
  .file-icon { width: 40px; height: 40px; flex: 0 0 40px; font-size: 9px; border-radius: 10px; }
  .file-desc {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .file-meta { flex-wrap: wrap; row-gap: 4px; }
  .who { padding: 0 9px; font-size: 12px; }
  .chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .chip { flex: 0 0 auto; }
  .stats { gap: 9px; }
  .stat { padding: 13px 14px; }
  .stat .v { font-size: 21px; }
}
