/* ==========================================================================
   A股学堂 — 设计系统
   深色金融 · 红金配色 · 杂志感排版
   ========================================================================== */

/* --- CSS Custom Properties --- */
:root {
  --bg-primary: #070b14;
  --bg-secondary: #0d1421;
  --bg-tertiary: #141d2e;
  --bg-card: #0f1729;
  --bg-card-hover: #1a2640;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --red-glow: rgba(239, 68, 68, 0.25);
  --gold-400: #f5c842;
  --gold-500: #d4a03c;
  --gold-600: #b8860b;
  --gold-glow: rgba(212, 160, 60, 0.20);
  --green-400: #4ade80;
  --green-500: #22c55e;
  --text-primary: #e8edf5;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #070b14;
  --border-subtle: rgba(212, 160, 60, 0.12);
  --border-gold: rgba(212, 160, 60, 0.30);
  --font-display: 'Noto Serif SC', 'Source Han Serif SC', 'STSong', Georgia, serif;
  --font-body: 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Source Code Pro', monospace;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.64, 0, 0.78, 0);
  --ease-gold: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 200ms;
  --duration-normal: 400ms;
  --duration-slow: 800ms;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 20px rgba(212, 160, 60, 0.15);
  --max-width: 1200px;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-gold); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-500); }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(220, 38, 38, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(212, 160, 60, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 var(--space-xl);
  transition: background var(--duration-normal) ease;
}

.navbar.scrolled {
  background: rgba(7, 11, 20, 0.96);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.navbar-inner {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.navbar-logo .logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--red-600), var(--red-500));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
  font-weight: 700;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.navbar-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--duration-fast) ease;
  position: relative;
  padding: 0.25rem 0;
}

.navbar-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold-500);
  transition: width var(--duration-normal) var(--ease-out);
}

.navbar-links a:hover { color: var(--text-primary); }
.navbar-links a:hover::after { width: 100%; }

/* --- Main Container --- */
.main { position: relative; z-index: 1; padding-top: var(--nav-height); }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-xl); }

/* --- Hero --- */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 40%, rgba(220, 38, 38, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(212, 160, 60, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

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

.hero-badge {
  display: inline-block;
  padding: 0.375rem 1rem;
  border: 1px solid var(--border-gold);
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-xl);
  opacity: 0;
  animation: fadeInUp 0.6s var(--ease-out) 0.1s forwards;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-lg);
  opacity: 0;
  animation: fadeInUp 0.6s var(--ease-out) 0.2s forwards;
}

.hero h1 .highlight-red {
  background: linear-gradient(135deg, var(--red-500), var(--red-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1 .highlight-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
  opacity: 0;
  animation: fadeInUp 0.6s var(--ease-out) 0.3s forwards;
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeInUp 0.6s var(--ease-out) 0.4s forwards;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red-600), var(--red-500));
  color: white;
  box-shadow: 0 4px 16px var(--red-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--red-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-gold);
}
.btn-secondary:hover {
  background: rgba(212, 160, 60, 0.08);
  border-color: var(--gold-500);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--gold-400);
  border: 1px solid var(--border-gold);
}
.btn-outline:hover {
  background: rgba(212, 160, 60, 0.1);
  border-color: var(--gold-400);
}

/* --- Sections --- */
.section { padding: var(--space-4xl) 0; }

.section-header { text-align: center; margin-bottom: var(--space-3xl); }

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--space-md);
  position: relative;
}

.section-label::before,
.section-label::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--gold-500);
  vertical-align: middle;
  margin: 0 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  max-width: 640px;
  margin: 0 auto;
}

/* --- Course Grid --- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-xl);
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-decoration: none;
  color: inherit;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.course-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red-600), var(--gold-500));
  opacity: 0;
  transition: opacity var(--duration-normal) ease;
}

.course-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
}
.course-card:hover::before { opacity: 1; }

.course-card .card-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-500);
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.course-card .card-icon { font-size: 2rem; margin-bottom: var(--space-md); display: block; }
.course-card h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin-bottom: var(--space-sm); }
.course-card p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }

.course-card .card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* --- Page Header --- */
.page-header {
  padding: var(--space-3xl) 0 var(--space-2xl);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-3xl);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color var(--duration-fast) ease; }
.breadcrumb a:hover { color: var(--gold-400); }
.breadcrumb .separator { color: var(--text-muted); opacity: 0.4; }

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

.page-header .page-subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 640px;
}

.progress-indicator {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.progress-step {
  width: 32px; height: 4px;
  border-radius: 2px;
  background: var(--bg-tertiary);
  transition: background var(--duration-normal) ease;
}
.progress-step.done { background: var(--gold-500); }
.progress-step.current { background: var(--red-500); }

/* --- Content Sections --- */
.content-section { margin-bottom: var(--space-3xl); }

.content-section h2 {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--red-600);
  display: inline-block;
}

.content-section h2 .section-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--bg-primary);
  background: var(--gold-500);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: var(--space-sm);
  font-family: var(--font-body);
}

.content-section h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--gold-400);
}

.content-section p { margin-bottom: var(--space-md); color: var(--text-secondary); line-height: 1.85; }
.content-section p strong { color: var(--text-primary); font-weight: 600; }

.content-section ul, .content-section ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
  color: var(--text-secondary);
}

.content-section li { margin-bottom: var(--space-sm); line-height: 1.7; }
.content-section li strong { color: var(--text-primary); }

/* --- Insight Box --- */
.insight-box {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--gold-500);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-xl);
}
.insight-box.tip { border-left-color: var(--green-400); }
.insight-box.warning { border-left-color: var(--red-500); }
.insight-box.info { border-left-color: var(--gold-400); }

.insight-box .insight-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
  display: block;
}
.insight-box.tip .insight-label { color: var(--green-400); }
.insight-box.warning .insight-label { color: var(--red-500); }
.insight-box.info .insight-label { color: var(--gold-400); }
.insight-box p { margin-bottom: 0; font-size: 0.9375rem; }

/* --- Formula Block --- */
.formula-block {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-xl);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--gold-400);
  overflow-x: auto;
}

.formula-block .formula-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.formula-block .formula-variable { color: var(--green-400); }
.formula-block .formula-comment { color: var(--text-muted); font-style: italic; }

/* --- K线结构示意图 --- */
.kline-anatomy {
  margin-bottom: var(--space-xl);
  text-align: center;
}

.kline-anatomy svg {
  width: 100%;
  max-width: 720px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.kline-anatomy figcaption {
  margin-top: var(--space-md);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Chart Container --- */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
}

.chart-container .chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.chart-container .chart-title { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); }
.chart-container .chart-desc { font-size: 0.8125rem; color: var(--text-muted); }

.chart-box { width: 100%; height: 400px; }
.chart-box.tall { height: 500px; }
.chart-box.short { height: 300px; }

/* --- Signal Grid --- */
.signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.signal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}
.signal-card.buy { border-left: 3px solid var(--green-400); }
.signal-card.sell { border-left: 3px solid var(--red-500); }

.signal-card .signal-label { font-size: 0.8125rem; font-weight: 600; margin-bottom: var(--space-sm); }
.signal-card.buy .signal-label { color: var(--green-400); }
.signal-card.sell .signal-label { color: var(--red-500); }
.signal-card p { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0; }

/* --- Param Table --- */
.param-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-xl);
}

.param-table th, .param-table td {
  text-align: left;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
}

.param-table th {
  font-weight: 600;
  color: var(--gold-400);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.param-table td { color: var(--text-secondary); }
.param-table tr:hover td { color: var(--text-primary); }

/* --- Page Nav --- */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-3xl);
}

.page-nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--duration-fast) ease;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
}

.page-nav a:hover {
  color: var(--gold-400);
  background: rgba(212, 160, 60, 0.06);
}

.page-nav .nav-next { text-align: right; }
.page-nav .nav-label { display: block; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-2xl) 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.footer a { color: var(--gold-400); text-decoration: none; }

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

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 12px var(--red-glow); }
  50% { box-shadow: 0 0 24px var(--red-glow), 0 0 40px rgba(239, 68, 68, 0.1); }
}

.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s var(--ease-out);
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --space-xl: 1.25rem;
    --space-2xl: 2rem;
    --space-3xl: 3rem;
    --space-4xl: 4rem;
  }
  .navbar { padding: 0 var(--space-md); }
  .navbar-links { gap: var(--space-md); }
  .navbar-links a { font-size: 0.8125rem; }
  .hero { min-height: 70vh; padding: var(--space-3xl) var(--space-md); }
  .course-grid { grid-template-columns: 1fr; }
  .container { padding: 0 var(--space-md); }
  .chart-box { height: 300px; }
  .chart-box.tall { height: 380px; }
  .signal-grid { grid-template-columns: 1fr; }
  .page-nav { flex-direction: column; gap: var(--space-md); }
  .page-nav a { width: 100%; justify-content: center; }
  .page-nav .nav-next { text-align: center; }
}

@media (max-width: 480px) {
  .navbar-links a:not(.nav-highlight) { display: none; }
  .hero h1 { font-size: 2rem; }
}
