/* ================= 设计令牌（对齐出租车管理系统 frontend/src/styles/main.css） ================= */
:root {
  --app-color-primary: #2f7dd1;
  --app-color-primary-soft: #eaf3ff;
  --app-color-primary-hover: #2368b0;
  --app-color-success: #2ca58d;
  --app-color-warning: #e6a23c;
  --app-color-danger: #d94f45;
  --app-color-info: #909399;
  --app-color-text: #303133;
  --app-color-text-secondary: #606266;
  --app-color-text-muted: #909399;
  --app-color-text-placeholder: #c0c4cc;
  --app-color-border: #e4e7ed;
  --app-color-border-light: #ebeef5;
  --app-color-bg: #f5f7fa;
  --app-color-surface: #ffffff;
  --app-color-overlay: rgba(15, 23, 42, 0.48);
  --app-overlay-blur: 10px;
  --app-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --app-font-size-xs: 12px;
  --app-font-size-sm: 13px;
  --app-font-size-base: 14px;
  --app-font-size-md: 16px;
  --app-shadow-header: 0 1px 4px rgba(0, 0, 0, 0.1);
  --app-shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
  --app-shadow-dialog: 0 12px 40px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(47, 125, 209, 0.1);
  --app-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.07);
  --app-radius-sm: 4px;
  --app-radius-md: 8px;
  --app-radius-lg: 10px;
  --app-radius-round: 20px;
  --app-space-xs: 4px;
  --app-space-sm: 8px;
  --app-space-md: 12px;
  --app-space-lg: 16px;
  --app-space-xl: 20px;
  --app-space-2xl: 24px;
  --app-header-height: 56px;
  --app-tap: 44px;
  --app-duration: 0.16s;
  --app-content-width: 1000px;
}

/* 深色主题（原护眼开关）：近黑底 + 业务蓝，非暖黄纸色 */
html.eye-care {
  color-scheme: dark;
  --app-color-primary: #2f7dd1;
  --app-color-primary-soft: #1e3a5a;
  --app-color-primary-hover: #4a96e0;
  --app-color-success: #3dccb0;
  --app-color-warning: #e8b84d;
  --app-color-danger: #ef6b62;
  --app-color-info: #9aa0a6;
  --app-color-text: #e8eaed;
  --app-color-text-secondary: #b8bcc4;
  --app-color-text-muted: #8b9098;
  --app-color-text-placeholder: #6d727a;
  --app-color-border: #333333;
  --app-color-border-light: #2a2a2a;
  --app-color-bg: #121212;
  --app-color-surface: #1a1a1a;
  --app-color-overlay: rgba(0, 0, 0, 0.68);
  --app-shadow-header: 0 1px 4px rgba(0, 0, 0, 0.45);
  --app-shadow-card: 0 2px 8px rgba(0, 0, 0, 0.4);
  --app-shadow-dialog: 0 12px 40px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(47, 125, 209, 0.16);
  --app-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  font-family: var(--app-font-family);
  font-size: var(--app-font-size-base);
  background: var(--app-color-bg);
  color: var(--app-color-text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-wrap: break-word;
}
button { font-family: inherit; cursor: pointer; }
h1,h2,h3 { line-height: 1.35; color: var(--app-color-text); }
.muted { color: var(--app-color-text-muted); font-weight: 400; font-size: .85em; }
img { max-width: 100%; height: auto; vertical-align: middle; }

.icon-sprite {
  position: absolute; width: 0; height: 0; overflow: hidden;
}
.ico {
  width: 16px; height: 16px;
  display: inline-block;
  vertical-align: -0.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  pointer-events: none;
}
.ico-lg { width: 28px; height: 28px; }
.ico-md { width: 18px; height: 18px; }
.ico-fill { fill: currentColor; stroke: currentColor; }

:focus-visible {
  outline: 2px solid var(--app-color-primary);
  outline-offset: 2px;
}

/* ================= 顶栏 ================= */
.topbar {
  background: var(--app-color-surface);
  border-bottom: 1px solid var(--app-color-border);
  box-shadow: var(--app-shadow-header);
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.topbar-inner {
  max-width: var(--app-content-width);
  margin: 0 auto;
  padding: 8px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 8px;
  align-items: center;
  min-width: 0;
}
.topbar-lead { display: contents; }
.logo {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
}
.logo-icon {
  width: 40px; height: 40px;
  border-radius: var(--app-radius-md);
  background: var(--app-color-primary-soft);
  color: var(--app-color-primary);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-icon .ico { width: 22px; height: 22px; }
.logo-text { min-width: 0; }
.logo-text strong {
  font-size: 15px; display: block; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.logo-text small { color: var(--app-color-text-muted); font-size: 11px; display: block; }
.topbar-actions {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.theme-switch {
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--app-color-text-secondary);
  flex-shrink: 0;
  touch-action: manipulation;
  user-select: none;
  display: inline-flex;
  align-items: center;
}
.theme-switch-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #d4d8de;
  flex-shrink: 0;
  transition: background var(--app-duration) ease;
}
.theme-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: #e6a23c;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform var(--app-duration) ease, background var(--app-duration) ease, color var(--app-duration) ease;
}
.theme-switch-thumb .ico { width: 12px; height: 12px; display: block; }
.theme-switch-thumb .ico-moon { display: none; }
.theme-switch.on .theme-switch-track { background: #2f7dd1; }
.theme-switch.on .theme-switch-thumb {
  transform: translateX(20px);
  background: #1a1a1a;
  color: #8ec3f5;
}
.theme-switch.on .ico-sun { display: none; }
.theme-switch.on .ico-moon { display: block; }
.theme-switch:hover { color: var(--app-color-primary); }
.nav {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
  scroll-padding-inline: 12px;
}
.nav::before,
.nav::after {
  content: "";
  flex: 0 0 12px;
  width: 12px;
  min-width: 12px;
  pointer-events: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 8px 12px; border-radius: var(--app-radius-md); font-size: var(--app-font-size-base); cursor: pointer;
  color: var(--app-color-text-secondary); user-select: none; position: relative; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
  min-height: 36px;
  transition: background var(--app-duration) ease, color var(--app-duration) ease;
}
.nav a .ico { width: 16px; height: 16px; }
.nav a .nav-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  line-height: 1.2;
}
.nav a:hover { background: var(--app-color-bg); color: var(--app-color-primary); }
.nav a.active {
  background: var(--app-color-primary); color: #fff; font-weight: 600;
}
.badge {
  background: var(--app-color-danger); color: #fff; font-size: 11px; border-radius: 999px;
  padding: 0 6px; margin-left: 0; display: inline-block; min-width: 18px; text-align: center;
  flex: 0 0 auto; line-height: 16px;
}
/* 游客：顶栏只留首页；首页入口卡 / 题库概览保持可见，点击走登录 */
html.is-guest .nav a:not([data-view="home"]),
html.is-guest #resumeExamPanel {
  display: none;
}
html.is-guest #wrongBadge,
html.is-guest #favBadge {
  display: none;
}

/* 宽屏：logo | 导航 | 操作区 同一行。顶栏不跟内容区 1000px 封顶，避免中间列把首页/统计裁掉 */
@media (min-width: 960px) {
  .topbar-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    min-height: var(--app-header-height);
    max-width: none;
    padding: 0 20px;
    column-gap: 16px;
    row-gap: 0;
  }
  .logo { grid-column: 1; grid-row: 1; }
  .nav {
    grid-column: 2; grid-row: 1;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
  }
  /* 不要用两端弹性占位，否则首页/统计会被挤出可视区 */
  .nav::before,
  .nav::after {
    display: none;
    content: none;
    flex: none;
    width: 0;
    min-width: 0;
  }
  .topbar-actions { grid-column: 3; grid-row: 1; }
}
@media (min-width: 960px) and (max-width: 1199px) {
  .nav { gap: 0; }
  .nav a { padding: 8px 6px; font-size: 12px; }
}
@media (min-width: 1200px) {
  .nav { overflow: visible; gap: 2px; }
  .nav a { padding: 8px 10px; }
}

/* ================= 布局 ================= */
#app {
  max-width: var(--app-content-width);
  width: 100%;
  margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px));
  flex: 1;
  min-width: 0;
}
.view:not([hidden]) { animation: fadein var(--app-duration) ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.panel {
  background: var(--app-color-surface);
  border-radius: var(--app-radius-lg);
  padding: var(--app-space-xl);
  box-shadow: var(--app-shadow-card);
  margin-bottom: 16px;
  border: 1px solid var(--app-color-border);
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; gap: 8px; flex-wrap: wrap;
}
.panel-head h3 {
  font-size: 16px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.panel-head h3 .ico { width: 18px; height: 18px; color: var(--app-color-primary); }

/* ================= 首页 ================= */
.hero {
  text-align: left;
  padding: 16px 20px;
  margin-bottom: 16px;
  background: var(--app-color-surface);
  border: 1px solid var(--app-color-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow-card);
}
.hero h1 { font-size: clamp(18px, 3vw, 22px); font-weight: 700; letter-spacing: 0.2px; }
.hero h1 span { color: var(--app-color-primary); display: inline; font-size: inherit; margin-left: 6px; }
.hero p { color: var(--app-color-text-secondary); margin-top: 8px; font-size: var(--app-font-size-base); line-height: 1.6; }

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.entry-card {
  background: var(--app-color-surface);
  border-radius: var(--app-radius-lg);
  padding: 16px;
  cursor: pointer;
  border: 1px solid var(--app-color-border);
  transition: transform var(--app-duration) ease, box-shadow var(--app-duration) ease, border-color var(--app-duration) ease;
  box-shadow: var(--app-shadow-card);
  width: 100%; text-align: left; color: inherit; font: inherit;
  appearance: none; -webkit-appearance: none;
  display: flex; align-items: flex-start; gap: 12px;
  position: relative; z-index: 1;
  touch-action: manipulation;
  min-width: 0;
}
.entry-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--app-shadow-hover);
  border-color: rgba(47, 125, 209, 0.28);
}
html.eye-care .entry-card:hover,
html.eye-care .biz-item:hover { border-color: rgba(47, 125, 209, 0.55); }
.entry-icon {
  width: 40px; height: 40px;
  border-radius: var(--app-radius-md);
  background: var(--app-color-primary-soft);
  color: var(--app-color-primary);
  margin-bottom: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.entry-icon .ico { width: 22px; height: 22px; }
.entry-body { min-width: 0; flex: 1; }
.entry-card h3, .entry-card .entry-title { font-size: 15px; margin-bottom: 4px; font-weight: 600; display: block; color: var(--app-color-text); }
.entry-card p, .entry-card .entry-desc { font-size: 13px; color: var(--app-color-text-secondary); display: block; line-height: 1.55; }

.biz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.biz-item {
  border: 1px solid var(--app-color-border); border-radius: var(--app-radius-md); padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center; background: var(--app-color-surface);
  width: 100%; text-align: left; color: inherit; font: inherit;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  transition: transform var(--app-duration) ease, box-shadow var(--app-duration) ease, border-color var(--app-duration) ease;
  position: relative; z-index: 1;
  touch-action: manipulation; min-width: 0; gap: 8px;
}
.biz-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--app-shadow-hover);
  border-color: rgba(47, 125, 209, 0.28);
}
.biz-item .bi-name { font-size: 14px; font-weight: 600; }
.biz-item .bi-sub { font-size: 12px; color: var(--app-color-text-muted); margin-top: 4px; }
.biz-item .bi-count {
  background: var(--app-color-primary-soft); color: var(--app-color-primary); font-weight: 700; font-size: 15px;
  border-radius: var(--app-radius-sm); padding: 4px 8px; flex-shrink: 0;
}

.resume-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px; color: var(--app-color-text-secondary);
}

/* ================= 按钮 ================= */
.btn {
  border: none; border-radius: var(--app-radius-md); padding: 8px 16px; font-size: 14px; font-weight: 600;
  transition: background var(--app-duration) ease, border-color var(--app-duration) ease, color var(--app-duration) ease, box-shadow var(--app-duration) ease;
  user-select: none; touch-action: manipulation;
  min-height: 36px;
}
.btn.primary {
  background: var(--app-color-primary); color: #fff;
}
.btn.primary:hover { background: var(--app-color-primary-hover); }
.btn .ico { width: 16px; height: 16px; margin-right: 4px; vertical-align: -0.2em; }
.btn.ghost.back, .btn.inline-ico {
  display: inline-flex; align-items: center; gap: 6px;
}
.btn.ghost.back .ico { margin-right: 0; }
.btn.ghost { background: var(--app-color-surface); color: var(--app-color-text-secondary); border: 1px solid var(--app-color-border); }
.btn.ghost:hover { border-color: var(--app-color-primary); color: var(--app-color-primary); }
.btn.danger { background: var(--app-color-danger); color: #fff; }
.btn.danger.ghost { background: var(--app-color-surface); color: var(--app-color-danger); border-color: #fbc4c0; }
.btn.big { padding: 12px 32px; font-size: 15px; min-height: var(--app-tap); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; pointer-events: none; }
.btn.success:disabled:hover { filter: none; background: #07c160; }

/* ================= 配置页 ================= */
.config-body { display: flex; flex-direction: column; gap: 16px; }
.cfg-row label { display: block; font-size: 13px; color: var(--app-color-text-secondary); margin-bottom: 8px; font-weight: 600; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.chip {
  border: 1px solid var(--app-color-border); background: var(--app-color-surface); color: var(--app-color-text-secondary);
  border-radius: 999px; padding: 8px 16px; font-size: 13px; transition: background var(--app-duration) ease, border-color var(--app-duration) ease, color var(--app-duration) ease;
  user-select: none;
  min-height: 40px; touch-action: manipulation;
}
.chip:hover { border-color: var(--app-color-primary); color: var(--app-color-primary); }
.chip.on { background: var(--app-color-primary); border-color: var(--app-color-primary); color: #fff; font-weight: 600; }
.cfg-info {
  background: var(--app-color-bg); border: 1px dashed var(--app-color-border); border-radius: var(--app-radius-md);
  padding: 12px 16px; font-size: 13px; color: var(--app-color-text-secondary); line-height: 1.6;
}
.cfg-actions { text-align: center; padding-top: 8px; }

/* ================= 刷题页 ================= */
.do-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.do-head .back { padding: 8px 12px; font-size: 13px; min-height: 36px; }
.do-progress { flex: 1; min-width: 0; }
.progress-text { font-size: 13px; color: var(--app-color-text-secondary); text-align: right; margin-bottom: 4px; }
.progress-text span { color: var(--app-color-text); font-weight: 700; font-size: 15px; }
.progress-bar { height: 8px; background: var(--app-color-border-light); border-radius: 999px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: var(--app-color-primary); border-radius: 999px; transition: width var(--app-duration) ease; }
.progress-bar.slim { height: 4px; margin-bottom: 16px; }
.tool-btn {
  width: 40px; height: 40px; border-radius: var(--app-radius-md); border: 1px solid var(--app-color-border);
  background: var(--app-color-surface); color: var(--app-color-warning); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  transition: border-color var(--app-duration) ease, background var(--app-duration) ease;
}
.tool-btn .ico { width: 18px; height: 18px; }
.tool-btn:hover { border-color: var(--app-color-warning); }
.tool-btn.faved { background: #fdf6ec; border-color: var(--app-color-warning); }
.tool-btn.faved .ico { fill: currentColor; }

.qcard {
  background: var(--app-color-surface); border-radius: var(--app-radius-lg); padding: 24px;
  box-shadow: var(--app-shadow-card); border: 1px solid var(--app-color-border);
}
.q-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.tag {
  font-size: 12px; font-weight: 600; border-radius: var(--app-radius-sm); padding: 4px 8px;
  background: var(--app-color-primary-soft); color: var(--app-color-primary);
  display: inline-flex; align-items: center; gap: 4px;
}
.tag.biz { background: #e8f8f4; color: var(--app-color-success); font-weight: 500; }
.tag.case { background: #fdf6ec; color: #b88230; }
.tag .ico, .tag.ok-tag .ico, .review-head .ico { width: 12px; height: 12px; margin-right: 3px; vertical-align: -1px; }
.tag.ok-tag { background: #e8f8f4; color: var(--app-color-success); }
.stat-chip { font-size: 12px; color: var(--app-color-text-muted); }
.q-stem { font-size: 16px; font-weight: 600; margin-bottom: 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }

.opts { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; text-align: left;
  border: 1px solid var(--app-color-border); background: var(--app-color-surface);
  color: var(--app-color-text); font: inherit;
  appearance: none; -webkit-appearance: none;
  border-radius: var(--app-radius-md); padding: 12px 16px; font-size: 15px;
  transition: border-color var(--app-duration) ease, background var(--app-duration) ease, box-shadow var(--app-duration) ease;
  line-height: 1.55;
  width: 100%;
  min-height: var(--app-tap);
  overflow: visible;
  cursor: pointer;
  touch-action: manipulation;
}
.opt:hover:not(:disabled) { border-color: var(--app-color-primary); background: var(--app-color-primary-soft); }
.opt:disabled { cursor: default; }
.opt .opt-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; min-width: 24px; min-height: 24px;
  box-sizing: border-box; border-radius: 50%;
  border: 1.5px solid #3d4a5c;
  background: #fff; color: #1f2329;
  font-family: Arial, 'Segoe UI', sans-serif;
  font-weight: 800; font-size: 12px; line-height: 1;
  flex: 0 0 24px; overflow: hidden; margin-top: 2px;
}
html.eye-care .opt .opt-letter {
  background: #2a2a2a; color: #e8eaed; border-color: #8b9098;
}
.opt .opt-text {
  flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; color: inherit; text-align: left;
}
.opt.picked {
  border-color: var(--app-color-primary);
  background: var(--app-color-primary-soft);
  box-shadow: inset 3px 0 0 var(--app-color-primary);
}
.opt.picked .opt-letter { background: var(--app-color-primary); color: #fff; border-color: var(--app-color-primary); }
.opt.judge-yes .opt-letter { background: var(--app-color-success); color: #fff; border-color: var(--app-color-success); }
.opt.judge-no .opt-letter { background: var(--app-color-danger); color: #fff; border-color: var(--app-color-danger); }
.opt.correct { border-color: var(--app-color-success); background: #e8f8f4; box-shadow: inset 3px 0 0 var(--app-color-success); }
.opt.correct .opt-letter { background: var(--app-color-success); color: #fff; border-color: var(--app-color-success); }
.opt.wrong { border-color: var(--app-color-danger); background: #fef0ef; box-shadow: inset 3px 0 0 var(--app-color-danger); }
.opt.wrong .opt-letter { background: var(--app-color-danger); color: #fff; border-color: var(--app-color-danger); }
html.eye-care .opt.correct { background: #14332c; }
html.eye-care .opt.wrong { background: #3a1c1a; }
.opt.dim { opacity: .7; }

.judge-result {
  margin-top: 16px; border-radius: var(--app-radius-md); padding: 12px 16px; font-size: 14px; font-weight: 600;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px; line-height: 1.6;
}
.judge-result .judge-line {
  display: flex; align-items: flex-start; gap: 8px;
}
.judge-result .ico { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
.judge-result.ok { background: #e8f8f4; color: #1f7a68; border: 1px solid #b8e6da; }
.judge-result.bad { background: #fef0ef; color: #b33c34; border: 1px solid #f5c2be; }
.judge-result .ans { font-weight: 800; }
.q-exp {
  margin-top: 8px; padding-top: 10px;
  border-top: 1px solid rgba(31, 35, 41, 0.12);
  font-weight: 500; font-size: 13px; line-height: 1.7;
}
.q-exp-title { font-weight: 800; font-size: 13px; margin-bottom: 4px; }
.q-exp-body { white-space: pre-wrap; word-break: break-word; }
.judge-result .q-exp { margin-top: 4px; padding-top: 10px; border-top-color: currentColor; opacity: .92; }
.wrong-item .q-exp, .review-item .q-exp {
  color: var(--app-color-text-secondary);
}

.q-actions {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; flex-wrap: wrap;
}
.q-actions.center { justify-content: center; }
.qcard > .q-actions,
.qcard > .do-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--app-color-border-light);
  flex-wrap: nowrap;
}

.finish-card {
  background: var(--app-color-surface); border-radius: var(--app-radius-lg); padding: 32px 24px; text-align: center;
  border: 1px solid var(--app-color-border); box-shadow: var(--app-shadow-card);
}
.finish-card h3 {
  font-size: 20px; margin-bottom: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.finish-card h3 .ico { width: 22px; height: 22px; color: var(--app-color-primary); }
.finish-card p { color: var(--app-color-text-secondary); margin-bottom: 16px; line-height: 1.6; }
.finish-card .q-actions { justify-content: center; }

/* ================= 考试页 ================= */
.exam-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px;
}
.exam-head-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.exam-timer {
  font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: var(--app-color-text); color: #fff; border-radius: var(--app-radius-md); padding: 4px 12px;
  flex-shrink: 0;
}
.exam-timer.warn { background: var(--app-color-danger); }

.exam-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-anchor: none;
}
#view-exam { overflow-anchor: none; }
.sheet-panel {
  margin-top: 0;
  background: var(--app-color-surface);
  border-radius: var(--app-radius-lg);
  padding: var(--app-space-xl);
  box-shadow: var(--app-shadow-card);
  border: 1px solid var(--app-color-border);
}
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; margin-bottom: 16px; }
@media (min-width: 960px) {
  .exam-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    align-items: start;
    gap: 16px;
  }
  .sheet-panel {
    position: sticky;
    top: calc(var(--app-header-height) + 12px);
    max-height: calc(100vh - var(--app-header-height) - 24px);
    overflow: auto;
  }
}
.sheet-cell {
  aspect-ratio: 1; border-radius: var(--app-radius-md); border: 1px solid var(--app-color-border);
  background: var(--app-color-surface); font-size: 13px; font-weight: 600; color: var(--app-color-text-secondary);
  display: flex; align-items: center; justify-content: center;
  min-height: 40px;
  touch-action: manipulation;
}
.sheet-cell.answered { background: var(--app-color-primary); border-color: var(--app-color-primary); color: #fff; }
.sheet-cell.current { outline: 2px solid var(--app-color-warning); outline-offset: 1px; }
.sheet-cell.wrong { background: var(--app-color-danger); border-color: var(--app-color-danger); color: #fff; }
.sheet-legend { display: flex; gap: 16px; font-size: 12px; color: var(--app-color-text-secondary); margin-top: 12px; align-items: center; flex-wrap: wrap; }
.sheet-legend .dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1px solid var(--app-color-border); background: #fff; margin-right: 4px; vertical-align: -1px; }
.sheet-legend .dot.answered { background: var(--app-color-primary); border-color: var(--app-color-primary); }
.sheet-legend .dot.current { border-color: var(--app-color-warning); }

/* ================= 结果页 ================= */
.result-hero {
  text-align: center; background: var(--app-color-surface); border-radius: var(--app-radius-lg); padding: 24px 20px;
  border: 1px solid var(--app-color-border); margin-bottom: 16px; box-shadow: var(--app-shadow-card);
}
.result-hero.pass { background: #f3faf7; border-color: #c5e6dc; }
.result-hero.fail { background: #fdf6f5; border-color: #f5c2be; }
.result-hero h2 {
  font-size: 20px; margin-bottom: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.result-hero h2 .ico { width: 22px; height: 22px; }
.score-ring {
  width: 112px; height: 112px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--app-color-success) var(--p,0%), var(--app-color-border-light) 0);
  position: relative;
}
.score-ring::before {
  content: ""; position: absolute; width: 88px; height: 88px; border-radius: 50%; background: var(--app-color-surface);
}
.result-hero.fail .score-ring { background: conic-gradient(var(--app-color-danger) var(--p,0%), var(--app-color-border-light) 0); }
.score-ring span { font-size: 32px; font-weight: 800; position: relative; }
.score-ring small { color: var(--app-color-text-muted); position: relative; }
.result-hero p { color: var(--app-color-text-secondary); font-size: 14px; line-height: 1.6; }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-bottom: 16px;
}
.stat-box {
  background: var(--app-color-surface); border-radius: var(--app-radius-md); padding: 16px; text-align: center;
  border: 1px solid var(--app-color-border); box-shadow: var(--app-shadow-card); min-width: 0;
}
.stat-box b { font-size: 22px; display: block; color: var(--app-color-primary); }
.stat-box span { font-size: 12px; color: var(--app-color-text-secondary); }

.review-item { border-bottom: 1px solid var(--app-color-border-light); padding: 16px 0; }
.review-item:last-child { border-bottom: none; }
.review-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.review-head .ri-num { font-weight: 700; color: var(--app-color-text-muted); font-size: 13px; }
.review-stem { font-size: 14px; font-weight: 600; margin-bottom: 8px; line-height: 1.65; }
.review-opts { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.review-opts .ro { display: flex; gap: 8px; align-items: baseline; color: var(--app-color-text-secondary); }
.review-opts .ro .rl {
  font-weight: 800; color: #1f2329; flex-shrink: 0; min-width: 1.5em;
  font-family: Arial, 'Segoe UI', sans-serif;
}
html.eye-care .review-opts .ro .rl { color: #e8eaed; }
.review-opts .ro.right { color: #1f7a68; font-weight: 600; }
.review-opts .ro.picked-wrong { color: #b33c34; }
.review-opts .ro.right .rl { color: var(--app-color-success); }
.review-opts .ro.picked-wrong .rl { color: var(--app-color-danger); }

/* ================= 错题本 / 统计 ================= */
.wrong-item {
  border: 1px solid var(--app-color-border); border-radius: var(--app-radius-md); padding: 16px;
  margin-bottom: 8px; background: var(--app-color-surface);
}
.wrong-item .wi-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.wrong-item .wi-stem { font-size: 14px; font-weight: 600; margin-bottom: 8px; line-height: 1.65; }
.wrong-item .wi-ans { font-size: 13px; color: #1f7a68; }
.wrong-item .wi-ans b { font-weight: 800; }
.wi-remove { font-size: 12px; color: var(--app-color-text-muted); background: none; border: none; min-height: 32px; }
.wi-remove:hover { color: var(--app-color-danger); }

.acc-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; min-width: 0; }
.acc-row .ar-name { width: 168px; font-size: 13px; flex-shrink: 0; font-weight: 600; }
.acc-row .ar-bar { flex: 1; height: 8px; background: var(--app-color-bg); border-radius: 999px; overflow: hidden; min-width: 0; }
.acc-row .ar-bar i { display: block; height: 100%; border-radius: 999px; background: var(--app-color-success); }
.acc-row .ar-val { width: 112px; text-align: right; font-size: 12px; color: var(--app-color-text-secondary); flex-shrink: 0; }

.exam-record {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--app-color-border-light); padding: 12px 0; font-size: 14px; flex-wrap: wrap;
}
.exam-record:last-child { border-bottom: none; }
.exam-record .er-score { font-weight: 800; font-size: 16px; }
.exam-record .er-score.pass { color: var(--app-color-success); }
.exam-record .er-score.fail { color: var(--app-color-danger); }
.exam-record .er-info { color: var(--app-color-text-secondary); font-size: 12px; }

.empty-tip {
  text-align: center; color: var(--app-color-text-muted); padding: 48px 16px; font-size: 14px; line-height: 1.65;
  background: var(--app-color-bg); border-radius: var(--app-radius-md); border: 1px dashed var(--app-color-border);
}

/* ================= 弹窗 ================= */
.modal-mask {
  position: fixed; inset: 0; background: var(--app-color-overlay); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(24px, env(safe-area-inset-bottom, 0px));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  -webkit-backdrop-filter: blur(var(--app-overlay-blur));
  backdrop-filter: blur(var(--app-overlay-blur));
  overscroll-behavior: contain;
}
.modal {
  position: relative;
  background: var(--app-color-surface);
  border-radius: var(--app-radius-md);
  padding: 0;
  max-width: 420px; width: 100%;
  text-align: center;
  box-shadow: var(--app-shadow-dialog);
  border: 1px solid rgba(47, 125, 209, 0.14);
  margin: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(88vh, calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
}
.modal-x {
  position: absolute;
  top: 8px; right: 8px;
  width: 32px; height: 32px;
  border: none; background: transparent;
  color: var(--app-color-text-muted);
  font-size: 18px; line-height: 1;
  cursor: pointer; z-index: 3;
  border-radius: var(--app-radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.modal-x .ico { width: 16px; height: 16px; }
.modal-x:hover { color: var(--app-color-text); background: rgba(48, 49, 51, 0.08); }
html.eye-care .modal-x:hover { background: rgba(255, 255, 255, 0.08); }
.modal > h3 {
  margin: 0; padding: 16px 48px 16px 20px;
  background: var(--app-color-primary-soft);
  border-bottom: 1px solid rgba(47, 125, 209, 0.16);
  font-size: 16px; font-weight: 600; text-align: left;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.modal > h3 .ico { width: 18px; height: 18px; color: var(--app-color-primary); }
.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal > p,
.modal-body > p { color: var(--app-color-text-secondary); font-size: 14px; margin: 16px 20px 8px; text-align: left; line-height: 1.65; }
.modal > .q-actions,
.modal .modal-foot {
  justify-content: flex-end;
  padding: 12px 20px 16px;
  margin-top: 0;
  border-top: 1px solid var(--app-color-border-light);
  flex-shrink: 0;
  background: var(--app-color-surface);
}
.modal .modal-foot.resume-actions {
  justify-content: stretch;
  gap: 12px;
  flex-wrap: nowrap;
}
.modal .modal-foot.resume-actions .btn {
  flex: 1;
  min-height: var(--app-tap);
  font-weight: 600;
}
.modal .modal-foot.resume-actions .btn.primary {
  background: var(--app-color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(47, 125, 209, 0.28);
}
.modal .modal-foot.resume-actions .btn.primary:hover {
  background: var(--app-color-primary-hover);
}

/* ================= 页脚（备案对齐出租车 IcpFooter） ================= */
.footer {
  text-align: center;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  color: var(--app-color-text-muted);
  font-size: 12px;
  background: var(--app-color-bg);
  border-top: 1px solid var(--app-color-border-light);
}
.footer > p { margin-bottom: 4px; line-height: 1.6; }
.footer-tagline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0 0 6px;
  line-height: 1.5;
}
.footer-tagline span { display: block; }
.company-legal {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 2px;
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
}
.company-line {
  margin: 0;
  color: var(--app-color-text-secondary);
  font-size: inherit;
  line-height: inherit;
  font-weight: 600;
}
.company-meta {
  margin: 0;
  color: #909399;
  font-size: inherit;
  line-height: inherit;
  font-weight: 400;
  word-break: break-word;
}
.icp-footer {
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: #909399;
  padding: 8px 0;
}
.icp-footer a {
  color: inherit;
  text-decoration: none;
  margin: 0 4px;
}
.icp-footer a:hover { color: var(--app-color-primary); }
.icp-footer .sep {
  color: #c0c4cc;
  margin: 0 4px;
}
.icp-footer .gongan .badge-icon {
  display: inline;
  vertical-align: -2px;
  margin-right: 2px;
  width: 14px;
  height: 14px;
  max-width: 14px;
  object-fit: contain;
  filter: none;
}

/* ================= 认证 / 会员 ================= */
.auth-area { display: flex; gap: 8px; align-items: center; flex-shrink: 0; min-width: 0; }
.auth-area a.btn { text-decoration: none; display: inline-flex; align-items: center; box-sizing: border-box; }
.auth-area .btn.small,
.auth-user-btn {
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-user-name-short { display: none; }
.btn.small { padding: 6px 12px; font-size: 13px; border: none; border-radius: var(--app-radius-md); font-weight: 600; min-height: 32px; }
.btn.gold { background: var(--app-color-warning); color: #fff; }
.btn.gold:hover { filter: brightness(1.04); }
.btn.success { background: #07c160; color: #fff; }
.btn.success:hover { filter: brightness(1.04); background: #06ad56; }
.vip-tag {
  background: var(--app-color-warning); color: #fff; font-size: 10px;
  border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: 1px;
}
.free-tag { background: var(--app-color-border-light); color: var(--app-color-text-secondary); font-size: 10px; border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: 1px; }
.auth-open-vip-btn { flex-shrink: 0; padding: 6px 10px; }

.auth-modal { max-width: 420px; }
#vipModal .modal > h3 {
  background: #fdf6ec;
  border-bottom-color: #f5dab1;
  color: #8a6419;
}
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--app-color-border);
  background: var(--app-color-primary-soft);
  padding-right: 40px;
  flex-shrink: 0;
}
.auth-tab {
  flex: 1; background: none; border: none; padding: 12px 8px; font-size: 15px; font-weight: 600;
  color: var(--app-color-text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
  min-height: var(--app-tap);
}
.auth-tab.on { color: var(--app-color-primary); border-bottom-color: var(--app-color-primary); background: var(--app-color-surface); }
.auth-reset-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.auth-reset-back {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--app-color-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 0 2px;
  min-height: 40px;
  font-family: inherit;
  cursor: pointer;
}
.auth-reset-back:hover { text-decoration: underline; }
.auth-reset-desc {
  margin: 0;
  font-size: 13px;
  color: var(--app-color-text-secondary);
  line-height: 1.5;
}
.auth-sms-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
}
.auth-sms-row input { flex: 1; min-width: 0; }
.auth-form .btn.auth-send-sms {
  flex: 0 0 auto;
  width: auto;
  min-width: 108px;
  max-width: 42%;
  padding: 8px 10px;
  white-space: nowrap;
  font-size: 13px;
  min-height: var(--app-tap);
}
.auth-forgot {
  margin: 0;
  text-align: right;
  font-size: 13px;
  line-height: 1.5;
}
.auth-forgot a { color: var(--app-color-primary); text-decoration: none; cursor: pointer; }
.auth-forgot a:hover { text-decoration: underline; }
.auth-form { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 20px; text-align: left; }
.auth-form input {
  border: 1px solid var(--app-color-border); border-radius: var(--app-radius-md);
  padding: 12px 16px; font-size: 16px; outline: none;
  transition: border-color var(--app-duration) ease; font-family: inherit; width: 100%;
  min-height: var(--app-tap);
}
.auth-form input:focus { border-color: var(--app-color-primary); box-shadow: 0 0 0 3px rgba(47, 125, 209, 0.12); }
.auth-form input::placeholder { color: var(--app-color-text-placeholder); }
.pwd-wrap { position: relative; width: 100%; }
.pwd-wrap > input { padding-right: 44px; }
.pwd-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; padding: 0; border: none; background: transparent;
  color: var(--app-color-text-muted); border-radius: var(--app-radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; touch-action: manipulation;
}
.pwd-toggle:hover { color: var(--app-color-text-secondary); }
.pwd-toggle:focus-visible { outline: 2px solid var(--app-color-primary); outline-offset: 1px; color: var(--app-color-text-secondary); }
.pwd-eye-ico {
  width: 20px; height: 20px; display: block; pointer-events: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.auth-error { color: var(--app-color-danger); font-size: 12px; min-height: 16px; }
.auth-form .btn.big { width: 100%; }
.auth-tip { font-size: 12px; color: var(--app-color-text-muted); text-align: center; line-height: 1.6; }
.auth-form .auth-tip { margin: 0; }
.auth-form .auth-tip:empty { display: none; }
.auth-tip .ico { width: 14px; height: 14px; margin-right: 2px; vertical-align: -2px; color: var(--app-color-warning); }
.auth-tip b { color: var(--app-color-warning); }
.auth-invite-hint {
  font-size: 12px;
  color: var(--app-color-text-muted);
  min-height: 16px;
  line-height: 1.4;
  margin: -2px 0 0;
}
.auth-invite-hint:empty,
.auth-invite-hint[hidden] {
  display: none;
  min-height: 0;
  margin: 0;
}
.auth-invite-hint.ok { color: var(--app-color-success); }
.auth-invite-hint.warn { color: var(--app-color-warning); }
.auth-invite-wrap { display: flex; flex-direction: column; gap: 8px; }
.auth-invite-wrap[hidden] { display: none !important; }
.auth-contact { font-size: 13px; text-align: center; margin: 0; line-height: 1.5; }
.auth-form .auth-contact {
  margin: 0;
  padding: 0;
  width: 100%;
  text-align: center;
  color: inherit;
  font-size: 13px;
  line-height: 1.5;
}
.auth-contact a { color: var(--app-color-primary); text-decoration: none; cursor: pointer; }
.auth-contact a:hover { text-decoration: underline; }
.auth-legal-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--app-color-text-secondary);
  line-height: 1.55;
  text-align: left;
  cursor: pointer;
  user-select: none;
}
.auth-legal-check.is-need { color: var(--app-color-danger); }
.auth-form .auth-legal-check input[type="checkbox"],
.auth-legal-check input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 3px 0 0;
  padding: 0;
  border: none;
  border-radius: 3px;
  box-shadow: none;
  flex-shrink: 0;
  accent-color: var(--app-color-primary);
  cursor: pointer;
}
.auth-form .auth-legal-check input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(47, 125, 209, 0.18);
  border: none;
}
.auth-legal-check a,
.auth-legal-hint a {
  color: var(--app-color-primary);
  text-decoration: none;
  cursor: pointer;
}
.auth-legal-check a:hover,
.auth-legal-hint a:hover { text-decoration: underline; }
#authRememberWrap { align-items: center; margin: 0; }
#authRememberWrap[hidden] { display: none !important; }
.auth-legal-hint {
  margin: 0;
  font-size: 12px;
  color: var(--app-color-text-muted);
  text-align: center;
  line-height: 1.55;
}
.legal-mask { z-index: 220; }
.legal-modal { max-width: 560px; text-align: left; }
.legal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 20px 16px;
  text-align: left;
}
.legal-body h4 {
  margin: 16px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--app-color-text);
  line-height: 1.45;
}
.legal-body h4:first-child { margin-top: 4px; }
.legal-body p,
.legal-body li {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--app-color-text-secondary);
  text-align: left;
}
.legal-body ul {
  margin: 0 0 8px;
  padding: 0 0 0 1.2em;
}
.legal-body li { margin-bottom: 4px; }
.legal-body b { color: var(--app-color-text); font-weight: 600; }
.legal-meta {
  font-size: 12px !important;
  color: var(--app-color-text-muted) !important;
}
.legal-body a { color: var(--app-color-primary); text-decoration: none; }
.legal-body a:hover { text-decoration: underline; }
.footer-docs {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.6;
}
.footer-docs a {
  color: var(--app-color-text-secondary);
  text-decoration: none;
}
.footer-docs a:hover { color: var(--app-color-primary); }
.footer-docs .sep { margin: 0 6px; color: #c0c4cc; }
.profile-modal { max-width: 420px; }
.invite-card {
  border: 1px solid #f5dab1;
  background: #fff8ee;
  border-radius: var(--app-radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.invite-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #8a6419;
}
.invite-card-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--app-color-text-secondary);
}
.invite-card-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--app-color-text-secondary);
}
.invite-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--app-color-text);
}
.invite-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.auth-invite-btn { flex-shrink: 0; }
.profile-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  text-align: left;
}
.profile-row { display: flex; flex-direction: column; gap: 4px; }
.profile-row input {
  border: 1px solid var(--app-color-border); border-radius: var(--app-radius-md);
  padding: 12px 16px; font-size: 16px; outline: none;
  font-family: inherit; width: 100%; min-height: var(--app-tap);
}
.profile-row input:focus { border-color: var(--app-color-primary); box-shadow: 0 0 0 3px rgba(47, 125, 209, 0.12); }
.profile-row input[readonly] {
  background: var(--app-color-bg);
  color: var(--app-color-text-secondary);
  cursor: default;
}
.profile-row input[readonly]:focus { box-shadow: none; border-color: var(--app-color-border); }
.profile-name-hint {
  margin: 0;
  font-size: 12px;
  color: var(--app-color-text-secondary);
  line-height: 1.45;
}
.profile-name-hint.is-lock { color: var(--app-color-warning); }
.profile-name-hint[hidden] { display: none !important; }
.profile-row label,
.profile-label {
  font-size: 12px;
  color: var(--app-color-text-secondary);
  font-weight: 600;
}
.profile-readonly {
  min-height: var(--app-tap);
  padding: 12px 16px;
  border: 1px solid var(--app-color-border);
  border-radius: var(--app-radius-md);
  background: var(--app-color-bg);
  color: var(--app-color-text);
  display: flex;
  align-items: center;
  word-break: break-all;
}
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px 20px;
}
.vip-status {
  background: var(--app-color-bg); border: 1px solid var(--app-color-border); border-radius: var(--app-radius-md);
  padding: 16px; font-size: 14px; color: var(--app-color-text-secondary); margin: 16px 20px 0; font-weight: 600; text-align: left;
}
.vip-status.ok { background: #fdf6ec; border-color: #f5dab1; color: #8a6419; }
.vip-status .muted { font-weight: 400; font-size: 12px; margin-top: 4px; }
.vip-status .vip-account { margin-top: 0; margin-bottom: 6px; }
.pay-wait-banner {
  margin: 12px 20px 0;
  padding: 12px 14px;
  border-radius: var(--app-radius-md);
  background: #fff7e8;
  border: 1px solid #f5dab1;
  color: #8a6419;
  font-size: 13px;
  text-align: left;
}
.pay-wait-banner b { display: block; margin-bottom: 4px; }
.pay-wait-banner.is-fail {
  background: #fef0ef;
  border-color: #fbc4c0;
  color: var(--app-color-danger);
}
.pay-wait-banner.is-fail .pay-fail-reason {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.55;
  margin: 6px 0 8px;
  color: var(--app-color-danger);
}
.pay-fail-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.pay-fail-banner-actions .btn {
  width: 100%;
  min-height: var(--app-tap);
}
.pay-wait-panel, .pay-done-panel, .pay-fail-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 20px 8px 8px;
  width: 100%;
}
.pay-wait-panel[hidden], .pay-done-panel[hidden], .pay-fail-panel[hidden], .pay-wait-banner[hidden] { display: none !important; }
.pay-wait-title, .pay-done-title, .pay-fail-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--app-color-text);
}
.pay-fail-title { color: var(--app-color-danger); }
.pay-wait-desc, .pay-done-desc {
  margin: 0;
  font-size: 13px;
  color: var(--app-color-text-secondary);
  line-height: 1.55;
}
.pay-fail-desc {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--app-color-danger);
  line-height: 1.55;
  width: 100%;
}
.pay-wait-user {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--app-color-text);
}
.pay-wait-user[hidden] { display: none !important; }
.pay-wait-eta { margin: 0; font-size: 12px; color: var(--app-color-warning); font-weight: 600; }
.pay-remark-ask {
  width: 100%;
  max-width: 320px;
  margin-top: 8px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pay-remark-ask[hidden] { display: none !important; }
.pay-wait-banner .pay-remark-ask { max-width: none; margin-top: 10px; }
.pay-remark-ask .btn { width: 100%; min-height: 40px; }
.pay-wait-spin {
  width: 36px; height: 36px;
  border: 3px solid #f5dab1;
  border-top-color: var(--app-color-warning);
  border-radius: 50%;
  animation: pay-spin 0.8s linear infinite;
}
@keyframes pay-spin { to { transform: rotate(360deg); } }
.pay-done-panel .btn,
.pay-fail-panel .btn { margin-top: 8px; width: 100%; min-height: var(--app-tap); }
.pay-fail-panel .btn + .btn { margin-top: 0; }
.auth-modal .auth-form { padding-top: 16px; }

.pass-mask { z-index: 110; }
.pass-modal > h3 { padding-bottom: 4px; padding-right: 48px; border-bottom: none; }
.pass-modal .msub {
  color: var(--app-color-text-muted); font-size: 12px; margin: 0;
  padding: 0 20px 12px; text-align: left;
  background: var(--app-color-primary-soft);
  border-bottom: 1px solid rgba(47, 125, 209, 0.16);
  flex-shrink: 0;
}
.pass-modal .auth-form { padding-bottom: 0; padding-top: 16px; }
.pass-field { display: flex; flex-direction: column; gap: 4px; }
.pass-field label {
  font-size: 12px; color: var(--app-color-text-secondary); font-weight: 600;
}
.pass-modal .q-actions {
  margin: 0;
}
.pass-modal .q-actions .btn { min-width: 88px; min-height: var(--app-tap); }

.btn.wx-get {
  background: #fff;
  color: #8a6419;
  border: 1px solid #e6c48a;
}
.btn.wx-get:hover {
  background: #fdf6ec;
  border-color: var(--app-color-warning);
  color: #6e4e12;
}
.wx-contact-modal { max-width: 400px; }
.wx-contact-modal > h3 { padding-bottom: 4px; padding-right: 48px; border-bottom: none; }
.wx-contact-modal .msub {
  color: var(--app-color-text-muted); font-size: 12px; margin: 0;
  padding: 0 20px 12px; text-align: left;
  background: var(--app-color-primary-soft);
  border-bottom: 1px solid rgba(47, 125, 209, 0.16);
  flex-shrink: 0;
}
.wx-contact-body {
  padding: 16px 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#payQrPanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
#payQrPanel[hidden] { display: none !important; }
.pay-plan-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pay-plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--app-color-border);
  border-radius: var(--app-radius-md);
  background: #fff;
  color: inherit;
  cursor: pointer;
  min-height: var(--app-tap);
}
.pay-plan-card:hover {
  border-color: #07c160;
  background: #f6ffed;
}
.pay-plan-card.is-on {
  border-color: #07c160;
  background: #f0fdf4;
  box-shadow: 0 0 0 1px #07c160;
}
.pay-plan-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pay-plan-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--app-color-text);
}
.pay-plan-days {
  font-size: 12px;
  color: var(--app-color-text-muted);
}
.pay-plan-price {
  font-size: 20px;
  font-weight: 800;
  color: #07c160;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.pay-amount-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.pay-amount-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--app-color-text-secondary);
  flex-shrink: 0;
}
.pay-amount-value {
  font-size: 22px;
  font-weight: 800;
  color: #07c160;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.pay-amount-hint {
  font-size: 12px;
  color: var(--app-color-text-muted);
}
.pay-remark-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pay-remark-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--app-color-text-secondary);
  line-height: 1.5;
}
.pay-remark-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}
.pay-remark-value {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--app-color-text);
  word-break: break-all;
  background: var(--app-color-bg);
  border: 1px solid var(--app-color-border);
  border-radius: var(--app-radius-md);
  padding: 10px 12px;
  line-height: 1.45;
  user-select: all;
  -webkit-user-select: all;
}
.pay-remark-row .btn {
  flex-shrink: 0;
  min-height: 40px;
  padding: 6px 12px;
}
.wx-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--app-color-border);
  border-radius: var(--app-radius-md);
}
.wx-qr-box[hidden],
.pay-jsapi-box[hidden],
.pay-openwx-box[hidden] { display: none !important; }
.pay-jsapi-box,
.pay-openwx-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.pay-openwx-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.pay-openwx-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--app-color-text-secondary);
}
.wx-qr-box img {
  width: min(220px, 70vw);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
}
.pay-mobile-hint {
  margin: 0;
  padding: 8px 10px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  font-size: 13px;
  line-height: 1.6;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  text-align: left;
}
.pay-mobile-hint[hidden] { display: none !important; }
.wx-qr-placeholder {
  width: min(220px, 70vw);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  color: var(--app-color-text-muted);
  border: 1px dashed var(--app-color-border);
  border-radius: var(--app-radius-md);
  padding: 16px;
  background: var(--app-color-bg);
}
.wx-contact-body #wxSaveQrBtn {
  width: 100%;
}
.pay-action-row {
  display: flex;
  gap: 10px;
  width: 100%;
}
.pay-action-row[hidden] { display: none !important; }
.pay-action-row .btn { flex: 1; min-width: 0; padding-left: 10px; padding-right: 10px; }
.pay-action-row #payPaidBtn:disabled { letter-spacing: 0; }
.wx-contact-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--app-color-text-secondary);
}
.wx-contact-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: #b45309;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--app-radius-md);
  padding: 8px 10px;
}

.toast {
  position: fixed; top: calc(70px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  background: var(--app-color-text); color: #fff; font-size: 14px; border-radius: 999px;
  padding: 8px 20px; z-index: 200; box-shadow: var(--app-shadow-dialog);
  max-width: calc(100vw - 32px);
}

@media (hover: none) {
  .entry-card:hover, .biz-item:hover { transform: none; box-shadow: var(--app-shadow-card); }
}

/* ================= 移动端 ================= */
@media (max-width: 959px) {
  .topbar-inner {
    padding: 8px 12px;
    column-gap: 8px;
    row-gap: 8px;
  }
  .nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    overflow-x: visible;
    overflow-y: visible;
    touch-action: manipulation;
    -webkit-overflow-scrolling: auto;
    scrollbar-width: auto;
  }
  .nav::before,
  .nav::after {
    display: none;
    content: none;
    width: 0;
    min-width: 0;
    flex: none;
  }
  .nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    width: auto;
    flex-shrink: 1;
    padding: 6px 2px;
    font-size: 12px;
    min-height: 52px;
    white-space: nowrap;
  }
  .nav a .nav-label {
    white-space: nowrap;
    max-width: 100%;
  }
  .nav a .badge {
    margin-left: 0;
    padding: 0 4px;
    min-width: 16px;
    font-size: 10px;
    line-height: 14px;
    height: 14px;
  }
  html.is-guest .nav {
    display: flex;
    overflow: visible;
  }
  html.is-guest .nav a[data-view="home"] {
    flex-direction: row;
    padding: 8px 12px;
    width: auto;
  }
  .auth-user-name-full { display: none; }
  .auth-user-name-short { display: inline; }
  .auth-area .btn.small.auth-user-btn,
  .auth-user-btn {
    max-width: none;
    flex-shrink: 0;
  }
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 768px) {
  #app { padding: 16px max(12px, env(safe-area-inset-right, 0px)) 28px max(12px, env(safe-area-inset-left, 0px)); }
  .hero { padding: 16px; }
  .hero h1 { font-size: 20px; }
  .entry-card { padding: 16px 12px; }
  .biz-grid { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .qcard { padding: 16px; }
  .q-stem { font-size: 16px; }
  .opt { font-size: 16px; padding: 12px; width: 100%; min-height: var(--app-tap); }
  .do-head { gap: 8px; }
  .do-head .back { padding: 8px; font-size: 13px; min-height: var(--app-tap); }
  .tool-btn { width: var(--app-tap); height: var(--app-tap); }
  .acc-row { flex-wrap: wrap; }
  .acc-row .ar-name { width: auto; flex: 1 1 100%; font-size: 13px; }
  .acc-row .ar-val { width: auto; }
  .sheet-grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
  .score-ring { width: 96px; height: 96px; }
  .score-ring::before { width: 76px; height: 76px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .modal-mask {
    align-items: flex-start;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-bottom: max(48px, env(safe-area-inset-bottom, 0px));
  }
  .auth-form input, .pass-field input { font-size: 16px; }
  .auth-form .btn.auth-send-sms { max-width: 46%; font-size: 13px; }
  .q-actions .btn,
  .do-actions .btn,
  .cfg-actions .btn,
  .resume-row .btn { flex: 1 1 0; min-width: 0; min-height: var(--app-tap); }
  .cfg-actions .btn.big { width: 100%; flex-basis: 100%; }
  .chip { min-height: var(--app-tap); padding: 8px 16px; }
  .logo-text small { display: none; }
  .theme-switch { height: 36px; }
  .auth-area .btn.small { min-height: 36px; font-size: 12px; padding: 6px 10px; }
  #logoutBtn, .auth-logout-btn { max-width: none; flex-shrink: 0; padding: 6px 8px; }
}
@media (max-width: 560px) {
  .entry-grid { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 380px) {
  .logo-text strong { font-size: 13px; }
}

/* ================= 收藏夹 / 背题（仅追加，不改全局） ================= */
.judge-result.recite {
  background: #eaf3ff;
  color: #2368b0;
  border: 1px solid #c5dcf5;
}
html.eye-care .judge-result.recite {
  background: #1e3a5a;
  color: #8ec3f5;
  border-color: rgba(47, 125, 209, 0.45);
}
.fav-toggle {
  line-height: 1;
  background: none;
  border: none;
  color: var(--app-color-warning);
  cursor: pointer;
  padding: 4px 8px;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 32px;
}
.fav-toggle .ico { width: 18px; height: 18px; fill: currentColor; }
.exam-record .er-flag {
  display: inline-flex; align-items: center; gap: 4px;
}
.exam-record .er-flag .ico { width: 14px; height: 14px; }
.exam-record .er-flag.pass { color: var(--app-color-success); }
.exam-record .er-flag.fail { color: var(--app-color-danger); }
.wi-remove {
  display: inline-flex; align-items: center; gap: 4px;
}
.wi-remove .ico { width: 12px; height: 12px; }
.empty-tip .ico { width: 18px; height: 18px; margin-right: 4px; vertical-align: -3px; color: var(--app-color-primary); }
.rl .ico { width: 12px; height: 12px; margin-right: 2px; vertical-align: -1px; color: var(--app-color-success); }
.fav-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ================= 深色主题：硬编码浅色覆盖 ================= */
html.eye-care .logo-icon,
html.eye-care .entry-icon,
html.eye-care .biz-item .bi-count,
html.eye-care .tag {
  color: #8ec3f5;
}
html.eye-care .btn.danger.ghost { border-color: #8a3d38; }
html.eye-care .tool-btn.faved { background: #3a2e14; }
html.eye-care .tag.biz,
html.eye-care .tag.ok-tag { background: #14332c; color: #7ee0c8; }
html.eye-care .tag.case { background: #3a2e14; color: #e8b84d; }
html.eye-care .judge-result.ok { background: #14332c; color: #7ee0c8; border-color: #2a6b5a; }
html.eye-care .judge-result.bad { background: #3a1c1a; color: #f5a19b; border-color: #8a3d38; }
html.eye-care .q-exp { border-top-color: rgba(255, 255, 255, 0.18); }
html.eye-care .wrong-item .q-exp, html.eye-care .review-item .q-exp { color: #c5c9d0; }
html.eye-care .exam-timer {
  background: #2a2a2a;
  color: #e8eaed;
  border: 1px solid #3d3d3d;
}
html.eye-care .exam-timer.warn {
  background: #ef6b62;
  color: #fff;
  border-color: #ef6b62;
}
html.eye-care .sheet-legend .dot { background: #2a2a2a; }
html.eye-care .result-hero.pass { background: #14332c; border-color: #2a6b5a; }
html.eye-care .result-hero.fail { background: #3a1c1a; border-color: #8a3d38; }
html.eye-care .review-opts .ro.right { color: #7ee0c8; }
html.eye-care .review-opts .ro.picked-wrong { color: #f5a19b; }
html.eye-care .wrong-item .wi-ans { color: #7ee0c8; }
html.eye-care .acc-row .ar-bar { background: #2a2a2a; }
html.eye-care .modal { border-color: rgba(47, 125, 209, 0.28); }
html.eye-care .modal > h3,
html.eye-care .pass-modal .msub { border-bottom-color: rgba(47, 125, 209, 0.28); }
html.eye-care .icp-footer { color: rgba(255,255,255,0.5); }
html.eye-care .footer-docs a:hover { color: rgba(255,255,255,0.9); }
html.eye-care .icp-footer a:hover { color: rgba(255,255,255,0.9); }
html.eye-care .icp-footer .gongan .badge-icon { filter: none; opacity: 1; }
html.eye-care #vipModal .modal > h3 {
  background: #3a2e14;
  border-bottom-color: #6b5420;
  color: #e8b84d;
}
html.eye-care .auth-form input,
html.eye-care .pass-field input {
  background: #222222;
  color: #e8eaed;
}
html.eye-care .auth-form input:focus,
html.eye-care .pass-field input:focus {
  box-shadow: 0 0 0 3px rgba(47, 125, 209, 0.28);
}
html.eye-care .vip-status.ok {
  background: #3a2e14;
  border-color: #6b5420;
  color: #e8b84d;
}
html.eye-care .pay-wait-banner {
  background: #3a2e14;
  border-color: #6b5420;
  color: #e8b84d;
}
html.eye-care .pay-wait-banner.is-fail {
  background: #3a1c1a;
  border-color: #8a3d38;
  color: #f5a19b;
}
html.eye-care .pay-wait-banner.is-fail .pay-fail-reason,
html.eye-care .pay-fail-title,
html.eye-care .pay-fail-desc {
  color: #ffb3ad;
}
html.eye-care .pay-fail-banner-actions .btn.ghost {
  border-color: #8a3d38;
  color: #f5a19b;
}
html.eye-care .pay-fail-banner-actions .btn.ghost:hover,
html.eye-care .pay-fail-panel .btn.ghost:hover {
  background: #3a1c1a;
  border-color: #ef6b62;
  color: #ffb3ad;
}
html.eye-care .pay-fail-panel .btn.ghost {
  border-color: #8a3d38;
  color: #f5a19b;
}
html.eye-care .btn.wx-get {
  background: #2a2a2a;
  color: #e8b84d;
  border-color: #6b5420;
}
html.eye-care .btn.wx-get:hover {
  background: #3a2e14;
  border-color: #e8b84d;
  color: #e8b84d;
}
html.eye-care .btn.success { background: #147a4a; }
html.eye-care .btn.success:hover { background: #0f6a3f; }
html.eye-care .wx-contact-modal .msub { border-bottom-color: rgba(47, 125, 209, 0.28); }
html.eye-care .wx-qr-box { background: #1a1a1a; border-color: #3d3d3d; }
html.eye-care .wx-qr-placeholder { background: #222222; }
html.eye-care .pay-amount-value { color: #34d399; }
html.eye-care .pay-plan-card {
  background: #1a1a1a;
  border-color: #3d3d3d;
}
html.eye-care .pay-plan-card:hover,
html.eye-care .pay-plan-card.is-on {
  background: #14332c;
  border-color: #2a6b5a;
}
html.eye-care .pay-plan-price { color: #34d399; }
html.eye-care .pay-remark-value {
  background: #222222;
  border-color: #3d3d3d;
  color: #e8eaed;
}
html.eye-care .wx-contact-note {
  color: #fdba74;
  background: #3a2e14;
  border-color: #6b5420;
}
html.eye-care .toast {
  background: #2a2a2a;
  color: #e8eaed;
  border: 1px solid #3d3d3d;
}
html.eye-care input:-webkit-autofill,
html.eye-care input:-webkit-autofill:hover,
html.eye-care input:-webkit-autofill:focus {
  -webkit-text-fill-color: #e8eaed;
  caret-color: #e8eaed;
  box-shadow: 0 0 0 1000px #222222 inset;
}
