:root {
  --bg: #f6f8fb;
  --bg-card: #ffffff;
  --bg-elevated: #f0f3f7;
  --purple: #5aab9a;
  --purple-light: #7ec4b6;
  --gold: #6b9ec4;
  --gold-dim: #5a8aad;
  --text: #2c3e50;
  --text-muted: #8a96a3;
  --success: #52b788;
  --warning: #e9b44c;
  --danger: #e07a7a;
  --border: rgba(44, 62, 80, 0.08);
  --shadow-sm: 0 1px 3px rgba(44, 62, 80, 0.05);
  --shadow-md: 0 4px 20px rgba(44, 62, 80, 0.07);
  --radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(122, 196, 182, 0.12), transparent),
    radial-gradient(ellipse 50% 35% at 100% 100%, rgba(107, 158, 196, 0.08), transparent),
    var(--bg);
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: transparent;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.back-btn {
  background: var(--bg-elevated);
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.back-btn.hidden { display: none; }

.top-title {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

#mainContent {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(80px + var(--safe-bottom));
  overflow-y: auto;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(44, 62, 80, 0.04);
}

.bottom-nav.hidden { display: none; }

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
}

.nav-item.active {
  color: var(--purple);
  font-weight: 500;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--purple);
  border-radius: 0 0 3px 3px;
}

.nav-icon { font-size: 20px; opacity: 0.85; }

.page { animation: fadeIn 0.3s ease; }

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

.hero {
  text-align: center;
  padding: 28px 12px 32px;
}

.hero-badge {
  display: inline-block;
  padding: 5px 14px;
  background: rgba(90, 171, 154, 0.1);
  border: none;
  border-radius: 20px;
  font-size: 12px;
  color: var(--purple);
  margin-bottom: 18px;
  letter-spacing: 0.04em;
}

.hero h2 {
  font-size: 26px;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}

.progress-bar-wrap {
  margin: 12px 0 4px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-track {
  height: 5px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--purple);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
  width: 100%;
  letter-spacing: 0.02em;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--purple);
  color: white;
  box-shadow: 0 4px 14px rgba(90, 171, 154, 0.28);
}

.btn-gold {
  background: var(--gold);
  color: white;
  box-shadow: 0 4px 14px rgba(107, 158, 196, 0.25);
}

.btn-outline {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  width: auto;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.action-grid-duo {
  grid-template-columns: 1fr 1fr;
}

/* —— 微信主页 4 产品货架 —— */
.product-shelf {
  margin: 8px 0 20px;
}

.product-shelf-header h2 {
  font-size: 17px;
  font-weight: 650;
  margin: 0 0 4px;
  color: var(--text);
}

.product-shelf-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.45;
}

.product-shelf-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shelf-card {
  background: var(--bg-card, #fff);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm);
}

.shelf-card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.shelf-card-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

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

.shelf-card-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.shelf-card-name {
  font-size: 15px;
  font-weight: 650;
  margin: 0;
  color: var(--text);
}

.shelf-card-price {
  font-size: 14px;
  font-weight: 650;
  color: var(--gold, #b8860b);
  flex-shrink: 0;
}

.shelf-card-tagline {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 6px;
  line-height: 1.45;
}

.shelf-card-badge {
  display: inline-block;
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 7px;
  border-radius: 4px;
}

.shelf-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn-link-redeem {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  font-size: 12px;
  color: var(--purple, #6b5b95);
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.empty-state .btn-link-redeem {
  margin-top: 16px;
  text-align: center;
}

.redeem-aside-card {
  margin-bottom: 12px;
  border: 1px dashed rgba(107, 91, 149, 0.35);
  background: rgba(107, 91, 149, 0.04);
}

.unlock-code-box {
  margin: 14px 0 12px;
  padding: 14px;
  text-align: center;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
}

.unlock-code-box code {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.unlock-copy-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.redeemed-code-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.redeemed-code-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.redeemed-code-list code {
  flex: 1;
  min-width: 120px;
  font-size: 13px;
  font-weight: 600;
}

.shelf-upsell {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
}

.shelf-upsell-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.shelf-upsell-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shelf-upsell-name {
  font-size: 13px;
  font-weight: 600;
}

.shelf-upsell-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.shelf-upsell-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.action-tile {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  box-shadow: var(--shadow-sm);
}

.action-tile:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-md);
}

.action-tile .icon { font-size: 26px; margin-bottom: 8px; }
.action-tile .label { font-size: 13px; font-weight: 500; color: var(--text); }

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 13px 14px;
  background: var(--bg-elevated);
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: rgba(90, 171, 154, 0.4);
  background: var(--bg-card);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
  font-family: inherit;
}

.form-input-date {
  color-scheme: light;
  min-height: 48px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.55;
}

.btn-lg {
  padding: 16px;
  font-size: 16px;
  margin-top: 8px;
}

.reading-card-home {
  background: linear-gradient(135deg, rgba(90, 171, 154, 0.06), rgba(107, 158, 196, 0.06));
  box-shadow: var(--shadow-md);
}

.reading-preview-line {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  margin-top: 8px;
  color: var(--purple);
}

.char-count {
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Chart grid */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 5px;
  aspect-ratio: 1;
  max-width: 360px;
  margin: 0 auto;
}

.palace-cell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  font-size: 9px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  box-shadow: var(--shadow-sm);
}

.palace-cell.center {
  grid-column: 2 / 4;
  grid-row: 2 / 4;
  background: rgba(90, 171, 154, 0.08);
  border-color: rgba(90, 171, 154, 0.25);
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

.palace-cell.highlight {
  border-color: rgba(90, 171, 154, 0.45);
  box-shadow: 0 0 0 2px rgba(90, 171, 154, 0.12);
}

.palace-name {
  font-weight: 600;
  color: var(--purple);
  font-size: 8px;
  margin-bottom: 2px;
}

.palace-branch { color: var(--text-muted); font-size: 7px; }

.palace-stars {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  align-content: flex-start;
}

.star-tag {
  font-size: 7px;
  padding: 1px 2px;
  border-radius: 3px;
  line-height: 1.2;
}

.star-main { background: rgba(90, 171, 154, 0.18); color: #3d8a7a; }
.star-aux { background: rgba(107, 158, 196, 0.15); color: #4a7a9a; }
.star-sihua { background: rgba(107, 158, 196, 0.2); color: #5a8aad; font-size: 9px; }

.daxian-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.daxian-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-muted);
}

.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* Course list */
.chapter-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}

.chapter-item.locked { opacity: 0.5; cursor: not-allowed; }
.chapter-item.done { box-shadow: 0 0 0 1px rgba(82, 183, 136, 0.3); }

.chapter-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.chapter-item.done .chapter-num {
  background: rgba(82, 183, 136, 0.12);
  color: var(--success);
}

.chapter-item.active .chapter-num {
  background: rgba(90, 171, 154, 0.15);
  color: var(--purple);
}

.chapter-info { flex: 1; min-width: 0; }
.chapter-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.chapter-sub { font-size: 12px; color: var(--text-muted); }

.chapter-status {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

.status-done { background: rgba(82, 183, 136, 0.12); color: var(--success); }
.status-current { background: rgba(90, 171, 154, 0.12); color: var(--purple); }
.status-locked { background: var(--bg-elevated); color: var(--text-muted); }

/* Lesson content */
.lesson-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}

.lesson-content h3 {
  font-size: 16px;
  color: var(--purple);
  margin: 20px 0 8px;
  font-weight: 600;
}

.lesson-content h3:first-child { margin-top: 0; }

.lesson-content p { margin-bottom: 10px; }
.lesson-content ul { padding-left: 18px; margin-bottom: 10px; }
.lesson-content li { margin-bottom: 4px; color: var(--text-muted); }

.lesson-tip {
  background: rgba(90, 171, 154, 0.08);
  border-left: 3px solid var(--purple);
  padding: 12px 14px;
  border-radius: 0 12px 12px 0;
  font-size: 13px;
  margin: 16px 0;
  color: var(--text-muted);
}

/* Homework */
.question-block {
  margin-bottom: 24px;
}

.question-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.option-list { display: flex; flex-direction: column; gap: 8px; }

.option-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
  box-shadow: var(--shadow-sm);
}

.option-item.selected {
  border-color: rgba(90, 171, 154, 0.4);
  background: rgba(90, 171, 154, 0.06);
}

.option-item input { accent-color: var(--purple); }

/* Grading result */
.grade-badge {
  text-align: center;
  padding: 24px;
  margin-bottom: 16px;
}

.grade-icon { font-size: 48px; margin-bottom: 8px; }
.grade-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.grade-sub { font-size: 13px; color: var(--text-muted); }

.feedback-section {
  margin-bottom: 14px;
}

.feedback-section h4 {
  font-size: 13px;
  color: var(--purple);
  margin-bottom: 6px;
  font-weight: 600;
}

.feedback-section p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
}

.ref-box {
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.65;
}

.star-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.star-chip {
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(90, 171, 154, 0.1);
  border-radius: 20px;
  color: var(--purple);
}

/* Reading page */
.reading-summary {
  text-align: center;
  padding: 28px 18px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.reading-summary h2 {
  font-size: 20px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 4px;
  font-weight: 600;
}

.reading-summary-desc {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-muted);
  margin-top: 12px;
  text-align: left;
}

.reading-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 14px;
}

.keyword-chip {
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(90, 171, 154, 0.1);
  color: var(--purple);
  border-radius: 20px;
}

.reading-bullets {
  margin: 10px 0 4px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}

.reading-bullets li {
  margin-bottom: 6px;
}

.reading-bullets li:last-child {
  margin-bottom: 0;
}

.reading-section {
  margin-bottom: 12px;
}

.reading-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.reading-section p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-muted);
}

.upgrade-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}

.upgrade-banner h4 { font-size: 15px; margin-bottom: 6px; font-weight: 600; }
.upgrade-banner p { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.6; }

.disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.75;
  line-height: 1.6;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.disclaimer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Paywall */
.sku-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.sku-card.featured {
  box-shadow: 0 0 0 1.5px rgba(90, 171, 154, 0.35), var(--shadow-sm);
}

.sku-icon { font-size: 32px; }
.sku-info { flex: 1; }
.sku-name { font-size: 15px; font-weight: 600; }
.sku-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.sku-price { font-size: 18px; font-weight: 600; color: var(--purple); }

.profile-header {
  text-align: center;
  padding: 24px 20px;
  margin-bottom: 16px;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(90, 171, 154, 0.2), rgba(107, 158, 196, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
}

.menu-list { list-style: none; }

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}

.menu-item:active { box-shadow: var(--shadow-md); }
.menu-item span:last-child { color: var(--text-muted); font-size: 13px; }

.toast {
  position: fixed;
  bottom: calc(90px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(44, 62, 80, 0.88);
  border: none;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 13px;
  color: white;
  z-index: 200;
  transition: opacity 0.3s;
  max-width: 90%;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.toast.hidden { opacity: 0; pointer-events: none; }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(246, 248, 251, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
  gap: 12px;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 2.5px solid var(--bg-elevated);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 44px; margin-bottom: 14px; opacity: 0.7; }
.empty-state p { font-size: 14px; margin-bottom: 20px; line-height: 1.7; }

.tag-prototype {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  background: rgba(233, 180, 76, 0.15);
  color: var(--warning);
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.reading-unlock-hero {
  text-align: center;
  padding: 20px 12px 24px;
}

.reading-unlock-hero .unlock-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.reading-unlock-hero h2 {
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 600;
}

.reading-unlock-hero p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.reading-preview-locked {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.preview-blur {
  filter: blur(4px);
  opacity: 0.55;
  user-select: none;
  pointer-events: none;
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: 500;
  color: var(--purple);
}

.lock-icon {
  font-size: 32px;
}

/* Premium report offers */
.premium-offers-block {
  margin: 24px 0 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.premium-offers-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.premium-offers-header p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 14px;
}

.premium-offer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.premium-offer-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.premium-offer-card.featured {
  box-shadow: 0 0 0 1.5px rgba(90, 171, 154, 0.35), var(--shadow-sm);
}

.premium-offer-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.premium-offer-icon { font-size: 22px; flex-shrink: 0; }

.premium-offer-meta { flex: 1; min-width: 0; }

.premium-offer-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.premium-offer-tagline {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

.premium-offer-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--purple);
  flex-shrink: 0;
}

.premium-offer-outline {
  list-style: none;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  flex: 1;
}

.premium-offer-outline li {
  padding-left: 10px;
  position: relative;
  margin-bottom: 3px;
}

.premium-offer-outline li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--purple);
}

.premium-offer-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.premium-offer-actions .btn-sm {
  width: 100%;
  padding: 8px 10px;
  font-size: 12px;
}

.report-preview-hero {
  text-align: center;
  padding: 8px 4px 16px;
}

.report-preview-title {
  font-size: 20px;
  font-weight: 600;
  margin: 10px 0 6px;
}

.report-preview-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

.report-preview-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--purple);
  margin-top: 8px;
}

.report-preview-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 12px 0;
  padding: 10px 12px;
  background: rgba(90, 171, 154, 0.08);
  border-radius: 10px;
}

.report-toc { margin-top: 4px; }

.report-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.report-section-head h3 { margin-bottom: 0; }

.report-section-tag {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

.tag-preview {
  background: rgba(90, 171, 154, 0.12);
  color: var(--purple);
}

.tag-locked {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.report-section-locked {
  opacity: 0.92;
}

.report-locked-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

.report-fake-lines {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-fake-lines span {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-elevated), rgba(138, 150, 163, 0.15));
}

.report-fake-lines span:nth-child(1) { width: 95%; }
.report-fake-lines span:nth-child(2) { width: 78%; }
.report-fake-lines span:nth-child(3) { width: 86%; }

.report-preview-cta {
  margin-top: 16px;
}

.full-part-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0 20px;
}

.full-part-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.full-part-card:active {
  border-color: rgba(90, 171, 154, 0.45);
  box-shadow: var(--shadow-md);
}

.full-part-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.full-part-icon {
  font-size: 22px;
  line-height: 1.2;
  flex-shrink: 0;
}

.full-part-meta { flex: 1; min-width: 0; }

.full-part-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.full-part-tagline {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.full-part-count {
  font-size: 11px;
  color: var(--purple);
  background: rgba(90, 171, 154, 0.12);
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.full-part-preview {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.full-part-cta {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--purple);
}

.sku-actions-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.sku-actions-col .btn-sm {
  min-width: 64px;
  padding: 6px 10px;
  font-size: 12px;
}

@media (max-width: 360px) {
  .premium-offer-grid {
    grid-template-columns: 1fr;
  }
}

/* Legal pages */
.legal-page .legal-header {
  margin-bottom: 16px;
}

.legal-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.legal-meta {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.legal-body {
  padding: 18px 16px;
}

.legal-section {
  margin-bottom: 20px;
}

.legal-section:last-child {
  margin-bottom: 0;
}

.legal-section h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.legal-section p {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.legal-list {
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}

.legal-list li {
  margin-bottom: 6px;
}

.legal-footer-links {
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
}

.legal-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--purple);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-dot {
  color: var(--text-muted);
  margin: 0 6px;
}

/* ================= 课程模块 ================= */
.course-progress {
  margin-top: 12px;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.course-progress-bar {
  height: 100%;
  background: var(--purple);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.course-module {
  margin-top: 16px;
}
.course-module-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 4px 8px;
}
.course-module-head h3 {
  font-size: 15px;
  font-weight: 600;
}
.course-module-head span {
  font-size: 12px;
  color: var(--text-muted);
}
.course-chapter {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.course-chapter:active {
  transform: scale(0.99);
}
.course-chapter.locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.course-chapter.done {
  border-color: var(--purple-light);
}
.course-chapter-idx {
  flex: 0 0 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--purple);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.course-chapter-main {
  flex: 1;
  min-width: 0;
}
.course-chapter-title {
  font-size: 14px;
  font-weight: 600;
}
.course-chapter-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.course-chapter-arrow {
  color: var(--text-muted);
  font-size: 16px;
}

/* 章节内容 */
.chapter-hero {
  text-align: left;
}
.chapter-title {
  margin-top: 8px;
  font-size: 20px;
}
.chapter-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}
.chapter-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 16px 0 8px;
}
.chapter-content p {
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 8px;
}
.chapter-content ul,
.chapter-content ol {
  margin: 8px 0 8px 20px;
  font-size: 14px;
  line-height: 1.75;
}
.chapter-content li {
  margin-bottom: 4px;
}
.lesson-tip {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--gold-dim);
}

/* 作业 */
.hw-question {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.hw-q-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 12px;
}
.hw-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hw-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
}
.hw-option input {
  accent-color: var(--purple);
}
.hw-textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.6;
}
.hw-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* 批改结果 */
.grade-hero {
  text-align: center;
}
.grade-icon {
  font-size: 40px;
}
.grade-hero h2 {
  margin-top: 6px;
  font-size: 20px;
}
.grade-hero p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}
.grade-ref {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}
.grade-quote {
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* 店铺兑换码 */
.unlock-form {
  margin-top: 16px;
}
.unlock-owned {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.mp-follow-card {
  margin-top: 12px;
  border-color: rgba(90, 171, 154, 0.35);
  background: linear-gradient(135deg, rgba(90, 171, 154, 0.08), var(--bg-card));
}
.mp-follow-name {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--purple);
}
.mp-follow-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.report-chart-block {
  margin-bottom: 14px;
}
.report-chart-block .chart-grid {
  margin-top: 12px;
}
.reading-section p {
  margin: 0 0 10px;
  line-height: 1.75;
  font-size: 14px;
  color: var(--text);
}
.reading-section p:last-of-type {
  margin-bottom: 8px;
}
