:root {
  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --border: #e5e7eb;
  --shadow: 0 4px 16px rgba(0, 0, 0, .06);
  --radius: 14px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #60a5fa;
  --accent-light: #1e3a5f;
  --border: #334155;
  --shadow: 0 4px 16px rgba(0, 0, 0, .3);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background .3s, color .3s;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Navbar */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.05rem; }
.logo .accent, .accent { color: var(--accent); }
nav a {
  color: var(--muted); text-decoration: none; margin: 0 10px; font-size: .95rem;
}
nav a:hover { color: var(--accent); }
.theme-toggle, .menu-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  width: 38px; height: 38px; cursor: pointer; font-size: 1rem; color: var(--text);
}
.menu-btn { display: none; }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 2px; text-transform: uppercase; font-size: .8rem; }
.hero h1 { font-size: 2.4rem; margin: 12px 0; }
.lead { color: var(--muted); font-size: 1.08rem; }
.hero-actions { margin-top: 26px; display: flex; gap: 14px; }
.btn {
  padding: 11px 26px; border-radius: 10px; text-decoration: none; font-weight: 600;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { border: 1.5px solid var(--accent); color: var(--accent); }
.hero-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.hero-card h3 { margin-bottom: 14px; }
.stat-list { list-style: none; }
.stat-list li { padding: 8px 0; color: var(--muted); border-bottom: 1px dashed var(--border); }
.stat-list span { color: var(--accent); font-weight: 700; font-size: 1.25rem; margin-right: 8px; }

/* Sections */
.section { padding: 56px 0; }
.section-title {
  font-size: 1.7rem; margin-bottom: 8px; padding-bottom: 10px;
  border-bottom: 3px solid var(--accent); display: inline-block;
}
.section-desc { color: var(--muted); margin-bottom: 22px; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  transition: transform .2s;
}
.card:hover { transform: translateY(-3px); }
.card h3 { margin-bottom: 10px; font-size: 1.08rem; }
.card p, .card li { color: var(--muted); font-size: .95rem; }

/* About */
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list li {
  background: var(--accent-light); color: var(--accent); border-radius: 999px;
  padding: 4px 14px; font-size: .85rem; font-weight: 600;
}

/* Skills: pipeline card */
.pipeline-card h3 { margin-bottom: 20px; }
.pipeline {
  display: flex; align-items: stretch; justify-content: space-between; gap: 10px;
}
.pipe-node {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 20px 12px; cursor: pointer; font-family: inherit; color: var(--text);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.pipe-node:hover {
  transform: translateY(-4px); border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(37, 99, 235, .15);
}
.pipe-icon { font-size: 1.8rem; }
.pipe-name { font-weight: 700; font-size: 1rem; }
.pipe-sub { font-size: .78rem; color: var(--muted); }
.pipe-arrow { align-self: center; color: var(--accent); font-size: 1.2rem; flex-shrink: 0; }
.pipe-hint { margin-top: 18px; text-align: center; font-size: .85rem; color: var(--muted); }
.bi-standalone { margin-top: 20px; }
.bi-standalone > p { margin-bottom: 14px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px);
}
.modal-box {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  width: min(560px, calc(100vw - 40px)); max-height: 80vh; overflow-y: auto;
  padding: 30px; animation: modalIn .22s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  border: 1px solid var(--border); border-radius: 8px; background: none;
  cursor: pointer; color: var(--muted); font-size: .9rem;
}
.modal-close:hover { color: var(--accent); border-color: var(--accent); }
.modal-box h3 { font-size: 1.2rem; margin-bottom: 6px; }
.modal-goal { color: var(--accent); font-weight: 600; font-size: .92rem; margin-bottom: 16px; }
.detail-list { list-style: none; }
.detail-list li { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.detail-list li:last-child { border-bottom: none; }
.detail-list strong { display: block; color: var(--text); font-size: .95rem; margin-bottom: 3px; }
.detail-list span { color: var(--muted); font-size: .88rem; }

@media (max-width: 700px) {
  .pipeline { flex-direction: column; }
  .pipe-node { flex-direction: row; justify-content: flex-start; text-align: left; padding: 14px 18px; }
  .pipe-node .pipe-sub { display: none; }
  .pipe-arrow { transform: rotate(90deg); }
}

/* Methods */
.methods-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.method-card { position: relative; padding-top: 30px; }
.method-no {
  position: absolute; top: 14px; right: 20px; font-size: 2rem; font-weight: 800;
  color: var(--accent-light); -webkit-text-stroke: 1px var(--accent);
}

/* BI */
.bi-card { margin-top: 20px; }
.bi-card ul { margin-left: 20px; }

/* AI */
.ai-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }

/* Notes */
.notes-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 20px; }
.note-meta { font-size: .82rem; color: var(--muted); margin-bottom: 8px; display: flex; gap: 10px; }
.note-tag {
  background: var(--accent-light); color: var(--accent); padding: 2px 10px;
  border-radius: 99px; font-weight: 600;
}

/* Contact */
.contact-card { margin-top: 20px; }
.contact-list { list-style: none; margin-top: 10px; }
.contact-list li { padding: 6px 0; }

/* Roadmap */
.roadmap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.roadmap-head {
  font-weight: 700; font-size: 1rem; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 2px solid var(--border);
}
.roadmap-head.done { color: #16a34a; border-color: #16a34a; }
.roadmap-head.learning { color: #ea580c; border-color: #ea580c; }
.roadmap-head.planned { color: var(--accent); border-color: var(--accent); }
.roadmap-col .tag-list li { background: var(--bg); color: var(--text); border: 1px solid var(--border); }

/* Footer */
footer {
  border-top: 1px solid var(--border); padding: 26px 0; margin-top: 40px;
  text-align: center; color: var(--muted); font-size: .9rem;
}

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s; }
.reveal.visible { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 860px) {
  .hero-inner, .about-grid, .skills-grid, .methods-grid, .ai-grid, .roadmap-grid, .notes-list {
    grid-template-columns: 1fr;
  }
  .menu-btn { display: block; }
  #nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    background: var(--card); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 14px 24px; gap: 10px;
  }
  #nav.open { display: flex; }
  .hero h1 { font-size: 1.8rem; }
}
