/* =====================================================
 * MacroMargin 镜像站样式 - 跟原站风格接近 (灰白深色双模式)
 * ===================================================== */

:root {
  --bg: #f2f0eb;
  --bg-secondary: #e8e4dc;
  --bg-tertiary: #ddd6c9;
  --surface: #ffffff;
  --text: #0a0a0a;
  --text-secondary: #4a4a4a;
  --text-muted: #888;
  --border: #d4cebd;
  --accent: #2c5f3f;
  --accent-light: #4a8a64;
  --warning: #b8442c;
  --highlight: #f5d76e;
  --max-width: 1100px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

html.dark {
  --bg: #0a0e1a;
  --bg-secondary: #131826;
  --bg-tertiary: #1c2233;
  --surface: #1a2030;
  --text: #e2e8f0;
  --text-secondary: #b0b8c8;
  --text-muted: #6a7280;
  --border: #2a3145;
  --accent: #4a8a64;
  --accent-light: #6cba8a;
  --warning: #d96548;
  --highlight: #d4af37;
}

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

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

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.header .container { display: flex; align-items: center; justify-content: space-between; }
.logo {
  font-family: 'Arial Black', sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav { display: flex; gap: 28px; align-items: center; }
.nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav a.active { color: var(--accent); }

/* Hero */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  letter-spacing: 0.1em;
}
.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 40px auto 0;
}
.hero-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  text-align: left;
}
.hero-stat-num { font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.hero-stat-label { font-size: 0.85rem; color: var(--text-secondary); }

/* Section */
.section { padding: 60px 0; }
.section-alt { background: var(--bg-secondary); }
.section-header { text-align: center; margin-bottom: 40px; }
.section-tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 12px;
  text-transform: uppercase;
  font-weight: 600;
}
.section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
  transition: all 0.2s;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.card-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  color: var(--text-secondary);
  font-weight: 600;
}
.card-summary {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-light); color: #fff; text-decoration: none; }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* TACO 事件 */
.event {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.event-strongest { border-left-color: var(--warning); }
.event-strong { border-left-color: var(--highlight); }
.event-context { border-left-color: var(--text-muted); }
.event-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.event-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: monospace;
}
.event-intensity {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text);
}
.event-intensity-strongest { background: var(--warning); color: #fff; }
.event-intensity-strong { background: var(--highlight); color: #000; }
.event-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.event-detail {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 6px;
}

/* Snapshot */
.snapshot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
}
.snapshot-total {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.snapshot-total-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--warning);
}
.snapshot-total-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.snapshot-factors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.factor {
  background: var(--bg-secondary);
  padding: 12px 16px;
  border-radius: 6px;
}
.factor-label { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 4px; }
.factor-value { font-size: 1.3rem; font-weight: 700; color: var(--text); font-family: monospace; }
.factor-up { color: var(--warning); }
.factor-down { color: var(--accent); }

/* Disclaimer */
.disclaimer {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--warning);
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  border-radius: 4px;
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: 60px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}
.footer h4 { font-size: 0.9rem; margin-bottom: 12px; color: var(--text); }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--text-secondary); font-size: 0.85rem; }
.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Auth gate */
.gate-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gate-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.gate-box h2 { margin-bottom: 8px; font-size: 1.4rem; }
.gate-box p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 20px; }
.gate-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
  letter-spacing: 0.3em;
  font-family: monospace;
  margin-bottom: 16px;
}
.gate-input:focus { outline: none; border-color: var(--accent); }
.gate-error { color: var(--warning); font-size: 0.85rem; margin-top: 8px; min-height: 20px; }
.gate-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 12px; }

/* Mobile */
@media (max-width: 720px) {
  .hero h1 { font-size: 2rem; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .snapshot-factors { grid-template-columns: repeat(2, 1fr); }
}
