:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #e11d48;
  --brand-dark: #be123c;
  --brand-soft: #fff1f2;
  --accent: #f59e0b;
  --ok: #10b981;
  --radius: 14px;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app-shell {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

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

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
}

.brand-domain {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
}

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

.voucher-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid #fecdd3;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.voucher-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}

.voucher-pill.active {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.voucher-pill.active .dot {
  background: var(--ok);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 14px 4px;
}

.tab {
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.tab-panel {
  display: none;
  padding: 10px 14px;
}

.tab-panel.active {
  display: block;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

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

.card-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.step-tip {
  font-size: 11px;
  color: var(--muted);
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.badge.muted {
  background: #f3f4f6;
  color: var(--muted);
}

.badge.ok {
  background: #d1fae5;
  color: #065f46;
}

.badge.accent {
  background: #fef3c7;
  color: #92400e;
}

.voucher-row {
  display: flex;
  gap: 8px;
}

input[type="text"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

.voucher-meta {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  font-size: 13px;
  color: #065f46;
}

.quick-hints {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn.primary:hover {
  background: var(--brand-dark);
}

.btn.primary:disabled {
  background: #f4a4b5;
  cursor: not-allowed;
}

.btn.ghost {
  background: #f9fafb;
  color: var(--text);
  border-color: #d1d5db;
}

.btn.danger-outline {
  background: #fff1f2;
  color: var(--brand-dark);
  border-color: #fda4af;
}

.btn.danger-outline.recording {
  background: var(--brand);
  color: #fff;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.btn.lg {
  padding: 13px 18px;
  font-size: 15px;
}

.btn.block {
  width: 100%;
}

.pill-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.pill {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f9fafb;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.pill.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.template-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.tpl-item {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fafafa;
  cursor: pointer;
}

.tpl-item.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.tpl-title {
  font-size: 13px;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.tpl-tag {
  font-size: 11px;
  color: var(--brand-dark);
  background: #ffe4e6;
  padding: 1px 6px;
  border-radius: 6px;
}

.tpl-preview {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 5px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-count {
  font-size: 11px;
  color: var(--muted);
}

.upload-dropzone {
  display: block;
  text-align: center;
  padding: 20px 12px;
  border: 2px dashed #fda4af;
  border-radius: 12px;
  background: #fffafb;
  cursor: pointer;
}

.drop-icon {
  font-size: 26px;
}

.drop-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--brand-dark);
  margin-top: 4px;
}

.drop-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.clip-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.clip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f9fafb;
}

.clip-info {
  min-width: 0;
  flex: 1;
}

.clip-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-meta {
  font-size: 11px;
  color: var(--muted);
}

.clip-actions {
  display: flex;
  gap: 6px;
}

.mini-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.voice-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.seg-btn {
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f9fafb;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.voice-grid,
.style-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.choice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fafafa;
  cursor: pointer;
}

.choice-card.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.choice-name {
  font-size: 13px;
  font-weight: 800;
}

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

.clone-box {
  padding: 12px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.clone-tip {
  font-size: 12px;
  color: #9a3412;
}

.sample-quote {
  margin: 6px 0 10px;
  padding: 9px 10px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ffedd5;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

.record-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.record-status {
  margin-top: 8px;
  font-size: 12px;
  color: #7c2d12;
}

.voice-preview {
  width: 100%;
  margin-top: 8px;
}

.submit-note {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.result-card {
  border-color: #fda4af;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #f3f4f6;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
  transition: width 0.35s ease;
}

.result-stage {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.result-video-wrap {
  margin-top: 12px;
}

.result-video-wrap video {
  width: 100%;
  max-height: 520px;
  border-radius: 12px;
  background: #000;
}

.result-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.wechat-save-tip {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f3f4f6;
  font-size: 11px;
  color: var(--muted);
}

.recent-list,
.course-list {
  display: grid;
  gap: 10px;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.course-hero h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.course-hero p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.course-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
}

.course-card.locked {
  opacity: 0.78;
}

.course-mod {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
}

.course-title {
  font-size: 14px;
  font-weight: 800;
  margin: 4px 0;
}

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

.course-bullets {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: #1f2937;
}

.course-bullets li {
  margin-bottom: 5px;
}

/* 试看标记：公开页只给框架，不泄露可直接照抄的操作细节 */
.course-try-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

/* 锁定态：每节只留一行状态，别做 7 个重复按钮 */
.course-lock-line {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
}

/* 底部统一购买入口：一屏只有一个明确动作 */
.course-cta {
  background: linear-gradient(180deg, #fff7ed 0%, #fff 100%);
  border: 1px solid #fdba74;
  border-radius: var(--radius);
  padding: 16px;
}

.course-cta-title {
  font-size: 15px;
  font-weight: 900;
  color: #9a3412;
  margin-bottom: 8px;
}

.course-cta-list {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 13px;
  color: #374151;
}

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

.course-cta-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

/* 锁定态：给出「买什么、买到什么」，而不是一句冷冰冰的“需解锁” */
.course-card.locked .course-locked-hint {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #9a3412;
}

.course-buy {
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.course-hw {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  font-size: 12px;
  color: #065f46;
  line-height: 1.6;
}

.empty-tip {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 18px 0;
}

.footer {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 16px 14px 8px;
}

.footer-links a {
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.52);
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 18px 16px 24px;
  z-index: 2;
}

.icon-close {
  border: none;
  background: #f3f4f6;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
}

.plan-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.plan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.plan-item.highlight {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.plan-name {
  font-size: 14px;
  font-weight: 800;
}

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

.plan-price {
  font-size: 18px;
  font-weight: 900;
  color: var(--brand);
}

.buy-howto {
  font-size: 12px;
  color: #374151;
  background: #f9fafb;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 100;
}

.hidden {
  display: none !important;
}
