﻿/* 客户端全局样式
   设计约束：纯扁平化，不使用阴影、渐变、发光等装饰效果。
   层次通过 1px 边框与浅灰底色区分。
   唯一例外是首页横幅 .hero：它是一块封面式的展示区，用一层低调的
   渐变把主标题推出来，其余组件不跟随这套处理。 */

:root {
  --c-bg: #f5f6f8;
  --c-surface: #ffffff;
  --c-border: #e8eaed;
  --c-border-strong: #d8dbe0;
  --c-text: #16181d;
  --c-text-sub: #6b7280;
  --c-text-muted: #9aa0aa;
  --c-ink: #16181d;
  --c-accent: #c8553d;
  --c-success: #1f7a4d;
  --c-gold: #b8860b;
  --radius-lg: 10px;
  --radius: 8px;
  --radius-sm: 6px;
  /* 顶栏内层内容高度；整体占位（--topbar-stack）另算，见下方 :root 补充 */
  --topbar-height: 40px;
  /* 页面容器上内边距：首页横幅靠它算「往上顶到视口顶部」的距离 */
  --page-pad-top: 32px;
}

* {
  box-sizing: border-box;
  /* 关闭移动端点击时系统默认的蓝色高亮块 */
  -webkit-tap-highlight-color: transparent;
}

/* 图标基础样式：尺寸跟随字号，颜色继承父元素，垂直居中与文字对齐 */
.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.125em;
  display: inline-block;
}

.icon-sm {
  width: 0.85em;
  height: 0.85em;
}

.icon-lg {
  width: 2em;
  height: 2em;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* 滚动定位时预留顶栏高度。
   顶栏是 position: sticky，若不留白，scrollIntoView 定位到的元素
   （例如查询结果）会正好贴在顶栏下面、被顶栏盖住上半截。 */
html {
  scroll-padding-top: calc(var(--topbar-height) + var(--glass-pad-y) * 2 + var(--glass-gap) + 12px);
  /* 始终为纵向滚动条预留位置。
     查询结果会让页面从「不满一屏」变成「可滚动」，若不预留，
     滚动条一出现整页宽度就缩掉十几像素，页面会横向抖一下。 */
  scrollbar-gutter: stable;
}

/* 键盘聚焦时保留可见焦点环，鼠标/触摸点击不显示，兼顾可访问性 */
:focus:not(:focus-visible) {
  outline: none;
}

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

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -.2px;
}

/* ---------- 顶部导航 ---------- */
/* 背景、模糊、描边与悬浮定位由 glass.css 的 .glass-bar 提供，
   这里只负责内层布局。横向留白由玻璃条自身的宽度决定（等于页面内容宽度），
   内层不再二次内缩，这样顶栏内容与卡片严格左右对齐。 */
.topbar-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  /* 图形（深底圆角 + 漫剧画幅）由 SVG 自己画，与站点图标同一份；
     这里只负责尺寸，不再画文字方块。 */
  flex-shrink: 0;
}

.logo-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.logo-text {
  font-size: 15px;
  font-weight: 600;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topnav a {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--c-text-sub);
  transition: background-color .15s ease, color .15s ease;
}

.topnav a:hover {
  background: var(--c-bg);
  color: var(--c-text);
}

.topnav a.active {
  background: var(--c-ink);
  color: #fff;
}

/* ---------- 顶栏压在深色横幅上（on-dark） ---------- */
/* 首页横幅是深色块，滚动时它会滑到吸顶栏底下：此时深色文字会被吞掉。
   由 layout.html 的脚本按「顶栏与横幅的重叠高度」挂上 .on-dark，
   这里只负责换一套配色（做法与参考站点 header 的 on-dark 一致）。 */
.topbar.on-dark {
  background: rgba(17, 19, 24, .34);
  border-color: rgba(255, 255, 255, .16);
}

.topbar.on-dark .logo-text {
  color: #fff;
}

/* 品牌标记是「深底 + 白线」，压在深色横幅上会和背景糊在一起，
   这里把配色反过来：白底 + 深线 */
.topbar.on-dark .logo-mark svg rect {
  fill: #fff;
}

.topbar.on-dark .logo-mark svg g {
  stroke: var(--c-ink);
}

.topbar.on-dark .topnav a {
  color: rgba(255, 255, 255, .92);
}

.topbar.on-dark .topnav a:hover {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.topbar.on-dark .topnav a.active {
  background: #fff;
  color: var(--c-ink);
}

.topbar.on-dark .menu-toggle span {
  background: #fff;
}

/* 顶栏里的账号标签：浅底深字放在深色横幅上同样看不清 */
.topbar.on-dark .chip {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .3);
  color: #fff;
}

/* 移动端气泡菜单贴在顶栏下方，跟着顶栏一起换色 */
.mobile-nav-menu.on-dark {
  background: rgba(17, 19, 24, .34);
  border-color: rgba(255, 255, 255, .16);
}

.mobile-nav-menu.on-dark a {
  color: rgba(255, 255, 255, .92);
}

.mobile-nav-menu.on-dark a:hover {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.mobile-nav-menu.on-dark .chip {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .3);
  color: #fff;
}

/* 换色要跟着滚动走，给文字留一个短过渡，避免临界点上「啪」地跳一下 */
.logo-text,
.topnav a,
.topbar .chip,
.menu-toggle span {
  transition: color .3s ease, background-color .3s ease;
}

.logo-mark svg rect,
.logo-mark svg g {
  transition: fill .3s ease, stroke .3s ease;
}

/* ---------- 窄屏：汉堡按钮 + 气泡菜单 ---------- */
/* 桌面隐藏汉堡，窄屏隐藏右侧导航（与参考站点的 header 结构一致） */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

/* 三条杆：绝对定位居中，X 形态由旋转确定，绝不留残影 */
.menu-toggle span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-ink);
  transform: translate(-50%, -50%);
  transition: transform .25s ease, opacity .2s ease;
}

.menu-toggle span:nth-child(1) { transform: translate(-50%, calc(-50% - 7px)); }
.menu-toggle span:nth-child(2) { transform: translate(-50%, -50%); }
.menu-toggle span:nth-child(3) { transform: translate(-50%, calc(-50% + 7px)); }

.menu-toggle.active span:nth-child(1) {
  transform: translate(-50%, -50%) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translate(-50%, -50%) scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* 气泡菜单：材质由 glass.css 的 .glass-pop 提供，这里只管位置与开合动画 */
.mobile-nav-menu {
  position: fixed;
  /* 贴在顶栏下方：顶栏占位（内容高 + 上下内边距 + 离顶距离）再留 6px 呼吸 */
  top: calc(var(--topbar-height) + var(--glass-pad-y) * 2 + var(--glass-gap) + 6px);
  right: var(--glass-pad-x);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 240px;
  max-width: calc(100vw - var(--glass-pad-x) * 2);
  max-height: calc(100vh - 140px);
  padding: 10px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px) scale(.96);
  transform-origin: top right;
  transition: opacity .2s ease, transform .22s cubic-bezier(.4, 0, .2, 1), visibility .2s;
}

.mobile-nav-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.mobile-nav-menu a {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
  color: var(--c-text);
}

.mobile-nav-menu .chip {
  margin: 4px 4px 8px;
  padding: 6px 10px;
  align-self: flex-start;
}

/* 菜单本身已是浮层，移动端不再铺遮罩（与参考项目一致） */
@media (max-width: 768px) {
  .topnav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }
}

/* ---------- 页面容器 ---------- */
/* 上下留白在容器上，左右留白也在容器上：
   与后台 .admin-shell（padding: 12px 15px 20px）同一套边距，
   内容随视口铺满，不再有 1120px 的居中上限。
   首页横幅例外——它要通栏，靠负 margin 把左右留白抵回去。 */
.page {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: var(--page-pad-top) var(--glass-pad-x) 40px;
}

.page > * {
  width: 100%;
}

/* ---------- 首页横幅 ---------- */
/* 全站唯一使用渐变的地方：横幅是封面式的展示块，用一层低调的渐变
   把主标题从背景里推出来；其余组件继续保持纯色 + 1px 描边的扁平风格。
   底色用 background-color 单独兜一层，老内核不认渐变时也不会变成白底。

   沉浸式：横幅整幅通栏，并向上顶到视口最顶部，让毛玻璃顶栏浮在它上面
   （顶栏压在深色块时的转白逻辑见下方 .topbar.on-dark）。
   文字仍然与下方卡片左对齐，靠 --hero-inset 把「页面留白」补回来。 */
.hero {
  /* 与卡片左沿对齐的横向内缩：页面留白 + 一点内边距 */
  --hero-inset: calc(var(--glass-pad-x) + 32px);
  /* 光晕横向中心：对准右侧装饰图形的圆心，通栏后也不会跑偏 */
  --hero-glow-x: calc(100% - var(--hero-inset) - 66px);

  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  /* 通栏：用负 margin 抵掉 .page 的左右内边距，横幅左右贴边 */
  width: calc(100% + var(--glass-pad-x) * 2);
  margin-left: calc(var(--glass-pad-x) * -1);
  margin-right: calc(var(--glass-pad-x) * -1);
  /* 上内边距 = 顶栏实际占位 + 40px 呼吸，保证文案不被浮在头顶的顶栏压住 */
  padding:
    calc(var(--topbar-height) + var(--glass-pad-y) * 2 + var(--glass-gap) + 40px)
    var(--hero-inset)
    56px;
  /* 往上顶掉顶栏占位与容器上内边距，横幅上沿与视口顶齐平。
     多减 2px：顶栏有 0.5px 描边，实际占位常比变量算出的高 1~2px，
     差这一点会在最上面留一条亮边（横幅再往上一点反正被顶栏盖住，看不出来） */
  margin-top: calc(-1 * (var(--topbar-height) + var(--glass-pad-y) * 2 + var(--page-pad-top)) - 2px);
  margin-bottom: 16px;
  border: 0;
  border-radius: 0;
  background-color: var(--c-ink);
  background-image:
    /* 装饰图形背后的一团暖色光晕。通栏后不能再用百分比尺寸——
       在 1920px 宽的元素上，按比例算出来的椭圆会被拉得很散，光就没了；
       这里给固定尺寸，只把中心点对准右侧图形。 */
    radial-gradient(560px 420px at var(--hero-glow-x) calc(100% - 122px),
      rgba(200, 85, 61, .26) 0%, rgba(200, 85, 61, 0) 70%),
    /* 主渐变：近乎纯黑，向右下缓慢过渡到带暖调的深褐 */
    linear-gradient(118deg, #121419 0%, #1b1e25 46%, #2b201d 100%);
  color: #fff;
}

.hero-main {
  min-width: 0;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: .08em;
  /* 深色渐变底上的小字，透明度留给它一点余量，避免在暖色一侧发灰 */
  color: rgba(255, 255, 255, .58);
}

.hero-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c-accent);
}

.hero-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.hero-desc {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .68);
}

/* 装饰图形：只做视觉，不进无障碍树 */
.hero-art {
  flex-shrink: 0;
  width: 132px;
  height: 132px;
  color: #fff;
}

/* 窄屏：优先保证文案可读，装饰图形让位；标题降一档避免换行过多 */
@media (max-width: 640px) {
  .hero {
    /* 窄屏内缩收一点，给文案多留几像素 */
    --hero-inset: calc(var(--glass-pad-x) + 16px);
    padding-bottom: 36px;
  }

  .hero-title {
    font-size: 21px;
  }

  .hero-art {
    display: none;
  }
}

/* ---------- 搜索区 ---------- */
.search-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

/* 两张卡片紧挨着出现时（例如表单卡 + 明细卡）也要有间距，否则贴成一整块 */
.search-card + .search-card {
  margin-top: 16px;
}

/* 查询结果区：跟在查询卡片下方 */
.result-area {
  margin-top: 16px;
  /* 关闭滚动锚定：结果区高度变化时，浏览器不要再自动补偿滚动位置，
     否则程序化滚动会和它打架，表现为页面来回晃 */
  overflow-anchor: none;
}

.search-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.search-desc {
  font-size: 13px;
  color: var(--c-text-sub);
  margin: 0 0 14px;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-actions {
  display: flex;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.btn:hover {
  background: var(--c-bg);
}

.btn-primary {
  flex: 1;
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: #fff;
  font-weight: 500;
}

.btn-primary:hover {
  background: #2b2f36;
  border-color: #2b2f36;
}

/* 按钮禁用时不要还有可点的手感 */
.btn:disabled {
  opacity: .75;
  cursor: default;
}

/* 查询按钮里的加载指示 */
.btn-spinner {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin .7s linear infinite;
}

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

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

/* 批量输入 */
.batch-hint {
  font-size: 12px;
  color: var(--c-text-muted);
  margin: -4px 0 0;
}

.textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 14px;
  line-height: 1.8;
  resize: vertical;
  outline: none;
  transition: border-color .15s ease;
}

.textarea:focus {
  border-color: var(--c-ink);
}

/* ---------- 数据概况（结果页）---------- */
.overview {
  margin-bottom: 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.overview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border);
}

.overview-title {
  font-size: 14px;
  font-weight: 600;
}

.overview-meta {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-left: auto;
  text-align: right;
  overflow-wrap: break-word;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  /* 用 1px 网格缝当分隔线：指标数量变化（2 个或 3 个）时都能自然分栏，
     不必再靠 nth-child 补边框，换行时也不会出现半截线 */
  gap: 1px;
  background: var(--c-border);
}

.overview-item {
  padding: 16px;
  background: var(--c-surface);
}

.overview-value {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.4px;
  font-variant-numeric: tabular-nums;
}

.overview-value.accent {
  color: var(--c-accent);
}

.overview-label {
  margin-top: 2px;
  font-size: 12px;
  color: var(--c-text-sub);
}

/* ---------- 区块标题 ---------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 2px 12px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  color: var(--c-text-sub);
}

.section-link:hover {
  color: var(--c-text);
}

/* ---------- 数据卡片（核心展示单元） ---------- */
.data-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.data-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

/* 头像占位：首字母 + 描边，不使用图片资源 */
.data-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
  border: 1px solid var(--c-border-strong);
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text-sub);
}

.data-identity {
  flex: 1;
  min-width: 0;
}

.data-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.data-name {
  font-size: 15px;
  font-weight: 600;
  word-break: break-all;
}

/* 名称即入口：批量结果里点名字或右侧「查看明细」都进同一张明细页 */
.data-name-link {
  color: inherit;
  text-decoration: none;
  transition: color .15s ease;
}

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

.data-detail {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  align-self: center;
  padding: 6px 10px;
  border: 1px solid var(--c-border-strong);
  border-radius: 999px;
  font-size: 12px;
  color: var(--c-text-sub);
  white-space: nowrap;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

.data-detail:hover {
  color: var(--c-accent);
  border-color: var(--c-accent);
  background: var(--c-accent-soft, rgba(200, 85, 61, .08));
}

.data-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--c-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.data-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--c-text-muted);
}

.data-id {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 12px;
  color: var(--c-text-sub);
}

/* 数据指标：四列均分，与参考图保持一致的信息密度 */
.data-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--c-border);
}

.metric {
  text-align: center;
}

.metric-value {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.2px;
}

.metric-label {
  margin-top: 2px;
  font-size: 12px;
  color: var(--c-text-muted);
}

.metric-value.accent {
  color: var(--c-accent);
}

/* 标签 */
.chip {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--c-border-strong);
  border-radius: 4px;
  font-size: 12px;
  color: var(--c-text-sub);
  background: var(--c-surface);
}

.chip-gold {
  border-color: #e6d5a8;
  background: #fdf9ee;
  color: var(--c-gold);
}

/* ---------- 提示条 ---------- */
.notice {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-sub);
}

.notice-error {
  border-color: #eccac6;
  background: #fdf4f3;
  color: #a33a2c;
}

.notice-info {
  border-color: #d5dfec;
  background: #f5f8fc;
  color: #2b5aa0;
}

.notice-success {
  border-color: #c6e3d3;
  background: #f3faf6;
  color: var(--c-success);
}

/* ---------- 榜单表格 ---------- */
.rank-list {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--c-border);
  transition: background-color .12s ease;
}

.rank-row:last-child {
  border-bottom: none;
}

.rank-row:hover {
  background: #fafbfc;
}

.rank-index {
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-muted);
  font-variant-numeric: tabular-nums;
}

.rank-index.top {
  color: var(--c-ink);
}

.rank-main {
  flex: 1;
  min-width: 0;
}

.rank-name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-sub {
  font-size: 12px;
  color: var(--c-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-value {
  flex-shrink: 0;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rank-value-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--c-text-muted);
}

/* 榜单筛选 */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-item {
  flex-shrink: 0;
  padding: 7px 14px;
  border: 1px solid var(--c-border-strong);
  border-radius: 999px;
  font-size: 13px;
  color: var(--c-text-sub);
  background: var(--c-surface);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

/* 排序条左侧的说明文字 */
.filter-label {
  flex-shrink: 0;
  align-self: center;
  font-size: 13px;
  color: var(--c-text-muted);
  margin-right: 2px;
}

.filter-item:hover {
  border-color: var(--c-ink);
}

.filter-item.active {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: #fff;
  font-weight: 500;
}

/* ---------- 空状态 ---------- */
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--c-text-muted);
  font-size: 14px;
}

.empty-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 24px;
  color: var(--c-border-strong);
}

/* ---------- 页脚 ---------- */
.site-footer {
  /* 与顶栏、页面内容同一套左右边距：内容铺满，左右各留 --glass-pad-x */
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0 var(--glass-pad-x) 32px;
  text-align: center;
  font-size: 12px;
  color: var(--c-text-muted);
}

.site-footer p {
  margin: 4px 0;
}

/* ---------- 结果页返回 ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--c-text-sub);
}

.back-link:hover {
  color: var(--c-text);
}

/* 结果页骨架。手机端把外壳拆掉，子元素仍按「排序 → 概况 → 卡片」往下排。 */
.result-layout {
  display: flex;
  flex-direction: column;
}

.result-main {
  display: contents;
}

.result-layout > .overview {
  order: 2;
}

.result-main > .filter-bar {
  order: 1;
}

.result-main > .data-card {
  order: 3;
}

/* ---------- 查询结果 / 明细：宽屏 ----------
   顶栏和页面仍铺满。结果页不论命中几个，都是概况铺满一行，
   账号卡片再按两列往下排。
   明细页仍是左侧账号、右侧区间数字，下面接趋势和逐日表。 */
@media (min-width: 960px) {
  body:has(.query-page) .page {
    padding-top: 20px;
    padding-bottom: 28px;
  }

  .query-page .back-link {
    margin-bottom: 12px;
    font-size: 13px;
  }

  .query-page .date-filter {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 14px;
  }

  .query-page .date-filter-title {
    flex: 1 0 100%;
    font-size: 12px;
  }

  .query-page .date-preset {
    padding: 4px 12px;
    font-size: 12px;
  }

  .query-page .date-input,
  .query-page .date-apply {
    height: 34px;
    font-size: 13px;
  }

  .query-page .filter-item {
    padding: 5px 12px;
    font-size: 12px;
  }

  .query-page .data-name {
    font-size: 14px;
  }

  .query-page .overview-head {
    padding: 10px 14px;
  }

  .query-page .overview-title {
    font-size: 13px;
  }

  .query-page .result-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
  }

  .query-page .result-main > .filter-bar,
  .query-page .result-main > .data-card,
  .query-page .result-layout > .overview {
    margin-bottom: 0;
  }

  .query-page .result-main > .filter-bar {
    grid-column: 1 / -1;
  }

  /* 概况始终铺满一行，账号卡片从下一行开始两列排列 */
  .query-page .result-layout > .overview {
    grid-column: 1 / -1;
  }

  .query-page .result-layout .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .query-page .result-layout .overview-value {
    font-size: 18px;
    line-height: 1.2;
  }

  .query-page .result-layout .overview-item {
    padding: 14px 16px 12px;
  }

  .query-page .result-layout .data-card:has(.data-metrics) {
    display: grid;
    grid-template-columns: auto minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    height: 100%;
    margin: 0;
    padding: 12px 14px;
  }

  .query-page .result-layout .data-card:has(.data-metrics) .data-card-head,
  .query-page .result-layout .data-card:has(.data-metrics) .data-metrics {
    display: contents;
  }

  .query-page .result-layout .data-card:has(.data-metrics) .data-avatar {
    order: 1;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .query-page .result-layout .data-card:has(.data-metrics) .data-identity {
    order: 2;
    min-width: 0;
  }

  .query-page .result-layout .data-card:has(.data-metrics) .metric {
    order: 3;
    margin: 0;
    padding: 2px 8px 2px 18px;
    text-align: left;
    border-left: 1px solid var(--c-border);
  }

  .query-page .result-layout .data-card:has(.data-metrics) .metric-value {
    font-size: 16px;
  }

  .query-page .result-layout .data-card:has(.data-metrics) .data-detail {
    order: 4;
    justify-self: end;
  }

  /* 明细：左侧账号，右侧区间数字铺满剩余宽度。
     两张卡片拉成一样高，图表上方只留一条相同的缝。 */
  .query-page:has(.trend-card) #result-area {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
  }

  .query-page:has(.trend-card) .data-card {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    padding: 14px;
  }

  .query-page:has(.trend-card) .data-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .query-page:has(.trend-card) .data-metrics {
    margin-top: 12px;
  }

  .query-page:has(.trend-card) .metric {
    text-align: left;
  }

  .query-page:has(.trend-card) .metric-value {
    font-size: 16px;
  }

  .query-page:has(.trend-card) .overview {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    container-type: inline-size;
  }

  .query-page:has(.trend-card) .overview-grid {
    flex: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .query-page:has(.trend-card) .overview-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 14px;
  }

  .query-page:has(.trend-card) .overview-value {
    font-size: 16px;
    line-height: 1.2;
  }

  .query-page:has(.trend-card) .trend-card,
  .query-page:has(.trend-card) .section-head,
  .query-page:has(.trend-card) .table-wrap,
  .query-page:has(.trend-card) .notice {
    grid-column: 1 / -1;
  }

  .query-page:has(.trend-card) .trend-card {
    margin-top: 0;
    padding: 12px 14px;
  }

  .query-page .trend-svg-wide {
    max-height: 220px;
  }
}

@container (min-width: 880px) {
  .query-page:has(.trend-card) .overview-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* 未命中列表 */
.miss-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.miss-item {
  padding: 4px 10px;
  border: 1px solid #eccac6;
  border-radius: 4px;
  background: #fdf4f3;
  color: #a33a2c;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 12px;
}

/* 数字辅助类 */
.num {
  font-variant-numeric: tabular-nums;
}

.cell-strong {
  display: block;
  font-weight: 500;
}

.cell-sub {
  display: block;
  font-size: 12px;
  color: var(--c-text-muted);
}

.mono {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  letter-spacing: -.1px;
}

/* ---------- 日期范围筛选 ---------- */
.date-filter {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 2px;
  /* 与下面的排序条 / 卡片拉开距离：之前这里是 0，
     日期筛选和下方内容挤在一起，看着很局促 */
  margin-bottom: 24px;
}

.date-filter-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-sub);
}

/* 标题旁的补充说明：日期筛选只对「单个 ID 展开的明细」有意义，
   批量汇总按整库合计，不做日期裁剪，这里提前说清楚免得白试 */
.date-filter-note {
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  color: var(--c-text-muted);
}

.date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.date-preset {
  padding: 6px 14px;
  border: 1px solid var(--c-border-strong);
  border-radius: 999px;
  background: var(--c-surface);
  color: var(--c-text-sub);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.date-preset:hover {
  border-color: var(--c-ink);
}

.date-preset.active {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: #fff;
  font-weight: 500;
}

.date-custom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
}

/* 一个日期字段 = 标签 + 输入框，作为整体换行，不会出现
   「标签留在上一行、输入框掉到下一行」的错位。
   刻意不拉伸（flex: 0 0 auto）：之前用 flex:1 会把两个日期框
   推到整行两头，中间空出一大片，「应用」被甩到最右边 */
.date-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 0 auto;
}

.date-label {
  font-size: 13px;
  color: var(--c-text-sub);
  white-space: nowrap;
}

.date-sep {
  font-size: 13px;
  color: var(--c-text-muted);
}

.date-input {
  width: 152px;
  min-width: 132px;
  padding: 9px 10px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease;
}

.date-input:focus {
  border-color: var(--c-ink);
}

/* 日期框和旁边的「查询 / 应用」同一高度 */
.date-input,
.date-apply,
.date-custom .btn {
  height: 40px;
  padding-top: 0;
  padding-bottom: 0;
}

.date-input {
  line-height: 38px;
}

.date-custom .btn {
  font-size: 14px;
}

@media (max-width: 560px) {
  .date-pair {
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  /* 竖排时输入框占满整行，固定 152px 会显得又窄又偏 */
  .date-input {
    width: 100%;
  }
  .date-label {
    font-size: 12px;
    color: var(--c-text-muted);
  }
  .date-sep {
    display: none;
  }
  .date-apply {
    width: 100%;
    margin-left: 0;
    margin-top: 4px;
  }
}

/* 「应用」按钮：和站内 .btn 同一套外观，不用浏览器原生按钮样式 */
.date-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--c-ink);
  border-radius: var(--radius);
  background: var(--c-ink);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s ease;
}

.date-apply:hover {
  opacity: .88;
}

/* 结果里的日期区间标签 */
.date-pill {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ---------- 收益趋势图 ---------- */
.trend-card {
  margin-top: 16px;
  padding: 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
}

.trend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.trend-head-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.trend-title {
  font-size: 15px;
  font-weight: 600;
}

.trend-sub {
  font-size: 12px;
  color: var(--c-text-muted);
}

.trend-meta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--c-text-muted);
  font-variant-numeric: tabular-nums;
}

.trend-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* 桌面显示宽画布，窄屏换成窄画布（两套坐标都在服务端算好） */
.trend-svg-narrow {
  display: none;
}

@media (max-width: 640px) {
  .trend-svg-wide {
    display: none;
  }

  .trend-svg-narrow {
    display: block;
  }
}

.trend-grid {
  stroke: var(--c-border);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}

.trend-tick {
  fill: var(--c-text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.trend-line {
  fill: none;
  stroke: var(--c-accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.trend-area {
  stroke: none;
}

.trend-stop-top {
  stop-color: var(--c-accent);
  stop-opacity: .18;
}

.trend-stop-bottom {
  stop-color: var(--c-accent);
  stop-opacity: 0;
}

.trend-dot {
  fill: var(--c-surface);
  stroke: var(--c-accent);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  transition: fill .12s ease, stroke .12s ease;
}

/* 悬停：透明命中圈 + 提示框。命中圈铺满点周围，比 4.5px 的圆点好瞄准 */
.trend-hit {
  fill: transparent;
  pointer-events: all;
}

.trend-tip {
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}

.trend-tip-bg {
  fill: rgba(22, 24, 29, .92);
}

.trend-tip-text {
  fill: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.trend-point:hover .trend-tip,
.trend-point:focus-within .trend-tip {
  opacity: 1;
}

.trend-point:hover .trend-dot {
  fill: var(--c-accent);
  stroke: var(--c-surface);
}

/* ---------- 逐日明细 ---------- */
/* 一天一行：日期 + 三个数字，底部一行合计。
   以前按「日期 × 剧目」做成卡片网格，现在没有剧目维度，
   每天只有一条数据，表格比卡片更省空间、也更容易对齐比较。 */
.daily-table {
  font-variant-numeric: tabular-nums;
}

.daily-table tbody td {
  padding: 10px 14px;
  background: #fff;
  transition: background-color .12s ease;
}

.daily-table tbody tr:hover td {
  background: #e8f1fa;
}

.daily-table tfoot td {
  padding: 11px 14px;
  font-weight: 600;
  background: #fafbfc;
  border-top: 1px solid var(--c-border);
}

/* 响应式：窄屏时指标改为两列 */
@media (max-width: 480px) {  .data-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 8px;
  }

  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 指标为奇数个时，最后一个独占整行：
     否则会空出一个格子，露出分隔线底色，看着像块脏斑 */
  .overview-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

/* ---------- 移动端输入框字号 ----------
   见文件末尾的「禁止 iOS 聚焦放大」：那条规则必须排在最后才压得住
   后面定义的具体控件样式，所以这里不再留一份。 */

/* ---------- 用户中心（注册、报白、收益） ---------- */
/* 表单控件在公开页也要可用：base.css 只被后台引用，
   这里补一份同规格的样式，避免用户端的输入框完全没有边框。 */
.input,
.select,
.textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  background: var(--c-surface);
  font-family: inherit;
  font-size: 15px;
  color: var(--c-text);
  outline: none;
  transition: border-color .15s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--c-ink);
}

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

.field-label {
  font-size: 13px;
  color: var(--c-text-sub);
}

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

.btn-block {
  width: 100%;
}

/* 输入框和旁边的按钮并排时拉成同一高度，避免框大按钮小 */
.control-line {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.control-line .input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.control-line .btn {
  flex: 0 0 auto;
  align-self: stretch;
  height: auto;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 15px;
}

/* 状态/信息标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--c-border-strong);
  border-radius: 4px;
  font-size: 12px;
  color: var(--c-text-sub);
  background: var(--c-surface);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  /* 上下都要留出间距：这些计数块紧跟在表单卡片后面，
     没有上边距时会贴着卡片底边，看着像被裁掉了 */
  margin: 16px 0;
}

.stat-box {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.stat-box-label {
  font-size: 12px;
  color: var(--c-text-sub);
}

.stat-box-value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat-box-value.accent {
  color: var(--c-accent);
}

/* 表格容器：与后台 .table-wrap 同一规范。
   窄屏表格内容比卡片宽时在自己这一层横向滚动，
   不再把卡片和页面一起撑开（否则整页出现横向滚动条）。 */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 表格：与后台 .data-table 同一套格子（内边距、表头底色、行高、
   单元格不换行），两个端看到的表格是同一个样子 */
.sub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sub-table thead th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--c-text-sub);
  background: #fafbfc;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}

.sub-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  vertical-align: middle;
}

.sub-table tbody tr:last-child td {
  border-bottom: none;
}

.sub-table tbody tr:hover td {
  background: #fafbfc;
}

/* 逐日明细的悬停色应用到当前行单元格，避免部分浏览器将 tr 背景绘制到相邻行。 */
.daily-table tbody tr:hover td {
  background: #f5f7f9;
}

.auth-card {
  max-width: 420px;
  margin: 0 auto;
}

/* 登录页钉在视口里：顶栏浮在画面上，页脚和页面留白不再把内容撑出一屏 */
body:has(.login-stage) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body:has(.login-stage) .site-footer {
  display: none;
}

.page:has(.login-stage) {
  padding: 0;
}

.page > .login-stage,
.login-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  background: var(--c-surface);
  border: 0;
  border-radius: 0;
  overflow: hidden;
}

.login-visual {
  position: relative;
  margin: 0;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: #f4efe8;
}

.login-visual img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.login-panel {
  max-width: none;
  margin: 0;
  min-height: 0;
  /* 上留白让开浮在画面上的顶栏，表单本身仍在栏下 */
  padding: calc(var(--topbar-height) + var(--glass-pad-y) * 2 + var(--glass-gap) + 28px) 48px 40px;
  display: flex;
  flex-direction: column;
  /* 装得下就居中；装不下时从顶部开始，才能把超出的部分滚回来 */
  justify-content: safe center;
  overflow-y: auto;
}

@media (max-width: 760px) {
  .page > .login-stage,
  .login-stage {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    overflow: hidden;
  }

  /* 上半屏只放欢迎图，顶栏浮在图上；表单直接接在图下面，不再套卡片 */
  .page > .login-stage .login-visual {
    position: relative;
    z-index: 0;
    inset: auto;
    flex: 0 0 42%;
    width: 100%;
    height: 42%;
    min-height: 0;
    max-width: none;
    margin: 0;
  }

  .page > .login-stage .login-visual img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center center;
  }

  .login-panel {
    position: relative;
    z-index: 1;
    left: auto;
    right: auto;
    bottom: auto;
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    max-height: none;
    min-height: 0;
    margin: 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    overflow-y: auto;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    justify-content: flex-start;
  }
}

/* 横屏高度紧，顶栏不再离顶悬浮，避免画面上沿空出一条 */
@media (max-height: 560px) {
  body:has(.login-stage) .glass-bar {
    top: 0;
  }
}

/* 手机横屏很矮，左右分栏时表单会被裁掉。画面仍铺到视口顶部，只滚动右侧表单。 */
@media (max-height: 560px) and (min-width: 761px) {
  body:has(.login-stage) {
    height: 100dvh;
    overflow: hidden;
  }

  .page > .login-stage,
  .login-stage {
    position: fixed;
    inset: 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
  }

  .login-visual {
    position: relative;
    top: auto;
    align-self: stretch;
    height: 100%;
    min-height: 0;
  }

  .login-panel {
    align-self: stretch;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    justify-content: flex-start;
    padding-top: calc(var(--topbar-height) + var(--glass-pad-y) * 2 + var(--glass-gap) + 16px);
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

/* 窄屏再横过来：欢迎图顶到屏幕上沿，整段内容在视口里滚动。 */
@media (max-width: 760px) and (max-height: 560px) {
  body:has(.login-stage) {
    height: 100dvh;
    overflow: hidden;
  }

  .page > .login-stage,
  .login-stage {
    position: fixed;
    inset: 0;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .page > .login-stage .login-visual {
    position: relative;
    top: auto;
    flex: none;
    height: 42%;
    min-height: 140px;
    max-height: none;
  }

  .login-panel {
    flex: none;
    height: auto;
    overflow: visible;
    padding-top: 16px;
  }
}

.tag-status {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
}

.tag-status.tag-wait {
  color: #a86000;
  border-color: #e8cf9f;
  background: #fdf6e7;
}

.tag-status.tag-ok {
  color: #1f7a4d;
  border-color: #bfe3cf;
  background: #eff8f2;
}

.tag-status.tag-bad {
  color: #b3261e;
  border-color: #efc9c6;
  background: #fdefee;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ==========================================================================
   禁止 iOS 聚焦放大（前台）
   --------------------------------------------------------------------------
   iOS Safari 在可输入元素的字号小于 16px 时，聚焦会把整个页面放大，
   输入框被推出视野、键盘弹出后还要手动缩回去，体验很差。
   这里在触屏 / 窄屏下把所有可输入控件统一提到 16px，从根上避免该行为。

   两点说明：
   1) 必须用 !important。这条规则要压住前面按场景写的字号
      （.textarea 14px、.date-input 14px 之类），而它们分布在文件各处，
      靠源码顺序保证不了，写在末尾也会被后加的具体规则顶掉。
   2) 刻意不使用 viewport 的 maximum-scale=1 —— 那会把双指缩放一起禁掉，
      对需要放大阅读的用户是实打实的伤害。

   后台那一份在 base.css 末尾，两边成对维护。 */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

