/* ========================================
   胡巍&互为螺旋 AI知识库
   风格参考 claw.hwdemtv.com
   ======================================== */

/* CSS Variables */
:root {
  --bg-primary: #F5F7FA;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-header: rgba(245, 247, 250, 0.92);
  --text-primary: #1a1d26;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --border-color: #E5E8EB;
  --border-light: rgba(26, 29, 38, 0.05);
  
  --accent: #009688;
  --accent-light: #4DB6AC;
  --accent-secondary: #C49B27;
  
  --gradient-start: #00B894;
  --gradient-end: #00C2FF;
  --glow-color: rgba(0, 184, 148, 0.2);
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 20px var(--glow-color);
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 24px;
  
  --header-height: 64px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #13161A;
  --bg-secondary: #1C2028;
  --bg-card: #1C2028;
  --bg-header: rgba(19, 22, 26, 0.92);
  --text-primary: #F2F5F9;
  --text-secondary: #A3AAB8;
  --text-muted: #6B7280;
  --border-color: #242A35;
  --border-light: rgba(242, 245, 249, 0.05);
  
  --accent: #00BFA5;
  --accent-light: #1DD1A1;
  --accent-secondary: #E8C361;
  
  --gradient-start: #1DD1A1;
  --gradient-end: #00C2FF;
  --glow-color: rgba(29, 209, 161, 0.2);
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

/* Reset */
*, ::after, ::before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }

/* Accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 1000;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ========================================
   Header
   ======================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  transition: background var(--transition), border-color var(--transition);
}

.header-inner {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.logo-emoji {
  font-size: 1.75rem;
  line-height: 1;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.domain-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  padding: 3px 10px;
  background: var(--border-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm) 10px var(--radius-sm) 10px;
  letter-spacing: 0.5px;
}

.header-center {
  flex: 1;
  text-align: center;
}

.site-slogan {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--border-light);
  color: var(--accent);
  border-color: var(--border-color);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ========================================
   Main Content
   ======================================== */
.main-content {
  margin-top: var(--header-height);
  padding: 0 32px 80px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 320px;
  margin: 40px 0;
  padding: 48px 56px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.hero-watermark {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 140px;
  font-weight: 900;
  font-family: var(--font-sans);
  letter-spacing: 0.1em;
  opacity: 0.03;
  user-select: none;
  pointer-events: none;
  color: var(--text-primary);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    var(--bg-card) 0%, 
    rgba(0, 184, 148, 0.03) 50%,
    rgba(0, 194, 255, 0.03) 100%
  );
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
}

.highlight {
  color: var(--accent);
  font-weight: 700;
}

/* Stats Bar */
.stats-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

.stats-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.stats-number {
  font-size: 1.4rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

.stats-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-divider {
  color: var(--border-color);
  font-weight: 300;
}

/* Friend Links */
.friend-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
}

.friend-links-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.friend-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 600;
  padding: 6px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.friend-link-pill:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.friend-link-pill span {
  font-size: 1rem;
}

/* ========================================
   Learning Path
   ======================================== */
.learning-path {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Phase Card */
.phase-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.phase-card:hover {
  box-shadow: var(--shadow-md);
}

.phase-header {
  padding: 28px 32px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 184, 148, 0.02) 100%);
}

.phase-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.phase-number {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  padding: 4px 10px;
  background: rgba(0, 184, 148, 0.1);
  border-radius: var(--radius-sm);
}

.phase-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.phase-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.phase-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.7;
}

.phase-progress {
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-bar {
  flex: 1;
  max-width: 200px;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
}

/* Chapter List */
.chapter-list {
  display: flex;
  flex-direction: column;
}

.chapter-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition);
  cursor: pointer;
}

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

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

.chapter-item:hover .chapter-status {
  color: var(--accent);
}

/* Completed State */
.chapter-item.completed {
  background: rgba(0, 184, 148, 0.03);
}

.chapter-item.completed .chapter-icon {
  color: var(--accent);
}

.chapter-item.completed .chapter-status {
  color: var(--accent);
}

/* Optional State */
.chapter-item.optional {
  background: rgba(196, 155, 39, 0.03);
}

.chapter-item.optional .chapter-icon {
  color: var(--accent-secondary);
}

.chapter-icon {
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

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

.chapter-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.chapter-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.chapter-status {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ========================================
   CTA Section
   ======================================== */
.cta-section {
  margin-top: 60px;
  padding: 48px;
  background: linear-gradient(135deg, 
    rgba(0, 184, 148, 0.08) 0%, 
    rgba(0, 194, 255, 0.08) 100%
  );
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
}

.cta-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.cta-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 15px var(--glow-color);
  transition: all var(--transition);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--glow-color);
}

.cta-button svg {
  transition: transform var(--transition);
}

.cta-button:hover svg {
  transform: translateX(4px);
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  margin-top: auto;
  padding: 32px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.footer-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--accent);
  font-weight: 600;
  transition: all var(--transition);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.footer-links a:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.footer-divider {
  color: var(--border-color);
  opacity: 0.5;
}

/* ========================================
   FAB (Floating Action Button)
   ======================================== */
.fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  opacity: 0;
  pointer-events: none;
  z-index: 80;
}

.fab.visible {
  opacity: 1;
  pointer-events: auto;
}

.fab:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.fab svg {
  width: 20px;
  height: 20px;
}

/* ========================================
   Complete Button (教程完成按钮)
   ======================================== */
.complete-section {
  margin-top: 32px;
}

.complete-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.complete-card.completed {
  background: rgba(0, 184, 148, 0.05);
  border-style: solid;
  border-color: var(--accent);
}

.complete-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 28px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.complete-btn:hover {
  border-color: var(--accent);
  background: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.complete-card.completed .complete-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.complete-icon {
  font-size: 1.2rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.complete-text {
  font-family: var(--font-sans);
}

.complete-hint {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-section {
  animation: fadeInUp 0.6s ease-out;
}

.phase-card {
  animation: fadeInUp 0.6s ease-out both;
}

.phase-card:nth-child(1) { animation-delay: 0.1s; }
.phase-card:nth-child(2) { animation-delay: 0.2s; }
.phase-card:nth-child(3) { animation-delay: 0.3s; }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
  .header-inner {
    padding: 0 24px;
  }
  
  .main-content {
    padding: 0 24px 60px;
  }
  
  .hero-section {
    padding: 36px 40px;
  }
  
  .hero-title {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .header-center {
    display: none;
  }
  
  .site-title {
    font-size: 1.1rem;
  }
  
  .hero-section {
    min-height: auto;
    padding: 28px 24px;
    margin: 24px 0;
  }
  
  .hero-title {
    font-size: 1.6rem;
  }
  
  .hero-desc {
    font-size: 1rem;
    margin-bottom: 24px;
  }
  
  .hero-watermark {
    font-size: 80px;
    right: -10px;
  }
  
  .stats-bar {
    flex-wrap: wrap;
    gap: 8px 16px;
  }
  
  .phase-header {
    padding: 20px 24px;
  }
  
  .phase-title {
    font-size: 1.3rem;
  }
  
  .chapter-item {
    padding: 16px 24px;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .chapter-icon {
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
  }
  
  .chapter-status {
    width: 100%;
    padding-left: 48px;
    margin-top: 4px;
  }
  
  .cta-section {
    padding: 32px 24px;
    margin-top: 40px;
  }
  
  .cta-title {
    font-size: 1.4rem;
  }
  
  .fab {
    bottom: 24px;
    right: 24px;
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 0 16px;
  }
  
  .main-content {
    padding: 0 16px 48px;
  }
  
  .domain-badge {
    display: none;
  }
  
  .hero-section {
    padding: 24px 20px;
  }
  
  .hero-title {
    font-size: 1.4rem;
  }
  
  .phase-header {
    padding: 16px 20px;
  }
  
  .chapter-item {
    padding: 14px 20px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, ::after, ::before {
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}
