:root {
  --paper: #f8f3e8;
  --paper-deep: #eee4d1;
  --surface: rgba(255, 253, 248, .92);
  --surface-solid: #fffdf8;
  --ink: #2d2418;
  --ink-soft: #62533f;
  --muted: #84745f;
  --brown: #5b4021;
  --brown-dark: #3d2a17;
  --gold: #c89428;
  --gold-dark: #946719;
  --gold-pale: #f3dfaa;
  --sage: #527360;
  --sage-pale: #e5eee6;
  --rust: #a64f32;
  --rust-pale: #f7e7df;
  --blue: #466b80;
  --line: rgba(105, 76, 39, .18);
  --line-strong: rgba(105, 76, 39, .32);
  --shadow: 0 24px 60px rgba(68, 47, 21, .09);
  --shadow-soft: 0 10px 28px rgba(68, 47, 21, .07);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", serif;
  color-scheme: light;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(236, 204, 130, .25), transparent 27rem),
    radial-gradient(circle at 94% 18%, rgba(215, 187, 119, .19), transparent 30rem),
    var(--paper);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button, select { color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

::selection { color: var(--brown-dark); background: var(--gold-pale); }
:focus-visible { outline: 3px solid rgba(200, 148, 40, .55); outline-offset: 3px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--brown-dark);
  color: #fff;
  transform: translateY(-160%);
  transition: transform .2s;
}
.skip-link:focus { transform: translateY(0); }

.page-atmosphere { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(2px); }
.orb-one { width: 420px; height: 420px; right: -170px; top: 130px; background: rgba(222, 181, 91, .13); }
.orb-two { width: 360px; height: 360px; left: -190px; top: 44%; background: rgba(120, 144, 115, .08); }
.grid-lines {
  position: absolute;
  inset: 0;
  opacity: .2;
  background-image: linear-gradient(rgba(111, 79, 39, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(111, 79, 39, .07) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 13px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 243, 232, .87);
  backdrop-filter: blur(20px) saturate(1.2);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--brown-dark); font-family: var(--serif); font-size: 20px; font-weight: 700; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  background: linear-gradient(145deg, #e4b944, #c89428);
  color: #fffdf7;
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 7px 18px rgba(148, 103, 25, .18);
}
.header-course { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 13px; }
.header-divider { width: 1px; height: 24px; background: var(--line-strong); }
.header-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.language-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 253, 248, .74); }
.language-switch button { min-height: 32px; padding: 4px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; }
.language-switch button[aria-pressed="true"] { background: var(--brown); color: #fffaf0; box-shadow: 0 3px 12px rgba(61, 42, 23, .18); }
.home-link { color: var(--brown); font-size: 13px; font-weight: 700; text-decoration: none; }
.home-link:hover { color: var(--gold-dark); }

.app-shell { width: min(1440px, 100%); margin: 0 auto; padding: clamp(26px, 5vw, 62px) clamp(16px, 4vw, 54px) 80px; }
.state-panel {
  display: grid;
  justify-items: center;
  max-width: 600px;
  margin: clamp(70px, 15vh, 160px) auto;
  padding: 48px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.state-panel h1 { margin: 0; font: 700 clamp(28px, 5vw, 42px)/1.25 var(--serif); }
.state-panel p { margin: 14px 0 0; color: var(--muted); }
.state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.state-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 20px; border-radius: 50%; background: var(--rust-pale); color: var(--rust); font: 700 27px/1 var(--serif); }
.loading-symbol { display: flex; gap: 7px; height: 26px; align-items: center; }
.loading-symbol span { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: loading-breathe 1.2s infinite ease-in-out; }
.loading-symbol span:nth-child(2) { animation-delay: .15s; }
.loading-symbol span:nth-child(3) { animation-delay: .3s; }

.course-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(26px, 6vw, 90px);
  min-height: 310px;
  padding: clamp(34px, 6vw, 76px);
  overflow: hidden;
  border: 1px solid rgba(103, 74, 37, .22);
  border-radius: 34px;
  background:
    linear-gradient(115deg, rgba(255, 253, 248, .95), rgba(248, 235, 205, .8)),
    var(--surface);
  box-shadow: var(--shadow);
}
.course-hero::after {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  right: -170px;
  bottom: -240px;
  border: 1px solid rgba(148, 103, 25, .21);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(148, 103, 25, .035), 0 0 0 76px rgba(148, 103, 25, .025);
}
.hero-copy { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 11px; color: var(--gold-dark); font-size: 10px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; }
.course-hero h1 { margin: 0; color: var(--brown-dark); font: 700 clamp(48px, 8vw, 82px)/.98 var(--serif); letter-spacing: -.04em; }
.hero-subtitle { max-width: 700px; margin: 22px 0 0; color: var(--ink-soft); font: 400 clamp(16px, 2vw, 20px)/1.75 var(--serif); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 26px; color: var(--muted); font-size: 12px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 4px rgba(82, 115, 96, .1); }
.progress-medallion { position: relative; z-index: 1; display: grid; place-items: center; width: clamp(150px, 17vw, 190px); aspect-ratio: 1; }
.progress-medallion svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track, .ring-value { fill: none; stroke-width: 6; }
.ring-track { stroke: rgba(148, 103, 25, .13); }
.ring-value { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 320.44; stroke-dashoffset: 320.44; transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.medallion-copy { display: grid; justify-items: center; }
.medallion-copy strong { color: var(--brown); font: 700 clamp(33px, 5vw, 48px)/1 var(--serif); }
.medallion-copy span { margin-top: 8px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }

.dashboard, .data-studio { margin-top: 30px; padding: clamp(24px, 4vw, 42px); border: 1px solid var(--line); border-radius: var(--radius-xl); background: rgba(255, 253, 248, .68); box-shadow: var(--shadow-soft); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; }
.section-heading h2, .sidebar-heading h2 { margin: 0; color: var(--brown-dark); font: 700 clamp(24px, 3.3vw, 34px)/1.2 var(--serif); }
.heading-note { max-width: 570px; margin: 0; color: var(--muted); font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-top: 24px; }
.metric-card { display: flex; flex-direction: column; min-height: 148px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-solid); }
.metric-primary { background: linear-gradient(145deg, var(--brown), var(--brown-dark)); color: #fff8e9; }
.metric-review { background: linear-gradient(145deg, #fff9ef, #f9e8cf); }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.metric-primary .metric-label { color: rgba(255, 248, 233, .68); }
.metric-card strong { margin-top: auto; font: 700 clamp(28px, 4vw, 40px)/1.1 var(--serif); }
.metric-note { margin-top: 5px; color: var(--muted); font-size: 11px; }
.metric-primary .metric-note { color: rgba(255, 248, 233, .6); }
.review-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; margin-top: 15px; padding: 16px 18px; border: 1px solid rgba(166, 79, 50, .18); border-radius: var(--radius-md); background: var(--rust-pale); }
.review-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #fff8f3; color: var(--rust); font-size: 21px; }
.review-banner strong { color: #79402c; }
.review-banner p { margin: 1px 0 0; color: #895e4d; font-size: 12px; }
.text-button { padding: 5px 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--rust); font-size: 12px; font-weight: 800; }
.admin-progress { margin-top: 18px; padding: 0 24px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 253, 248, .78); box-shadow: var(--shadow-soft); }
.admin-progress summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 19px 0; color: var(--brown); cursor: pointer; list-style: none; }
.admin-progress summary::-webkit-details-marker { display: none; }
.admin-progress summary span:first-child { display: grid; }
.admin-progress summary b { font-family: var(--serif); font-size: 17px; }
.admin-progress summary small { color: var(--muted); font-size: 10px; font-weight: 400; }
.admin-progress summary span:last-child { font-size: 22px; transition: transform .2s; }
.admin-progress[open] summary span:last-child { transform: rotate(45deg); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.admin-table th, .admin-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.admin-table th { color: var(--brown); background: #f1e7d5; }
.admin-meter { display: inline-block; width: 74px; height: 6px; margin-right: 7px; overflow: hidden; border-radius: 999px; background: #e6dccb; vertical-align: middle; }
.admin-meter i { display: block; height: 100%; background: var(--sage); }

.learning-layout { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); align-items: start; gap: 20px; margin-top: 30px; }
.course-sidebar { position: sticky; top: 93px; max-height: calc(100vh - 112px); padding: 24px 18px 18px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-xl); background: rgba(255, 253, 248, .86); box-shadow: var(--shadow-soft); }
.sidebar-heading { padding: 0 8px 14px; border-bottom: 1px solid var(--line); }
.sidebar-heading h2 { font-size: 25px; }
.section-nav { display: grid; gap: 6px; margin-top: 13px; }
.nav-section { position: relative; width: 100%; padding: 14px 34px 14px 44px; border: 1px solid transparent; border-radius: 13px; background: transparent; text-align: left; transition: background .18s, border-color .18s, transform .18s; }
.nav-section:hover { background: rgba(239, 226, 201, .48); }
.nav-section[aria-current="true"] { border-color: rgba(148, 103, 25, .2); background: #f5ead4; transform: translateX(2px); }
.nav-number { position: absolute; left: 13px; top: 15px; color: var(--gold-dark); font: 700 12px/1.5 var(--serif); }
.nav-title { display: block; color: var(--brown-dark); font-size: 13px; font-weight: 700; line-height: 1.4; }
.nav-status { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.nav-check { position: absolute; right: 12px; top: 17px; display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid var(--line-strong); border-radius: 50%; color: transparent; font-size: 10px; }
.nav-section.is-mastered .nav-check { border-color: var(--sage); background: var(--sage); color: #fff; }
.nav-section.is-started:not(.is-mastered) .nav-check { border-color: var(--gold); background: var(--gold-pale); color: var(--gold-dark); }
.sidebar-key { display: flex; flex-wrap: wrap; gap: 11px 15px; margin: 16px 8px 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.sidebar-key > span { display: inline-flex; align-items: center; gap: 6px; }
.key-dot { width: 8px; height: 8px; border-radius: 50%; }
.key-mastered { background: var(--sage); }
.key-started { background: var(--gold); }

.lesson-panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); }
.section-article { padding: clamp(24px, 4.5vw, 52px); }
.section-topline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.section-ordinal { display: inline-flex; align-items: center; gap: 9px; color: var(--gold-dark); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.section-ordinal::before { content: ""; width: 28px; height: 1px; background: var(--gold); }
.completion-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; }
.completion-pill.is-mastered { border-color: rgba(82, 115, 96, .25); background: var(--sage-pale); color: var(--sage); }
.completion-pill.is-started { border-color: rgba(200, 148, 40, .25); background: #f8eccd; color: var(--gold-dark); }
.section-title { max-width: 840px; margin: 20px 0 0; color: var(--brown-dark); font: 700 clamp(34px, 5vw, 54px)/1.11 var(--serif); letter-spacing: -.02em; }
.section-summary { max-width: 800px; margin: 17px 0 0; color: var(--ink-soft); font: 400 16px/1.8 var(--serif); }
.section-score-line { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 17px; color: var(--muted); font-size: 11px; }
.section-score-line strong { color: var(--brown); }

.objectives { margin-top: 32px; padding: 23px 26px; border: 1px solid rgba(200, 148, 40, .21); border-radius: var(--radius-lg); background: linear-gradient(135deg, #fffaf0, #f9efd9); }
.objectives h3, .content-block h3, .lab-card h3, .demo-panel h3, .quiz-panel h3 { margin: 0; color: var(--brown-dark); font: 700 21px/1.3 var(--serif); }
.objectives ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px 28px; margin: 17px 0 0; padding: 0; list-style: none; }
.objectives li { position: relative; padding-left: 22px; color: var(--ink-soft); font-size: 13px; }
.objectives li::before { content: "✓"; position: absolute; left: 0; color: var(--gold-dark); font-weight: 800; }

.lesson-stack { display: grid; gap: 18px; margin-top: 28px; }
.content-block { padding: 25px 26px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 253, 248, .78); }
.content-block p { margin: 12px 0 0; color: var(--ink-soft); }
.content-block ul, .content-block ol { margin: 13px 0 0; padding-left: 22px; color: var(--ink-soft); }
.content-block li + li { margin-top: 7px; }
.content-block code:not(.code-block code) { padding: 2px 5px; border-radius: 5px; background: #efe5d4; color: #754c1a; font-family: Consolas, "SFMono-Regular", monospace; font-size: .9em; }
.content-block.callout { border-color: rgba(70, 107, 128, .2); background: #edf3f4; }
.content-block.warning { border-color: rgba(166, 79, 50, .19); background: #fbefea; }
.content-block.tip { border-color: rgba(82, 115, 96, .22); background: #edf4ed; }
.lesson-kicker { display: block; margin-bottom: 8px; color: var(--gold-dark); font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.concept-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.concept-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fffdf8; }
.concept-card strong { display: block; color: var(--brown); font-family: var(--serif); font-size: 17px; }
.concept-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.lesson-table-wrap { margin-top: 16px; overflow-x: auto; }
.lesson-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.lesson-table th, .lesson-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.lesson-table th { color: var(--brown); background: rgba(239, 226, 201, .55); font-weight: 800; }

.labs-stack { display: grid; gap: 20px; margin-top: 32px; }
.subsection-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.subsection-heading h2 { margin: 0; color: var(--brown-dark); font: 700 28px/1.2 var(--serif); }
.subsection-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.lab-card { overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: #fffdf9; }
.lab-head { display: flex; justify-content: space-between; gap: 18px; padding: 22px 24px 18px; }
.lab-head p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.lab-type { flex: 0 0 auto; align-self: start; padding: 5px 9px; border-radius: 999px; background: #efe4cc; color: var(--gold-dark); font: 800 9px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.code-shell { background: #211a13; color: #f4ead5; }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 7px 12px 7px 20px; border-bottom: 1px solid rgba(255, 255, 255, .09); color: #bda988; font-size: 10px; }
.code-dots { display: inline-flex; gap: 5px; }
.code-dots i { width: 6px; height: 6px; border-radius: 50%; background: #735c3b; }
.copy-button { padding: 5px 9px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 7px; background: rgba(255, 255, 255, .05); color: #e9d9ba; font-size: 10px; }
.copy-button:hover { border-color: rgba(232, 195, 111, .5); background: rgba(232, 195, 111, .09); }
.code-block { margin: 0; padding: 22px; overflow: auto; font: 12px/1.75 Consolas, "SFMono-Regular", Menlo, monospace; tab-size: 2; }
.expected-output { padding: 17px 22px 19px; border-top: 1px solid var(--line); background: #f7f1e5; }
.expected-output strong { display: block; margin-bottom: 8px; color: var(--brown); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.expected-output pre { margin: 0; overflow: auto; color: var(--ink-soft); font: 11px/1.65 Consolas, monospace; white-space: pre-wrap; }

.demo-panel { margin-top: 32px; padding: clamp(22px, 4vw, 32px); border: 1px solid rgba(70, 107, 128, .2); border-radius: var(--radius-lg); background: linear-gradient(145deg, #f1f6f5, #e9f0ec); }
.demo-intro { margin: 9px 0 0; color: var(--ink-soft); font-size: 13px; }
.demo-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 21px; }
.demo-control { display: grid; gap: 7px; }
.demo-control span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.demo-control select, .demo-control input { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid rgba(70, 107, 128, .23); border-radius: 10px; background: rgba(255, 255, 255, .72); accent-color: var(--blue); }
.demo-control output { color: var(--blue); font-weight: 800; }
.demo-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; margin-top: 16px; }
.demo-result { padding: 16px; border: 1px solid rgba(70, 107, 128, .16); border-radius: 12px; background: rgba(255, 255, 255, .65); }
.demo-result span { display: block; color: var(--muted); font-size: 9px; letter-spacing: .07em; }
.demo-result strong { display: block; margin-top: 5px; color: #31586c; font: 700 24px/1.1 var(--serif); }
.demo-note { margin: 14px 0 0; color: var(--muted); font-size: 11px; }
.architecture-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 21px; }
.architecture-step { position: relative; min-height: 76px; padding: 13px 12px; border: 1px solid rgba(70, 107, 128, .2); border-radius: 12px; background: rgba(255, 255, 255, .62); color: var(--muted); font-size: 10px; font-weight: 800; line-height: 1.4; text-align: left; transition: border-color .18s, background .18s, transform .18s; }
.architecture-step:not(:last-child)::after { content: "→"; position: absolute; z-index: 2; right: -9px; top: 27px; color: #8ba1a7; }
.architecture-step.is-active { border-color: var(--blue); background: #e2edef; color: #31586c; transform: translateY(-2px); }
.architecture-step.is-complete { border-color: rgba(82, 115, 96, .3); background: var(--sage-pale); color: var(--sage); }
.architecture-detail { min-height: 105px; margin-top: 11px; padding: 18px 20px; border-left: 3px solid var(--blue); border-radius: 0 11px 11px 0; background: rgba(255, 255, 255, .63); }
.architecture-detail strong { color: #31586c; font: 700 18px/1.3 var(--serif); }
.architecture-detail p { margin: 7px 0 0; color: var(--ink-soft); font-size: 12px; }
.demo-play-controls, .checklist-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 13px; }
.demo-mini-chart { display: flex; align-items: end; gap: 8px; min-height: 230px; margin-top: 17px; padding: 30px 8px 0; border-bottom: 1px solid rgba(70, 107, 128, .22); }
.demo-bar { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-self: stretch; flex: 1 1 0; min-width: 35px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.demo-bar i { align-self: end; width: min(46px, 80%); height: var(--bar-height); min-height: 5px; border-radius: 7px 7px 0 0; background: linear-gradient(#6d8e91, #466b80); transition: height .35s ease; }
.demo-bar:hover i, .demo-bar:focus-visible i { background: linear-gradient(#d3aa4a, #a9771c); }
.demo-bar-value { margin-bottom: 6px; font-size: 8px; font-weight: 800; writing-mode: vertical-rl; transform: rotate(180deg); }
.demo-bar-label { max-width: 80px; padding-top: 7px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.demo-checklist { display: grid; gap: 8px; margin-top: 20px; }
.checklist-item { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid rgba(70, 107, 128, .17); border-radius: 11px; background: rgba(255, 255, 255, .64); color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.checklist-item:has(input:checked) { border-color: rgba(82, 115, 96, .3); background: var(--sage-pale); color: var(--sage); }
.checklist-item input { width: 17px; height: 17px; margin: 0; accent-color: var(--sage); }
.checklist-status { position: relative; min-width: 210px; padding-bottom: 9px; color: var(--blue); font-size: 11px; font-weight: 800; }
.checklist-status::before, .checklist-status::after { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; border-radius: 999px; }
.checklist-status::before { width: 100%; background: rgba(70, 107, 128, .14); }
.checklist-status::after { width: var(--checklist-progress, 0%); background: var(--blue); transition: width .3s; }

.read-action { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 13px; margin-top: 32px; padding: 17px 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #faf5e9; }
.read-action p { margin: 0; color: var(--muted); font-size: 11px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 9px 17px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; font-weight: 800; text-decoration: none; transition: transform .16s, box-shadow .16s, background .16s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--brown); color: #fffaf1; box-shadow: 0 7px 16px rgba(61, 42, 23, .15); }
.button-primary:hover { background: var(--brown-dark); }
.button-primary:disabled { cursor: wait; opacity: .56; transform: none; }
.button-quiet { border-color: var(--line-strong); background: #fffdf8; color: var(--brown); }
.button-complete { background: var(--sage); color: #fff; }

.quiz-panel { margin-top: 34px; padding: clamp(24px, 4vw, 34px); border: 1px solid rgba(200, 148, 40, .3); border-radius: var(--radius-lg); background: linear-gradient(140deg, #fffdf8, #f9eed7); }
.quiz-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.quiz-head p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.best-score { flex: 0 0 auto; padding: 8px 11px; border-radius: 10px; background: #f0dfb6; color: var(--gold-dark); font-size: 10px; font-weight: 800; }
.question-list { display: grid; gap: 14px; margin-top: 23px; }
.question-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255, 255, 255, .74); }
.question-card.is-correct { border-color: rgba(82, 115, 96, .35); background: #eff6ef; }
.question-card.is-wrong { border-color: rgba(166, 79, 50, .3); background: #fcf0eb; }
.question-number { margin: 0 0 7px; color: var(--gold-dark); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.question-prompt { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.question-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.option-label { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8; color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.option-label:hover { border-color: rgba(200, 148, 40, .48); }
.option-label:has(input:checked) { border-color: var(--gold); background: #fff5db; color: var(--brown); }
.option-label input { flex: 0 0 auto; margin: 3px 0 0; accent-color: var(--gold-dark); }
.fill-answer { width: 100%; max-width: 520px; min-height: 43px; margin-top: 14px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fffdf8; }
.question-feedback { margin: 13px 0 0; padding-top: 12px; border-top: 1px solid currentColor; color: var(--muted); font-size: 11px; }
.question-feedback strong { color: inherit; }
.is-correct .question-feedback { color: var(--sage); }
.is-wrong .question-feedback { color: var(--rust); }
.quiz-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 19px; }
.quiz-status { color: var(--muted); font-size: 11px; }
.quiz-result { margin-top: 17px; padding: 17px 20px; border: 1px solid rgba(82, 115, 96, .23); border-radius: var(--radius-md); background: var(--sage-pale); color: var(--sage); }
.quiz-result strong { font: 700 23px/1.2 var(--serif); }
.quiz-result p { margin: 4px 0 0; font-size: 11px; }
.lesson-pagination { display: flex; justify-content: space-between; gap: 10px; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line); }
.lesson-pagination button { max-width: 47%; }

.data-studio { margin-top: 30px; }
.studio-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 16px; margin-top: 24px; }
.studio-chart-panel, .studio-table-panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fffdf8; }
.studio-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.studio-controls label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.studio-controls select { width: 100%; min-height: 39px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fffdf8; font-size: 11px; }
.chart-summary { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 18px 0 12px; color: var(--muted); font-size: 11px; }
.chart-summary strong { color: var(--brown); }
.sales-chart { display: grid; gap: 9px; min-height: 215px; padding-top: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(74px, 115px) 1fr auto; gap: 9px; align-items: center; }
.bar-label { overflow: hidden; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 23px; border-radius: 6px; background: #eee6d7; overflow: hidden; }
.bar-fill { height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--gold), #dcba67); transform-origin: left; animation: bar-grow .5s ease both; }
.bar-value { min-width: 55px; color: var(--brown); font: 700 10px/1 var(--sans); text-align: right; }
.table-title-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.table-title-row h3 { margin: 0; color: var(--brown); font: 700 20px/1.2 var(--serif); }
.table-title-row span { color: var(--muted); font-size: 10px; }
.table-scroll { margin-top: 14px; overflow: auto; }
#dataset-table { width: 100%; border-collapse: collapse; font-size: 10px; }
#dataset-table th, #dataset-table td { max-width: 140px; padding: 9px 10px; overflow: hidden; border-bottom: 1px solid var(--line); text-align: left; text-overflow: ellipsis; white-space: nowrap; }
#dataset-table th { position: sticky; top: 0; background: #f1e7d5; color: var(--brown); font-weight: 800; }
.empty-note { padding: 30px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); color: var(--muted); text-align: center; }

.toast { position: fixed; z-index: 80; right: 22px; bottom: 22px; max-width: min(360px, calc(100vw - 44px)); padding: 12px 16px; border-radius: 11px; background: var(--brown-dark); color: #fff8e9; box-shadow: 0 12px 35px rgba(33, 24, 14, .28); font-size: 12px; animation: toast-in .25s ease both; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@keyframes loading-breathe { 0%, 70%, 100% { transform: scale(.65); opacity: .45; } 35% { transform: scale(1); opacity: 1; } }
@keyframes bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .learning-layout { grid-template-columns: 1fr; }
  .course-sidebar { position: static; max-height: none; }
  .section-nav { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
  .studio-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-header { min-height: 64px; gap: 10px; padding: 10px 15px; }
  .brand { font-size: 17px; }
  .brand-mark { width: 32px; height: 32px; }
  .header-course, .home-link { display: none; }
  .language-switch button { padding-inline: 10px; }
  .app-shell { padding: 22px 12px 54px; }
  .course-hero { grid-template-columns: 1fr; min-height: 0; padding: 31px 25px; }
  .course-hero h1 { font-size: clamp(44px, 16vw, 66px); }
  html[data-language="en"] .course-hero h1 { font-size: clamp(42px, 12vw, 52px); }
  .progress-medallion { width: 142px; justify-self: start; }
  .section-heading { display: block; }
  .heading-note { margin-top: 10px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 132px; padding: 18px; }
  .review-banner { grid-template-columns: auto 1fr; }
  .review-banner .text-button { grid-column: 2; justify-self: start; }
  .section-nav { display: flex; margin-inline: -3px; padding: 3px; overflow-x: auto; scroll-snap-type: x proximity; }
  .nav-section { flex: 0 0 220px; scroll-snap-align: start; }
  .sidebar-key { display: none; }
  .section-article { padding: 27px 19px; }
  .section-title { font-size: 36px; }
  .objectives ul, .concept-grid { grid-template-columns: 1fr; }
  .subsection-heading { display: block; }
  .subsection-heading p { margin-top: 5px; }
  .question-options { grid-template-columns: 1fr; }
  .studio-controls { grid-template-columns: 1fr; }
  .studio-chart-panel, .studio-table-panel { padding: 17px; }
  .architecture-flow { grid-template-columns: 1fr 1fr; }
  .architecture-step:nth-child(2)::after { display: none; }
  .demo-mini-chart { gap: 4px; overflow-x: auto; }
  .demo-bar { flex-basis: 55px; min-width: 48px; }
  .bar-row { grid-template-columns: 76px minmax(54px, 1fr) minmax(54px, auto); }
  .bar-value { min-width: 0; font-size: 9px; }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 112px; }
  .metric-card strong { margin-top: 18px; }
  .course-sidebar, .lesson-panel, .dashboard, .data-studio { border-radius: 20px; }
  .lab-head, .quiz-head { display: block; }
  .lab-type, .best-score { display: inline-block; margin-top: 10px; }
  .read-action { align-items: stretch; }
  .read-action .button { width: 100%; }
  .lesson-pagination { flex-direction: column; }
  .lesson-pagination button { max-width: none; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media (prefers-contrast: more) {
  :root { --line: rgba(74, 48, 18, .45); --line-strong: rgba(74, 48, 18, .65); --muted: #65533d; }
}
