/* ===== MACD Guide - Shared Styles ===== */
/* 红涨绿跌 中国A股配色 */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2332;
  --bg-card-hover: #1f2d40;
  --border: #2a3a50;
  --text-primary: #e8edf5;
  --text-secondary: #8899aa;
  --text-muted: #5a6a7a;
  /* 红涨绿跌 */
  --rise: #e74c3c;
  --rise-bg: rgba(231,76,60,0.12);
  --rise-dim: #7f1d1d;
  --fall: #2ecc71;
  --fall-bg: rgba(46,204,113,0.12);
  --fall-dim: #14532d;
  /* MACD专用色 */
  --diff-color: #f0c040;   /* DIFF 黄色 */
  --dea-color: #a855f7;    /* DEA 紫色 */
  --bar-rise: #e74c3c;     /* 红柱 */
  --bar-fall: #2ecc71;     /* 绿柱 */
  /* 通用 */
  --blue: #3b82f6;
  --yellow: #eab308;
  --orange: #f97316;
  --purple: #a855f7;
  --cyan: #06b6d4;
  --accent: #60a5fa;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Top Nav ===== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,14,23,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 6px;
  overflow-x: auto;
}
.nav-inner::-webkit-scrollbar { height: 0; }
.nav-logo {
  font-weight: 800;
  font-size: 1em;
  color: var(--text-primary);
  margin-right: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.88em;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.nav-link:hover {
  background: rgba(96,165,250,0.1);
  color: var(--text-primary);
  text-decoration: none;
}
.nav-link.active {
  background: var(--accent);
  color: #fff;
}

/* ===== Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Page Hero ===== */
.page-hero {
  padding: 52px 24px 36px;
  text-align: center;
}
.page-hero h1 {
  font-size: 2.2em;
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #f0c040, #a855f7, #e74c3c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-hero .subtitle {
  color: var(--text-secondary);
  font-size: 1.05em;
  max-width: 650px;
  margin: 0 auto;
}

/* ===== Section ===== */
.section {
  padding: 48px 0;
}
.section-title {
  font-size: 1.6em;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title .icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1em;
  flex-shrink: 0;
}
.section-desc {
  color: var(--text-secondary);
  font-size: 1em;
  margin-bottom: 32px;
  max-width: 700px;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  transition: all 0.3s;
}
.card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}

/* ===== Chart Box ===== */
.chart-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}
.chart-box h4 {
  margin-bottom: 14px;
  font-size: 1em;
  color: var(--text-secondary);
}
.chart-box svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== Legend ===== */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  font-size: 0.85em;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}
.legend-dot {
  width: 12px; height: 12px;
  border-radius: 3px;
}

/* ===== Signal Card ===== */
.signal-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  margin-bottom: 28px;
}
.signal-card.buy { border-left: 4px solid var(--rise); }
.signal-card.sell { border-left: 4px solid var(--fall); }
.signal-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.signal-badge {
  padding: 3px 10px; border-radius: 6px;
  font-size: 0.78em; font-weight: 700;
}
.badge-buy { background: var(--rise-dim); color: var(--rise); }
.badge-sell { background: var(--fall-dim); color: var(--fall); }
.signal-detail {
  display: flex; gap: 8px; align-items: flex-start;
  margin-bottom: 7px; font-size: 0.92em;
}
.signal-detail .label {
  flex-shrink: 0; padding: 2px 8px; border-radius: 4px;
  font-size: 0.82em; font-weight: 600;
  min-width: 50px; text-align: center;
}
.label-k { background: rgba(59,130,246,0.15); color: var(--blue); }
.label-v { background: rgba(249,115,22,0.15); color: var(--orange); }
.label-m { background: rgba(168,85,247,0.15); color: var(--purple); }
.signal-detail .desc { color: var(--text-secondary); }
.signal-reliability {
  margin-top: 12px; padding: 10px 14px;
  border-radius: 8px; font-size: 0.88em; font-weight: 600;
}
.rel-high { background: var(--rise-bg); color: var(--rise); }
.rel-danger { background: var(--fall-bg); color: var(--fall); }
.rel-medium { background: rgba(234,179,8,0.12); color: var(--yellow); }

/* ===== Matrix Table ===== */
.matrix-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.matrix-table {
  width: 100%; border-collapse: collapse; font-size: 0.93em;
}
.matrix-table th {
  background: rgba(59,130,246,0.1);
  padding: 14px 16px; text-align: left;
  font-weight: 700; white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
.matrix-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(42,58,80,0.5);
  color: var(--text-secondary);
}
.matrix-table tr:hover td { background: rgba(96,165,250,0.04); }
.matrix-table .up { color: var(--rise); font-weight: 600; }
.matrix-table .down { color: var(--fall); font-weight: 600; }
.matrix-table .flat { color: var(--yellow); font-weight: 600; }

/* ===== Tip Card ===== */
.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
}
.tip-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
}
.tip-num {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1em; flex-shrink: 0;
  background: rgba(96,165,250,0.15); color: var(--accent);
}
.tip-tag {
  display: inline-block;
  background: rgba(234,179,8,0.15); color: var(--yellow);
  padding: 2px 10px; border-radius: 4px;
  font-weight: 600; font-size: 0.85em; margin-top: 8px;
}

/* ===== Banner ===== */
.banner {
  border-radius: 14px; padding: 24px 32px;
  text-align: center; margin: 32px 0;
}
.banner-highlight {
  background: linear-gradient(135deg, rgba(231,76,60,0.1), rgba(234,179,8,0.1), rgba(46,204,113,0.1));
  border: 1px solid rgba(234,179,8,0.3);
}
.banner .main { font-size: 1.2em; font-weight: 700; margin-bottom: 6px; }
.banner .sub { color: var(--text-secondary); font-size: 0.95em; }
.banner .hl { color: var(--yellow); }

/* ===== Page Nav Footer ===== */
.page-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 32px 0 48px; gap: 16px;
}
.page-nav a {
  padding: 10px 20px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary); font-weight: 600; font-size: 0.95em;
  transition: all 0.2s;
}
.page-nav a:hover {
  background: var(--accent); color: #fff;
  text-decoration: none; border-color: var(--accent);
}

/* ===== Divider ===== */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .page-hero h1 { font-size: 1.6em; }
  .section-title { font-size: 1.3em; }
  .container { padding: 0 14px; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
