/* ==========================================================================
   动画体检台 · 第三层人审网页样式
   视觉原则：画廊薄玻璃 + 轻盈浮光按钮 + 统一半透明层级 + 仅 2 种字体无黑描边
   ========================================================================== */

:root {
  --font-ui: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI",
    "Microsoft YaHei", system-ui, sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", "PingFang SC", system-ui, sans-serif;

  /* 舞台与环境底色 */
  --bg-base: #0e1524;
  --bg-elevated: #141d31;

  /* 全屏统一一档薄玻璃 */
  --glass-bg: rgba(255, 255, 255, 0.065);
  --glass-bg-hover: rgba(255, 255, 255, 0.1);
  --glass-bg-strong: rgba(20, 29, 49, 0.78);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  --glass-blur: blur(18px);

  /* 文字层次（高对比、无黑粗描边） */
  --text-primary: #f3f6fc;
  --text-secondary: #a8b5cb;
  --text-muted: #78869f;

  /* 语义色：仅用于图形状态点与浮光透亮按钮 */
  --ok-rgb: 56, 211, 159;
  --bad-rgb: 255, 107, 122;
  --pending-rgb: 112, 184, 255;
  --warn-rgb: 245, 185, 92;

  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-pill: 999px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

body {
  background:
    radial-gradient(64% 46% at 14% 6%, rgba(102, 174, 255, 0.18), transparent 64%),
    radial-gradient(54% 48% at 90% 88%, rgba(62, 209, 165, 0.14), transparent 66%),
    radial-gradient(45% 36% at 80% 14%, rgba(176, 134, 255, 0.11), transparent 62%),
    var(--bg-base);
  background-attachment: fixed;
}

button,
input {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  touch-action: manipulation;
}

button:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   基础玻璃容器 & 图标按钮 & 浮光流光主按钮
   ========================================================================== */

.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-xl);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.icon-btn:hover:not(:disabled) {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.22);
}

.icon-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.icon-btn.icon-only {
  width: 42px;
  padding: 0;
}

.icon-btn.compact {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.icon-btn.compact.icon-only {
  width: 36px;
  padding: 0;
}

.icon-btn.active {
  background: rgba(var(--pending-rgb), 0.2);
  border-color: rgba(var(--pending-rgb), 0.5);
  color: #e6f3ff;
}

/* 流光透明玻璃主按钮（用于首页「开始看」、登录确认等，拒绝实心黄橙块） */
.btn-aurora {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 600;
  color: #f8fbff;
  background: linear-gradient(
    180deg,
    rgba(130, 198, 255, 0.26) 0%,
    rgba(90, 152, 245, 0.16) 100%
  );
  border: 1px solid rgba(162, 214, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 6px 24px rgba(84, 160, 255, 0.22);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  overflow: hidden;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.btn-aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 255, 255, 0.18) 48%,
    transparent 74%
  );
  pointer-events: none;
}

.btn-aurora:hover:not(:disabled) {
  border-color: rgba(188, 228, 255, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    0 8px 28px rgba(96, 174, 255, 0.3);
}

.btn-aurora:active:not(:disabled) {
  transform: scale(0.97);
}

/* 胶囊滑块（iOS 分段选择风格） */
.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  gap: 4px;
}

.segmented-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
  white-space: nowrap;
}

.segmented-item.is-active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

/* 图形状态点 */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-pending {
  background: rgb(var(--pending-rgb));
  box-shadow: 0 0 8px rgba(var(--pending-rgb), 0.75);
}

.dot-bad {
  background: rgb(var(--bad-rgb));
  box-shadow: 0 0 8px rgba(var(--bad-rgb), 0.75);
}

.dot-ok {
  background: rgb(var(--ok-rgb));
  box-shadow: 0 0 8px rgba(var(--ok-rgb), 0.7);
}

.dot-warn {
  background: rgb(var(--warn-rgb));
  box-shadow: 0 0 8px rgba(var(--warn-rgb), 0.7);
}

/* ==========================================================================
   首页布局
   ========================================================================== */

.page-home {
  max-width: 980px;
  margin: 0 auto;
  padding: calc(14px + var(--safe-top)) calc(16px + var(--safe-right))
    calc(28px + var(--safe-bottom)) calc(16px + var(--safe-left));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, rgba(112, 184, 255, 0.28), rgba(56, 211, 159, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--glass-highlight);
}

.brand-title {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  background: rgba(var(--warn-rgb), 0.14);
  border: 1px solid rgba(var(--warn-rgb), 0.32);
  color: #fde3b4;
  font-size: 12.5px;
  font-weight: 500;
}

/* 顶部汇总玻璃卡 */
.hero-summary {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  flex: 1;
  min-width: 240px;
}

.stat-tile {
  padding: 12px 10px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease;
}

.stat-tile:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.stat-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
}

.stat-unit {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 3px;
}

.hero-cta-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 图形化总进度条 */
.progress-bar {
  height: 7px;
  width: 100%;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
}

.progress-seg-ok {
  background: linear-gradient(90deg, rgba(var(--ok-rgb), 0.78), rgb(var(--ok-rgb)));
  height: 100%;
  transition: width 260ms ease;
}

.progress-seg-bad {
  background: linear-gradient(90deg, rgba(var(--bad-rgb), 0.8), rgb(var(--bad-rgb)));
  height: 100%;
  transition: width 260ms ease;
}

/* 筛选条 */
.home-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.run-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: rgba(var(--pending-rgb), 0.14);
  border: 1px solid rgba(var(--pending-rgb), 0.34);
  font-size: 12.5px;
  color: #dceeff;
}

/* 角色卡片网格 */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.group-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.group-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.085);
}

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.group-names {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.group-game {
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-char {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-thumb-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #172033;
  border: 1px solid rgba(255, 255, 255, 0.09);
  cursor: pointer;
}

.group-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 220ms ease;
}

.group-thumb-img.is-loaded {
  opacity: 1;
}

.skeleton-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.03) 100%
  );
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.group-counts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transition: background 140ms ease, border-color 140ms ease, transform 120ms ease;
}

.count-pill:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.22);
}

.count-pill:active:not(:disabled) {
  transform: scale(0.96);
}

.count-pill.is-pending {
  background: rgba(var(--pending-rgb), 0.14);
  border-color: rgba(var(--pending-rgb), 0.34);
}

.count-pill.is-bad {
  background: rgba(var(--bad-rgb), 0.14);
  border-color: rgba(var(--bad-rgb), 0.34);
}

.empty-card {
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
}

/* ==========================================================================
   卡片审阅页（竖屏一屏全览 / 横屏 & 电脑左右两栏）
   ========================================================================== */

.page-review {
  height: 100dvh;
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(10px + var(--safe-top)) calc(14px + var(--safe-right))
    calc(12px + var(--safe-bottom)) calc(14px + var(--safe-left));
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.review-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.review-nav-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.review-who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.review-who-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-step-badge {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.step-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: min(200px, 100%);
}

.step-dot {
  flex: 1;
  max-width: 24px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  transition: background 180ms ease;
}

.step-dot.is-current {
  background: rgb(var(--pending-rgb));
  box-shadow: 0 0 8px rgba(var(--pending-rgb), 0.7);
}

.step-dot.is-approved {
  background: rgb(var(--ok-rgb));
}

.step-dot.is-rejected {
  background: rgb(var(--bad-rgb));
}

/* 审阅主区（竖屏上下，横屏/宽屏左右） */
.review-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stage-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* 动图主舞台 */
.stage-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
  background: #172033;
  display: flex;
  flex-direction: column;
}

.stage-viewport {
  position: relative;
  width: 100%;
  max-height: 30dvh;
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
  background-color: #182234;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.025) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.stage-viewport.is-light-bg {
  background-color: #dde5f0;
  background-image:
    linear-gradient(45deg, rgba(15, 23, 42, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(15, 23, 42, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(15, 23, 42, 0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(15, 23, 42, 0.05) 75%);
}

.stage-canvas,
.stage-fallback-img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 30dvh;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.stage-header-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(12, 18, 31, 0.42);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stage-status-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.stage-fps-inline {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

.stage-head-zoom {
  min-width: 32px !important;
  width: 32px !important;
  height: 32px !important;
}

.stage-error {
  padding: 18px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* 帧控条（全图形图标 + 帧滑块 + 极简计数） */
.player-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: rgba(12, 18, 31, 0.52);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.frame-slider-wrap {
  flex: 1;
  min-width: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.frame-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.18);
  outline: none;
  cursor: pointer;
}

.frame-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f5f9ff;
  border: 2px solid rgba(var(--pending-rgb), 0.9);
  box-shadow: 0 0 8px rgba(var(--pending-rgb), 0.6);
}

.frame-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f5f9ff;
  border: 2px solid rgba(var(--pending-rgb), 0.9);
}

.frame-counter {
  font-size: 12.5px;
  color: var(--text-secondary);
  min-width: 34px;
  text-align: right;
  flex-shrink: 0;
}

/* 右侧/下方信息与决策栏 */
.detail-column {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

/* 大白话时刻说明卡 */
.moment-card {
  padding: 11px 14px;
  border-radius: var(--radius-lg);
}

.moment-title {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.moment-text {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

/* 机器量到的数（双列紧凑数据胶囊） */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.metric-chip {
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-chip.is-fail {
  background: rgba(var(--bad-rgb), 0.09);
  border-color: rgba(var(--bad-rgb), 0.3);
}

.metric-chip.is-pass {
  background: rgba(var(--ok-rgb), 0.075);
  border-color: rgba(var(--ok-rgb), 0.24);
}

.metric-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.metric-val-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-expected {
  font-size: 12px;
  color: var(--text-muted);
}

/* AI 判断与疑点 */
.ai-card {
  padding: 11px 14px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ai-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.ai-badge.is-no {
  background: rgba(var(--bad-rgb), 0.18);
  color: #ffc3c9;
  border: 1px solid rgba(var(--bad-rgb), 0.36);
}

.ai-badge.is-unsure {
  background: rgba(var(--warn-rgb), 0.18);
  color: #ffe2b3;
  border: 1px solid rgba(var(--warn-rgb), 0.36);
}

.ai-badge.is-yes {
  background: rgba(var(--ok-rgb), 0.16);
  color: #bff5e2;
  border: 1px solid rgba(var(--ok-rgb), 0.32);
}

.ai-summary {
  margin: 0;
  font-size: 14px;
  line-height: 1.48;
  color: var(--text-primary);
}

.ai-q-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-q-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.ai-q-icon {
  margin-top: 2px;
  flex-shrink: 0;
}

/* 底部拇指操作区 */
.action-dock {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.note-row {
  position: relative;
  display: flex;
  align-items: center;
}

.note-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 150ms ease, background 150ms ease;
}

.note-input::placeholder {
  color: var(--text-muted);
}

.note-input:focus {
  border-color: rgba(var(--pending-rgb), 0.55);
  background: rgba(255, 255, 255, 0.1);
}

.decision-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* 两大浮光玻璃决策按钮（轻边、顶部唯一高光、柔和光晕、无厚底唇） */
.btn-decision {
  position: relative;
  height: 54px;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: transform 130ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.btn-decision:active:not(:disabled) {
  transform: scale(0.96);
}

.btn-reject {
  color: #ffe8eb;
  background: linear-gradient(
    180deg,
    rgba(var(--bad-rgb), 0.34) 0%,
    rgba(var(--bad-rgb), 0.16) 100%
  );
  border: 1px solid rgba(var(--bad-rgb), 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 6px 22px rgba(var(--bad-rgb), 0.22);
}

.btn-reject:hover:not(:disabled) {
  border-color: rgba(var(--bad-rgb), 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 8px 26px rgba(var(--bad-rgb), 0.32);
}

.btn-approve {
  color: #e6fff6;
  background: linear-gradient(
    180deg,
    rgba(var(--ok-rgb), 0.34) 0%,
    rgba(var(--ok-rgb), 0.16) 100%
  );
  border: 1px solid rgba(var(--ok-rgb), 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 6px 22px rgba(var(--ok-rgb), 0.22);
}

.btn-approve:hover:not(:disabled) {
  border-color: rgba(var(--ok-rgb), 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 8px 26px rgba(var(--ok-rgb), 0.32);
}

/* ==========================================================================
   手机横屏 & 电脑宽屏：左右分栏（一屏全览、零拥挤）
   ========================================================================== */

@media (min-width: 840px), (orientation: landscape) and (max-height: 540px) {
  .review-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr);
    gap: 14px;
    align-items: stretch;
  }

  .stage-column {
    min-height: 0;
    justify-content: center;
  }

  .stage-card {
    height: 100%;
    max-height: 100%;
  }

  .stage-viewport {
    flex: 1;
    max-height: none;
    min-height: 160px;
  }

  .stage-canvas,
  .stage-fallback-img {
    max-height: 100%;
  }

  .detail-column {
    min-height: 0;
  }
}

/* 超矮手机横屏（如 844×390、667×375）进一步压缩上下空隙 */
@media (orientation: landscape) and (max-height: 440px) {
  .page-review {
    padding-top: calc(6px + var(--safe-top));
    padding-bottom: calc(8px + var(--safe-bottom));
    gap: 6px;
  }

  .icon-btn {
    height: 36px;
    min-width: 36px;
  }

  .icon-btn.icon-only {
    width: 36px;
  }

  .info-scroll {
    gap: 6px;
  }

  .moment-card {
    padding: 7px 10px;
  }

  .moment-title {
    margin-bottom: 1px;
    font-size: 11.5px;
  }

  .moment-text {
    font-size: 14px;
  }

  .metric-chip {
    padding: 6px 9px;
  }

  .metric-value {
    font-size: 14.5px;
  }

  .ai-card {
    padding: 7px 10px;
    gap: 4px;
  }

  .ai-summary {
    font-size: 13px;
    line-height: 1.38;
  }

  .note-input {
    height: 34px;
    font-size: 13px;
  }

  .btn-decision {
    height: 42px;
    font-size: 15px;
  }
}

/* 小屏竖屏（375×667）微调保证首屏不拥挤 */
@media (max-width: 400px) and (max-height: 700px) {
  .page-review {
    gap: 8px;
    padding-top: calc(8px + var(--safe-top));
    padding-bottom: calc(10px + var(--safe-bottom));
  }

  .stage-viewport {
    max-height: 24dvh;
    min-height: 98px;
  }

  .moment-card {
    padding: 9px 12px;
  }

  .moment-text {
    font-size: 15px;
  }

  .metric-chip {
    padding: 7px 10px;
  }

  .metric-value {
    font-size: 15px;
  }

  .ai-card {
    padding: 9px 12px;
  }

  .note-input {
    height: 38px;
  }

  .btn-decision {
    height: 50px;
  }
}

/* ==========================================================================
   看完小结页
   ========================================================================== */

.page-summary {
  max-width: 680px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(18px + var(--safe-top)) calc(16px + var(--safe-right))
    calc(28px + var(--safe-bottom)) calc(16px + var(--safe-left));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-hero {
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.summary-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--ok-rgb), 0.14);
  border: 1px solid rgba(var(--ok-rgb), 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 0 28px rgba(var(--ok-rgb), 0.22);
}

.summary-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
}

.summary-numbers {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 340px;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 140ms ease, border-color 140ms ease;
}

.summary-item:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.24);
}

.summary-item-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.summary-item-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.summary-item-note {
  font-size: 13px;
  color: var(--text-secondary);
}

.summary-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-actions > * {
  flex: 1;
  min-width: 140px;
  white-space: nowrap;
  padding-left: 14px;
  padding-right: 14px;
  font-size: 15px;
}

/* ==========================================================================
   全屏放大看图器（缩放 + 平移 + 逐帧拨）
   ========================================================================== */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(8, 13, 24, 0.92);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  padding: calc(10px + var(--safe-top)) calc(14px + var(--safe-right))
    calc(14px + var(--safe-bottom)) calc(14px + var(--safe-left));
  gap: 10px;
}

.lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lightbox-stage {
  flex: 1;
  min-height: 0;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #172033;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}

.lightbox-stage.is-light-bg {
  background: #dde5f0;
}

.lightbox-stage:active {
  cursor: grabbing;
}

.lightbox-canvas-wrap {
  transform-origin: center center;
  transition: transform 80ms linear;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-canvas {
  display: block;
  max-width: 94vw;
  max-height: 68dvh;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ==========================================================================
   口令登录玻璃层 & 顶部轻提示条
   ========================================================================== */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(8, 13, 24, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: min(380px, 100%);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}

.auth-error {
  font-size: 13px;
  color: #ffb8c0;
}

.toast-bar {
  position: fixed;
  left: 50%;
  top: calc(62px + var(--safe-top));
  transform: translateX(-50%);
  z-index: 55;
  max-width: calc(100vw - 24px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: rgba(18, 26, 44, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--glass-highlight), 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
}

.toast-bar.is-bottom {
  top: auto;
  bottom: calc(18px + var(--safe-bottom));
}

.toast-undo {
  color: #9dd1ff;
  font-weight: 600;
  min-width: 44px;
  min-height: 32px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
}
