/* Software Engineering English — terminal dark + code green */
:root {
  --bg: #0d1117;
  --bg-2: #161b22;
  --bg-3: #1f2733;
  --surface: #161b22;
  --surface-2: #1c232e;
  --line: #21262d;
  --line-2: #30363d;
  --ink: #e6edf3;
  --ink-soft: #c9d1d9;
  --muted: #8b949e;
  --muted-2: #6e7681;
  --green: #3fb950;
  --green-dim: #2ea043;
  --cyan: #58a6ff;
  --cyan-dim: #1f6feb;
  --magenta: #d2a8ff;
  --orange: #f78166;
  --yellow: #d29922;
  --red: #f85149;
  --code-bg: #010409;
  --code-text: #e6edf3;
  --mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', Consolas, 'Courier New', monospace;
  --display: 'Songti SC', 'STSong', 'Noto Serif CJK SC', 'Iowan Old Style', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
  --radius: 6px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink-soft);
  background:
    radial-gradient(ellipse at 80% -10%, rgba(63, 185, 80, .08), transparent 50%),
    radial-gradient(ellipse at 0% 110%, rgba(88, 166, 255, .06), transparent 50%),
    linear-gradient(180deg, #0a0e14, var(--bg) 320px);
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 54px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(13, 17, 23, .85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.nav-back { color: var(--cyan); text-decoration: none; font-size: .88rem; font-weight: 700; font-family: var(--mono); }
.nav-back::before { content: '‹ '; color: var(--green); }
.nav-title { flex: 1; min-width: 0; color: var(--ink); font-size: .92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { color: var(--bg); background: var(--green); border-radius: 4px; padding: 3px 10px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; font-family: var(--mono); }

/* hero */
.hero {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(13,17,23,.6), rgba(13,17,23,.96)),
    repeating-linear-gradient(0deg, rgba(63,185,80,.04) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(88,166,255,.04) 0 1px, transparent 1px 32px),
    var(--bg);
  padding: 78px 24px 60px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(63,185,80,.12), transparent 40%);
  pointer-events: none;
}
.hero-grid { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 36px; align-items: center; position: relative; z-index: 1; }
.hero-eyebrow, .section-label, .ch-num, .nav-dir {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .14em;
}
.hero-eyebrow { color: var(--green); font-size: .72rem; margin-bottom: 14px; }
.hero-eyebrow::before { content: '> '; color: var(--cyan); }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.35rem, 6vw, 4.4rem);
  line-height: 1.06;
  margin: 0 0 18px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0;
}
.hero-sub { max-width: 620px; margin: 0 0 24px; color: var(--muted); font-size: 1rem; line-height: 1.85; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: .76rem;
  color: var(--ink-soft);
  font-family: var(--mono);
}
.chip::before { content: '#'; color: var(--green); margin-right: 3px; }

/* terminal mock board */
.terminal-board {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(0,0,0,.5), 0 0 0 1px rgba(63,185,80,.08);
  overflow: hidden;
  font-family: var(--mono);
  font-size: .82rem;
}
.term-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
}
.term-head .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.term-head .dot.r { background: #ff5f57; }
.term-head .dot.y { background: #febc2e; }
.term-head .dot.g { background: #28c840; }
.term-head .title { margin-left: auto; color: var(--muted); font-size: .72rem; }
.term-body { padding: 16px 14px; color: var(--ink-soft); line-height: 1.85; }
.term-line { display: block; }
.term-line .prompt { color: var(--green); }
.term-line .cmd { color: var(--cyan); }
.term-line .arg { color: var(--magenta); }
.term-line .out { color: var(--muted); }
.term-line .ok { color: var(--green); }
.term-line .err { color: var(--red); }
.term-line .cursor { color: var(--green); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* container */
.container, .content { width: 100%; max-width: 920px; margin: 0 auto; padding: 38px 24px 84px; }
.content { max-width: 820px; }
.content > * { max-width: 100%; }
.section-label { color: var(--muted); font-size: .68rem; font-weight: 800; margin: 32px 0 10px 2px; }
.section-label::before { content: '// '; color: var(--green); }

/* cards */
.card, .feature, .chapter-nav a {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 12px 30px rgba(0,0,0,.25);
}
.card { padding: 22px; margin-bottom: 16px; }
.intro-card p:last-child, .prose p:last-child { margin-bottom: 0; }
p { color: var(--ink-soft); margin: 0 0 15px; font-size: .95rem; }
.content p, .content li, .chapter-hero p { overflow-wrap: anywhere; word-break: break-word; }
.prose h2 { margin: 0 0 12px; font-size: 1.18rem; color: var(--green); }
.prose ol { margin-bottom: 0; }
strong { color: var(--ink); }
em { color: var(--cyan); font-style: normal; }

/* feature grid */
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.feature { padding: 18px; transition: transform .16s, border-color .16s; }
.feature:hover { transform: translateY(-2px); border-color: var(--green); }
.feature span { font-family: var(--mono); color: var(--green); font-weight: 800; font-size: .72rem; }
.feature h3 { margin: 7px 0 6px; font-size: 1rem; color: var(--ink); }
.feature p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.65; }

/* list cards */
.list-card { padding: 0; overflow: hidden; }
.card-list { list-style: none; margin: 0; padding: 0; }
.card-list li { border-bottom: 1px solid var(--line); }
.card-list li:last-child { border-bottom: 0; }
.card-list a {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 15px 16px;
  color: inherit;
  text-decoration: none;
  transition: background .16s;
}
.card-list a:hover { background: var(--bg-3); }
.list-num {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--bg-3);
  border: 1px solid var(--green);
  color: var(--green);
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 800;
}
.list-content { flex: 1; min-width: 0; }
.list-title { color: var(--ink); font-weight: 800; font-size: .96rem; margin-bottom: 2px; }
.list-desc { color: var(--muted); font-size: .8rem; line-height: 1.55; font-family: var(--mono); }
.list-chevron { color: var(--muted-2); font-size: 1.2rem; align-self: center; }
.card-list a:hover .list-chevron { color: var(--green); }

/* chapter hero */
.chapter-hero {
  background:
    radial-gradient(circle at 50% -20%, rgba(63,185,80,.18), transparent 60%),
    linear-gradient(180deg, #0a0e14, #0d1117 70%);
  color: var(--ink);
  text-align: center;
  padding: 56px 24px 48px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.chapter-hero .ch-num { color: var(--green); font-size: .68rem; margin-bottom: 10px; }
.chapter-hero .ch-num::before { content: '$ '; color: var(--cyan); }
.chapter-hero h1 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.14;
  margin: 0 auto 12px;
  letter-spacing: 0;
  max-width: 780px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.chapter-hero h1 br { display: none; }
.chapter-hero p { color: var(--muted); max-width: 620px; margin: 0 auto; overflow-wrap: anywhere; }

/* progress */
.progress { height: 4px; background: var(--line); border-radius: 99px; margin-bottom: 36px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); border-radius: inherit; box-shadow: 0 0 8px rgba(63,185,80,.55); }

/* content */
.content h2 {
  font-family: var(--display);
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1.28;
  margin: 44px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
  letter-spacing: 0;
}
.content h2::before { content: '## '; color: var(--green); font-family: var(--mono); }
.content h2:first-of-type { margin-top: 0; }
.content h3 { color: var(--cyan); font-size: 1.08rem; margin: 28px 0 10px; }
.content h3::before { content: '### '; color: var(--muted); font-family: var(--mono); font-size: .9em; }
.content h4 {
  color: var(--green);
  font-size: .76rem;
  margin: 22px 0 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-family: var(--mono);
}
.content ul, .content ol { color: var(--ink-soft); padding-left: 24px; margin: 10px 0 16px; font-size: .93rem; }
.content li { margin: 4px 0; }
.content ul li::marker { color: var(--green); }
.content ol li::marker { color: var(--cyan); font-family: var(--mono); }
.content blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--cyan);
  background: rgba(88,166,255,.06);
  color: var(--ink-soft);
  border-radius: 0 6px 6px 0;
  font-size: .92rem;
}

/* code */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: .86rem;
  line-height: 1.72;
  margin: 16px 0;
  border: 1px solid var(--line-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--mono);
}
pre.terminal { border-left: 3px solid var(--green); }
pre.diff { background: #0a0d12; border-left: 3px solid var(--cyan); }
pre.commit { background: #0c1420; border-left: 3px solid var(--magenta); }
pre.pr { background: #0d1117; border-left: 3px solid var(--orange); }
pre.email { background: #1a1410; color: #f0e8d8; border-left: 3px solid var(--yellow); }
code { font-family: var(--mono); }
p code, li code, td code, h3 code, h4 code {
  background: rgba(63,185,80,.1);
  color: var(--green);
  border: 1px solid rgba(63,185,80,.28);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: .86em;
}

/* table */
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 560px; }
th {
  background: var(--bg-3);
  color: var(--ink);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: left;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line-2);
  font-family: var(--mono);
}
td { color: var(--ink-soft); padding: 11px 13px; border-top: 1px solid var(--line); vertical-align: top; }
tr:first-child td { border-top: 0; }
td .level { display: inline-block; font-family: var(--mono); font-size: .68rem; padding: 2px 7px; border-radius: 99px; font-weight: 800; letter-spacing: .04em; }
td .lv-bad { background: rgba(248,81,73,.15); color: var(--red); border: 1px solid rgba(248,81,73,.3); }
td .lv-good { background: rgba(63,185,80,.14); color: var(--green); border: 1px solid rgba(63,185,80,.3); }
td .lv-ok { background: rgba(88,166,255,.12); color: var(--cyan); border: 1px solid rgba(88,166,255,.28); }

/* callouts */
.callout {
  margin: 18px 0;
  padding: 15px 16px;
  border-radius: var(--radius);
  background: rgba(88,166,255,.06);
  border-left: 3px solid var(--cyan);
  border: 1px solid rgba(88,166,255,.22);
  border-left-width: 3px;
}
.callout-mark {
  display: block;
  color: var(--cyan);
  font-size: .76rem;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: .08em;
  font-family: var(--mono);
  text-transform: uppercase;
}
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.callout.warn { background: rgba(210,153,34,.06); border-color: rgba(210,153,34,.28); border-left-color: var(--yellow); }
.callout.warn .callout-mark { color: var(--yellow); }
.callout.danger { background: rgba(248,81,73,.06); border-color: rgba(248,81,73,.28); border-left-color: var(--red); }
.callout.danger .callout-mark { color: var(--red); }
.callout.tip { background: rgba(63,185,80,.06); border-color: rgba(63,185,80,.26); border-left-color: var(--green); }
.callout.tip .callout-mark { color: var(--green); }
.callout.note { background: rgba(210,168,255,.06); border-color: rgba(210,168,255,.26); border-left-color: var(--magenta); }
.callout.note .callout-mark { color: var(--magenta); }

/* chapter nav */
.chapter-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); }
.chapter-nav a {
  display: flex;
  flex-direction: column;
  padding: 14px;
  text-decoration: none;
  color: inherit;
  min-height: 80px;
  justify-content: center;
  transition: border-color .16s, background .16s, transform .16s;
}
.chapter-nav a:hover { border-color: var(--green); background: var(--bg-3); transform: translateY(-1px); }
.next { text-align: right; }
.nav-dir { color: var(--muted); font-size: .66rem; font-weight: 800; }
.nav-title-text { color: var(--ink); font-weight: 700; font-size: .9rem; line-height: 1.45; }

.site-footer { border-top: 1px solid var(--line); background: rgba(13,17,23,.7); padding: 28px 24px; text-align: center; color: var(--muted); font-size: .82rem; font-family: var(--mono); }
.site-footer a { color: var(--cyan); text-decoration: none; font-weight: 700; }

/* responsive */
@media (max-width: 760px) {
  .nav { padding: 0 16px; gap: 10px; }
  .nav-badge { display: none; }
  .hero { padding: 56px 18px 42px; }
  .hero-grid { grid-template-columns: 1fr; }
  .terminal-board { font-size: .78rem; }
  .container, .content { padding-left: 18px; padding-right: 18px; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .chapter-nav { grid-template-columns: 1fr; }
  .next { text-align: left; }
  .chapter-hero h1 { font-size: 1.72rem; word-break: break-word; }
  .chapter-hero h1 br { display: block; }
}
@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
  .card-list a { padding: 14px; }
  .list-num { width: 32px; height: 32px; }
}
