/* ==========================================
   年轮 — 主样式表
   移动优先，红色暖调，原型驱动
   配色：主色 #E85A4F  辅色 #D64141
   ========================================== */

/* ==== CSS 变量 ==== */
:root {
  --primary: #E85A4F;
  --primary-dark: #D64141;
  --text-primary: #333333;
  --text-secondary: #7F7F7F;
  --text-light: #D7D7D7;
  --border: #F0F0F0;
  --bg-white: #FFFFFF;
  --bg-light: #F5F5F5;
  --bg-page: #FAFAFA;
  --bg-pink: #FFF0EF;
  --bg-yellow: #FFAE02;
  --avatar-bg: #6F65C6;
  --success: #4DAF50;
  --danger: #D64141;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.10);
}

/* ==== 全局重置 ==== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* ==== 容器 ==== */
.page-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-white);
  position: relative;
  overflow-x: hidden;
}

.page-container.full {
  max-width: 100%;
}

/* ==== 顶部导航 ==== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar .back {
  font-size: 20px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

.top-bar .title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.top-bar .action {
  font-size: 14px;
  color: var(--primary);
  cursor: pointer;
}

/* ==== 表单通用 ==== */
.form-group {
  margin-bottom: 20px;
}

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

.form-group .hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.input-field {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-light);
  transition: border-color 0.2s;
  outline: none;
}

.input-field:focus {
  border-color: var(--primary);
  background: var(--bg-white);
}

.input-field::placeholder {
  color: var(--text-light);
}

.input-field.error {
  border-color: var(--danger);
}

/* ==== 按钮 ==== */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(232, 90, 79, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

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

.btn-outline:hover {
  background: var(--bg-pink);
}

.btn-light {
  background: var(--bg-light);
  color: var(--text-primary);
}

.btn-light:hover {
  background: var(--border);
}

.btn-text {
  background: transparent;
  color: var(--primary);
  padding: 8px;
  font-weight: 500;
}

/* ==== 页面头部（带logo的品牌区） ==== */
.brand-header {
  text-align: center;
  padding: 60px 20px 40px;
}

.brand-header .app-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  background: var(--avatar-bg);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
}

.brand-header .app-name {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.brand-header .tagline {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ==== 表单卡片 ==== */
.form-card {
  background: var(--bg-white);
  padding: 32px 24px;
}

/* ==== 分割线 ==== */
.divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--text-light);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  padding: 0 16px;
}

/* ==== 社交登录 ==== */
.social-login {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
}

.social-login .social-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.social-login .social-icon:hover {
  background: var(--border);
}

/* ==== 底部链接 ==== */
.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
}

.form-footer a {
  color: var(--primary);
  font-weight: 500;
}

/* ==== 验证方式卡片 ==== */
.verify-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.verify-card {
  display: flex;
  align-items: center;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.verify-card:hover,
.verify-card.active {
  border-color: var(--primary);
  background: var(--bg-pink);
}

.verify-card .icon {
  font-size: 28px;
  margin-right: 16px;
}

.verify-card .info h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.verify-card .info p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.verify-card .arrow {
  margin-left: auto;
  color: var(--text-light);
  font-size: 16px;
}

/* ==== 验证码输入 ==== */
.code-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 24px 0;
}

.code-inputs input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-light);
  outline: none;
}

.code-inputs input:focus {
  border-color: var(--primary);
  background: var(--bg-white);
}

/* ==== 步骤指示器 ==== */
.steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.step {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.step.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
}

.step.done {
  background: var(--success);
}

/* ==== 成功页面 ==== */
.success-page {
  text-align: center;
  padding: 60px 24px;
}

.success-page .emoji {
  font-size: 64px;
  margin-bottom: 24px;
}

.success-page h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.success-page .desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.success-page .user-id {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.success-page .id-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.success-page .rank-badge {
  display: inline-block;
  padding: 8px 20px;
  background: var(--bg-pink);
  border-radius: 20px;
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 32px;
}

/* ==== 日期选择器 ==== */
.date-picker {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.date-picker select {
  flex: 1;
  padding: 12px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-light);
  text-align: center;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.date-picker select:focus {
  border-color: var(--primary);
}

/* ==== 性别选择 ==== */
.gender-select {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.gender-option {
  flex: 1;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.gender-option:hover,
.gender-option.active {
  border-color: var(--primary);
  background: var(--bg-pink);
  color: var(--primary);
}

/* ==== 信息卡片 ==== */
.info-card {
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.info-card.pink {
  background: var(--bg-pink);
}

.info-card.light {
  background: var(--bg-light);
}

.info-card .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.info-card .value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==== 标签 ==== */
.tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-default {
  background: var(--bg-light);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.tag-default:hover,
.tag-default.active {
  background: var(--bg-pink);
  color: var(--primary);
  border-color: var(--primary);
}

.tag-custom {
  background: #f3e8ff;
  color: #7c3aed;
  border: 1px dashed #c4b5fd;
}

.tag-custom:hover,
.tag-custom.active {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
}

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

.tag-success {
  background: var(--success);
  color: #fff;
}

.tag-warning {
  background: var(--bg-yellow);
  color: #fff;
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* ==== 情绪选择 ==== */
.emotion-select {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.emotion {
  flex: 1;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.emotion:hover,
.emotion.active {
  border-color: var(--primary);
  background: var(--bg-pink);
}

.emotion .icon {
  font-size: 24px;
  display: block;
  margin-bottom: 4px;
}

/* ==== 时间线 ==== */
.timeline {
  position: relative;
  padding: 20px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 40px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-year {
  position: relative;
  padding: 16px 0 16px 56px;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.timeline-year::before {
  content: '';
  position: absolute;
  left: 34px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-pink);
  transform: translateY(-50%);
}

.timeline-event {
  position: relative;
  padding: 10px 0 10px 56px;
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-event::before {
  content: '';
  position: absolute;
  left: 39px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transform: translateY(-50%);
}

.timeline-event .date {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 50px;
}

.timeline-event .name {
  font-size: 14px;
  color: var(--text-primary);
}

.timeline-event .tag {
  font-size: 11px;
  padding: 2px 8px;
}

/* ==== 统计卡片 ==== */
.stat-cards {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  padding: 0 20px;
}

.stat-card {
  flex: 1;
  text-align: center;
  padding: 16px 8px;
  background: var(--bg-pink);
  border-radius: var(--radius);
}

.stat-card .num {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ==== 分类标签页 ==== */
.category-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

.category-tabs .tab {
  flex-shrink: 0;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.category-tabs .tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ==== 报告头部 ==== */
.report-header {
  text-align: center;
  padding: 24px 20px 16px;
}

.report-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.report-header .sample {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ==== 报告时间轴 ==== */
.report-timeline {
  padding: 0 20px 40px;
}

.report-node {
  position: relative;
  padding: 16px 20px 16px 60px;
  border-bottom: 1px solid var(--border);
}

.report-node:last-child {
  border-bottom: none;
}

.report-node .year-tag {
  position: absolute;
  left: 0;
  top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  min-width: 44px;
  text-align: right;
}

.report-node .event-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-node .event-name .old {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
}

.report-node .percent {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.report-node .sub-events {
  margin-top: 8px;
}

.report-node .sub-event {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.report-node .sub-event .pct {
  font-weight: 600;
  color: var(--text-primary);
}

/* ==== 首页查询区 ==== */
.query-section {
  padding: 20px;
}

.query-section .section-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.query-section .section-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* ==== 响应式 ==== */
@media (max-width: 480px) {
  .page-container {
    max-width: 100%;
  }

  .brand-header {
    padding: 40px 20px 30px;
  }

  .stat-cards {
    flex-direction: row;
  }

  .date-picker select {
    font-size: 14px;
  }

  .code-inputs input {
    width: 42px;
    height: 50px;
    font-size: 20px;
  }
}

/* ==== 工具类 ==== */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.px-20 { padding-left: 20px; padding-right: 20px; }
.py-16 { padding-top: 16px; padding-bottom: 16px; }

.hidden { display: none !important; }

/* ===================================
   🔧 开发调试 — 页面悬浮编号
   上线前整块删除 ↓
   =================================== */
.page-badge {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 99999;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 700;
  font-family: 'Consolas', 'SF Mono', monospace;
  letter-spacing: 0.5px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  pointer-events: none;
  user-select: none;
  line-height: 1.6;
}
/* 上线前整块删除 ↑ */
/* =================================== */
