/* ============================================================
   在线报名系统 · 视觉主题 v3
   深墨蓝 + 暖金，官网式排版。所有类名沿用旧版，业务逻辑零改动。
   想换配色或整体调字号，只改下面 :root 里的变量即可。
   ============================================================ */
:root {
  /* 基础色 */
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #16233a;
  --muted: #5f6f86;
  --hint: #8a97a9;
  --line: #e4e9f1;
  --line-soft: #eef2f7;

  /* 品牌色 */
  --primary: #1d4e8f;
  --primary-dark: #123a6c;
  --primary-soft: #eaf2fc;
  --ink: #0b2444;
  --ink-2: #153f73;
  --ink-3: #245c9c;
  --accent: #d9a441;
  --accent-light: #f0cf8e;
  --accent-soft: #fdf6e8;

  /* 状态色 */
  --danger: #c0392b;
  --danger-soft: #fdf0ee;
  --success: #16794f;
  --success-soft: #eaf7f1;
  --amber: #a86a12;
  --amber-soft: #fdf5e6;

  /* 圆角与阴影 */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(11, 36, 68, .04);
  --shadow: 0 1px 2px rgba(11, 36, 68, .04), 0 12px 34px rgba(11, 36, 68, .06);
  --shadow-lg: 0 26px 60px rgba(11, 36, 68, .16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  /* 全站字号总开关：1 = 原始字号（当前值，已恢复成放大前的大小）。
     想整体放大改 1.12（放大 12%），更明显可改 1.18；只改这一个数，
     下面所有 font-size 会一起变，不用逐条修改。 */
  --font-scale: 1;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* 弹窗打开期间锁住背景滚动（由 form-validate.js 加/删） */
body.dialog-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1100px 460px at 50% -220px, rgba(29, 78, 143, .10), transparent 72%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: calc(15.5px * var(--font-scale));
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
::selection { background: rgba(217, 164, 65, .25); }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid rgba(11, 36, 68, .07);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 20px rgba(11, 36, 68, .04);
}
.topbar::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ink), var(--primary) 48%, var(--accent) 100%);
}
.topbar-inner { position: relative; max-width: 1400px; margin: 0 auto; padding: 0 32px; height: 84px; display: flex; align-items: center; gap: 40px; }
/* ---------- 品牌 LOGO：徽章 + 两行文字 ---------- */
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--ink); white-space: nowrap; }
/* 徽章：斜向高光 + 内描边 + 底部一道暖金细线，呼应顶栏的金色渐变压边 */
.brand-mark {
  position: relative; flex: none;
  width: 48px; height: 48px; border-radius: 15px;
  display: grid; place-items: center;
  color: #fff; font-size: calc(22px * var(--font-scale)); font-weight: 700; letter-spacing: -.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 46%),
    linear-gradient(150deg, #2f6ab5 0%, var(--primary) 46%, var(--ink) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .13),
    inset 0 1px 0 rgba(255, 255, 255, .3),
    inset 0 -3px 8px rgba(0, 0, 0, .16),
    0 9px 20px rgba(11, 36, 68, .2),
    0 2px 8px rgba(217, 164, 65, .14);
  transition: transform .25s ease, box-shadow .25s ease;
}
.brand-mark::after {
  content: ""; position: absolute; left: 50%; bottom: 7px;
  width: 16px; height: 2px; border-radius: 2px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}
.brand:hover .brand-mark {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .16),
    inset 0 1px 0 rgba(255, 255, 255, .34),
    inset 0 -3px 8px rgba(0, 0, 0, .16),
    0 13px 26px rgba(11, 36, 68, .26),
    0 3px 10px rgba(217, 164, 65, .22);
}
/* 右侧两行：主名称用深蓝渐变，副标题做成「金线 + 小字」的标签 */
.brand-lines { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.brand-text {
  display: block; font-size: calc(20px * var(--font-scale)); font-weight: 700; line-height: 1.16;
  letter-spacing: .6px; color: var(--ink); white-space: nowrap;
}
@supports (-webkit-background-clip: text) {
  .brand-text {
    background: linear-gradient(100deg, var(--ink) 12%, var(--primary) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
}
.brand-sub {
  display: flex; align-items: center; gap: 7px;
  font-size: calc(10px * var(--font-scale)); font-weight: 600; line-height: 1.3; letter-spacing: 1.5px;
  color: var(--muted); margin-top: 5px; white-space: nowrap;
  text-transform: uppercase;
}
.brand-sub::before {
  content: ""; flex: none; width: 14px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(217, 164, 65, .3));
}
.brand-image .brand-lines { display: none; }
/* 导航 + 用户操作的外层容器：桌面端横排占满剩余宽度，窄屏由响应式规则变成下拉面板 */
.topbar-panel { display: flex; align-items: center; flex: 1; gap: 40px; min-width: 0; }
.nav { display: flex; gap: 4px; flex: 1; }
/* 手机端「菜单」开关：桌面隐藏，三条横线在展开时变成 X */
.nav-toggle {
  display: none; align-items: center; gap: 8px; flex: none; margin-left: auto;
  min-height: 44px; padding: 8px 13px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--primary-dark);
  font-size: calc(14px * var(--font-scale)); font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle-bars { display: inline-flex; flex-direction: column; justify-content: center; gap: 4px; width: 18px; height: 14px; }
.nav-toggle-bars i { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
.topbar.is-open .nav-toggle-bars i:first-child { transform: translateY(6px) rotate(45deg); }
.topbar.is-open .nav-toggle-bars i:nth-child(2) { opacity: 0; }
.topbar.is-open .nav-toggle-bars i:last-child { transform: translateY(-6px) rotate(-45deg); }
.nav a { position: relative; padding: 10px 17px; border-radius: 9px; color: var(--muted); font-size: calc(14.5px * var(--font-scale)); cursor: pointer; transition: .18s; }
.nav a:hover { background: var(--surface-soft); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a.active::after {
  content: ""; position: absolute; left: 17px; right: 17px; bottom: 3px;
  height: 2px; border-radius: 2px; background: var(--accent);
}
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: calc(13px * var(--font-scale)); color: var(--muted); white-space: nowrap; }
.topbar-user .uname { font-size: calc(13px * var(--font-scale)); letter-spacing: .4px; }

/* ---------- 版心与页头 ---------- */
.container { max-width: 1400px; width: 100%; margin: 0 auto; padding: 50px 32px 104px; flex: 1; }
.narrow { max-width: 520px; margin: 0 auto; }
.page-head { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 30px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.page-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 58px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.page-head h1 { font-size: calc(32px * var(--font-scale)); letter-spacing: -.8px; line-height: 1.3; font-weight: 650; }
.page-head .sub { color: var(--muted); font-size: calc(14px * var(--font-scale)); margin-top: 8px; }

/* ---------- 页脚：白底 + 细分隔线 + 居中一行小字 ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); color: var(--hint); font-size: calc(13px * var(--font-scale)); text-align: center; }
.site-footer-inner { max-width: 1400px; margin: 0 auto; padding: 22px 32px; }

/* ---------- 首页 ----------
   原深色主视觉（大横幅、装饰圆环、三步流程、按钮组）已按需求移除，
   首页直接从「全部活动」列表开始，保持简洁。
   如需恢复，在 app/views/home.php 的 .section-head 前加回 hero 区块即可。 */

/* ---------- 分区标题 ---------- */
.section-head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 22px; scroll-margin-top: 100px; }
.section-head h2 { position: relative; padding-left: 16px; font-size: calc(21px * var(--font-scale)); letter-spacing: -.3px; }
.section-head h2::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 19px; border-radius: 2px; background: linear-gradient(180deg, var(--accent), var(--primary)); }
.section-en { font-size: calc(10px * var(--font-scale)); font-weight: 700; letter-spacing: 2.2px; color: var(--hint); }
.section-count { margin-left: auto; color: var(--primary); font-size: calc(12.5px * var(--font-scale)); background: var(--primary-soft); border: 1px solid rgba(29, 78, 143, .12); padding: 4px 13px; border-radius: 999px; }

/* ---------- 通用卡片 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 30px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-title { font-size: calc(17px * var(--font-scale)); font-weight: 600; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.hint { color: var(--hint); font-size: calc(13px * var(--font-scale)); }
.divider { height: 1px; background: var(--line); margin: 22px 0; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; background: linear-gradient(135deg, #24589b, var(--primary-dark)); color: #fff; padding: 11px 21px; border-radius: 10px; cursor: pointer; font-size: calc(14.5px * var(--font-scale)); font-weight: 600; transition: .2s; white-space: nowrap; box-shadow: 0 4px 12px rgba(18, 58, 108, .18); }
.btn:hover { background: linear-gradient(135deg, #2c65ad, var(--primary)); color: #fff; transform: translateY(-2px); box-shadow: 0 9px 22px rgba(18, 58, 108, .26); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--surface-soft); border-color: #c7d4e5; color: var(--text); box-shadow: var(--shadow-sm); }
.btn-danger { background: var(--surface); border-color: #efc9c4; color: var(--danger); box-shadow: none; }
.btn-danger:hover { background: var(--danger-soft); border-color: #e6b4ae; color: var(--danger); box-shadow: none; }
.btn-sm { padding: 6px 13px; font-size: calc(12.5px * var(--font-scale)); border-radius: 8px; box-shadow: none; }
.btn-block { width: 100%; padding: 14px 20px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* 活动管理里两个「一键清空」按钮独占第二行，和编辑/删除等常用按钮拉开距离 */
.clear-actions-row { margin-top: 9px; }
.clear-actions-hint { margin-top: 6px; }
.link { background: none; border: none; color: var(--primary); cursor: pointer; padding: 0; font-size: inherit; font-weight: 600; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--danger); }

/* ---------- 表单控件 ---------- */
.form-row { margin-bottom: 20px; }
.form-row > label { display: block; font-size: calc(14px * var(--font-scale)); font-weight: 600; margin-bottom: 9px; }
.control { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 12px 15px; color: var(--text); outline: none; transition: .18s; font-size: calc(14.5px * var(--font-scale)); box-shadow: inset 0 1px 2px rgba(11, 36, 68, .03); }
.control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
textarea.control { resize: vertical; }
.control::placeholder { color: var(--hint); }
.field-error { color: var(--danger); font-size: calc(13px * var(--font-scale)); margin-top: 7px; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 12px 16px; border-radius: 10px; font-size: calc(14px * var(--font-scale)); margin-bottom: 18px; border-left: 3px solid var(--danger); }
.form-ok { background: var(--success-soft); color: var(--success); padding: 12px 16px; border-radius: 10px; font-size: calc(14px * var(--font-scale)); margin-bottom: 18px; border-left: 3px solid var(--success); }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: calc(13px * var(--font-scale)); color: var(--muted); line-height: 1.75; }
.check-line input { margin-top: 4px; accent-color: var(--primary); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.form-field { margin-bottom: 22px; min-width: 0; }
.form-field.half { grid-column: span 1; }
.form-field .field-label { display: block; font-size: calc(14px * var(--font-scale)); font-weight: 600; margin-bottom: 9px; }
.required { color: var(--danger); margin-left: 3px; }
.field-help { color: var(--hint); font-size: calc(12.5px * var(--font-scale)); margin-top: 7px; }
/* 短信验证码：输入框 + 获取按钮同一行，按钮不被压窄 */
.sms-row { display: flex; gap: 10px; align-items: stretch; }
.sms-row .control { flex: 1 1 auto; min-width: 0; }
.sms-row .sms-send-btn { flex: 0 0 auto; white-space: nowrap; min-width: 108px; }
.sms-row .sms-send-btn:disabled { opacity: .6; cursor: not-allowed; }
/* 说明文字中的网址链接：在灰色小字里保持可辨识的可点样式 */
.help-link { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.help-link:hover { color: var(--primary-dark); text-decoration-thickness: 2px; }
.field-note { background: var(--primary-soft); color: var(--primary-dark); padding: 14px 18px; border-radius: 11px; font-size: calc(14px * var(--font-scale)); margin-bottom: 22px; grid-column: 1 / -1; border-left: 3px solid var(--primary); }
.choice-list { display: flex; flex-wrap: wrap; gap: 10px 22px; padding-top: 4px; }
.choice { display: inline-flex; align-items: center; gap: 8px; font-size: calc(14px * var(--font-scale)); cursor: pointer; }
.choice input { accent-color: var(--primary); width: 16px; height: 16px; }
.upload-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.upload-name { font-size: calc(14px * var(--font-scale)); color: var(--text); }
.upload-hint { font-size: calc(12.5px * var(--font-scale)); color: var(--hint); }
/* 文件选择：隐藏浏览器自带的「未选择任何文件」，用 label 做按钮 */
.file-pick { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.upload-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.btn-file-pick { font-weight: 500; }
.upload-input:focus-visible + .btn-file-pick { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 分步上传：状态行与按钮 */
.upload-state { flex-basis: 100%; font-size: calc(12.5px * var(--font-scale)); min-height: 1px; }
.upload-state:empty { display: none; }
.upload-state.upload-busy { color: var(--hint); }
.upload-state.upload-err { color: var(--danger); }
.upload-state.upload-ok-row { color: var(--success); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-ok { color: var(--success); }
.upload-box .btn-upload { flex: 0 0 auto; }
.upload-remove { font-size: calc(12.5px * var(--font-scale)); }
/* 多文件：已上传文件列表（每项一段，排成一列） */
.upload-list { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; }
.upload-list:empty { display: none; }
.upload-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); font-size: calc(12.5px * var(--font-scale)); }
.upload-item-link { color: var(--primary); word-break: break-all; }
.upload-item-size { color: var(--hint); }
.upload-item-del { margin-left: auto; }
/* 只读详情里的多附件下载链接：每个占一行 */
.file-download { display: inline-flex; align-items: baseline; gap: 6px; margin-right: 14px; }
.file-download .file-size { color: var(--hint); font-size: calc(12px * var(--font-scale)); }
/* 分步上传：实时进度条 */
.upload-state.upload-progress-state { color: var(--muted); }
.upload-progress-row { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; min-width: 0; }
.upload-progress {
  position: relative;
  flex: 1 1 160px;
  min-width: 110px;
  max-width: 340px;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--ink-3));
  transition: width .12s linear;
}
.upload-progress-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--muted);
}
/* 拿不到总长度时的流动动画 */
.upload-progress.is-indeterminate .upload-progress-bar {
  width: 40% !important;
  animation: upload-flow 1.1s ease-in-out infinite;
}
@keyframes upload-flow {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
@media (prefers-reduced-motion: reduce) {
  .upload-progress-bar { transition: none; }
  .upload-progress.is-indeterminate .upload-progress-bar { animation: none; width: 100% !important; opacity: .6; }
}

/* ---------- 必填项漏填：红框高亮 + 汇总弹窗 ---------- */
.form-field.field-missing > .control { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.form-field.field-missing > .choice-list,
.form-field.field-missing > .upload-box { border: 1px solid var(--danger); border-radius: 10px; padding: 10px 12px; background: var(--danger-soft); }
.form-field.field-missing .field-label { color: var(--danger); }

.validate-mask { position: fixed; inset: 0; z-index: 9999; background: rgba(11, 36, 68, .48); display: flex; align-items: center; justify-content: center; padding: 20px; }
.validate-dialog { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px 24px; border-top: 4px solid var(--danger); }
.validate-title { margin: 0 0 10px; font-size: calc(18px * var(--font-scale)); font-weight: 600; color: var(--text); }
.validate-lead { margin: 0 0 14px; font-size: calc(14px * var(--font-scale)); color: var(--muted); line-height: 1.7; }
.validate-list { margin: 0 0 22px; padding: 14px 16px 14px 34px; list-style: disc; background: var(--danger-soft); border-radius: var(--radius-sm); color: var(--danger); font-size: calc(14px * var(--font-scale)); line-height: 1.9; max-height: 260px; overflow-y: auto; }
.validate-list li { word-break: break-all; }
.validate-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 活动卡片 ---------- */
.activity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px; }
.activity-card { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 28px 20px; cursor: pointer; transition: .24s; display: flex; flex-direction: column; min-height: 214px; box-shadow: var(--shadow); }
.activity-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.activity-card:hover { border-color: rgba(29, 78, 143, .38); transform: translateY(-5px); box-shadow: 0 20px 42px rgba(11, 36, 68, .14); }
.activity-card h3 { font-size: calc(19px * var(--font-scale)); margin-bottom: 11px; letter-spacing: -.3px; padding-right: 44px; }
.activity-card .desc { color: var(--muted); font-size: calc(14px * var(--font-scale)); line-height: 1.8; flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.activity-card .foot { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: calc(12.5px * var(--font-scale)); color: var(--hint); }
.act-index { position: absolute; right: 20px; top: 16px; font-size: calc(34px * var(--font-scale)); font-weight: 700; letter-spacing: -2px; color: rgba(29, 78, 143, .09); transition: .24s; pointer-events: none; }
.activity-card:hover .act-index { color: rgba(217, 164, 65, .32); }
.act-arrow { margin-left: auto; font-size: calc(17px * var(--font-scale)); color: var(--primary); opacity: .45; transition: .24s; }
.activity-card:hover .act-arrow { opacity: 1; transform: translateX(4px); }

/* ---------- 徽章 / 空态 ---------- */
.badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-size: calc(12px * var(--font-scale)); font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge.green { background: var(--success-soft); color: var(--success); border-color: rgba(22, 121, 79, .14); }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(168, 106, 18, .14); }
.badge.gray { background: #eef1f6; color: #6b7280; border-color: rgba(107, 114, 128, .12); }
.badge.blue { background: var(--primary-soft); color: var(--primary); border-color: rgba(29, 78, 143, .14); }
.badge.red { background: var(--danger-soft); color: var(--danger); border-color: rgba(192, 57, 43, .14); }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: calc(18px * var(--font-scale)); margin-bottom: 9px; }
.loading { text-align: center; padding: 68px 20px; color: var(--muted); }

/* ---------- 可折叠的长说明（手机上不占整屏） ---------- */
.help-details { margin-top: 14px; padding: 6px 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }
.help-details summary { display: flex; align-items: center; min-height: 40px; cursor: pointer; color: var(--primary); font-size: calc(13px * var(--font-scale)); font-weight: 600; list-style: none; }
.help-details summary::-webkit-details-marker { display: none; }
.help-details summary::after { content: "＋"; margin-left: auto; font-size: calc(15px * var(--font-scale)); font-weight: 400; color: var(--hint); }
.help-details[open] summary::after { content: "－"; }
.help-details .hint { margin: 6px 0 12px; line-height: 1.85; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: calc(14px * var(--font-scale)); }
th, td { padding: 15px 19px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { background: var(--surface-soft); font-weight: 600; color: var(--muted); font-size: calc(12px * var(--font-scale)); letter-spacing: .6px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9fbfe; }
td:first-child { font-weight: 600; color: var(--primary); }

/* ---------- 状态面板 ---------- */
.status-panel { border-radius: 12px; padding: 20px 24px; margin-bottom: 22px; border-left: 4px solid var(--primary); }
.status-panel.blue { background: var(--primary-soft); border-left-color: var(--primary); }
.status-panel.green { background: var(--success-soft); border-left-color: var(--success); }
.status-panel.red { background: var(--danger-soft); border-left-color: var(--danger); }
.status-panel.gray { background: #eef1f6; border-left-color: #9aa7b8; }
.status-panel.amber { background: var(--amber-soft); border-left-color: var(--amber); }
.status-panel h3 { font-size: calc(16px * var(--font-scale)); margin-bottom: 7px; color: var(--text); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 14px 24px; font-size: calc(14px * var(--font-scale)); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* ---------- 后台 ---------- */
.admin-layout { display: grid; grid-template-columns: 232px 1fr; gap: 30px; align-items: start; }
.admin-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 12px; position: sticky; top: 100px; box-shadow: var(--shadow); }
.admin-side::before { content: "管理菜单"; display: block; padding: 4px 15px 12px; font-size: calc(10.5px * var(--font-scale)); letter-spacing: 1.6px; font-weight: 700; color: var(--hint); }
.admin-side button, .admin-side .side-link { position: relative; display: block; width: 100%; text-align: left; padding: 11px 14px 11px 16px; border: none; background: none; border-radius: 9px; color: var(--muted); cursor: pointer; font-size: calc(14px * var(--font-scale)); transition: .18s; }
.admin-side button:hover, .admin-side .side-link:hover { background: var(--surface-soft); color: var(--text); text-decoration: none; }
.admin-side button.active, .admin-side .side-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.admin-side .side-link.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--accent); }
.admin-main { min-width: 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.toolbar .control { width: auto; min-width: 180px; }
.toolbar .spacer { flex: 1; }

/* ---------- 表单设计器 ---------- */
.designer { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.field-list { display: flex; flex-direction: column; gap: 9px; }
.field-item { border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; display: flex; align-items: center; gap: 10px; background: var(--surface); cursor: pointer; transition: .18s; }
.field-item.selected { border-color: var(--primary); background: var(--primary-soft); }
.field-item .fi-main { flex: 1; min-width: 0; cursor: pointer; }
.field-item .fi-label { font-size: calc(14px * var(--font-scale)); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-item .fi-meta { font-size: calc(12.5px * var(--font-scale)); color: var(--hint); }
.field-item .fi-actions { display: flex; gap: 4px; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; width: 29px; height: 29px; display: grid; place-items: center; cursor: pointer; color: var(--muted); font-size: calc(12px * var(--font-scale)); padding: 0; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.type-picker { display: flex; flex-wrap: wrap; gap: 9px; }
.type-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 7px 13px; font-size: calc(12.5px * var(--font-scale)); cursor: pointer; color: var(--muted); font-family: inherit; transition: .18s; }
.type-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.props { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: sticky; top: 100px; box-shadow: var(--shadow); }
.props h3 { font-size: calc(15px * var(--font-scale)); margin-bottom: 16px; }
.props .form-row { margin-bottom: 13px; }
.props .check-line input { accent-color: var(--primary); }
/* 帮助文字里的插入链接按钮与填写面板 */
.link-add-btn { margin-left: 8px; padding: 2px 9px; font-size: calc(12px * var(--font-scale)); font-weight: 500; color: var(--primary); background: var(--primary-soft); border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.link-add-btn:hover { border-color: var(--primary); background: #dfeaf9; }
.link-tip { font-size: calc(11.5px * var(--font-scale)); color: var(--hint); margin-top: 5px; line-height: 1.5; }
.link-editor { margin-top: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); display: flex; flex-direction: column; gap: 8px; }
.link-editor[hidden] { display: none; }
.link-editor .control { font-size: calc(13px * var(--font-scale)); padding: 7px 10px; }
.link-editor-actions { display: flex; gap: 8px; }
.link-editor-err { font-size: calc(12px * var(--font-scale)); color: var(--danger); }
.link-editor-err[hidden] { display: none; }
.preview-box { border: 1px dashed #cfd8e6; border-radius: 11px; padding: 18px; background: var(--surface-soft); }

.modal-mask { position: fixed; inset: 0; background: rgba(11, 36, 68, .52); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--surface); border-radius: 18px; width: min(560px, 100%); max-height: 86vh; overflow: auto; padding: 28px; box-shadow: 0 26px 76px rgba(11, 36, 68, .3); }
.modal h2 { font-size: calc(19px * var(--font-scale)); margin-bottom: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 9px; font-size: calc(13px * var(--font-scale)); z-index: 100; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); max-width: 90vw; }

/* ---------- 登录 / 注册：居中单卡片（无顶栏、无页脚） ---------- */
.auth-simple {
  min-height: 100vh; display: flex; justify-content: center; align-items: flex-start;
  padding: 8vh 16px 40px; background: #f7f9fd;
}
.auth-simple-card {
  width: 100%; max-width: 430px; padding: 38px 36px 32px;
  background: #fff; border: 1px solid #e6ebf3; border-radius: 20px;
  box-shadow: 0 18px 52px rgba(16, 42, 84, .09);
}
.auth-simple-kicker { color: #1a56db; font-size: calc(13px * var(--font-scale)); font-weight: 700; letter-spacing: .4px; margin-bottom: 14px; }
.auth-simple-card h1 { font-size: calc(29px * var(--font-scale)); line-height: 1.3; font-weight: 700; letter-spacing: -.6px; color: var(--text); }
.auth-simple-sub { color: var(--hint); font-size: calc(14px * var(--font-scale)); margin-top: 8px; margin-bottom: 26px; }
.auth-simple-notice {
  background: #f0fdf4; color: #16794f; border: 1px solid #c5ecd2; border-radius: 10px;
  padding: 12px 16px; font-size: calc(14px * var(--font-scale)); margin-bottom: 24px;
}
.auth-simple .form-row { margin-bottom: 20px; }
.auth-simple .form-row > label { font-size: calc(14px * var(--font-scale)); font-weight: 600; color: #1f2d44; }
.auth-simple .control {
  height: 54px; padding: 13px 16px; font-size: calc(15.5px * var(--font-scale));
  background: #eef4ff; border-color: transparent; border-radius: 10px;
  box-shadow: none; color: var(--text);
}
.auth-simple .control:focus { background: #eaf1ff; border-color: #9dbcf7; box-shadow: 0 0 0 3px rgba(26, 86, 219, .10); }
.auth-simple .control::placeholder { color: #a5b1c2; }
.auth-simple .form-error, .auth-simple .form-ok { border-left: none; border-radius: 10px; }
.auth-simple-password { position: relative; }
.auth-simple-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #1a56db; font-size: calc(14px * var(--font-scale));
  font-weight: 600; cursor: pointer; padding: 6px 8px;
}
.auth-simple-toggle:hover { color: #123f9e; }
.auth-simple .btn.auth-simple-submit {
  width: 100%; height: 50px; margin-top: 4px; padding: 0 20px;
  background: #1a56db; border: 1px solid #1a56db; color: #fff;
  border-radius: 9px; font-size: calc(16px * var(--font-scale)); font-weight: 600;
  box-shadow: 0 8px 20px rgba(26, 86, 219, .18);
}
.auth-simple .btn.auth-simple-submit:hover {
  background: #1549bd; border-color: #1549bd; color: #fff;
  transform: translateY(-1px); box-shadow: 0 12px 24px rgba(26, 86, 219, .24);
}
.auth-simple .check-line { margin-bottom: 20px; }
.auth-simple-foot { text-align: center; font-size: calc(13.5px * var(--font-scale)); color: var(--hint); margin-top: 24px; }
.auth-simple-foot a { color: #1a56db; font-weight: 600; }
.auth-simple-foot a:hover { text-decoration: underline; }

/* 其余窄页（改密、管理员认领、提示页）仍沿用卡片式 */
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; color: var(--ink); font-size: calc(17px * var(--font-scale)); font-weight: 600; letter-spacing: .5px; }
.narrow > .card { position: relative; padding: 36px 38px; border-radius: 18px; }
.narrow > .card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 18px 18px 0 0; }
.narrow .card-title { border-bottom: none; padding-bottom: 0; margin-bottom: 6px; }
.narrow .card-title.auth-title { justify-content: flex-start; font-size: calc(23px * var(--font-scale)); letter-spacing: -.4px; }
.container > .form-ok, .container > .form-error { margin-bottom: 18px; }
a.activity-card { color: var(--text); text-decoration: none; }
.card .form-grid { margin-bottom: 20px; }
.admin-main .toolbar { margin-bottom: 18px; }

/* ---------- 自定义 LOGO / 网站设置 ---------- */
.brand-image { gap: 0; }
.brand-image img { display: block; max-height: 48px; max-width: 220px; width: auto; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(11, 36, 68, .08)); }
.auth-brand.brand-image { margin-bottom: 22px; }
.auth-brand.brand-image img { max-height: 60px; max-width: 260px; }
.auth-brand .brand-mark { width: 40px; height: 40px; font-size: calc(18px * var(--font-scale)); }
.auth-brand .brand-text { font-size: calc(18px * var(--font-scale)); }
.auth-brand .brand-sub { font-size: calc(9px * var(--font-scale)); letter-spacing: 1.5px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 18px; align-items: start; }
.settings-grid [hidden] { display: none !important; }
.logo-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.logo-mode { display: flex; align-items: flex-start; gap: 10px; padding: 16px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); transition: .18s; }
.logo-mode:hover { border-color: #b9cbe0; }
.logo-mode.is-selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(29, 78, 143, .08); }
.logo-mode input { margin-top: 3px; accent-color: var(--primary); flex: none; }
.lm-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lm-body strong { font-size: calc(14px * var(--font-scale)); font-weight: 600; color: var(--text); }
.lm-body small { font-size: calc(12.5px * var(--font-scale)); color: var(--muted); line-height: 1.5; }
/* 预览区模拟真实顶栏：同样的顶部渐变细线，尺寸直接继承前台 LOGO 样式 */
.logo-preview-bar {
  position: relative; display: flex; align-items: center; gap: 14px;
  min-height: 90px; padding: 18px 24px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-soft); margin-bottom: 14px; overflow: hidden;
}
.logo-preview-bar::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--ink), var(--primary) 48%, var(--accent) 100%);
}
.logo-preview-bar img { display: block; max-height: 48px; max-width: 240px; width: auto; object-fit: contain; }
.logo-preview-bar img[hidden] { display: none; }

/* ---------- 证书 PDF 内联预览（前台 / 后台共用） ---------- */
.cert-frame { display: block; width: 100%; height: min(76vh, 780px); min-height: 420px; border: 1px solid #dbe3ef; border-radius: 10px; background: #fff; }
.cert-frame.admin { height: min(70vh, 720px); min-height: 380px; }

/* ---------- 入场动效 ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.section-head, .activity-grid, .container > .card, .container > .table-wrap,
.container > .status-panel, .narrow > .card, .auth-simple-card { animation: rise .55s cubic-bezier(.2, .7, .3, 1) both; }
.activity-grid { animation-delay: .1s; }

/* ============================================================
   响应式
   1000px 以下：平板 / 小桌面，只收窄留白、把后台侧栏和表单改成单列
   820px  以下：手机，顶栏折叠、表格转卡片、按钮加大触控区（本段是重点）
   380px  以下：小屏手机，再收一点留白
   注意：--font-scale 全程不动，正文小字号保持用户设定的原样。
   ============================================================ */
@media (max-width: 1000px) {
  .container { padding: 32px 20px 72px; }
  .topbar-inner { padding: 0 20px; gap: 20px; }
  .topbar-panel { gap: 20px; }
  .site-footer-inner { padding: 20px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; display: flex; gap: 4px; overflow-x: auto; }
  .admin-side::before { display: none; }
  .admin-side button, .admin-side .side-link { white-space: nowrap; width: auto; }
  .designer { grid-template-columns: 1fr; }
  .props { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .activity-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .logo-modes { grid-template-columns: 1fr; }
  .auth-simple { padding: 6vh 16px 32px; }
}

/* ---------- 手机端（≤820px） ---------- */
@media (max-width: 820px) {
  /* 1. 顶栏：一行只放品牌 + 菜单按钮，导航和用户操作收进下拉面板 */
  .topbar-inner { height: 60px; padding: 0 16px; gap: 12px; }
  .brand { min-width: 0; gap: 10px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; font-size: calc(18px * var(--font-scale)); }
  .brand-mark::after { bottom: 6px; width: 13px; }
  .brand-text { max-width: 48vw; overflow: hidden; text-overflow: ellipsis; font-size: calc(16px * var(--font-scale)); letter-spacing: .3px; }
  .brand-sub { max-width: 48vw; overflow: hidden; text-overflow: ellipsis; font-size: calc(9px * var(--font-scale)); letter-spacing: 1px; margin-top: 3px; }
  .brand-image img { max-height: 38px; max-width: 48vw; }
  .nav-toggle { display: inline-flex; }
  .topbar-panel {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 34px rgba(11, 36, 68, .14);
    padding: 8px 16px 14px;
    max-height: calc(100vh - 60px);
    max-height: calc(100dvh - 60px); /* 手机浏览器地址栏伸缩时用动态视口高度 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .topbar.is-open .topbar-panel { display: flex; }
  .topbar-panel .nav { flex: none; flex-direction: column; gap: 2px; }
  .topbar-panel .nav a {
    display: flex; align-items: center; min-height: 46px;
    padding: 10px 14px; border-radius: 10px;
    font-size: calc(14.5px * var(--font-scale));
  }
  .topbar-panel .nav a.active::after {
    left: 4px; right: auto; top: 10px; bottom: 10px;
    width: 3px; height: auto;
  }
  .topbar-panel .topbar-user {
    margin-top: 8px; padding-top: 12px; gap: 8px; flex-wrap: wrap;
    border-top: 1px solid var(--line-soft);
  }
  .topbar-panel .topbar-user .uname { margin-right: auto; }

  /* 2. 版心、页头、分区标题：竖排 + 允许长文本换行，避免把按钮挤出屏幕 */
  .container { padding: 22px 14px 48px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; padding-bottom: 16px; margin-bottom: 20px; }
  .page-head > div { min-width: 0; max-width: 100%; }
  .page-head h1 { font-size: calc(24px * var(--font-scale)); overflow-wrap: anywhere; }
  .page-head .sub { overflow-wrap: anywhere; }
  .page-head > .btn, .page-head > .badge, .page-head > .btn-row { align-self: flex-start; }
  .section-head { flex-wrap: wrap; gap: 8px 12px; scroll-margin-top: 72px; }
  .section-head h2 { font-size: calc(19px * var(--font-scale)); }
  .section-en { display: none; }
  .section-count { margin-left: auto; }
  .card { padding: 20px 16px; border-radius: 14px; }
  .card-title { flex-wrap: wrap; gap: 6px; font-size: calc(16px * var(--font-scale)); padding-bottom: 12px; margin-bottom: 16px; overflow-wrap: anywhere; }
  .status-panel { padding: 16px 16px; }
  /* 长英文、长文件名、URL 一律允许折行，杜绝横向溢出 */
  .hint, .muted, .status-panel, .help-details .hint { overflow-wrap: anywhere; }
  .empty { padding: 36px 12px; }
  .help-details summary { min-height: 46px; }
  .site-footer-inner { padding: 16px 14px; }

  /* 3. 活动卡片：单列、缩减留白、去掉触屏上会「粘住」的悬浮位移 */
  .activity-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .activity-card { min-height: 0; padding: 20px 18px 16px; }
  .activity-card h3 { font-size: calc(18px * var(--font-scale)); padding-right: 36px; overflow-wrap: anywhere; }
  .activity-card .foot { flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; }
  .act-index { font-size: calc(28px * var(--font-scale)); right: 14px; top: 12px; }
  .act-arrow { display: none; }
  .activity-card:hover { transform: none; border-color: var(--line); }

  /* 4. 表格转卡片：列名由 mobile.js 写进 data-label，标签在上、内容在下。
        用 block 而不是 flex，是为了让单元格里多个 div 仍按正常竖排显示。 */
  .table-wrap { overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .table-wrap table, .table-wrap tbody { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr {
    display: block; margin-bottom: 12px; padding: 4px 14px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
  }
  .table-wrap tr:last-child { margin-bottom: 0; }
  .table-wrap td {
    display: block; padding: 9px 0;
    border-bottom: 1px solid var(--line-soft);
    white-space: normal; overflow-wrap: anywhere; word-break: break-word;
  }
  .table-wrap tr td:last-child { border-bottom: none; }
  .table-wrap tr:hover td { background: transparent; }
  .table-wrap td::before {
    content: attr(data-label); display: block;
    color: var(--muted); font-size: calc(12.5px * var(--font-scale));
    font-weight: 600; margin-bottom: 3px; line-height: 1.6;
  }
  .table-wrap td:not([data-label])::before,
  .table-wrap td[data-label=""]::before,
  .table-wrap td:first-child::before { display: none; }
  .table-wrap td:first-child { color: var(--primary); font-weight: 600; }
  .table-wrap td > * { max-width: 100%; }

  /* 5. 按钮与表单：加大触控面积。
        输入框统一 16px 是必要的——iOS Safari 遇到小于 16px 的输入框会自动放大整页，
        这里只改输入类控件，页面正文字号一个都没动。 */
  .btn { min-height: 44px; padding: 10px 18px; }
  .btn-sm { min-height: 38px; padding: 8px 14px; }
  .btn-block { min-height: 50px; }
  .btn-row { gap: 8px; }
  input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
  select, textarea { font-size: 16px; }
  .control { padding: 12px 14px; min-height: 46px; }
  .form-row { margin-bottom: 18px; }
  .form-field { margin-bottom: 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .form-field.half { grid-column: auto; }
  .choice-list { gap: 12px 18px; }
  .choice { min-height: 40px; }
  .choice input { width: 19px; height: 19px; }
  .upload-box { gap: 10px; }
  .upload-box input[type="file"] { max-width: 100%; }
  .check-line input { width: 18px; height: 18px; }
  .kv { grid-template-columns: minmax(0, 104px) minmax(0, 1fr); gap: 8px 14px; }
  .kv dt, .kv dd { overflow-wrap: anywhere; }
  .field-note { padding: 12px 14px; }

  /* 6. 后台：侧栏横滑、工具栏竖排、设计器按钮加大 */
  .admin-side {
    gap: 6px; padding: 8px; border-radius: 12px;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .admin-side::-webkit-scrollbar { display: none; }
  .admin-side .side-link {
    flex: none; display: inline-flex; align-items: center;
    min-height: 42px; padding: 9px 14px;
  }
  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .toolbar .control { width: 100%; min-width: 0; }
  .toolbar .spacer { display: none; }
  .toolbar .btn { width: 100%; }
  .field-item { flex-wrap: wrap; padding: 12px; }
  .icon-btn { width: 38px; height: 38px; font-size: calc(14px * var(--font-scale)); }
  .type-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 9px 14px; }
  .props { padding: 16px; }
  .logo-preview-bar { min-height: 72px; padding: 14px; }
  .logo-preview-bar img { max-width: 60vw; }

  /* 7. 弹窗、提示、证书预览 */
  .validate-mask, .modal-mask { padding: 12px; }
  .validate-dialog { padding: 20px 18px 18px; max-height: 86vh; overflow-y: auto; }
  .validate-list { max-height: 40vh; padding-left: 30px; }
  .validate-actions { gap: 8px; }
  .validate-actions .btn { flex: 1; }
  .modal { padding: 20px 18px; max-height: 88vh; }
  .modal-foot { flex-wrap: wrap; }
  .toast { bottom: 16px; }
  .cert-frame { height: 62vh; min-height: 300px; }
  .cert-frame.admin { height: 58vh; min-height: 280px; }

  /* 8. 登录 / 注册 / 其它窄页 */
  .auth-simple { padding: 24px 14px 32px; }
  .auth-simple-card { padding: 26px 20px 24px; border-radius: 16px; }
  .auth-simple-card h1 { font-size: calc(24px * var(--font-scale)); }
  .narrow > .card { padding: 24px 20px; }
}

/* ---------- 小屏手机（≤380px） ---------- */
@media (max-width: 380px) {
  .container { padding: 18px 12px 40px; }
  .topbar-inner { padding: 0 12px; }
  .nav-toggle-text { display: none; }
  .brand-text, .brand-sub { max-width: 44vw; }
  .card { padding: 18px 14px; }
  .btn-sm { padding: 8px 12px; }
  .validate-dialog { padding: 18px 16px 16px; }
  .section-count { padding: 3px 10px; }
}

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