/* ==========================================
   2026高考作文AI估分工具 - 样式表
   移动端优先 · 主色调 #165DFF #FF7D00
   ========================================== */

/* ===== 重置与基础 ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #165DFF;
  --primary-dark: #0E42D2;
  --primary-light: #3C7EFF;
  --accent: #FF7D00;
  --accent-dark: #E06D00;
  --success: #00B42A;
  --warning: #FF7D00;
  --danger: #F53F3F;
  --bg: #F7F8FA;
  --card-bg: #FFFFFF;
  --text: #1D2129;
  --text-secondary: #4E5969;
  --text-muted: #86909C;
  --border: #E5E6EB;
  --border-light: #F2F3F5;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== 页面切换 ===== */
.page {
  display: none;
  min-height: 100vh;
}

.page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 免责声明条 ===== */
.disclaimer-bar {
  background: #FFF7E6;
  color: #D46B08;
  font-size: 0.75rem;
  padding: 8px 16px;
  text-align: center;
  border-bottom: 1px solid #FFE7BA;
  line-height: 1.5;
}

.disclaimer-footer {
  padding: 24px 16px;
  text-align: center;
}

.disclaimer-footer p {
  color: var(--text-muted);
  font-size: 0.75rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== 按钮 ===== */
.btn-primary {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 25px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(22,93,255,0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary-gold {
  display: inline-block;
  background: linear-gradient(135deg, #FF7D00, #FF9A2E);
  color: #fff;
  border: none;
  border-radius: 25px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255,125,0,0.4);
}

.btn-huge {
  padding: 18px 48px;
  font-size: 1.2rem;
  border-radius: 30px;
  letter-spacing: 2px;
}

.btn-secondary {
  display: inline-block;
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 25px;
  padding: 12px 28px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-share {
  width: 100%;
  margin-top: 16px;
}

.btn-score {
  background: linear-gradient(135deg, #165DFF, #FF7D00);
  font-size: 1.1rem;
}

/* ===== 首页 ===== */
.home-hero {
  text-align: center;
  padding: 48px 20px 40px;
  max-width: 600px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, #165DFF, #3C7EFF);
  color: #fff;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
  color: var(--text);
}

.hero-title .highlight {
  background: linear-gradient(135deg, #165DFF, #FF7D00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 28px;
}

/* 首页统计数据 */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 首页特性列表 */
.hero-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 32px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.feature-item {
  background: var(--card-bg);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

/* 用户评价 */
.testimonials {
  padding: 40px 20px;
  max-width: 700px;
  margin: 0 auto;
}

.testimonials h3 {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 24px;
  color: var(--text);
}

.testimonial-list {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}

.testimonial-card {
  flex: 0 0 280px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border-light);
  scroll-snap-align: start;
}

.testimonial-stars {
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.testimonial-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.6;
}

.testimonial-author {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== 向导页 ===== */
.wizard-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 24px 20px 120px;
}

/* 进度条 */
.progress-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* 步骤内容 */
.wizard-step {
  animation: fadeIn 0.4s ease;
}

.wizard-step.hide {
  display: none;
}

.wizard-step h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.step-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* 输入组件 */
.input-select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2386909C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
  transition: border-color 0.3s;
}

.input-select:focus {
  outline: none;
  border-color: var(--primary);
}

.input-text {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.3s;
}

.input-text:focus {
  outline: none;
  border-color: var(--primary);
}

.input-text::placeholder {
  color: var(--text-muted);
}

.input-group {
  margin-bottom: 24px;
}

.input-group label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.required {
  color: var(--danger);
}

/* 单选卡片 */
.radio-group, .checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.radio-card, .checkbox-card {
  position: relative;
  flex: 1 1 calc(50% - 5px);
  min-width: 130px;
}

.radio-card input, .checkbox-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card span, .checkbox-card span {
  display: block;
  padding: 14px 16px;
  text-align: center;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.radio-card input:checked + span {
  border-color: var(--primary);
  background: rgba(22,93,255,0.05);
  color: var(--primary);
  font-weight: 600;
}

.checkbox-card input:checked + span {
  border-color: var(--primary);
  background: rgba(22,93,255,0.05);
  color: var(--primary);
  font-weight: 600;
}

/* 自我评估颜色 */
.radio-card.green input:checked + span { border-color: var(--success); background: rgba(0,180,42,0.05); color: var(--success); }
.radio-card.yellow input:checked + span { border-color: #E6A23C; background: rgba(230,162,60,0.05); color: #B88230; }
.radio-card.orange input:checked + span { border-color: var(--accent); background: rgba(255,125,0,0.05); color: var(--accent); }
.radio-card.red input:checked + span { border-color: var(--danger); background: rgba(245,63,63,0.05); color: var(--danger); }

/* 确认信息卡片 */
.review-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.review-card .review-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

.review-card .review-row:last-child {
  border-bottom: none;
}

.review-row .review-label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.review-row .review-value {
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

.review-tip {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* 导航按钮 */
.wizard-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 12px;
  z-index: 100;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
}

.wizard-nav .btn-secondary {
  flex: 1;
  text-align: center;
}

.wizard-nav .btn-primary {
  flex: 1.5;
  text-align: center;
}

/* ===== 结果页通用 ===== */
.result-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.result-container h2 {
  font-size: 1.3rem;
  text-align: center;
  margin-bottom: 24px;
  color: var(--text);
}

/* 分数卡片 */
.result-score-card {
  background: linear-gradient(135deg, #165DFF, #3C7EFF);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  color: #fff;
  margin-bottom: 20px;
}

.score-main {
  margin-bottom: 8px;
}

.score-number {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
}

.score-total {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-left: 4px;
}

.score-range {
  font-size: 0.95rem;
  opacity: 0.85;
  background: rgba(255,255,255,0.15);
  display: inline-block;
  padding: 4px 16px;
  border-radius: 12px;
}

/* 跑题风险 */
.result-risk {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  text-align: center;
}

.risk-badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
}

.risk-low { background: rgba(0,180,42,0.1); color: var(--success); }
.risk-medium { background: rgba(230,162,60,0.1); color: #B88230; }
.risk-high { background: rgba(245,63,63,0.1); color: var(--danger); }

/* 评价 */
.result-comment {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--border-light);
}

.result-comment h4 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--text);
}

.result-comment p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== 付费升级区域 ===== */
.upgrade-section {
  margin: 32px 0;
  text-align: center;
}

.upgrade-section h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text);
}

.upgrade-section > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.plan-cards {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

.plan-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
}

.plan-card.basic {
  border-color: var(--primary);
  border-width: 1px;
}

.plan-card.premium {
  border-color: var(--accent);
  border-width: 2px;
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), #FF9A2E);
  color: #fff;
  padding: 4px 20px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.plan-header {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.plan-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
}

.plan-card.premium .plan-price {
  color: var(--accent);
}

.plan-features {
  list-style: none;
  text-align: left;
  margin-bottom: 20px;
}

.plan-features li {
  padding: 6px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.plan-card .btn-primary,
.plan-card .btn-primary-gold {
  width: 100%;
}

/* ===== 付费结果页 ===== */
#paid-content {
  margin-bottom: 24px;
}

.dimension-table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
}

.dimension-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.dimension-table th {
  background: #F7F8FA;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.dimension-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.dimension-table .score-cell {
  font-weight: 700;
  color: var(--primary);
}

.grade-a { color: var(--success) !important; }
.grade-b { color: #1677FF !important; }
.grade-c { color: #E6A23C !important; }
.grade-d { color: var(--danger) !important; }

.section-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
}

.section-card h4 {
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: var(--text);
}

.improve-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.improve-item:last-child {
  border-bottom: none;
}

.improve-item .improve-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.improve-item .improve-detail {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.improve-item .improve-gain {
  display: inline-block;
  background: rgba(0,180,42,0.1);
  color: var(--success);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  margin-top: 4px;
}

.rank-card {
  background: linear-gradient(135deg, rgba(22,93,255,0.05), rgba(255,125,0,0.05));
  border: 1px solid rgba(22,93,255,0.15);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}

.rank-card .rank-num {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.rank-card .rank-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.upgrade-premium {
  background: linear-gradient(135deg, rgba(255,125,0,0.05), rgba(255,125,0,0.02));
  border: 2px solid rgba(255,125,0,0.2);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin: 24px 0;
}

.upgrade-premium h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.upgrade-premium p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* ===== 支付弹窗 ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
}

.modal-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px 24px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--border-light);
  color: var(--text);
}

.modal-box h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text);
}

.modal-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
}

#pay-qrcode {
  display: flex;
  justify-content: center;
  margin: 16px 0;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
}

#pay-qrcode canvas,
#pay-qrcode img {
  width: 200px !important;
  height: 200px !important;
}

.qrcode-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 8px 0;
}

#pay-status {
  min-height: 24px;
  font-size: 0.9rem;
  margin: 8px 0;
}

.pay-checking { color: var(--primary); }
.pay-success { color: var(--success); }
.pay-error { color: var(--danger); }

/* ===== 加载遮罩 ===== */
.loading-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading-text {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ===== Toast提示 ===== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 0.9rem;
  z-index: 2000;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ===== 响应式 ===== */
@media (min-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .plan-cards {
    flex-direction: row;
    gap: 16px;
  }

  .plan-card {
    flex: 1;
  }

  .testimonial-list {
    justify-content: center;
    overflow-x: auto;
  }
}

@media (max-width: 380px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .score-number {
    font-size: 2.8rem;
  }

  .wizard-nav {
    padding: 10px 12px;
  }

  .wizard-nav .btn-primary,
  .wizard-nav .btn-secondary {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
}
