/* 社工研习社 · 小红书奶油手账高颜值视觉系统 */
:root {
  --bg-desk: #EFECE6;
  --bg-cream: #FAF7F2;
  --bg-card: #FFFFFF;
  --bg-oat: #F4EDE2;
  --bg-sage-soft: #EAF1EB;
  --bg-terracotta-soft: #FBEDE8;
  --bg-gold-soft: #FBF3E4;

  --sage: #4F6F52;
  --sage-dark: #3B553E;
  --caramel: #BA7B45;
  --terracotta: #C8644B;
  --ink: #2C2A26;
  --ink-sub: #6E685F;
  --ink-muted: #9E978D;
  --border: #EAE3D7;

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --shadow-soft: 0 8px 24px rgba(59, 48, 36, 0.05);
  --shadow-card: 0 2px 10px rgba(59, 48, 36, 0.04);

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-desk);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* Desktop studio wrapper + Mobile shell */
.studio-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 28px;
  padding: 20px 16px;
  min-height: 100vh;
}

.phone-shell {
  width: 100%;
  max-width: 430px;
  min-height: calc(100vh - 40px);
  background: var(--bg-cream);
  border-radius: 32px;
  box-shadow: 0 20px 60px rgba(44, 42, 38, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Desktop side helper panel (hidden on mobile) */
.desktop-helper {
  width: 310px;
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.helper-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.helper-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-family: var(--font-serif);
  color: var(--ink);
}

.helper-card p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ink-sub);
}

.demo-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.demo-btn {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-cream);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.demo-btn:hover {
  border-color: var(--sage);
  background: var(--bg-sage-soft);
}

.demo-btn.active {
  background: var(--sage);
  color: #fff;
  border-color: var(--sage);
}

.code-chip-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.code-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-oat);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.code-chip code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  color: var(--sage-dark);
}

@media (max-width: 599px) {
  .studio-layout {
    padding: 0;
  }
  .desktop-helper {
    display: none;
  }
  .phone-shell {
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* Top Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(14px);
  padding: 11px 14px;
  border-bottom: 1px solid rgba(234, 227, 215, 0.85);
  transition: border-color 0.2s, background 0.2s;
}

.phone-shell.exam-mode .app-header {
  background: #fffdf8;
  border-bottom: 1.5px solid #d24b46;
}

.phone-shell.exam-mode .brand-logo {
  background: linear-gradient(135deg, #c63b36, #91221e);
  box-shadow: 0 3px 10px rgba(181, 43, 39, 0.25);
}

.phone-shell.exam-mode {
  background: #f3efe6;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

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

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: linear-gradient(135deg, #5A7B5E, #3E5A42);
  color: #FAF7F2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 3px 10px rgba(79, 111, 82, 0.25);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.brand-sub {
  font-size: 11px;
  color: var(--ink-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill-action {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.pill-action.highlight {
  background: var(--bg-gold-soft);
  border-color: #E7C99B;
  color: #8E5926;
}

.pill-action:hover {
  transform: translateY(-1px);
}

/* Scope switcher (Product A vs Product B) */
.scope-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-oat);
  padding: 3px;
  border-radius: var(--radius-pill);
  gap: 3px;
}

.scope-tab {
  border: none;
  background: transparent;
  padding: 7px 10px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-sub);
  cursor: pointer;
  transition: all 0.22s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.scope-tab.active {
  background: var(--bg-card);
  color: var(--sage-dark);
  box-shadow: 0 2px 8px rgba(44, 42, 38, 0.08);
}

.scope-tab.qust.active {
  color: #8E5926;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #CCC3B4;
}

.status-dot.unlocked {
  background: #529B62;
}

/* Main scrolling area */
.app-main {
  flex: 1;
  padding: 14px 16px 96px;
  overflow-y: auto;
}

.view-section {
  display: none;
  animation: fadeUp 0.24s ease;
}

.view-section.active {
  display: block;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

.card-cream {
  background: linear-gradient(145deg, #FFFDF9, #F5EFE4);
}

.card-sage {
  background: linear-gradient(145deg, #F3F8F3, #E6F0E7);
  border-color: #D2E2D4;
}

.card-qust {
  background: linear-gradient(145deg, #FFFBF3, #F8ECDA);
  border-color: #EAD3B0;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--font-serif);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge-sage { background: var(--bg-sage-soft); color: var(--sage-dark); }
.badge-gold { background: var(--bg-gold-soft); color: #925B24; }
.badge-hot { background: var(--bg-terracotta-soft); color: var(--terracotta); }
.badge-oat { background: var(--bg-oat); color: var(--ink-sub); }
.badge-lock { background: #EFECE6; color: #7C756A; }

/* Hero countdown banner */
.hero-journal {
  background: linear-gradient(135deg, #4B6A4F 0%, #37513B 100%);
  color: #FAF7F2;
  border-radius: var(--radius-xl);
  padding: 18px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(55, 81, 59, 0.22);
}

.hero-journal::after {
  content: "研";
  position: absolute;
  right: 12px;
  bottom: -18px;
  font-family: var(--font-serif);
  font-size: 92px;
  color: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
}

.hero-sub {
  font-size: 13px;
  opacity: 0.88;
  margin: 0 0 12px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px;
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  opacity: 0.82;
}

/* Buttons */
.btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--sage);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--sage-dark);
}

.btn-gold {
  background: linear-gradient(135deg, #C7894E, #A86B34);
  color: #fff;
}

.btn-oat {
  background: var(--bg-oat);
  color: var(--ink);
}

.btn-oat:hover:not(:disabled) {
  background: #EAE0D1;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 10px;
}

.btn-block {
  width: 100%;
}

/* Task list */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-cream);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s;
}

.task-item.done {
  background: var(--bg-sage-soft);
  border-color: #CDE0D0;
}

.task-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.8px solid #BEB5A8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  color: #fff;
}

.task-item.done .task-check {
  background: var(--sage);
  border-color: var(--sage);
}

.task-text {
  flex: 1;
  font-size: 13px;
}

.task-item.done .task-text {
  text-decoration: line-through;
  color: var(--ink-sub);
}

/* Sub-tabs inside views */
.sub-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.sub-tab {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--ink-sub);
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.sub-tab.active {
  background: var(--ink);
  color: #FAF7F2;
  border-color: var(--ink);
}

/* Toggle Plain vs Exam */
.mode-toggle {
  display: inline-flex;
  background: var(--bg-oat);
  border-radius: var(--radius-pill);
  padding: 2px;
  gap: 2px;
}

.mode-toggle button {
  border: none;
  background: transparent;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-sub);
  cursor: pointer;
}

.mode-toggle button.active {
  background: var(--bg-card);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Question cards & Grader */
.question-card {
  cursor: pointer;
  transition: transform 0.16s, border-color 0.16s;
}

.question-card:hover {
  border-color: var(--sage);
}

.question-card.locked {
  opacity: 0.88;
}

.prompt-box {
  background: var(--bg-cream);
  border-left: 3px solid var(--sage);
  padding: 12px 14px;
  border-radius: 0 12px 12px 0;
  font-size: 14px;
  margin: 10px 0;
  white-space: pre-wrap;
}

.textarea {
  width: 100%;
  min-height: 118px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  background: #FFFEFC;
  color: var(--ink);
  resize: vertical;
  outline: none;
}

.textarea:focus, .input:focus, .select:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(79, 111, 82, 0.12);
}

.input, .select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 14px;
  background: #FFFEFC;
  color: var(--ink);
  outline: none;
  font-family: var(--font-sans);
}

/* Grading Result Box */
.grade-result {
  background: linear-gradient(160deg, #FDFBF7, #F1F6F1);
  border: 1px solid #C8DCCB;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 14px;
}

.score-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.score-circle span {
  font-size: 20px;
  line-height: 1;
}

.score-circle small {
  font-size: 10px;
  opacity: 0.85;
}

.point-list {
  margin: 6px 0 10px;
  padding-left: 18px;
  font-size: 13px;
}

.point-list li {
  margin-bottom: 4px;
}

.rewrite-box {
  background: #fff;
  border: 1px dashed #B9CDBB;
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  white-space: pre-wrap;
  line-height: 1.7;
}

/* Blank highlight for templates */
.tpl-blank {
  display: inline-block;
  background: #F4E6CF;
  color: #7D4C1E;
  padding: 0 6px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tpl-blank.hidden-blank {
  background: #D7CEBF;
  color: transparent;
  user-select: none;
}

/* Flashcards */
.flashcard-stage {
  perspective: 1000px;
  margin-bottom: 14px;
}

.flashcard-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 18px;
  min-height: 220px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.flashcard-front-q {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  margin: 12px 0;
}

.audio-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-oat);
  padding: 10px 12px;
  border-radius: 14px;
  margin-top: 10px;
}

/* Hotspot cards */
.hotspot-stars {
  color: #D98A3C;
  font-size: 13px;
  letter-spacing: 1px;
}

.theory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

/* Bottom Nav */
.bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 253, 249, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
}

.nav-btn {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 10px;
  transition: color 0.18s;
}

.nav-btn .nav-icon {
  font-size: 18px;
  line-height: 1;
}

.nav-btn.active {
  color: var(--sage-dark);
  font-weight: 700;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(34, 31, 27, 0.52);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-sheet {
  width: 100%;
  max-width: 410px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-cream);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  animation: fadeUp 0.22s ease;
}

.poster-preview-img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  display: block;
  margin: 10px 0;
}

/* Option pills for self test & theory game */
.option-btn {
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.16s;
}

.option-btn:hover {
  border-color: var(--sage);
  background: var(--bg-sage-soft);
}

.option-btn.selected {
  border-color: var(--sage);
  background: var(--bg-sage-soft);
  font-weight: 600;
}

.option-btn.correct {
  border-color: #3D8B4D;
  background: #E7F6EA;
  color: #1F572B;
}

.option-btn.wrong {
  border-color: #C8644B;
  background: #FDEEEB;
  color: #8D321D;
}

/* Admin Table / List */
.key-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: var(--bg-cream);
  border-radius: 12px;
  margin-bottom: 7px;
  font-size: 12px;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(44, 42, 38, 0.92);
  color: #FAF7F2;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.muted {
  color: var(--ink-muted);
  font-size: 12px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

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


/* ============ V6.5 Interactive Exam-Sheet Simulator (Ported & Upgraded from Sibling Prototype) ============ */
.sim-exam-paper {
  background: linear-gradient(180deg, #fffefb 0%, #faf6ed 100%);
  color: #1f2328;
  box-shadow: 0 8px 24px rgba(44, 42, 38, 0.1), inset 0 0 0 1.5px #dfd5c3;
  border-radius: 14px;
  position: relative;
  display: flex;
  overflow: hidden;
  font-family: "STKaiti", "Kaiti SC", "KaiTi", "Songti SC", serif;
}

.sim-binding-zone {
  width: 30px;
  flex-shrink: 0;
  border-right: 1.5px dashed #c83e3e;
  color: #c83e3e;
  writing-mode: vertical-rl;
  letter-spacing: 0.32em;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  background: rgba(200, 62, 62, 0.025);
}

.sim-paper-inner {
  flex: 1;
  padding: 14px 16px;
  position: relative;
  min-width: 0;
}

.sim-paper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: rgba(180, 42, 42, 0.85);
  border-bottom: 1px solid rgba(180, 42, 42, 0.32);
  padding-bottom: 5px;
  margin-bottom: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
}

.sim-ink-good {
  color: #1c222b;
  line-height: 1.82;
  font-size: 14px;
}

.sim-hang-body {
  padding-left: 22px;
  color: #232a34;
  line-height: 1.72;
  margin-bottom: 4px;
}

.sim-page-footer {
  text-align: center;
  font-size: 11px;
  color: #4f4a42;
  margin-top: 10px;
  padding-top: 5px;
  border-top: 1px solid #d5ccb9;
  font-family: "Songti SC", "STSong", serif;
}

.sim-red-check {
  color: #d62d56;
  font-weight: 900;
  font-size: 18px;
  font-family: cursive, sans-serif;
  margin-left: 6px;
}

.sim-ink-messy {
  color: #202630;
  line-height: 1.42;
  letter-spacing: -0.02em;
  font-size: 14px;
}

.sim-hotspot-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d94848;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(217, 72, 72, 0.22);
  margin: 0 3px;
  vertical-align: middle;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  transition: transform 0.15s ease;
}

.sim-hotspot-dot:hover,
.sim-hotspot-dot.active {
  transform: scale(1.18);
  background: #b02a2a;
}

.sim-strike-clean {
  text-decoration: line-through;
  text-decoration-color: #1c222b;
  text-decoration-thickness: 1.5px;
}

.sim-blob-mess {
  background: #1c222b;
  color: #1c222b;
  border-radius: 4px;
  padding: 0 5px;
  user-select: none;
}

.sim-annot-card {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 8px 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 6px;
}

.sim-annot-card.active {
  border-color: #d94848;
  background: #fff5f4;
}

.sim-timeline-bar {
  width: 100%;
  height: 26px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.sim-mini-pages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.sim-mini-page-box {
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  border: 1.5px solid #d6cbb6;
  background: #fffdf8;
  position: relative;
  overflow: hidden;
}


/* ============ V7 Hybrid: Option 2 Cream Home Desk -> Option 3 Red-Line Exam Room ============ */
.phone-shell.exam-mode .nav-btn.active {
  color: #b52b27;
}

.v7-desk-hero {
  background: linear-gradient(135deg, #47684d 0%, #314b36 100%);
  color: #fff;
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 10px 24px rgba(55, 84, 60, 0.18);
}

.v7-desk-cta {
  width: 100%;
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 13px;
  border: none;
  background: #f6e2b5;
  color: #382610;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s;
}

.v7-desk-cta:active {
  transform: scale(0.985);
}

.v7-diamond-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.v7-diamond-card {
  background: #fff;
  border: 1px solid #eae0d0;
  border-radius: 16px;
  padding: 13px 12px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(44, 40, 36, 0.03);
}

.v7-diamond-card:hover {
  border-color: #cbb89d;
  box-shadow: 0 5px 14px rgba(44, 40, 36, 0.07);
}

.v7-diamond-icon {
  font-size: 20px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.v7-diamond-title {
  font-weight: 800;
  font-size: 14px;
  color: #2c2824;
  margin-bottom: 2px;
}

.v7-diamond-sub {
  font-size: 12px;
  color: #8a7e72;
}

/* Option 3 Authentic Exam Paper Sheet */
.v7-exam-sheet-wrap {
  background: #fffdf8;
  border: 1.5px solid #d8cebc;
  border-radius: 14px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(32, 28, 22, 0.07);
}

.v7-exam-q-row {
  background: #faf6ec;
  border: 1px solid #ece3d2;
  border-radius: 10px;
  padding: 10px 11px;
  margin-bottom: 8px;
}

.v7-ink-btn {
  background: #23262b;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
}

.v7-ink-btn:hover {
  background: #b52b27;
}

.v7-red-clock {
  background: #fdf2f2;
  border: 1px solid #e6b0ae;
  color: #b52b27;
  padding: 3px 9px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 800;
}

.v7-grader-textarea {
  width: 100%;
  min-height: 195px;
  border: none;
  outline: none;
  resize: vertical;
  background: transparent;
  font-family: "STKaiti", "Kaiti SC", "KaiTi", "Songti SC", serif;
  font-size: 16px;
  line-height: 1.9;
  color: #1c222b;
  padding: 2px 0;
}

/* ============ V8 Strict L1 -> L2 -> L3 Hierarchy & Clean 3-Capsule Drill Strip ============ */
.phone-shell.l2-mode .app-header,
.phone-shell.l2-mode .bottom-nav,
.phone-shell.l3-mode .app-header,
.phone-shell.l3-mode .bottom-nav {
  display: none !important;
}

.phone-shell.l2-mode .app-main,
.phone-shell.l3-mode .app-main {
  padding-bottom: 28px;
}

.phone-shell.l3-mode {
  background: #f2eee4;
}

.v8-l2-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 22;
  background: rgba(255, 253, 249, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.phone-shell.l2-mode .v8-l2-bar {
  display: flex;
}

.v8-l3-bar {
  background: #fffdf8;
  border-bottom: 1.5px solid #cf433e;
  margin: -14px -16px 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 22;
}

.bottom-nav.v8-nav-4 {
  grid-template-columns: repeat(4, 1fr);
}

.v8-drill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.v8-drill-pill {
  background: #ffffff;
  border: 1px solid #e7ded0;
  border-radius: 14px;
  padding: 11px 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
  box-shadow: 0 2px 6px rgba(44, 40, 36, 0.03);
}

.v8-drill-pill:hover {
  border-color: #b79b73;
  box-shadow: 0 4px 12px rgba(44, 40, 36, 0.07);
}

.v8-drill-pill:active {
  transform: scale(0.98);
}

.v8-drill-name {
  font-weight: 800;
  font-size: 13px;
  color: #2c2824;
}

.v8-drill-meta {
  font-size: 11px;
  color: #8a7e72;
  margin-top: 2px;
}

.v8-sub-entry {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e7ded0;
  border-radius: 15px;
  padding: 12px 14px;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.14s;
  box-shadow: 0 2px 7px rgba(44, 40, 36, 0.025);
}

.v8-sub-entry:hover {
  border-color: #c7b59b;
}

.v8-sub-entry-arrow {
  color: #9b8f80;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.v8-section-label {
  font-size: 12px;
  font-weight: 700;
  color: #7d7468;
  margin: 12px 2px 7px;
}

/* ============ V8.4 Beginner 4x3 Answering Pedagogy & Large Exam Sheet System ============ */
@media (min-width: 760px) {
  .phone-shell.l2-sheet-wide {
    max-width: 680px;
    transition: max-width 0.22s ease;
  }
}

.qtype-4grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.qtype-tab-btn {
  border: 1.5px solid #e4dac9;
  background: #fdfbf7;
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.qtype-tab-btn .qt-name {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #2c2824;
  line-height: 1.25;
}

.qtype-tab-btn .qt-sub {
  display: block;
  font-size: 11px;
  color: #8a7e72;
  margin-top: 2px;
}

.qtype-tab-btn.active {
  background: #3d5b42;
  border-color: #3d5b42;
  box-shadow: 0 4px 12px rgba(61, 91, 66, 0.22);
}

.qtype-tab-btn.active .qt-name {
  color: #ffffff;
}

.qtype-tab-btn.active .qt-sub {
  color: rgba(255, 255, 255, 0.84);
}

.qstep-3bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  background: #f2ece1;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.qstep-btn {
  border: none;
  background: transparent;
  border-radius: 9px;
  padding: 7px 6px;
  font-size: 12px;
  font-weight: 700;
  color: #6b6257;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.qstep-btn.active {
  background: #ffffff;
  color: #2c2824;
  box-shadow: 0 2px 6px rgba(44, 40, 36, 0.08);
}

.ped-box {
  background: #fffdf9;
  border: 1px solid #e7decb;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}

.ped-box-title {
  font-size: 13px;
  font-weight: 800;
  color: #2c2824;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* Visual Row-Count & 总-分-总 Anatomy Table */
.zfz-table {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.zfz-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 9px;
  align-items: stretch;
  background: #ffffff;
  border: 1px solid #ece4d5;
  border-radius: 10px;
  padding: 8px 9px;
}

.zfz-badge {
  border-radius: 8px;
  padding: 5px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  line-height: 1.25;
}

.zfz-badge b {
  font-size: 12px;
  font-weight: 800;
}

.zfz-badge span {
  font-size: 10px;
  margin-top: 2px;
  opacity: 0.9;
}

.zfz-badge.role-head {
  background: #edf0f3;
  color: #2d3748;
  border: 1px solid #d4dce4;
}

.zfz-badge.role-zong1 {
  background: #e7f1e8;
  color: #275231;
  border: 1px solid #c5dec8;
}

.zfz-badge.role-fen {
  background: #fdf2df;
  color: #854d0e;
  border: 1px solid #f2d7a7;
}

.zfz-badge.role-zong2 {
  background: #fbeae5;
  color: #963622;
  border: 1px solid #efc5b9;
}

.zfz-body {
  font-size: 13px;
  line-height: 1.72;
  color: #232824;
}

/* Fixed boilerplate vs Empty Blank Slot vs Filled Example Chip */
.boiler-fixed {
  color: #1f2b22;
  font-weight: 600;
}

.blank-slot {
  display: inline;
  background: #fff6ea;
  border-bottom: 2px dashed #c86d2d;
  color: #9e4710;
  padding: 1px 6px;
  margin: 0 2px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
}

.filled-chip {
  display: inline;
  background: #fef0c7;
  border: 1px solid #e3b959;
  color: #5d3806;
  padding: 1px 6px;
  margin: 0 2px;
  border-radius: 4px;
  font-weight: 700;
}

/* Mini Visual Page Row-Diagram */
.mini-sheet-diagram {
  background: #faf7f0;
  border: 1.5px solid #2d2d2d;
  border-radius: 4px;
  padding: 8px 10px 8px 22px;
  position: relative;
  font-size: 12px;
}

.mini-sheet-diagram::before {
  content: "密封线";
  position: absolute;
  left: 3px;
  top: 0;
  bottom: 0;
  width: 13px;
  border-right: 1px dashed #555;
  writing-mode: vertical-rl;
  font-size: 9px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 3px;
}

.mini-bar-block {
  border-radius: 5px;
  padding: 5px 8px;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.sheet-closeup-bleed {
  margin: 0 -6px 10px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid #cfc2ac;
  box-shadow: 0 10px 26px rgba(32, 24, 15, 0.14);
  cursor: zoom-in;
  position: relative;
  background: #3d2b1f;
}

.sheet-closeup-bleed img {
  width: 100%;
  display: block;
}

/* ============ V9 视觉整理：顶栏 / 按钮不折行 / 触屏输入 / 宽屏布局 ============ */

/* 顶栏：品牌区可收缩，右侧按钮不折行 */
.header-top { gap: 10px; }
.brand-wrap { min-width: 0; flex: 1 1 auto; }
.brand-wrap > div:last-child { min-width: 0; }
.brand-logo { flex: 0 0 auto; }
.brand-title { white-space: nowrap; }
.brand-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.header-actions { flex: 0 0 auto; gap: 6px; }
.pill-action {
  white-space: nowrap;
  height: 30px;
  padding: 0 11px;
  font-weight: 600;
}
.pill-action.icon-only {
  width: 30px;
  padding: 0;
  justify-content: center;
  color: var(--ink-sub);
}
.school-pill { max-width: 150px; gap: 5px; }
.school-pill-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.school-pill-caret { color: var(--ink-muted); font-size: 10px; }

/* 小按钮、深色按钮文字不折行 */
.v7-ink-btn, .nav-btn span { white-space: nowrap; }
.btn { max-width: 100%; }
.v7-ink-btn { flex: 0 0 auto; padding: 6px 12px; }

/* 触屏设备输入框 16px，避免 iOS 聚焦时自动放大（允许双指缩放后需要） */
@media (pointer: coarse) {
  input[type="text"], input[type="search"], input[type="password"], input:not([type]),
  textarea, select {
    font-size: 16px !important;
  }
}

/* 提示条：放到顶栏下方，不再盖住品牌区；长文案自动换行 */
.toast {
  top: calc(64px + env(safe-area-inset-top));
  max-width: min(88vw, 380px);
  width: max-content;
  text-align: center;
  line-height: 1.5;
  white-space: normal;
}

/* 宽屏（电脑）：不再只是一台“居中手机”，内容区加宽，考场/批改页更宽 */
@media (min-width: 1024px) {
  .studio-layout { padding: 28px 24px; }
  .phone-shell {
    max-width: 760px;
    min-height: calc(100vh - 56px);
    border-radius: 28px;
  }
  .phone-shell.l3-mode,
  .phone-shell.l2-sheet-wide { max-width: 920px; }
  .app-header { padding: 14px 24px; }
  .app-main { padding-left: 28px !important; padding-right: 28px !important; }
  .school-pill { max-width: 240px; }
  .modal-sheet { max-width: 520px; }
  .bottom-nav { padding-left: 80px; padding-right: 80px; }
}

/* 考场顶部工具条：两个下拉 + 换卷按钮一行排开，不截断 */
.paper-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr) auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}
.paper-toolbar .select {
  min-width: 0;
  padding: 7px 9px;
  font-size: 13px;
  background: #fffdf8;
  text-overflow: ellipsis;
}
.paper-toolbar .btn { background: #b52b27; border-color: #b52b27; }

/* 手机上装订线收窄，把宽度让给题目 */
@media (max-width: 480px) {
  .sim-binding-zone { width: 18px; font-size: 9px; letter-spacing: 0.18em; padding: 8px 0; }
  .sim-paper-inner { padding: 12px 12px; }
}

/* ============ V9.1 一级页入口：大卡片 + 图标块，竖向铺满一屏 ============ */
.v8-sub-entry {
  justify-content: flex-start;
  gap: 14px;
  padding: 16px 16px;
  margin-bottom: 12px;
  border-radius: 18px;
  min-height: 92px;
  box-shadow: 0 3px 12px rgba(44, 40, 36, 0.045);
}
.v8-sub-entry:active { transform: scale(0.985); }
.entry-icon {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  line-height: 1;
}
.entry-icon.tone-sage  { background: var(--bg-sage-soft); }
.entry-icon.tone-gold  { background: var(--bg-gold-soft); }
.entry-icon.tone-terra { background: var(--bg-terracotta-soft); }
.entry-icon.tone-oat   { background: var(--bg-oat); }
.entry-text { flex: 1; min-width: 0; }
.entry-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
}
.entry-desc {
  font-size: 13px;
  color: var(--ink-sub);
  line-height: 1.55;
  margin-top: 4px;
}
.v8-sub-entry-arrow { font-size: 20px; margin-left: auto; }
.v8-section-label { font-size: 13px; margin: 16px 2px 9px; }

/* 底栏是 sticky 占位的，不需要再给内容区垫 96px 空白 */
.app-main { padding-bottom: 20px; }

/* 一级页：内容不足一屏时，入口卡片按比例拉高，把底部留白吃掉 */
.view-section.l1-fill.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 61px - 60px - 34px - env(safe-area-inset-bottom));
}
.l1-fill .v8-sub-entry {
  flex: 1 1 auto;
  max-height: 150px;
}
.l1-fill > .card { flex: 0 0 auto; }

/* 备考桌：题型胶囊加高，"今日随手练"卡片吃掉剩余高度 */
.v8-drill-pill { padding: 16px 8px; border-radius: 16px; }
.v8-drill-name { font-size: 16px; }
.v8-drill-meta { font-size: 12px; margin-top: 4px; }
.home-wrong-strip {
  min-height: 0;
  padding: 12px 14px;
  margin-bottom: 12px;
  justify-content: space-between;
}
.home-fill .home-wrong-strip { flex: 0 0 auto; max-height: none; }
.home-fill .home-quick-card {
  padding: 16px;
  margin-bottom: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  max-height: 320px;
}
.home-quick-prompt {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
  margin: 6px 0 12px;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
}

/* 答题页：交卷前的次数提示 */
.grader-quota-hint {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--bg-oat);
  color: var(--ink-sub);
  font-size: 13px;
  line-height: 1.55;
}
.grader-quota-hint:empty { display: none; }
.grader-quota-hint b { color: var(--ink); }
.grader-quota-hint a { color: #b52b27; font-weight: 700; text-decoration: none; margin-left: 2px; }

/* 宽屏时内容区左右内边距变成 28px，顶部吸附条同步外扩铺满 */
@media (min-width: 1024px) {
  .v8-l3-bar { margin-left: -28px; margin-right: -28px; padding-left: 24px; padding-right: 24px; }
}

/* 长标签/长按钮允许换行，不撑出卡片 */
.theory-tags .badge { white-space: normal; text-align: left; line-height: 1.45; border-radius: 10px; }
.key-row > :first-child { min-width: 0; flex: 1 1 auto; }
.key-row > .btn { flex: 0 0 auto; }
a.btn { white-space: normal; text-align: center; }
.badge { max-width: 100%; }
.flex-gap > .badge { white-space: normal; line-height: 1.4; }
.flex-between > .badge, .card-title-row > .badge { flex-shrink: 0; white-space: nowrap; }

/* 公开回忆原卷说明 */
.recall-note {
  margin: 6px 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-oat);
  color: var(--ink-sub);
  font-size: 12px;
  line-height: 1.6;
}

/* 弹窗底部按钮常驻可见，不用滚到最底才能点 */
.modal-sticky-footer {
  position: sticky;
  bottom: -20px;
  margin: 12px -20px -20px;
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(250, 247, 242, 0) 0, var(--bg-cream) 14px);
  z-index: 2;
}
.modal-sheet { overscroll-behavior: contain; }

/* ============ V9.2 答题页 ============ */
.grader-question-card {
  background: #fffdf8;
  border: 1px solid #dfd6c4;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.grader-meta { margin-bottom: 8px; gap: 6px; }
.grader-meta .badge { font-size: 11px; }
.grader-prompt {
  font-family: "KaiTi", "STKaiti", "Kaiti SC", "Songti SC", "SimSun", serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.6;
  color: #1c2026;
  white-space: pre-wrap;
}
.grader-rule {
  margin-top: 8px;
  font-size: 12px;
  color: #9e3c25;
  background: #fbefec;
  border-radius: 8px;
  padding: 5px 9px;
  display: inline-block;
}
.grader-rule:empty { display: none; }

/* 答题纸：去掉装饰性的竖排装订线，换成左侧细红线，宽度留给作答 */
.grader-sheet { margin-bottom: 8px; }
.grader-sheet .sim-paper-inner {
  border-left: 2px solid rgba(181, 43, 39, 0.28);
  padding: 12px 14px 10px 16px;
}
.grader-sheet .sim-paper-header {
  white-space: nowrap;
  gap: 10px;
}
.grader-sheet .sim-paper-header > span { overflow: hidden; text-overflow: ellipsis; }
.grader-sheet .sim-paper-header b { font-weight: 700; flex: 0 0 auto; }
.grader-sheet .v7-grader-textarea {
  min-height: max(240px, calc(100dvh - 520px));
  font-family: "KaiTi", "STKaiti", "Kaiti SC", "Songti SC", serif;
  font-size: 17px;
}
.grader-sheet .v7-grader-textarea::placeholder { color: #b3aa9c; font-size: 15px; }
.grader-diagnosis { font-size: 12px; line-height: 1.6; margin: 0 2px 8px; }
.grader-diagnosis:empty { display: none; }

.grader-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grader-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid #ddd2bf;
  background: #fffdf8;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.grader-tool-btn:active { transform: scale(0.98); }
.grader-submit {
  margin-top: 10px;
  padding: 14px 16px;
  font-size: 15px;
  background: #b52b27;
  border-color: #b52b27;
  border-radius: 14px;
}
@media (min-width: 1024px) {
  .grader-prompt { font-size: 21px; }
  .grader-sheet .v7-grader-textarea { min-height: max(320px, calc(100vh - 480px)); }
}

/* 考场/答题页顶栏：不再用负外边距抵消内边距（sticky 会把它推回来盖住下面 14px 内容） */
.phone-shell.l3-mode .app-main { padding-top: 0; }
.phone-shell.l3-mode .v8-l3-bar { margin-top: 0; }

/* 批改结果：字数一行 + 免费用户范文模糊 */
.grade-wordcount {
  font-size: 13px;
  color: var(--ink-sub);
  background: var(--bg-oat);
  border-radius: 10px;
  padding: 7px 11px;
  margin-bottom: 8px;
}
.rewrite-locked { position: relative; overflow: hidden; min-height: 150px; }
.rewrite-locked-text { filter: blur(5px); user-select: none; pointer-events: none; }
.rewrite-locked-mask {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(to bottom, rgba(255, 253, 248, 0.35), rgba(255, 253, 248, 0.92));
  font-weight: 700;
  color: var(--ink);
  font-size: 14px;
}

/* 邀请好友卡片 */
.invite-card { border: 1px solid #e7c99b; background: #fffaf0; }
.invite-link-row { display: flex; gap: 8px; }
.invite-link-row .input { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-sub); }

/* ============ V9.3 手机与 iPad 平板触屏专项适配（主流备考设备体验加固） ============ */

/* 1. 全局触控手势与防 iOS/iPadOS 输入框自动放大 */
button, a, label, select, input, textarea, .nav-btn, .v8-sub-entry, .v8-drill-pill, .flashcard-inner {
  touch-action: manipulation;
}
.sub-tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sub-tabs::-webkit-scrollbar {
  display: none;
}
@media (pointer: coarse) {
  input[type="text"], input[type="search"], input[type="password"],
  input[type="number"], input[type="date"], input[type="tel"], input:not([type]),
  textarea, select {
    font-size: 16px !important;
  }
  .pill-action {
    min-height: 34px;
    padding: 0 12px;
  }
  .pill-action.icon-only {
    width: 34px;
    height: 34px;
  }
  .btn-sm {
    min-height: 36px;
  }
  .nav-btn {
    padding: 6px 4px;
  }
}

/* 2. 软键盘弹起防抖：使用 svh 替代 dvh 防止手机/平板打字时外层卡片剧烈收缩跳动 */
.view-section.l1-fill.active {
  min-height: calc(100vh - 155px);
  min-height: calc(100svh - 61px - 60px - 34px - env(safe-area-inset-bottom));
}
.grader-sheet .v7-grader-textarea {
  min-height: clamp(220px, 38svh, 420px);
  scroll-margin-top: 76px;
}

/* 3. 手机端（<= 599px）：全屏贴边 + 顶部刘海安全区 + 拇指友好的底部抽屉弹窗 */
@media (max-width: 599px) {
  .studio-layout {
    padding: 0;
  }
  .desktop-helper {
    display: none;
  }
  .phone-shell {
    max-width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    border-radius: 0;
    box-shadow: none;
  }
  .app-header {
    padding-top: max(11px, calc(6px + env(safe-area-inset-top)));
  }
  .v8-l2-bar,
  .phone-shell.l3-mode .v8-l3-bar {
    padding-top: max(10px, calc(6px + env(safe-area-inset-top)));
  }
  /* 手机弹窗改为底部半屏抽屉，大拇指单手即可点确认和关闭 */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal-sheet {
    max-width: 100%;
    max-height: 90dvh;
    border-radius: 24px 24px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .modal-sticky-footer {
    bottom: -18px;
    margin: 12px -16px -18px;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  }
}

/* 4. iPad 与安卓平板端（600px – 1023px，覆盖 iPad Mini / Air / 标准版 / Pro 竖屏与分屏） */
@media (min-width: 600px) and (max-width: 1023px) {
  .studio-layout {
    padding: 18px 20px;
  }
  .desktop-helper {
    display: none;
  }
  .phone-shell {
    max-width: 740px;
    min-height: calc(100svh - 36px);
    border-radius: 26px;
    box-shadow: 0 18px 48px rgba(44, 42, 38, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  }
  /* iPad 进入红线考场与空白答题纸时进一步展开为 A4 舒适书写宽幅 */
  .phone-shell.l3-mode,
  .phone-shell.l2-sheet-wide {
    max-width: 880px;
  }
  .app-header {
    padding: 13px 22px;
  }
  .app-main {
    padding: 18px 24px 24px !important;
  }
  .v8-l3-bar {
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 22px;
    padding-right: 22px;
  }
  .school-pill {
    max-width: 240px;
  }
  .bottom-nav {
    padding-left: 48px;
    padding-right: 48px;
  }
  .modal-backdrop {
    align-items: center;
    padding: 24px;
  }
  .modal-sheet {
    max-width: 540px;
    max-height: 86dvh;
    border-radius: 24px;
  }
  .grader-prompt {
    font-size: 20px;
  }
  .grader-sheet .v7-grader-textarea {
    min-height: clamp(280px, 44svh, 500px);
    font-size: 18px;
  }
}

/* 5. 平板与宽屏（>= 680px）背诵卡片双列排布 + 竖屏高分辨率防卡片过度拉长 */
@media (min-width: 680px) {
  #pkCardsContainer,
  #flashcardListContainer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
  }
  #pkCardsContainer > .card,
  #flashcardListContainer > .flashcard-stage {
    margin-bottom: 0;
  }
  #pkCardsContainer > button,
  #pkCardsContainer > .btn,
  #pkCardsContainer > :only-child,
  #flashcardListContainer > button,
  #flashcardListContainer > .btn,
  #flashcardListContainer > :only-child {
    grid-column: 1 / -1;
  }
}

@media (min-height: 900px) {
  .l1-fill .v8-sub-entry {
    flex: 0 0 auto;
    max-height: none;
    min-height: 96px;
  }
}

