/* Biome — common.css */
/* 设计：深蓝黑底 + Biome 官方青蓝 #60A5FA */
:root {
  --bg:           #0a0f1a;
  --surface:      #101725;
  --surface-2:    #161f32;
  --card:         #131b2c;
  --card-hover:   #1a2540;
  --border:       rgba(96,165,250,0.14);
  --border-bright:rgba(96,165,250,0.3);
  --text:         #e6edf9;
  --text-2:       #b1bbd0;
  --text-3:       #8390a8;
  --accent:       #60A5FA;
  --accent-2:     #93c5fd;
  --accent-text:  #7FB3FF;
  --accent-glow:  rgba(96,165,250,0.25);
  --green:        #4ade80;
  --blue:         #60a5fa;
  --red:          #f87171;
  --yellow:       #fbbf24;
  --purple:       #c084fc;
  --cyan:         #22d3ee;
  --radius:       10px;
  --radius-lg:    14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1rem;
  padding: 0 2rem; height: 56px;
  background: rgba(10,15,26,0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-back { color: var(--accent-text); text-decoration: none; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.03em; opacity: 0.9; display: flex; align-items: center; gap: 0.4rem; transition: opacity 0.2s; }
.nav-back::before { content: '←'; }
.nav-back:hover { opacity: 1; }
.nav-title { flex: 1; text-align: center; font-size: 0.9rem; color: var(--text-2); font-weight: 500; }
.nav-badge { background: var(--accent); color: #000; font-size: 0.65rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }

.hero {
  position: relative; overflow: hidden;
  padding: 6rem 2rem 5rem; text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(96,165,250,0.11) 0%, #101725 40%, #0a0f1a 100%);
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 20% 40%, rgba(96,165,250,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(147,197,253,0.06) 0%, transparent 45%);
}
.hero-badge {
  display: inline-block; padding: 0.3rem 1rem;
  border: 1px solid var(--border-bright); border-radius: 20px;
  font-size: 0.78rem; color: var(--accent-text);
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 1.5rem; background: rgba(96,165,250,0.08);
  position: relative;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 60%, #e6edf9 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  position: relative;
}
.hero-sub { font-size: 1.05rem; color: var(--text-2); max-width: 660px; margin: 0 auto 2.5rem; line-height: 1.8; position: relative; }
.hero-icon { font-size: 3.2rem; margin-bottom: 1rem; position: relative; display: inline-block; }

.promise-bar { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.2rem 2rem; margin-bottom: 2.5rem; position: relative; }
.promise-item { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text-2); font-size: 0.88rem; }
.promise-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }

.hero-stats { display: flex; justify-content: center; gap: 3.2rem; flex-wrap: wrap; position: relative; }
.stat-item { text-align: center; }
.stat-num { display: block; font-size: 2rem; font-weight: 700; color: var(--accent-text); letter-spacing: -0.02em; }
.stat-label { display: block; color: var(--text-3); font-size: 0.8rem; margin-top: 0.2rem; letter-spacing: 0.05em; }

.container { max-width: 1100px; margin: 0 auto; padding: 3rem 2rem; }

.intro-block { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-lg); padding: 2rem 2.2rem; margin-bottom: 3rem; }
.intro-block h2 { font-size: 1.3rem; color: var(--text); margin-bottom: 1rem; font-weight: 600; }
.intro-block p { color: var(--text-2); margin-bottom: 0.9rem; font-size: 0.96rem; }
.intro-block p:last-child { margin-bottom: 0; }
.intro-block strong { color: var(--accent-text); font-weight: 600; }
.intro-block code { background: var(--surface-2); color: var(--accent-text); padding: 0.1em 0.42em; border-radius: 4px; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 0.88em; border: 1px solid var(--border); }

.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title h2 { font-size: 1.8rem; color: var(--text); margin-bottom: 0.6rem; font-weight: 700; }
.section-title p { color: var(--text-3); font-size: 0.96rem; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin-bottom: 4rem; }
.feature-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.6rem 1.4rem; transition: all 0.25s; }
.feature-item:hover { border-color: var(--accent); transform: translateY(-3px); background: var(--card-hover); }
.feature-icon { font-size: 1.8rem; margin-bottom: 0.8rem; }
.feature-item h3 { font-size: 1.05rem; color: var(--text); margin-bottom: 0.5rem; font-weight: 600; }
.feature-item p { color: var(--text-2); font-size: 0.88rem; line-height: 1.7; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.4rem; }
.card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.6rem 1.5rem; text-decoration: none; color: inherit; transition: all 0.25s; position: relative; overflow: hidden; }
.card::before { content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: var(--accent); transform: scaleY(0); transform-origin: bottom; transition: transform 0.3s; }
.card:hover { border-color: var(--accent); background: var(--card-hover); transform: translateY(-3px); box-shadow: 0 12px 28px rgba(96,165,250,0.14); }
.card:hover::before { transform: scaleY(1); transform-origin: top; }
.card-num { font-size: 0.72rem; color: var(--accent-text); letter-spacing: 0.12em; font-weight: 700; margin-bottom: 0.5rem; text-transform: uppercase; font-family: 'SF Mono', Menlo, monospace; }
.card h3 { font-size: 1.12rem; color: var(--text); margin-bottom: 0.6rem; font-weight: 600; line-height: 1.4; }
.card p { color: var(--text-2); font-size: 0.9rem; line-height: 1.65; margin-bottom: 1rem; }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.card-tag { font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); font-family: 'SF Mono', Menlo, monospace; }

.animate { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.animate.visible { opacity: 1; transform: translateY(0); }

/* 章节页 */
.chapter-hero { padding: 4rem 2rem 2.6rem; text-align: center; border-bottom: 1px solid var(--border); background: radial-gradient(ellipse 70% 80% at 50% 0%, rgba(96,165,250,0.08) 0%, transparent 70%); }
.chapter-hero .chapter-num { font-size: 0.78rem; color: var(--accent-text); letter-spacing: 0.2em; font-weight: 700; text-transform: uppercase; margin-bottom: 0.7rem; font-family: 'SF Mono', Menlo, monospace; }
.chapter-hero h1 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); color: var(--text); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.9rem; }
.chapter-hero p { color: var(--text-2); font-size: 1rem; max-width: 660px; margin: 0 auto; line-height: 1.7; }

.progress { height: 3px; background: var(--surface); overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 0.3s; }

.content { max-width: 860px; margin: 0 auto; padding: 3rem 2rem 4rem; }
.content h2 { font-size: 1.6rem; color: var(--text); margin: 2.6rem 0 1rem; font-weight: 700; letter-spacing: -0.01em; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.content h2:first-child { margin-top: 0; }
.content h3 { font-size: 1.2rem; color: var(--accent-text); margin: 1.9rem 0 0.8rem; font-weight: 600; }
.content h4 { font-size: 1rem; color: var(--text); margin: 1.4rem 0 0.5rem; font-weight: 600; }
.content p { color: var(--text-2); margin-bottom: 1rem; line-height: 1.85; }
.content strong { color: var(--text); font-weight: 600; }
.content em { color: var(--accent-text); font-style: normal; font-weight: 500; }
.content ul, .content ol { margin: 0.8rem 0 1.2rem 1.8rem; color: var(--text-2); }
.content li { margin-bottom: 0.45rem; line-height: 1.75; }
.content a { color: var(--accent-text); text-decoration: none; border-bottom: 1px dashed var(--accent-text); }
.content a:hover { color: var(--accent); border-bottom-style: solid; }
.content code { background: var(--surface-2); color: var(--accent-text); padding: 0.12em 0.45em; border-radius: 4px; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 0.88em; border: 1px solid var(--border); }
.content pre { background: #06080e; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.3rem; overflow-x: auto; margin: 1.1rem 0 1.5rem; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 0.86rem; line-height: 1.65; position: relative; }
.content pre code { background: transparent; color: var(--text); padding: 0; border: none; font-size: inherit; }

.kw { color: #ff7b72; }
.ty { color: #ffa198; }
.st { color: #a5d6ff; }
.cm { color: #8b949e; font-style: italic; }
.fn { color: #d2a8ff; }
.nu { color: #79c0ff; }
.at { color: #ffc170; }
.pr { color: #7FB3FF; font-weight: 600; }

.callout { padding: 1rem 1.2rem; border-radius: var(--radius); margin: 1.3rem 0; border-left: 3px solid var(--accent); background: var(--surface); }
.callout strong { display: block; margin-bottom: 0.3rem; color: var(--accent-text); font-size: 0.92rem; letter-spacing: 0.02em; }
.callout p { color: var(--text-2); font-size: 0.92rem; margin-bottom: 0.4rem; }
.callout p:last-child { margin-bottom: 0; }
.callout.info { border-color: var(--blue); }
.callout.info strong { color: var(--blue); }
.callout.tip { border-color: var(--green); }
.callout.tip strong { color: var(--green); }
.callout.warning { border-color: var(--yellow); }
.callout.warning strong { color: var(--yellow); }
.callout.danger { border-color: var(--red); }
.callout.danger strong { color: var(--red); }

.def-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 1.3rem 0; }
.def-list dt { color: var(--accent-text); font-weight: 600; font-size: 0.95rem; margin-bottom: 0.3rem; font-family: 'SF Mono', Menlo, monospace; }
.def-list dd { color: var(--text-2); margin-bottom: 0.9rem; padding-left: 0.6rem; border-left: 2px solid var(--border); font-size: 0.92rem; line-height: 1.7; }
.def-list dd:last-child { margin-bottom: 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.3rem 0; }
.two-col > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.two-col h4 { color: var(--accent-text); font-size: 0.92rem; margin-bottom: 0.5rem; margin-top: 0; }
.two-col p, .two-col li { font-size: 0.88rem; color: var(--text-2); }

table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: 0.9rem; }
th, td { padding: 0.6rem 0.9rem; border: 1px solid var(--border); text-align: left; color: var(--text-2); }
th { background: var(--surface-2); color: var(--text); font-weight: 600; }

.chapter-nav { max-width: 860px; margin: 0 auto; padding: 0 2rem 3rem; display: flex; justify-content: space-between; gap: 1rem; }
.chapter-nav a { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; text-decoration: none; color: var(--text-2); transition: all 0.25s; font-size: 0.9rem; }
.chapter-nav a:hover { border-color: var(--accent); color: var(--text); background: var(--card-hover); }
.chapter-nav .prev::before { content: '← '; color: var(--accent-text); }
.chapter-nav .next { text-align: right; }
.chapter-nav .next::after { content: ' →'; color: var(--accent-text); }
.chapter-nav .dir { display: block; font-size: 0.72rem; color: var(--text-3); letter-spacing: 0.1em; margin-bottom: 0.2rem; text-transform: uppercase; }

.site-footer { text-align: center; padding: 2.4rem 2rem; border-top: 1px solid var(--border); color: var(--text-3); font-size: 0.85rem; background: var(--surface); }
.site-footer a { color: var(--accent-text); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 768px) {
  .hero { padding: 4rem 1.2rem 3rem; }
  .hero-stats { gap: 1.6rem; }
  .container { padding: 2rem 1.2rem; }
  .content { padding: 2rem 1.2rem 3rem; }
  .two-col { grid-template-columns: 1fr; }
  .chapter-nav { padding: 0 1.2rem 2rem; flex-direction: column; }
  .chapter-nav .next { text-align: left; }
}
