/* ==================== 浅色主题变量 ==================== */
:root {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f0f2f5;
  --bg-accent: #e8f4f8;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a5a;
  --text-muted: #8a8a9a;
  --accent-primary: #0891b2;
  --accent-secondary: #06b6d4;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-orange: #f97316;
  --border-color: #e5e7eb;
  --border-light: #f0f0f0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: all 0.25s ease;
}

/* ==================== 基础重置 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  min-height: 100vh;
}

/* ==================== 导航栏 ==================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.navbar-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 20px;
}

.navbar-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-logo span:last-child {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.navbar-menu {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-btn {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

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

.nav-btn.active {
  background: var(--accent-primary);
  color: white;
}

.mobile-menu-btn {
  display: none;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.5rem;
}

/* ==================== 主容器 ==================== */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 20px 40px;
  min-height: 100vh;
}

/* ==================== 首页Hero ==================== */
.hero {
  text-align: center;
  padding: 50px 20px 60px;
}

.hero-badge {
  display: inline-block;
  padding: 8px 20px;
  background: var(--bg-accent);
  border: 1px solid var(--accent-primary);
  border-radius: 50px;
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 30px;
}

.hero-quote {
  font-size: 1.2rem;
  color: var(--accent-primary);
  padding: 24px 30px;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.08), rgba(6, 182, 212, 0.05));
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius);
  max-width: 700px;
  margin: 0 auto;
  font-weight: 500;
}

/* ==================== 搜索框 ==================== */
.search-container {
  max-width: 500px;
  margin: 0 auto 40px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border: 2px solid var(--border-color);
  border-radius: 50px;
  font-size: 1rem;
  transition: var(--transition);
  background: var(--bg-secondary);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* ==================== 快速卡片网格 ==================== */
.quick-start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin: 30px 0;
}

.quick-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.quick-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent-primary);
}

.quick-card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.quick-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.quick-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==================== 七层卡片 ==================== */
.layers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.layer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.layer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--layer-color);
}

.layer-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.layer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.layer-icon {
  font-size: 1.8rem;
}

.layer-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.layer-book {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.layer-question {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ==================== 内容区块 ==================== */
.content-section {
  margin: 40px 0;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--accent-primary);
  border-radius: 2px;
}

/* ==================== 详情页 ==================== */
.detail-page {
  animation: fadeIn 0.3s ease;
}

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

.detail-header {
  padding: 30px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 30px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 20px;
}

.back-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.detail-title h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.detail-meta {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.detail-insight {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.06), rgba(6, 182, 212, 0.03));
  border-left: 4px solid var(--accent-primary);
  padding: 24px;
  border-radius: var(--radius);
  margin: 24px 0;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
}

/* ==================== 可折叠卡片 ==================== */
.collapse-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.collapse-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card);
}

.collapse-header:hover {
  background: var(--bg-hover);
}

.collapse-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

.collapse-arrow {
  transition: transform 0.3s ease;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.collapse-card.open .collapse-arrow {
  transform: rotate(180deg);
}

.collapse-content {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  background: var(--bg-secondary);
}

.collapse-card.open .collapse-content {
  padding: 20px;
  max-height: 2000px;
  border-top: 1px solid var(--border-color);
}

/* ==================== 步骤列表 ==================== */
.steps-list {
  list-style: none;
}

.step-item {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.step-item:last-child {
  border-bottom: none;
}

.step-number {
  width: 32px;
  height: 32px;
  background: var(--accent-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
  color: var(--text-primary);
}

/* ==================== 表格 ==================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: var(--bg-hover);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.data-table td {
  color: var(--text-secondary);
}

.data-table tr:hover td {
  background: var(--bg-hover);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* ==================== 标签 ==================== */
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
}

.tag-primary { background: rgba(8, 145, 178, 0.12); color: var(--accent-primary); }
.tag-red { background: rgba(239, 68, 68, 0.12); color: var(--accent-red); }
.tag-green { background: rgba(16, 185, 129, 0.12); color: var(--accent-green); }
.tag-yellow { background: rgba(245, 158, 11, 0.12); color: var(--accent-yellow); }
.tag-purple { background: rgba(139, 92, 246, 0.12); color: var(--accent-purple); }

/* ==================== SOS急救包 ==================== */
.sos-container {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.06), rgba(239, 68, 68, 0.02));
  border: 2px solid var(--accent-red);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin: 24px 0;
}

.sos-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-red);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sos-step {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.sos-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sos-step-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.sos-step-time {
  color: var(--accent-red);
  font-size: 0.9rem;
  font-weight: 500;
}

.sos-step ul {
  list-style: none;
}

.sos-step li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  color: var(--text-secondary);
}

.sos-step li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-red);
}

.sos-reminder {
  background: rgba(239, 68, 68, 0.1);
  padding: 16px 20px;
  border-radius: var(--radius);
  color: var(--accent-red);
  font-size: 0.95rem;
  margin-top: 16px;
  font-weight: 500;
}

/* ==================== 诊断工具 ==================== */
.diagnosis-tool {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

.diagnosis-question {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text-primary);
  font-weight: 500;
}

.score-slider {
  width: 100%;
  margin: 16px 0;
}

.score-slider input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-hover);
  outline: none;
  -webkit-appearance: none;
}

.score-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.score-display {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* ==================== 30天计划 ==================== */
.plan-week {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.plan-week-header {
  padding: 18px 20px;
  background: var(--bg-hover);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plan-week-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.plan-week-theme {
  color: var(--accent-primary);
  font-size: 0.9rem;
  font-weight: 500;
}

.plan-days {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.plan-week.open .plan-days {
  padding: 20px;
  max-height: 1000px;
}

.plan-day {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.plan-day:last-child {
  border-bottom: none;
}

.plan-day-num {
  width: 40px;
  height: 40px;
  background: var(--bg-hover);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 16px;
  flex-shrink: 0;
  color: var(--text-primary);
}

.plan-day.rest .plan-day-num {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-yellow);
}

.plan-day-content {
  flex: 1;
}

.plan-day-time {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==================== 练习追踪 ==================== */
.tracker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.tracker-day {
  aspect-ratio: 1;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  color: var(--text-secondary);
}

.tracker-day:hover {
  background: var(--border-color);
}

.tracker-day.completed {
  background: var(--accent-primary);
  color: white;
}

.tracker-day.today {
  border: 2px solid var(--accent-yellow);
}

/* ==================== 输入框和按钮 ==================== */
.input-group {
  margin: 16px 0;
}

.input-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.text-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
}

.text-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

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

textarea.text-input {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background: #0e7490;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

.btn-danger {
  background: var(--accent-red);
  color: white;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .navbar-menu {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
  }
  
  .navbar-menu.open {
    display: flex;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .nav-btn {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
  }
  
  .hero {
    padding: 30px 10px 40px;
  }
  
  .hero-quote {
    font-size: 1rem;
    padding: 20px;
  }
  
  .detail-title h1 {
    font-size: 1.4rem;
  }
  
  .layers-grid {
    grid-template-columns: 1fr;
  }
  
  .quick-start-grid {
    grid-template-columns: 1fr;
  }
  
  .data-table {
    font-size: 0.85rem;
  }
  
  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }
}

/* ==================== 打印样式 ==================== */
@media print {
  .navbar, .back-btn, .btn, .search-container {
    display: none !important;
  }
  
  .main-container {
    padding-top: 20px;
  }
  
  .collapse-content {
    max-height: none !important;
    padding: 20px !important;
  }
}

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-hover);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==================== 选中样式 ==================== */
::selection {
  background: rgba(8, 145, 178, 0.2);
  color: var(--text-primary);
}
