:root {
  --bg: #f6f3ed;
  --bg-soft: #efe8dc;
  --surface: rgba(255, 252, 247, 0.82);
  --surface-strong: #f5f0e6;
  --surface-muted: #ede7dc;
  --text-primary: #29241b;
  --text-secondary: rgba(41, 36, 27, 0.68);
  --text-muted: rgba(41, 36, 27, 0.42);
  --accent: #f54e00;
  --accent-soft: rgba(245, 78, 0, 0.12);
  --success: #2f8b62;
  --danger: #c4465b;
  --border: rgba(41, 36, 27, 0.12);
  --border-strong: rgba(41, 36, 27, 0.22);
  --shadow-soft: 0 14px 36px rgba(48, 38, 20, 0.06);
  --shadow-strong: 0 18px 44px rgba(48, 38, 20, 0.1);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --font-serif: Iowan Old Style, Charter, Georgia, Cambria, "Times New Roman", serif;
  --font-sans: "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --max-width: 540px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-width: 320px;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background:
    radial-gradient(circle at top, rgba(255, 246, 230, 0.72), transparent 34%),
    linear-gradient(180deg, #fbf7f1 0%, #f4efe7 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a,
button,
input,
textarea {
  font: inherit;
}

button {
  border: none;
  background: none;
  color: inherit;
}

#app {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.page-shell {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1rem 0 2rem;
}

.practice-shell {
  padding-bottom: 2.25rem;
}

.hidden {
  display: none !important;
}

.panel,
.card {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 1rem;
}

.card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover,
.entry-card:hover,
.secondary-entry:hover,
.day-cell:hover,
.topic-tag:hover,
.btn-pill:hover,
.btn-ghost:hover,
.floating-cta:hover {
  transform: translateY(-1px);
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-strong);
}

.panel-header,
.entry-card-top,
.hero-progress-header,
.top-bar,
.practice-topbar,
.progress-info,
.stat-row,
.record-controls,
.hero-metrics,
.brand-row,
.discussion-line,
.exam-outline-item {
  display: flex;
  align-items: center;
}

.panel-header,
.hero-progress-header,
.top-bar,
.practice-topbar,
.progress-info,
.stat-row,
.brand-row,
.exam-outline-item {
  justify-content: space-between;
}

.section-intro {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.9rem;
}

.section-intro.compact {
  margin-bottom: 0.75rem;
}

.section-title,
.page-title,
.success-title,
.cta-banner-title {
  font-family: var(--font-serif);
  letter-spacing: -0.01em;
}

.section-title,
.page-title {
  font-size: 1.35rem;
  line-height: 1.25;
  font-weight: 600;
}

.section-desc,
.success-desc,
.cta-banner-desc {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.eyebrow,
.label,
.section-heading,
.brand-label,
.day-cell-kicker,
.entry-badge,
.topbar-chip,
.exam-outline-label {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.top-bar,
.practice-topbar {
  min-height: 2.75rem;
  position: relative;
}

.top-bar {
  gap: 0.75rem;
}

.practice-topbar {
  gap: 0.75rem;
}

.progress-counter,
.practice-progress,
.audio-time,
.card-desc,
.record-hint,
.progress-label,
.translate-text,
.hero-progress-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.back-btn,
.back-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.35rem 0;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
}

.practice-topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-left: auto;
  text-align: right;
}

.topbar-chip {
  padding: 0.38rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

.practice-timer {
  min-width: 3.2rem;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(41, 36, 27, 0.08);
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 700;
}

.brand-hero {
  padding: 1.2rem;
  gap: 1rem;
}

.brand-row {
  align-items: flex-start;
  gap: 0.9rem;
}

.brand-copy {
  flex: 1;
}

.brand-mark,
.app-logo {
  width: 2.8rem;
  height: 2.8rem;
  flex-shrink: 0;
  border-radius: 0.85rem;
  background: #28231a;
  color: #fff7ef;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-title,
.app-name {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  line-height: 1.15;
  font-weight: 600;
  margin-top: 0.18rem;
}

.brand-desc {
  margin-top: 0.45rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 24rem;
}

.brand-tag,
.app-badge,
.header-badge {
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  font-size: 0.74rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.hero-progress {
  padding: 1rem;
  border-radius: calc(var(--radius) - 2px);
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.88), rgba(244, 236, 225, 0.85));
  border: 1px solid rgba(245, 78, 0, 0.12);
}

.hero-progress-header {
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.hero-progress-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.25;
}

.hero-metrics {
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.hero-metric {
  flex: 1;
  padding: 0.8rem 0.85rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(41, 36, 27, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.hero-metric-value {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
}

.hero-metric-value small {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.hero-track,
.progress-track,
.audio-track {
  width: 100%;
  overflow: hidden;
}

.hero-track,
.progress-track {
  height: 0.38rem;
  border-radius: var(--radius-pill);
  background: rgba(41, 36, 27, 0.08);
}

.hero-fill,
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f54e00 0%, #ff7b25 100%);
}

.hero-progress-note {
  margin-top: 0.65rem;
}

.entry-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.entry-grid {
  display: grid;
  gap: 0.75rem;
}

.entry-grid.compact-grid {
  grid-template-columns: 1fr;
}

.entry-card {
  width: 100%;
  padding: 1rem;
  text-align: left;
  background: rgba(255, 252, 247, 0.86);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.entry-card:hover {
  border-color: rgba(245, 78, 0, 0.2);
  box-shadow: var(--shadow-strong);
}

.entry-badge {
  color: var(--accent);
}

.entry-arrow,
.secondary-entry-arrow,
.card-arrow {
  font-size: 1rem;
  color: var(--text-muted);
}

.entry-card-title,
.card-title,
.secondary-entry-title,
.record-title,
.cta-banner-title,
.success-title,
.day-cell-title,
.exam-outline-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.entry-card-desc,
.secondary-entry-desc,
.day-cell-note,
.exam-outline-desc {
  margin-top: 0.32rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.support-panel {
  padding: 1rem;
}

.secondary-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.secondary-entry {
  width: 100%;
  padding: 0.9rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  border-top: 1px solid rgba(41, 36, 27, 0.08);
  cursor: pointer;
}

.secondary-entry:first-child {
  border-top: none;
  padding-top: 0.1rem;
}

.btn-primary,
.btn-ghost,
.btn-pill {
  min-height: 48px;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.btn-primary {
  width: 100%;
  padding: 0.95rem 1.2rem;
  background: #262218;
  color: #faf5eb;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(38, 34, 24, 0.18);
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  padding: 0.9rem 1.15rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-primary);
}

.btn-pill {
  padding: 0.65rem 1rem;
  background: #2c261b;
  color: #fff6ea;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
}

.full-width {
  width: 100%;
}

.question-panel,
.record-panel,
.secondary-toggle {
  padding: 1rem 1rem 1.05rem;
}

.question-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.question-text {
  font-family: var(--font-serif);
  font-size: 1.58rem;
  line-height: 1.28;
  color: var(--text-primary);
}

.translate-text {
  line-height: 1.7;
}

.audio-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.2rem;
}

.audio-btn {
  width: 2.8rem;
  height: 2.8rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: #2b261c;
  color: #fff8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(43, 38, 28, 0.16);
}

.audio-track {
  height: 0.22rem;
  border-radius: var(--radius-pill);
  background: rgba(41, 36, 27, 0.12);
}

.audio-fill {
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f54e00, #f54e00);
}

.record-panel {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.record-copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: center;
}

.record-controls {
  justify-content: center;
  gap: 0.85rem;
}

.record-btn {
  width: 5.4rem;
  height: 5.4rem;
  border-radius: 50%;
  background: #2a251b;
  color: #fff7ee;
  font-size: 1.75rem;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(42, 37, 27, 0.14);
}

.record-btn.recording {
  background: var(--danger);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(196, 70, 91, 0.26);
  }
  50% {
    box-shadow: 0 0 0 18px rgba(196, 70, 91, 0);
  }
}

.playback-btn {
  min-height: 46px;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.56);
  color: var(--text-primary);
  cursor: pointer;
}

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

.secondary-toggle {
  padding: 0.2rem 0;
  box-shadow: none;
  border: none;
  background: transparent;
}

.secondary-toggle-row {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
}

.secondary-toggle-btn {
  flex: 1;
  min-height: 44px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 1rem;
  border: 1px solid rgba(245, 78, 0, 0.14);
  background: rgba(245, 78, 0, 0.06);
  color: #c64b0a;
  text-align: left;
  cursor: pointer;
}

.secondary-audio-btn {
  min-width: 7.5rem;
  min-height: 44px;
  padding: 0.75rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(41, 36, 27, 0.1);
  background: rgba(255, 255, 255, 0.68);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.secondary-toggle-btn.expanded {
  border-bottom-left-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
}

.secondary-toggle-content {
  padding: 0.9rem 1rem 1rem;
  margin-top: 0.4rem;
  border-radius: 1rem;
  background: rgba(255, 249, 242, 0.88);
  border: 1px solid rgba(41, 36, 27, 0.08);
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.primary-action-bar {
  position: sticky;
  bottom: 0.75rem;
  padding-top: 0.15rem;
}

.primary-action-bar.inline-action {
  position: static;
  padding-top: 0;
}

.stats-panel {
  width: 100%;
  margin-top: 1.1rem;
}

.stat-row {
  padding: 0.85rem 0;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(41, 36, 27, 0.08);
}

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

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
}

.success-screen {
  align-items: stretch;
  text-align: center;
}

.success-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
}

.success-title {
  font-size: 1.5rem;
  line-height: 1.2;
}

.success-desc {
  margin-top: 0.45rem;
}

.streak-banner {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  background: rgba(245, 78, 0, 0.08);
  color: #c64b0a;
  font-weight: 700;
}

.stack-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

.cta-banner {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(245, 78, 0, 0.08), rgba(245, 78, 0, 0.02));
  border: 1px solid rgba(245, 78, 0, 0.12);
  text-align: center;
  cursor: pointer;
}

.cta-banner-title {
  font-size: 1.06rem;
}

.cta-banner-desc {
  margin-top: 0.35rem;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.day-cell {
  width: 100%;
  min-height: 110px;
  padding: 0.95rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.52);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.3rem;
}

.day-cell.current {
  border-color: rgba(245, 78, 0, 0.28);
  background: rgba(245, 78, 0, 0.08);
}

.day-cell.completed {
  border-color: rgba(47, 139, 98, 0.22);
  background: rgba(47, 139, 98, 0.08);
}

.day-cell.locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.topic-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.topic-tag {
  min-height: 42px;
  padding: 0.68rem 0.95rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.56);
  cursor: pointer;
}

.topic-tag.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff8f0;
}

.topic-intro {
  margin-top: 1.05rem;
}

.discussion-example {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.discussion-line {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.65rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.discussion-speaker {
  min-width: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.topic-title {
  text-transform: capitalize;
}

.exam-outline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.exam-outline-item {
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.95rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(41, 36, 27, 0.08);
}

.exam-outline-label {
  min-width: 3.6rem;
  padding-top: 0.18rem;
  color: var(--accent);
}

.exam-transition,
.exam-intro {
  text-align: left;
}

.progress-bar {
  margin: 1rem 0;
}

.accent {
  color: var(--accent);
}

.app-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-header .header-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
}

.card-icon {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 0.85rem;
  background: var(--surface-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-body {
  flex: 1;
  min-width: 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(36, 31, 22, 0.55);
  backdrop-filter: blur(8px);
}

.modal-content {
  width: min(100%, 340px);
  padding: 2rem 1.4rem 1.5rem;
  position: relative;
  text-align: center;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  box-shadow: var(--shadow-strong);
}

.modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
}

.qr-image {
  width: 200px;
  height: 200px;
  border-radius: 1rem;
  object-fit: cover;
}

.qr-title {
  margin-top: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.qr-desc {
  margin-top: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.floating-cta {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 900;
  padding: 0.82rem 1.1rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff7ef;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(245, 78, 0, 0.28);
  cursor: pointer;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

@media (min-width: 600px) {
  #app {
    padding: 0 1.4rem 2.4rem;
  }

  .entry-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .day-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  body {
    padding: 1.5rem 0;
  }

  .page-shell {
    gap: 1rem;
  }
}
