/* =========================================================
   OMC 视频部文档下载中心 —— 样式表
   目录：
   1. 变量与基础重置
   2. 顶部 Hero
   3. 分组与文件列表
   4. 文件类型图标（纯 CSS）
   5. 下载按钮
   6. 说明区与页脚
   7. 响应式
   8. 深色模式 / 打印
   ========================================================= */

/* ---------- 1. 变量与基础重置 ---------- */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f7f8fc;
  --border: #e4e7f0;
  --text: #1b2333;
  --text-soft: #5b6478;
  --text-mute: #8b93a7;
  --brand: #2f6bff;
  --brand-strong: #1f52d6;
  --brand-soft: rgba(47, 107, 255, 0.1);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(20, 32, 66, 0.06);
  --shadow-md: 0 10px 28px rgba(20, 32, 66, 0.1);
  --ring: 0 0 0 3px rgba(47, 107, 255, 0.35);

  /* ---------- 顶部配色 ----------
     下载页顶部大图、后台 / 查询页顶栏共用这一条。
     想换颜色或换渐变，只改这一行即可（纯色也行，写 #2f6bff 就可以）；
     深色模式在文件末尾的 @media (prefers-color-scheme: dark) 里单独覆盖。 */
  --hero-bg: linear-gradient(135deg, #2f6bff 0%, #5b8cff 45%, #1f52d6 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* 手机端去除点击高亮 */
  -webkit-tap-highlight-color: transparent;
}

a,
button {
  /* 消除移动端双击缩放与点击延迟 */
  touch-action: manipulation;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

/* ---------- 2. 顶部 Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  /* 底部留白收紧，避免 Hero 过长 */
  padding: 34px 24px 36px;
  color: #fff;
  /* 背景见文件顶部的 --hero-bg（默认是蓝色渐变） */
  background: var(--hero-bg);
}

/* 背景装饰光斑：给纯渐变加一点层次，不想要可以整段删掉 */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero::before {
  width: 380px;
  height: 380px;
  top: -160px;
  right: -80px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 70%);
}

.hero::after {
  width: 300px;
  height: 300px;
  bottom: -180px;
  left: -60px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
}

/* 顶部一行：左边徽标，右边当前登录用户 */
.hero__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.hero__logo {
  display: block;
  width: 100%;
  max-width: 268px;
  height: auto;
}

.hero__user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 14px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 13.5px;
  white-space: nowrap;
}

.hero__user-name {
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero__logout {
  flex: none;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.6;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.hero__logout:hover {
  background: rgba(255, 255, 255, 0.32);
}

.hero__title {
  font-size: clamp(26px, 4.2vw, 38px);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.hero__desc {
  max-width: 620px;
  margin-top: 14px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.88);
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.stat {
  min-width: 132px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
}

.stat__num {
  display: block;
  font-size: 19px;
  font-weight: 700;
}

.stat__label {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
}

/* ---------- 2.5 快捷导航栏 ----------
   后台和下载页共用（assets/nav.js 接管）。
   有 [data-nav] 的元素就是导航目标，按文档顺序生成按钮。

   手机上不做成下拉菜单，而是一行可横向滑动的胶囊：
   手指左右滑就能看到全部入口，比点开菜单再选快。 */
.secnav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* 内容为空（比如还没登录、一个分组都没有）时整条藏起来 */
.secnav[hidden] {
  display: none;
}

.secnav__inner {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: var(--secnav-max, 1000px);
  margin: 0 auto;
  padding: 9px 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* 这里刻意不写 scroll-behavior: smooth ——
     它会让 scrollLeft 赋值这种"直接定位"也变成异步动画，
     动画该不该有交给 nav.js 显式传 behavior 决定。 */
}

.secnav__inner::-webkit-scrollbar {
  display: none;
}

.secnav__link {
  flex: none;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.secnav__link:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.secnav__link.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* 滚动到某个区块时给它留出导航栏的高度，否则标题会被压住 */
[data-nav] {
  scroll-margin-top: 64px;
}

/* ---------- 3. 分组与文件列表 ---------- */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

.group {
  /* 与 Hero 保持正常间距，避免顶部内容被遮挡 */
  position: relative;
  z-index: 1;
  margin-top: 24px;
  padding: 26px 26px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.group + .group {
  margin-top: 26px;
}

.group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.group__title {
  position: relative;
  padding-left: 14px;
  font-size: 17px;
  font-weight: 700;
}

.group__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--brand);
  transform: translateY(-50%);
}

.group__count {
  font-size: 12.5px;
  color: var(--text-mute);
}

.file-list {
  display: flex;
  flex-direction: column;
}

.file {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 4px;
  border-bottom: 1px dashed var(--border);
  transition: background-color 0.18s ease;
}

.file:last-child {
  border-bottom: none;
}

.file:hover {
  background: var(--surface-soft);
}

.file__body {
  flex: 1 1 auto;
  min-width: 0;
}

.file__name {
  font-size: 15.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.file__desc {
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--text-soft);
}

.file__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-mute);
}

.file__meta > span:not(.tag)::before {
  content: "·";
  margin-right: 8px;
  color: var(--border);
}

.tag {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ---------- 4. 文件类型图标（纯 CSS） ---------- */
.file__icon {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 54px;
  border-radius: 8px 14px 8px 8px;
  background: #e8ecf6;
  color: #3d4a63;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* 右上角折角 */
.file__icon::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 14px;
  border-radius: 0 14px 0 4px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: -1px 1px 0 rgba(0, 0, 0, 0.06);
}

/* 显示扩展名 */
.file__icon::after {
  content: attr(data-ext);
}

/* 按文件类型着色 */
.file__icon[data-ext="mp4"] { background: #ffe8e0; color: #c2410c; }
.file__icon[data-ext="pdf"] { background: #fee2e2; color: #b91c1c; }
.file__icon[data-ext="docx"] { background: #e0eaff; color: #1d4ed8; }
.file__icon[data-ext="xlsx"] { background: #dcf5e6; color: #15803d; }
.file__icon[data-ext="pptx"] { background: #ffeadf; color: #c2410c; }
.file__icon[data-ext="zip"] { background: #efe6ff; color: #6d28d9; }
.file__icon[data-ext="csv"] { background: #def3f1; color: #0f766e; }
.file__icon[data-ext="dmg"] { background: #e6e9f0; color: #334155; }

/* ---------- 5. 下载按钮 ---------- */
.btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.18s ease, transform 0.12s ease,
    box-shadow 0.18s ease;
}

.btn::before {
  content: "";
  flex: none;
  width: 11px;
  height: 13px;
  margin-right: 7px;
  /* 纯色块 + 裁剪，保证箭头完整显示 */
  background: currentColor;
  clip-path: polygon(50% 100%, 0 50%, 32% 50%, 32% 0, 68% 0, 68% 50%, 100% 50%);
}

.btn:hover {
  background: var(--brand-strong);
  box-shadow: 0 8px 18px rgba(47, 107, 255, 0.32);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* ---------- 6. 说明区与页脚 ---------- */
.notice {
  margin-top: 26px;
  padding: 20px 26px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.notice__title {
  font-size: 14.5px;
  font-weight: 700;
}

.notice__list {
  margin-top: 10px;
  padding-left: 20px;
  list-style: disc;
  font-size: 13.5px;
  color: var(--text-soft);
}

.notice__list li + li {
  margin-top: 4px;
}

.notice__list::marker,
.notice__list li::marker {
  color: var(--brand);
}

.footer {
  padding: 26px 24px 40px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-mute);
}

/* 加载中 / 空列表 / 出错 的提示块（index.html 由 assets/app.js 控制显隐） */
[hidden] {
  display: none !important;
}

.state {
  margin-top: 24px;
  padding: 30px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
  font-size: 14px;
  color: var(--text-soft);
}

.state--error {
  border-style: solid;
  border-color: #f0b4b4;
  background: #fff5f5;
  color: #b91c1c;
}

/* ---------- 6.1 下载页登录卡片 ---------- */
.login {
  /* 窄一点居中，避免变成一整条空荡荡的大卡片 */
  max-width: 420px;
  margin: 24px auto 0;
  padding: 32px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.login__title {
  font-size: 17px;
  font-weight: 700;
}

.login__desc {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--text-soft);
}

.login__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 320px;
  margin: 22px auto 0;
  text-align: left;
}

.login__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login__label {
  font-size: 12.5px;
  color: var(--text-soft);
}

.login__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.login__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}

.login__submit {
  margin-top: 4px;
  padding: 11px 18px;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.login__submit:hover {
  background: var(--brand-strong);
}

.login__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login__msg {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--text-soft);
  min-height: 20px;
}

.login__msg--error {
  color: #dc2626;
}

/* ---------- 6.2 修改密码弹窗 ----------
   下载页 / 后台 / 记录查询页三处共用同一份结构（assets/account.js 接管），
   所以样式放在这个三页都会加载的 style.css 里，
   类名统一用 pw- 前缀，避免和 admin.css 里的 .admin-dialog 打架。 */
.pw-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
}

.pw-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
}

.pw-dialog__title {
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 700;
}

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

.pw-field__label {
  font-size: 12.5px;
  color: var(--text-soft);
}

.pw-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.pw-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}

.pw-msg {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-soft);
  min-height: 18px;
}

.pw-msg--error { color: #dc2626; }
.pw-msg--ok { color: #16a34a; }

.pw-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.pw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.pw-btn:hover {
  background: var(--brand-strong);
}

.pw-btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.pw-btn--ghost:hover {
  background: var(--surface-soft);
  border-color: var(--brand);
  color: var(--brand);
}

/* ---------- 6.3 在线预览弹窗 ----------
   同样三页共用（assets/viewer.js 接管）。 */
.vw {
  display: flex;
  flex-direction: column;
  width: min(1100px, 94vw);
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
}

.vw::backdrop {
  background: rgba(15, 23, 42, 0.62);
}

/* dialog 未打开时必须真的不显示，否则铺一层白板挡住页面 */
.vw:not([open]) {
  display: none;
}

.vw__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.vw__title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vw__icon {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.vw__icon:hover {
  background: var(--surface-soft);
  color: var(--text);
}

/* 媒体区统一深色底：视频和图片留黑边比较自然。
 *
 * 这里用 justify-content 做水平居中，**不用 align-items: center** ——
 * align-items 居中的可滚动 flex 容器在内容比容器高时会把顶部裁掉，
 * 手机上横屏就会看不到开头。改成给内容加 margin: auto 来居中，
 * 溢出时照样能从顶部开始滚。
 * overflow: auto 是为了手机横屏那种矮视口 —— 内容再高也不会被切掉。 */
.vw__body {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  padding: 0;
  overflow: auto;
  background: #0d1117;
}

.vw__frame {
  flex: none;
  width: 100%;
  height: 78vh;
  border: 0;
  background: #fff;
}

.vw__video {
  flex: none;
  width: 100%;
  max-height: 78vh;
  margin: auto 0;
  background: #000;
}

.vw__audio {
  flex: none;
  width: min(560px, 100%);
  margin: auto;
}

.vw__img {
  flex: none;
  max-width: 100%;
  max-height: 78vh;
  margin: auto;
  object-fit: contain;
}

.vw__text {
  flex: none;
  width: 100%;
  height: 78vh;
  margin: 0;
  padding: 16px 18px;
  overflow: auto;
  background: var(--surface);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

.vw__fallback {
  flex: none;
  margin: auto;
  padding: 40px 24px;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.9;
  text-align: center;
}

/* 手机上 PDF 的替代面板（内嵌阅读器翻不了页，改用系统阅读器打开） */
.vw__prompt {
  flex: none;
  width: 100%;
  max-width: 460px;
  /* auto 而不是 0 auto：既能居中，内容比容器高时也不会把顶部裁掉 */
  margin: auto;
  padding: 32px 24px;
  text-align: center;
}

.vw__prompt-title {
  color: #e6edf7;
  font-size: 16px;
  font-weight: 700;
}

.vw__prompt-text {
  margin-top: 10px;
  color: #aab6cc;
  font-size: 13.5px;
  line-height: 1.9;
  text-align: left;
}

.vw__prompt-note {
  margin-top: 14px;
  color: #8494ad;
  font-size: 12.5px;
  line-height: 1.8;
}

/* 这个按钮是面板里的主要出口，做大手一点好点 */
.vw__btn--big {
  min-height: 46px;
  margin-top: 20px;
  padding: 12px 28px;
  font-size: 15px;
  text-decoration: none;
}

.vw__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex: none;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.vw__meta {
  font-size: 12.5px;
  color: var(--text-soft);
}

.vw__actions {
  display: flex;
  gap: 10px;
}

.vw__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.vw__btn:hover {
  background: var(--brand-strong);
}

.vw__btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.vw__btn--ghost:hover {
  background: var(--surface-soft);
  border-color: var(--brand);
  color: var(--brand);
}

/* 文件卡片右侧的按钮组（查看 + 下载） */
.file__acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* 下载页文件卡片上的「查看」按钮 */
.file__view {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.file__view:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

/* ---------- 7. 响应式 ---------- */
@media (max-width: 720px) {
  /* 导航栏：窄屏收一点内边距，让更多入口能露出来 */
  .secnav__inner {
    gap: 5px;
    padding: 8px 14px;
  }

  .secnav__link {
    padding: 5px 12px;
    font-size: 12.5px;
  }

  [data-nav] {
    scroll-margin-top: 56px;
  }

  .hero {
    padding: 24px 18px 26px;
  }

  .hero__top {
    margin-bottom: 14px;
    gap: 10px;
  }

  .hero__logo {
    max-width: 186px;
  }

  .hero__user {
    padding: 4px 5px 4px 12px;
    font-size: 13px;
  }

  .hero__user-name {
    max-width: 110px;
  }

  .hero__title {
    font-size: 26px;
  }

  .login {
    padding: 24px 18px;
  }

  .hero__desc {
    font-size: 14px;
  }

  .hero__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 22px;
  }

  .stat {
    min-width: 0;
    padding: 10px 6px;
    text-align: center;
  }

  .stat__num {
    font-size: 15px;
    overflow-wrap: anywhere;
  }

  .stat__label {
    font-size: 11px;
  }

  .container {
    padding: 0 14px 48px;
  }

  .group {
    margin-top: 16px;
    padding: 18px 14px 4px;
    border-radius: 14px;
  }

  .group__head {
    flex-wrap: wrap;
  }

  .file {
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 2px;
  }

  .file__icon {
    width: 38px;
    height: 45px;
    font-size: 10px;
  }

  .file__body {
    flex: 1 1 calc(100% - 48px);
  }

  .file__name {
    font-size: 15px;
  }

  .file__desc {
    font-size: 13px;
  }

  .file__meta {
    gap: 6px;
    font-size: 12px;
  }

  /* 按钮独占一行，增大点击热区 */
  .btn {
    width: 100%;
    min-height: 44px;
    margin-top: 2px;
  }

  /* 按钮组独占一行铺开 */
  .file__acts {
    width: 100%;
    justify-content: stretch;
  }

  .file__view,
  .file__acts .btn {
    flex: 1;
  }

  .file__view {
    min-height: 40px;
    justify-content: center;
  }

  .notice {
    padding: 16px;
  }

  /* 预览弹窗在小屏上铺满，矮一点免得超出视口 */
  .vw {
    width: 96vw;
    max-height: 94vh;
  }

  /* 用 calc 扣掉标题栏和底部按钮占的高度，而不是写死 68vh ——
     手机横屏时 vh 很小，写死的话 PDF 区域会比剩余空间高，底部被裁掉。 */
  .vw__frame,
  .vw__text {
    height: calc(94vh - 130px);
    min-height: 180px;
  }

  .vw__video,
  .vw__img {
    max-height: calc(94vh - 170px);
  }

  .vw__prompt {
    padding: 24px 18px;
  }

  .vw__foot {
    padding: 10px 12px;
  }

  .vw__actions {
    width: 100%;
  }

  .vw__btn {
    flex: 1;
  }
}

/* 更窄的机型（约 375px 及以下） */
@media (max-width: 480px) {
  .hero__stats {
    gap: 6px;
  }

  .stat {
    padding: 9px 4px;
  }

  .stat__num {
    font-size: 13.5px;
  }

  .stat__label {
    font-size: 10.5px;
  }

  .file__meta > span:not(.tag)::before {
    margin-right: 6px;
  }
}

/* ---------- 8. 深色模式 / 打印 ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10131c;
    --surface: #191d29;
    --surface-soft: #1f2432;
    --border: #2b3244;
    --text: #eaeefb;
    --text-soft: #a9b2c7;
    --text-mute: #7d879e;
    --brand: #4d81ff;
    --brand-strong: #6a97ff;
    --brand-soft: rgba(77, 129, 255, 0.18);
    --ring: 0 0 0 3px rgba(106, 151, 255, 0.45);

    /* 深色模式下顶部用更深一档的蓝，免得在一片深色里太扎眼 */
    --hero-bg: linear-gradient(135deg, #1b3fa8 0%, #2f6bff 50%, #16307d 100%);
  }

  .state--error {
    border-color: #5b2b2b;
    background: #2a1a1a;
    color: #fca5a5;
  }
}

@media print {
  .hero {
    color: #000;
    background: none;
  }

  .hero__logo,
  .hero__stats,
  .btn {
    display: none;
  }

  .group,
  .notice {
    box-shadow: none;
    margin-top: 16px;
    break-inside: avoid;
  }
}
