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

/* ===== Theme Variables ===== */
:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --border: #1e1e1e;
  --border-hover: #333333;
  --text: #e5e5e5;
  --text-dim: #737373;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --switch-bg: #1a1a1a;
  --switch-thumb: #2a2a2a;
  --switch-icon: #737373;
  --switch-icon-active: #e5e5e5;
}

:root[data-theme="light"] {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e5e5e5;
  --border-hover: #d4d4d4;
  --text: #1a1a1a;
  --text-dim: #737373;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --switch-bg: #e8e8e8;
  --switch-thumb: #ffffff;
  --switch-icon: #999999;
  --switch-icon-active: #1a1a1a;
}

/* ===== Base ===== */
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.4s ease, color 0.4s ease;
}
a { color: inherit; text-decoration: none; }

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

/* ===== Header ===== */
header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  transition: border-color 0.4s ease;
}
header .container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }

/* ===== Theme Switcher ===== */
.theme-switch {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--switch-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px;
  gap: 0;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.theme-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  width: calc((100% - 6px) / 3);
  background: var(--switch-thumb);
  border-radius: 9px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  z-index: 0;
}

.theme-switch[data-active="auto"]  .theme-slider { transform: translateX(0); }
.theme-switch[data-active="light"] .theme-slider { transform: translateX(100%); }
.theme-switch[data-active="dark"]  .theme-slider { transform: translateX(200%); }

.theme-btn {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--switch-icon);
  transition: color 0.3s ease;
  padding: 0;
}

.theme-btn.active { color: var(--switch-icon-active); }
.theme-btn svg { width: 16px; height: 16px; }

/* ===== Hero ===== */
.hero { padding: 100px 0 80px; text-align: center; }
.hero h1 { font-size: 56px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.hero h1 .highlight { color: var(--accent); }
.hero p { font-size: 18px; color: var(--text-dim); margin-top: 20px; max-width: 520px; margin-left: auto; margin-right: auto; }

/* ===== Cards Section ===== */
.section { padding: 40px 0 80px; }
.section-title { font-size: 14px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 32px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s, background 0.4s ease;
}
.card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.card-icon { font-size: 28px; margin-bottom: 16px; }
.card h3 { font-size: 17px; font-weight: 600; }
.card p { font-size: 14px; color: var(--text-dim); margin-top: 8px; word-break: break-all; }

/* ===== Footer ===== */
footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: 40px; transition: border-color 0.4s ease; }
footer .container { display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--text-dim); gap: 8px; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero h1 { font-size: 36px; }
  .hero { padding: 60px 0 40px; }
}
