/* ============================================================
   LLMPath · 炼模之路 — Design System (HuggingFace-inspired)
   ============================================================ */

:root {
  /* Brand */
  --brand: #ffd21e;
  --brand-dark: #f5c400;
  --brand-soft: #fff8d6;
  --ink: #0b0d0f;

  /* Neutrals */
  --bg: #ffffff;
  --bg-soft: #faf9f5;
  --bg-mute: #f3f4f6;
  --panel: #ffffff;
  --border: #e8e5dd;
  --border-strong: #d9d5cb;
  --text: #1f2328;
  --text-soft: #4b5563;
  --text-mute: #6b7280;
  --text-faint: #9ca3af;

  /* Accents */
  --blue: #2563eb;
  --blue-soft: #eff4ff;
  --purple: #7c3aed;
  --purple-soft: #f3edff;
  --green: #16a34a;
  --green-soft: #e9f9ef;
  --orange: #ea8c00;
  --orange-soft: #fff4e2;
  --red: #dc2626;
  --red-soft: #fdecec;
  --teal: #0d9488;
  --teal-soft: #e6f7f5;

  /* Difficulty */
  --easy: #16a34a;
  --medium: #ea8c00;
  --hard: #dc2626;

  /* Effects */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 2px 8px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .10), 0 2px 8px rgba(16, 24, 40, .05);
  --shadow-brand: 0 8px 24px rgba(255, 210, 30, .35);

  /* Layout */
  --nav-h: 60px;
  --maxw: 1240px;
  --font: "Overpass", "Source Sans Pro", -apple-system, BlinkMacSystemFont,
          "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
code, pre, .mono { font-family: var(--mono); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-mute); }
.soft { color: var(--text-soft); }

/* ============================ Navbar ============================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; gap: 20px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #ffd21e, #ff9d00);
  display: grid; place-items: center; font-size: 18px;
  box-shadow: var(--shadow-brand);
}
.logo-sub { font-size: 11px; color: var(--text-mute); font-weight: 600; margin-top: -3px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-links a {
  padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 14px;
  color: var(--text-soft); transition: .15s;
}
.nav-links a:hover { background: var(--bg-mute); color: var(--text); }
.nav-links a.active { background: var(--brand-soft); color: #7a5b00; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 12px; min-width: 220px;
  color: var(--text-mute); font-size: 13px; transition: .15s;
}
.search:focus-within { border-color: var(--brand-dark); box-shadow: 0 0 0 3px var(--brand-soft); }
.search input { border: 0; background: transparent; outline: 0; font-family: var(--font); font-size: 13px; width: 100%; color: var(--text); }
.search kbd {
  font-family: var(--mono); font-size: 11px; background: #fff; border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--text-mute);
}

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px;
  border: 2px solid #fff; box-shadow: var(--shadow-sm); cursor: pointer;
}

/* ============================ Buttons ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  font-family: var(--font); font-weight: 700; font-size: 14px; cursor: pointer;
  transition: .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #23282e; }
.btn-brand { background: var(--brand); color: #3d2f00; box-shadow: var(--shadow-brand); }
.btn-brand:hover { background: var(--brand-dark); }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--bg-soft); border-color: var(--text-faint); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--bg-mute); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 24px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }

/* ============================ Badges / Chips ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid transparent;
}
.badge-easy { background: var(--green-soft); color: var(--green); border-color: #bfe8cd; }
.badge-medium { background: var(--orange-soft); color: var(--orange); border-color: #f5dcae; }
.badge-hard { background: var(--red-soft); color: var(--red); border-color: #f3c6c6; }
.badge-blue { background: var(--blue-soft); color: var(--blue); border-color: #cdddff; }
.badge-purple { background: var(--purple-soft); color: var(--purple); border-color: #ddccff; }
.badge-teal { background: var(--teal-soft); color: var(--teal); border-color: #b9e7e2; }
.badge-gray { background: var(--bg-mute); color: var(--text-mute); border-color: var(--border); }
.badge-brand { background: var(--brand-soft); color: #7a5b00; border-color: #f0e2a0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: 999px; border: 1px solid var(--border); background: #fff;
  font-size: 13px; font-weight: 600; color: var(--text-soft); cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--border-strong); background: var(--bg-soft); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px;
  border-radius: 6px; background: var(--bg-mute); color: var(--text-soft);
  font-size: 12px; font-weight: 600;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ============================ Cards ============================ */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: .18s;
}
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--border-strong); }
.card-pad { padding: 22px; }

/* ============================ Sections ============================ */
.section { padding: 64px 0; }
.section-head { margin-bottom: 32px; }
.section-head h2 { font-size: 30px; }
.section-head p { color: var(--text-mute); margin-top: 8px; font-size: 16px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700;
  color: #7a5b00; background: var(--brand-soft); padding: 5px 12px; border-radius: 999px;
  border: 1px solid #f0e2a0; margin-bottom: 14px;
}

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================ Hero ============================ */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1000px 500px at 80% -10%, #fff3c4 0%, transparent 60%),
    radial-gradient(800px 400px at 10% 0%, #ede4ff 0%, transparent 55%),
    var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 72px 24px 64px;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center;
}
.hero h1 { font-size: 52px; line-height: 1.1; letter-spacing: -.02em; }
.hero h1 .grad {
  background: linear-gradient(120deg, #ff9d00, #ffd21e 40%, #7c3aed);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero .lead { font-size: 19px; color: var(--text-soft); margin-top: 18px; max-width: 520px; }
.hero-cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 36px; }
.hero-stats .num { font-size: 26px; font-weight: 800; }
.hero-stats .lbl { font-size: 13px; color: var(--text-mute); }

/* Hero terminal card */
.term {
  background: #0d1117; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid #21262d;
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: #161b22; border-bottom: 1px solid #21262d; }
.term-bar .d { width: 11px; height: 11px; border-radius: 50%; }
.term-title { margin-left: 8px; font-size: 12px; color: #8b949e; font-family: var(--mono); }
.term-body { padding: 16px 18px; font-family: var(--mono); font-size: 13px; line-height: 1.75; color: #c9d1d9; min-height: 240px; }
.term-body .c-gray { color: #8b949e; }
.term-body .c-green { color: #56d364; }
.term-body .c-yellow { color: #e3b341; }
.term-body .c-blue { color: #79c0ff; }
.term-body .c-purple { color: #d2a8ff; }
.cursor { display: inline-block; width: 8px; height: 15px; background: #56d364; vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ============================ Pipeline ============================ */
.pipeline { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.stage {
  flex: 1; min-width: 130px; position: relative; text-align: center;
  padding: 20px 12px; border-radius: var(--radius); transition: .18s; cursor: pointer;
}
.stage:hover { background: var(--bg-soft); }
.stage-ico {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px;
  display: grid; place-items: center; font-size: 24px;
  background: var(--bg-mute); border: 1px solid var(--border);
}
.stage-name { font-weight: 700; font-size: 14px; }
.stage-desc { font-size: 12px; color: var(--text-mute); margin-top: 3px; }
.stage-num {
  position: absolute; top: 8px; left: 12px; font-size: 11px; font-weight: 800;
  color: var(--text-faint); font-family: var(--mono);
}
.stage-arrow { display: grid; place-items: center; color: var(--text-faint); font-size: 20px; padding: 0 2px; }

/* ============================ Problem list (LeetCode style) ============================ */
.list-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 0; border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.prob-table { width: 100%; border-collapse: collapse; }
.prob-table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-faint); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.prob-row { border-bottom: 1px solid var(--border); transition: .12s; cursor: pointer; }
.prob-row:hover { background: var(--bg-soft); }
.prob-row td { padding: 14px; vertical-align: middle; }
.prob-title { font-weight: 600; font-size: 15px; }
.prob-title:hover { color: var(--blue); }
.prob-meta { font-size: 12px; color: var(--text-mute); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.status-ico { width: 22px; text-align: center; font-size: 15px; }
.done { color: var(--green); }

/* Progress bar */
.pbar { height: 7px; background: var(--bg-mute); border-radius: 999px; overflow: hidden; }
.pbar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffd21e, #ff9d00); }
.pbar-green > i { background: linear-gradient(90deg, #34d399, #16a34a); }
.pbar-blue > i { background: linear-gradient(90deg, #60a5fa, #2563eb); }

/* ============================ Layout with sidebar ============================ */
.layout { display: grid; grid-template-columns: 260px 1fr; gap: 0; max-width: var(--maxw); margin: 0 auto; }
.sidebar {
  border-right: 1px solid var(--border); padding: 24px 18px; min-height: calc(100vh - var(--nav-h));
  position: sticky; top: var(--nav-h); align-self: start; max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
}
.side-group { margin-bottom: 22px; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-weight: 800; padding: 0 10px 8px; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--text-soft); transition: .12s; cursor: pointer;
}
.side-link:hover { background: var(--bg-mute); color: var(--text); }
.side-link.active { background: var(--brand-soft); color: #7a5b00; }
.side-link .ico { width: 20px; text-align: center; }
.side-link .count { margin-left: auto; font-size: 12px; color: var(--text-faint); font-family: var(--mono); }
.main { padding: 28px 32px; min-width: 0; }

/* ============================ Split (challenge) ============================ */
.split { display: grid; grid-template-columns: 1fr 1fr; height: calc(100vh - var(--nav-h)); }
.split-left { border-right: 1px solid var(--border); overflow-y: auto; padding: 24px 28px; }
.split-right { display: flex; flex-direction: column; min-width: 0; background: var(--bg-soft); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 28px; }
.tab {
  padding: 12px 14px; font-size: 14px; font-weight: 600; color: var(--text-mute);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .12s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--brand-dark); }

/* Code editor mock */
.editor { background: #0d1117; color: #c9d1d9; font-family: var(--mono); font-size: 13px; line-height: 1.7; flex: 1; overflow: auto; }
.editor-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #161b22; border-bottom: 1px solid #21262d; font-size: 12px; color: #8b949e; }
.code-lines { padding: 14px 0; }
.code-line { display: flex; padding: 0 16px; }
.code-line:hover { background: #161b22; }
.ln { width: 32px; color: #484f58; text-align: right; padding-right: 16px; user-select: none; flex-shrink: 0; }
.code-line .code { white-space: pre; }
.k { color: #ff7b72; } .s { color: #a5d6ff; } .f { color: #d2a8ff; } .n { color: #79c0ff; } .cm { color: #8b949e; } .v { color: #ffa657; }

/* ============================ Simulator ============================ */
.sim-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.field { margin-bottom: 16px; }
.field label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.field label .val { font-family: var(--mono); color: var(--blue); font-weight: 700; }
input[type=range] { width: 100%; accent-color: var(--brand-dark); height: 5px; cursor: pointer; }
select, .input {
  width: 100%; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: #fff; font-family: var(--font); font-size: 14px; color: var(--text); outline: 0; transition: .15s;
}
select:focus, .input:focus { border-color: var(--brand-dark); box-shadow: 0 0 0 3px var(--brand-soft); }

.chart-wrap { background: #0d1117; border-radius: var(--radius); padding: 16px; border: 1px solid #21262d; }
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.chart-head .t { color: #e6edf3; font-weight: 700; font-size: 14px; }
.chart-head .legend { display: flex; gap: 14px; font-size: 12px; color: #8b949e; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
svg text { font-family: var(--mono); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.metric .k { font-size: 12px; color: var(--text-mute); font-weight: 600; }
.metric .v { font-size: 24px; font-weight: 800; margin-top: 4px; font-family: var(--mono); }
.metric .d { font-size: 12px; margin-top: 2px; font-weight: 600; }
.up { color: var(--green); } .down { color: var(--red); }

.log {
  background: #0d1117; border-radius: var(--radius); padding: 14px; font-family: var(--mono);
  font-size: 12.5px; line-height: 1.7; color: #8b949e; height: 200px; overflow-y: auto; border: 1px solid #21262d;
}
.log .ok { color: #56d364; } .log .warn { color: #e3b341; } .log .info { color: #79c0ff; }

/* ============================ Profile / progress ============================ */
.profile-head { display: flex; gap: 24px; align-items: flex-start; padding: 32px 0; }
.profile-ava {
  width: 96px; height: 96px; border-radius: 24px; flex-shrink: 0;
  background: linear-gradient(135deg, #7c3aed, #2563eb); display: grid; place-items: center;
  color: #fff; font-size: 38px; font-weight: 800; box-shadow: var(--shadow);
}
.contrib { display: flex; gap: 3px; }
.contrib-col { flex: 1 1 0; min-width: 6px; display: flex; flex-direction: column; gap: 3px; }
.contrib-cell { width: 100%; aspect-ratio: 1 / 1; border-radius: 3px; background: var(--bg-mute); }
.contrib-legend .contrib-cell { width: 12px; height: 12px; aspect-ratio: auto; flex: 0 0 auto; }
.l1 { background: #d9f2df; } .l2 { background: #a6e3b4; } .l3 { background: #5fcb7c; } .l4 { background: #16a34a; }

.stat-card { text-align: center; padding: 20px; }
.stat-card .big { font-size: 34px; font-weight: 800; }
.stat-card .lbl { font-size: 13px; color: var(--text-mute); margin-top: 2px; }

/* Radar / bars */
.skill-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.skill-row .name { width: 110px; font-size: 13px; font-weight: 600; }
.skill-row .pbar { flex: 1; }
.skill-row .pct { width: 42px; text-align: right; font-size: 13px; font-family: var(--mono); color: var(--text-mute); }

/* ============================ Footer ============================ */
.footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 48px 0 32px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: 12px; }
.footer a { display: block; padding: 5px 0; font-size: 14px; color: var(--text-soft); }
.footer a:hover { color: var(--text); }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; font-size: 13px; color: var(--text-mute); }

/* ============================ Misc ============================ */
.callout {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid; font-size: 14px;
}
.callout-info { background: var(--blue-soft); border-color: #cdddff; color: #1e40af; }
.callout-warn { background: var(--orange-soft); border-color: #f5dcae; color: #92600a; }
.callout-tip { background: var(--green-soft); border-color: #bfe8cd; color: #14532d; }
.callout .ico { font-size: 18px; }

.divider { height: 1px; background: var(--border); margin: 24px 0; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mt32{margin-top:32px}
.gap8{gap:8px}.gap16{gap:16px}
.flex1{flex:1}
.center{text-align:center}
.hidden{display:none !important}
.scroll-x{overflow-x:auto}

.doc h2 { font-size: 24px; margin: 40px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.doc h3 { font-size: 18px; margin: 26px 0 12px; }
.doc p { color: var(--text-soft); margin-bottom: 12px; }
.doc ul { margin: 0 0 16px; }
.doc li { position: relative; padding-left: 22px; margin-bottom: 8px; color: var(--text-soft); }
.doc li::before { content: "▸"; position: absolute; left: 4px; color: var(--brand-dark); }
.doc strong { color: var(--text); }
.doc code { background: var(--bg-mute); padding: 2px 6px; border-radius: 5px; font-size: 13px; color: var(--purple); }

.table-spec { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 14px; }
.table-spec th, .table-spec td { text-align: left; padding: 10px 14px; border: 1px solid var(--border); }
.table-spec th { background: var(--bg-soft); font-weight: 700; }
.table-spec tr:hover td { background: var(--bg-soft); }

.feature-ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; margin-bottom: 14px;
}

/* Responsive */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero h1 { font-size: 38px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--border); }
  .split { grid-template-columns: 1fr; height: auto; }
  .split-left { border-right: 0; border-bottom: 1px solid var(--border); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .search { min-width: 0; width: 40px; padding: 7px; }
  .search input, .search kbd { display: none; }
}
