:root {
  --ink: #172033;
  --muted: #667085;
  --soft: #f4f6fa;
  --line: #e4e8f0;
  --blue: #4c6ee8;
  --blue-dark: #3558cb;
  --navy: #121d33;
  --navy-2: #182640;
  --white: #fff;
  --shadow: 0 12px 34px rgba(28, 42, 72, .08);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--soft);
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--soft); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: 250px; padding: 25px 18px 18px;
  display: flex; flex-direction: column; color: #d6dced; background: linear-gradient(180deg, var(--navy), #10192c);
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 27px; color: white; }
.brand-glyph { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; font-weight: 800; background: linear-gradient(135deg, #7088ff, #36a6a0); box-shadow: 0 8px 22px rgba(62, 120, 219, .35); }
.side-brand b, .side-brand small, .side-foot b, .side-foot small { display: block; }
.side-brand b { font-size: 16px; letter-spacing: .04em; }
.side-brand small { margin-top: 3px; color: #8996b1; font-size: 11px; letter-spacing: .08em; }
.side-nav { display: grid; gap: 7px; }
.side-nav a { padding: 11px 13px; border-radius: 9px; display: flex; align-items: center; gap: 12px; color: #aeb8ce; font-size: 14px; transition: .18s ease; }
.side-nav a span { width: 20px; text-align: center; color: #7f8ea9; font-size: 17px; }
.side-nav a:hover { color: white; background: rgba(255,255,255,.06); }
.side-nav a.active { color: white; background: linear-gradient(90deg, rgba(76,110,232,.7), rgba(76,110,232,.32)); box-shadow: inset 3px 0 #8ea3ff; }
.side-nav a.active span { color: white; }
.nav-label { margin: 29px 13px 9px; color: #68758e; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.muted-nav a { padding-block: 9px; }
.side-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.09); display: flex; align-items: center; gap: 8px; }
.side-foot > a { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0; }
.side-foot b { max-width: 92px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: #edf1fb; }
.side-foot small { margin-top: 2px; font-size: 9px; color: #6f7d97; }
.avatar { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #273957; color: #c9d3e8; font-weight: 700; }
.side-foot form { margin: 0; }
.side-foot button { border: 0; background: transparent; color: #6f7d97; font-size: 11px; padding: 6px 0; }
.side-foot button:hover { color: white; }

.app-main { margin-left: 250px; min-height: 100vh; }
.content-shell { width: min(1280px, calc(100% - 64px)); margin: 0 auto; }
.overview-content { padding: 46px 0 70px; }
.flash-stack { position: fixed; right: 24px; top: 20px; z-index: 50; width: min(420px, calc(100vw - 48px)); }
.notice { margin-bottom: 8px; padding: 12px 15px; border: 1px solid #badbc8; border-radius: 9px; background: #ecf9f1; color: #276441; box-shadow: var(--shadow); }
.notice.error { border-color: #f1c4c2; background: #fff0ef; color: #9f3732; }

.overview-hero { min-height: 330px; padding: 56px clamp(48px, 7vw, 105px); position: relative; overflow: hidden; display: flex; align-items: center; color: white; background: linear-gradient(118deg, #15223f 0%, #294c8f 58%, #287f83 100%); }
.overview-hero::before { content: ""; position: absolute; width: 620px; height: 620px; right: -265px; top: -290px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.018); }
.hero-copy { position: relative; z-index: 2; max-width: 720px; }
.eyebrow { color: #72809a; font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow.light { color: #9db2de; }
.overview-hero h1 { margin: 13px 0 15px; max-width: 690px; font-size: clamp(32px, 4.1vw, 54px); line-height: 1.16; letter-spacing: -.04em; }
.overview-hero p { max-width: 620px; margin: 0; color: #c8d5eb; font-size: 16px; line-height: 1.8; }
.hero-actions, .header-actions, .detail-actions, .form-actions, .card-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-actions { margin-top: 28px; }
.button, .primary, .secondary { min-height: 39px; padding: 9px 16px; border: 1px solid transparent; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 650; font-size: 13px; transition: .18s ease; }
.button:hover, .primary:hover, .secondary:hover { transform: translateY(-1px); }
.button.primary, .primary { color: white; background: var(--blue); border-color: var(--blue); }
.button.primary:hover, .primary:hover { background: var(--blue-dark); }
.button.secondary, .secondary { color: #40506e; background: white; border-color: #d8deea; }
.button.ghost { color: var(--muted); border-color: transparent; background: transparent; }
.button.small, .primary.small, .secondary.small { min-height: 33px; padding: 7px 12px; font-size: 12px; }
.hero-primary { color: #183059; background: white; }
.hero-secondary { color: white; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.hero-orbit { position: absolute; right: 8%; width: 230px; height: 230px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; display: grid; place-items: center; }
.hero-orbit::before, .hero-orbit::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; transform: rotate(35deg); }
.hero-orbit::before { width: 295px; height: 95px; }
.hero-orbit::after { width: 95px; height: 295px; }
.hero-orbit span { width: 88px; height: 88px; display: grid; place-items: center; border-radius: 50%; color: white; font-size: 34px; font-weight: 800; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.23); box-shadow: 0 0 60px rgba(102,201,204,.24); }
.hero-orbit i { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #89e1dc; box-shadow: 0 0 15px #89e1dc; }
.hero-orbit i:first-child { top: 30px; right: 28px; }.hero-orbit i:nth-child(2) { bottom: 28px; left: 36px; background: #a8b8ff; }

.section-heading, .panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-heading { margin-bottom: 22px; }
.section-heading h2, .panel-heading h2 { margin: 6px 0 0; letter-spacing: -.02em; }
.section-heading h2 { font-size: 24px; }.panel-heading h2 { font-size: 18px; }
.section-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.text-link { color: #4f68bb; font-size: 13px; font-weight: 650; white-space: nowrap; }
.domain-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.domain-card { position: relative; overflow: hidden; min-height: 250px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 6px 22px rgba(35,52,86,.045); transition: .2s ease; }
.domain-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--accent); }
.domain-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 35%, white); box-shadow: var(--shadow); }
.domain-top { display: flex; justify-content: space-between; align-items: center; }
.domain-icon, .large-node-icon { display: grid; place-items: center; color: white; background: var(--accent); }
.domain-icon { width: 38px; height: 38px; border-radius: 11px; font-weight: 800; }
.domain-progress { color: var(--accent); font-size: 12px; font-weight: 800; }
.domain-card h3 { margin: 21px 0 9px; font-size: 19px; }
.domain-card p { min-height: 57px; margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.domain-meta { margin-top: 17px; display: flex; justify-content: space-between; color: #7a8498; font-size: 10px; }
.progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: #edf0f5; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent, var(--blue)); }
.domain-card .progress-track { margin-top: 10px; }
.overview-split { margin-top: 42px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 6px 22px rgba(35,52,86,.035); }
.principle-panel, .topic-panel, .domain-maturity, .type-distribution, .review-panel, .health-panel { padding: 23px; }
.compound-chain { margin-top: 28px; display: grid; grid-template-columns: repeat(9, auto); align-items: center; justify-content: space-between; }
.compound-chain div { min-width: 90px; text-align: center; }
.compound-chain span, .compound-chain b, .compound-chain small { display: block; }
.compound-chain span { width: 32px; height: 32px; margin: 0 auto 9px; display: grid; place-items: center; border-radius: 50%; color: #5069c2; background: #eef1ff; font-size: 10px; font-weight: 800; }
.compound-chain b { font-size: 13px; }.compound-chain small { margin-top: 5px; color: #8a93a5; font-size: 9.5px; }.compound-chain i { color: #bcc3d2; font-style: normal; }
.topic-row { padding: 12px 0; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #edf0f4; }
.topic-row:last-child { border-bottom: 0; }.topic-row > span { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, white); font-size: 11px; font-weight: 800; }
.topic-row div { min-width: 0; flex: 1; }.topic-row b, .topic-row small { display: block; }.topic-row b { font-size: 12px; }.topic-row small { margin-top: 3px; overflow: hidden; color: #8a93a5; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }.topic-row em { color: #a0a9b9; font-style: normal; }
.compact-heading { margin-top: 42px; }.recent-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.recent-card { min-height: 120px; padding: 17px; display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.recent-card > span { flex: 0 0 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; font-size: 11px; font-weight: 800; }
.recent-card div { min-width: 0; }.recent-card small, .recent-card b { display: block; }.recent-card small { color: #8993a6; font-size: 9px; }.recent-card b { margin-top: 7px; font-size: 13px; }.recent-card p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.compact-header { min-height: 145px; padding: 32px clamp(32px, 5vw, 68px); display: flex; align-items: center; justify-content: space-between; gap: 30px; border-bottom: 1px solid #dfe4ec; background: white; }
.compact-header h1 { margin: 7px 0 5px; font-size: 30px; letter-spacing: -.035em; }
.compact-header p { margin: 0; color: var(--muted); font-size: 13px; }
.header-note { max-width: 280px; padding: 12px 14px; border-left: 3px solid #7a91e9; color: #69758a; background: #f5f7fd; font-size: 11px; line-height: 1.6; }
.tree-shell, .dashboard-shell { padding: 25px 0 55px; }
.filter-bar { margin-bottom: 15px; padding: 11px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.filter-bar select, .filter-bar input { border: 0; outline: 0; color: #49556b; background: transparent; }
.filter-bar select { height: 36px; padding: 0 29px 0 10px; border-left: 1px solid var(--line); font-size: 12px; }
.search-field { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; }
.search-field span { color: #7e899c; font-size: 22px; }.search-field input { width: 100%; }
.filter-count { margin-left: auto; padding-right: 8px; color: #8992a5; font-size: 11px; white-space: nowrap; }
.tree-workspace { min-height: 660px; display: grid; grid-template-columns: minmax(320px, 38%) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: white; box-shadow: var(--shadow); }
.tree-panel { min-width: 0; border-right: 1px solid var(--line); background: #fbfcfe; }
.tree-panel-title { height: 67px; padding: 14px 17px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.tree-panel-title b, .tree-panel-title small { display: block; }.tree-panel-title b { font-size: 13px; }.tree-panel-title small { margin-top: 4px; color: #8c96a8; font-size: 9.5px; }.tree-panel-title > a { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid #d8deea; border-radius: 8px; color: #63718b; background: white; }
.tree-list, .tree-list ul { margin: 0; padding: 0; list-style: none; }.tree-list { padding: 11px 9px 18px; }.tree-list ul { padding: 0; }
.tree-item { min-height: 44px; margin-bottom: 2px; padding: 6px 9px 6px calc(8px + var(--depth) * 17px); display: flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; }
.tree-item:hover { background: #f1f4f9; }.tree-item.selected { border-color: color-mix(in srgb, var(--accent) 28%, white); background: color-mix(in srgb, var(--accent) 9%, white); }
.tree-toggle { width: 12px; color: #a3adbc; text-align: center; font-size: 11px; }
.node-icon { --accent: #7887a4; flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, white); font-size: 10px; font-weight: 800; }
.tree-copy { flex: 1; min-width: 0; }.tree-copy b, .tree-copy small { display: block; }.tree-copy b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.tree-copy small { margin-top: 2px; color: #8993a5; font-size: 8.5px; }.tree-item em { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 99px; color: #8c96aa; background: white; font-size: 8px; font-style: normal; }
.result-list { padding: 10px; }.result-item { padding: 9px; display: flex; gap: 9px; align-items: center; border-radius: 8px; }.result-item:hover, .result-item.selected { background: #eef2fb; }.result-item b, .result-item small { display: block; }.result-item b { font-size: 12px; }.result-item small { margin-top: 3px; color: #8791a5; font-size: 9px; }
.detail-panel { position: relative; padding: 30px clamp(25px, 4vw, 48px) 38px; overflow: hidden; }
.detail-accent { position: absolute; inset: 0 auto 0 0; width: 4px; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.detail-title { display: flex; align-items: center; gap: 13px; }.large-node-icon { flex: 0 0 45px; height: 45px; border-radius: 12px; font-size: 15px; font-weight: 800; }
.detail-head h2 { margin: 6px 0 0; font-size: 24px; letter-spacing: -.025em; }.detail-summary { margin: 24px 0 12px; color: #4f5b70; font-size: 14px; line-height: 1.75; }
.badge-row { display: flex; gap: 7px; flex-wrap: wrap; }.badge-row span, .node-badges span { padding: 5px 9px; border: 1px solid #e1e5ed; border-radius: 99px; color: #6d788c; background: #fafbfd; font-size: 9px; }
.detail-progress { margin: 24px 0 28px; padding: 17px; border-radius: 10px; background: #f7f8fb; }.detail-progress > div:first-child { margin-bottom: 10px; display: flex; justify-content: space-between; font-size: 11px; }.detail-progress strong { color: #4d5d7a; }.detail-progress small { margin-top: 8px; display: block; color: #9099a9; font-size: 9px; }
.detail-section { margin-top: 26px; }.detail-section h3 { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 13px; }.question-list { margin: 0; padding-left: 21px; color: #4f5c71; font-size: 12px; line-height: 1.9; }
.markdown-preview { margin: 0; padding: 18px; white-space: pre-wrap; border: 1px solid #e9ecf2; border-radius: 9px; color: #445168; background: #fbfcfe; font: 12px/1.85 inherit; }
.child-chips { display: flex; flex-wrap: wrap; gap: 7px; }.child-chips a { padding: 7px 10px; border-radius: 7px; color: #53627c; background: #f1f4f9; font-size: 10px; }
.detail-full-link { margin-top: 28px; display: inline-block; color: #526bc3; font-size: 11px; font-weight: 700; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.metric-grid article { min-height: 125px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: white; }.metric-grid span, .metric-grid b, .metric-grid small { display: block; }.metric-grid span { color: #7d8799; font-size: 11px; }.metric-grid b { margin: 8px 0 5px; font-size: 31px; letter-spacing: -.04em; }.metric-grid small { color: #a0a8b6; font-size: 9px; }.metric-grid .metric-accent { color: white; border-color: transparent; background: linear-gradient(135deg, #405fae, #317c87); }.metric-grid .metric-accent span, .metric-grid .metric-accent small { color: #d0dcef; }
.dashboard-grid { margin-top: 17px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 17px; align-items: start; }
.maturity-row { padding: 16px 0; display: grid; grid-template-columns: 9px minmax(130px, .9fr) 1.4fr 40px; align-items: center; gap: 12px; border-bottom: 1px solid #eef0f4; }.maturity-row:last-child { border-bottom: 0; }.dot { width: 8px; height: 8px; border-radius: 50%; }.maturity-row b, .maturity-row small { display: block; }.maturity-row b { font-size: 12px; }.maturity-row small { margin-top: 3px; color: #929bab; font-size: 8.5px; }.maturity-row strong { color: #657188; font-size: 11px; text-align: right; }
.type-bars { margin-top: 16px; }.type-bars > div { margin-bottom: 11px; display: grid; grid-template-columns: 75px 1fr 20px; align-items: center; gap: 9px; font-size: 9.5px; }.type-bars b { color: #6d788b; text-align: right; }.type-bars .progress-track { height: 6px; }.type-bars .progress-track i { background: #7086d8; }
.review-row { padding: 12px 0; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #edf0f4; }.review-row div { min-width: 0; flex: 1; }.review-row b, .review-row small { display: block; }.review-row b { font-size: 11px; }.review-row small { margin-top: 3px; color: #9099a9; font-size: 8.5px; }.review-row strong { color: #69768b; font-size: 10px; }
.health-row { padding: 15px 0; display: grid; grid-template-columns: 10px 1fr 35px; align-items: center; border-bottom: 1px solid #eef0f4; }.health-row b { font-size: 11px; }.health-row strong { text-align: right; font-size: 13px; }.health-dot { width: 7px; height: 7px; border-radius: 50%; }.health-dot.warn { background: #e6a45c; }.health-dot.good { background: #4eb487; }.health-note { margin: 16px 0 0; padding: 11px; border-radius: 7px; color: #788398; background: #f6f7fa; font-size: 9px; line-height: 1.6; }

/* Shared supporting pages */
.shell, .page-heading, .node-layout, .breadcrumbs, .create-panel, .course-grid, .stats, .empty, .knowledge-results { width: min(1120px, calc(100% - 64px)); margin-left: auto; margin-right: auto; }
.page-heading { padding: 40px 0 22px; }.page-heading h1, .node-hero h1 { margin: 7px 0; }.page-heading p { color: var(--muted); }.page-heading.compact { padding-bottom: 10px; }
.create-panel, .node-content, .node-aside section, .course-card, .login-card, .empty, .knowledge-results { border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 6px 22px rgba(35,52,86,.04); }
.create-panel { margin-bottom: 50px; padding: 25px; }.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }.form-grid label { display: grid; gap: 7px; color: #515e73; font-size: 12px; font-weight: 650; }.form-grid .full { grid-column: 1/-1; }.form-grid input, .form-grid select, .form-grid textarea, .login-card input, .create-panel input, .create-panel textarea, .create-panel select { width: 100%; padding: 10px 11px; border: 1px solid #dce1ea; border-radius: 8px; outline: 0; color: var(--ink); background: white; }.form-grid textarea { min-height: 84px; resize: vertical; }.form-grid .body-editor { min-height: 260px; }.form-actions { margin-top: 20px; }
.course-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 15px; }.course-card { padding: 20px; }.course-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--blue); }.course-meta { margin-top: 14px; color: #8791a3; font-size: 10px; }.course-card h3 { margin: 6px 0; }.course-card p { color: var(--muted); font-size: 12px; line-height: 1.6; }.card-actions { margin-top: 16px; }
.empty { padding: 34px; text-align: center; }.small-empty { width: auto; margin: 0; box-shadow: none; }.empty p { color: var(--muted); }
.breadcrumbs { padding-top: 28px; display: flex; gap: 8px; color: #6f7d95; font-size: 11px; }.node-hero { width: min(1120px, calc(100% - 64px)); margin: 18px auto; padding: 27px; display: flex; justify-content: space-between; gap: 25px; border-radius: 14px; color: white; background: linear-gradient(120deg,#172445,#326799); }.node-hero p { color: #c9d6e9; }.node-badges { display: flex; gap: 7px; flex-wrap: wrap; }.node-badges span { color: #dce6f5; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.07); }.node-layout { padding-bottom: 50px; display: grid; grid-template-columns: 1.5fr .7fr; gap: 16px; }.node-content, .node-aside section { padding: 22px; }.node-content pre { white-space: pre-wrap; font: 13px/1.9 inherit; }.node-aside { display: grid; gap: 14px; align-content: start; }.aside-link, .version-row { padding: 10px 0; display: block; border-bottom: 1px solid #eef0f4; }.aside-link b, .aside-link span, .version-row b, .version-row span, .version-row small { display: block; }.aside-link span, .version-row small { margin-top: 3px; color: #8b95a8; font-size: 9px; }.danger-button { padding: 8px 12px; border: 1px solid #edc3c0; border-radius: 7px; color: #a7443d; background: #fff3f2; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: radial-gradient(circle at 75% 15%, #2e7180, transparent 35%), linear-gradient(135deg, #101a30, #1e3764); }.login-card { width: min(420px, 100%); padding: 38px; }.login-card h1 { margin: 9px 0; }.login-card p { color: var(--muted); line-height: 1.7; }.login-card form { margin-top: 24px; display: grid; gap: 15px; }.login-card label { display: grid; gap: 7px; color: #59657a; font-size: 12px; font-weight: 650; }.wide { width: 100%; }

@media (max-width: 1100px) {
  .domain-grid, .recent-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-orbit { right: -55px; opacity: .55; }
  .overview-split, .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: static; width: 100%; height: auto; padding: 13px 16px; flex-direction: row; align-items: center; gap: 15px; overflow-x: auto; }
  .side-brand { padding: 0; min-width: 180px; }.side-brand small, .nav-label, .muted-nav, .side-foot { display: none; }.side-nav { display: flex; min-width: max-content; }.side-nav a { padding: 8px 11px; }
  .app-main { margin-left: 0; }.content-shell { width: min(100% - 30px, 720px); }
  .overview-hero { min-height: 300px; padding: 43px 28px; }.hero-orbit { display: none; }
  .compact-header { padding: 25px 22px; align-items: flex-start; }.compact-header p { max-width: 480px; }
  .filter-bar { flex-wrap: wrap; }.search-field { flex-basis: 100%; }.filter-count { display: none; }.filter-bar select { border-left: 0; border: 1px solid var(--line); border-radius: 7px; }
  .tree-workspace { grid-template-columns: 1fr; }.tree-panel { max-height: 420px; overflow: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }.node-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .domain-grid, .recent-grid, .metric-grid, .course-grid, .form-grid { grid-template-columns: 1fr; }
  .overview-hero h1 { font-size: 34px; }.overview-content { padding-top: 32px; }
  .compound-chain { grid-template-columns: 1fr; gap: 11px; }.compound-chain i { transform: rotate(90deg); }
  .compact-header, .detail-head { display: block; }.header-actions, .detail-actions { margin-top: 16px; }
  .form-grid .full { grid-column: auto; }.node-hero { display: block; }.node-hero .hero-actions { margin-top: 18px; }
  .maturity-row { grid-template-columns: 9px 1fr 35px; }.maturity-row .progress-track { grid-column: 2/4; }.overview-split { grid-template-columns: 1fr; }
}

/* Domain-first learning system */
.today-hero { min-height: 350px; }
.today-actions { margin: -20px 0 46px; position: relative; z-index: 3; display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.today-actions > a { min-height: 112px; padding: 19px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow); }
.today-actions .action-symbol { flex: 0 0 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #536bc4; background: #eef1ff; font-size: 16px; }
.today-actions div { flex: 1; min-width: 0; }.today-actions b, .today-actions strong, .today-actions small { display: block; }.today-actions b { font-size: 12px; }.today-actions strong { margin: 2px 0; font-size: 23px; }.today-actions small { color: #858fa2; font-size: 9px; }.today-actions em { color: #9aa4b5; font-style: normal; }
.continue-heading { margin-top: 0; }.domain-heading { margin-top: 46px; }
.active-topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.active-topic-card { position: relative; min-height: 198px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 6px 22px rgba(35,52,86,.04); }
.active-topic-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--accent); }.active-topic-card > div { display: flex; gap: 6px; }.active-topic-card > div span { padding: 4px 7px; border-radius: 99px; color: #66748d; background: #f1f3f7; font-size: 8px; }.active-topic-card h3 { margin: 17px 0 8px; font-size: 16px; }.active-topic-card p { height: 44px; margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.7; }.active-topic-card footer { margin-top: 18px; padding-top: 12px; display: flex; justify-content: space-between; border-top: 1px solid #edf0f4; color: #8a94a7; font-size: 9px; }.active-topic-card footer b { color: var(--accent); }.learning-loop-row { margin-top: 42px; }.recent-note-panel .topic-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.domain-hero { min-height: 225px; padding: 43px clamp(38px, 6vw, 84px); display: flex; align-items: center; justify-content: space-between; gap: 40px; color: white; background: linear-gradient(118deg, #15213b, color-mix(in srgb, var(--accent) 65%, #172541)); }
.domain-hero-copy { max-width: 720px; }.domain-hero h1 { margin: 10px 0 9px; font-size: 38px; letter-spacing: -.04em; }.domain-hero p { margin: 0; color: rgba(255,255,255,.75); font-size: 14px; line-height: 1.75; }.domain-hero-stat { min-width: 150px; padding: 18px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: rgba(255,255,255,.08); backdrop-filter: blur(8px); }.domain-hero-stat b, .domain-hero-stat span, .domain-hero-stat small { display: block; }.domain-hero-stat b { font-size: 33px; }.domain-hero-stat span { margin-top: 2px; font-size: 11px; }.domain-hero-stat small { margin-top: 10px; color: rgba(255,255,255,.58); font-size: 8px; }
.domain-shell { padding: 27px 0 65px; }.subdomain-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 11px; }.subdomain-tabs a { min-height: 86px; padding: 15px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 11px; background: white; }.subdomain-tabs a > span { flex: 0 0 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: #6374aa; background: #eef1f8; font-size: 10px; font-weight: 800; }.subdomain-tabs a b, .subdomain-tabs a small { display: block; }.subdomain-tabs a b { font-size: 12px; }.subdomain-tabs a small { margin-top: 5px; overflow: hidden; color: #8993a6; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }.subdomain-tabs a div { min-width: 0; }.subdomain-tabs a.active { border-color: #91a1dd; background: #f3f5fd; box-shadow: inset 3px 0 #6179d4; }
.domain-focus-head { margin: 38px 0 20px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }.domain-focus-head h2 { margin: 6px 0; font-size: 25px; }.domain-focus-head p { margin: 0; color: var(--muted); font-size: 12px; }
.domain-active-strip { margin-bottom: 31px; padding: 12px; display: grid; grid-template-columns: 130px repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; border: 1px solid #dfe4ee; border-radius: 12px; background: #eef2f8; }.strip-title { padding: 10px; display: flex; flex-direction: column; justify-content: center; }.strip-title span { font-size: 12px; font-weight: 800; }.strip-title small { margin-top: 4px; color: #8792a6; font-size: 8px; }.domain-active-strip > a { min-width: 0; padding: 11px; display: grid; grid-template-columns: auto 1fr auto; gap: 5px 8px; align-items: center; border-radius: 8px; background: white; }.domain-active-strip > a > span { padding: 3px 6px; border-radius: 99px; color: #607092; background: #edf0f6; font-size: 7px; }.domain-active-strip > a b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.domain-active-strip > a small { grid-column: 2; color: #8b95a8; font-size: 7.5px; }.domain-active-strip > a em { grid-column: 3; grid-row: 1/3; color: #7c8ba5; font-style: normal; }.category-heading { margin-top: 0; }
.knowledge-lane-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; align-items: start; }.knowledge-lane { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; }.knowledge-lane > header { height: 66px; padding: 13px 15px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: #fafbfd; }.knowledge-lane > header > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: #536bc4; background: #edf1ff; font-size: 11px; font-weight: 800; }.knowledge-lane > header div { flex: 1; }.knowledge-lane h3 { margin: 0; font-size: 13px; }.knowledge-lane > header small { margin-top: 3px; display: block; color: #8b95a8; font-size: 8px; }.knowledge-lane > header a { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid #dce2eb; border-radius: 7px; color: #67758e; background: white; }.lane-body { padding: 8px 13px 13px; }.lane-node { padding: 13px 2px; display: block; border-bottom: 1px solid #edf0f4; }.lane-node:last-child { border-bottom: 0; }.lane-node > div { display: flex; gap: 6px; }.lane-node > div span, .lane-node > div em { padding: 3px 6px; border-radius: 99px; font-size: 7px; font-style: normal; }.lane-node > div span { color: #68758e; background: #eef1f5; }.lane-node > div em { color: #35775d; background: #e7f6ee; }.lane-node > b { margin-top: 8px; display: block; font-size: 12px; }.lane-node p { margin: 4px 0 0; color: #7f899c; font-size: 9px; line-height: 1.55; }.lane-node footer { margin-top: 8px; display: flex; justify-content: space-between; color: #929baa; font-size: 8px; }.lane-node footer strong { color: #66748b; }.lane-empty { padding: 24px 5px; text-align: center; }.lane-empty b { font-size: 11px; }.lane-empty p { margin: 7px 0 0; color: #929bab; font-size: 8px; line-height: 1.6; }

.topic-page { width: min(1220px, calc(100% - 64px)); margin: 0 auto; padding: 25px 0 65px; }.topic-breadcrumbs { margin-bottom: 15px; display: flex; flex-wrap: wrap; gap: 7px; color: #7d899e; font-size: 9px; }.topic-breadcrumbs b { color: #536079; }.topic-header { position: relative; overflow: hidden; min-height: 180px; padding: 30px 34px; display: flex; align-items: center; justify-content: space-between; gap: 28px; border-radius: 15px; color: white; background: linear-gradient(120deg, #17233e, color-mix(in srgb, var(--accent) 58%, #1d3150)); }.topic-header::after { content: ""; position: absolute; width: 260px; height: 260px; right: -100px; top: -125px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; box-shadow: 0 0 0 45px rgba(255,255,255,.025); }.topic-header > div { position: relative; z-index: 2; }.topic-label-row { display: flex; gap: 7px; }.topic-label-row span { padding: 5px 8px; border: 1px solid rgba(255,255,255,.18); border-radius: 99px; color: rgba(255,255,255,.8); background: rgba(255,255,255,.07); font-size: 8px; }.topic-label-row .active-label { color: #d6f7e8; background: rgba(63,177,123,.24); }.topic-header h1 { margin: 14px 0 8px; font-size: 30px; letter-spacing: -.035em; }.topic-header p { max-width: 720px; margin: 0; color: rgba(255,255,255,.73); font-size: 12px; line-height: 1.7; }.topic-header-actions { display: flex; gap: 8px; position: relative; z-index: 3; }.topic-layout { margin-top: 17px; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }.topic-reader, .topic-meta-card { border: 1px solid var(--line); border-radius: 13px; background: white; }.topic-reader { padding: 28px 34px 38px; }.selection-tip { margin-bottom: 28px; padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid #dbe1f3; border-radius: 9px; background: #f4f6fd; }.selection-tip > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: white; background: #6079d4; font-size: 11px; font-weight: 800; }.selection-tip b, .selection-tip small { display: block; }.selection-tip b { font-size: 10px; }.selection-tip small { margin-top: 3px; color: #828ca0; font-size: 8px; }.reader-section { margin-top: 31px; }.reader-section:first-of-type { margin-top: 0; }.reader-section-title { margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }.reader-section-title span { color: #8b96ab; font-size: 8px; font-weight: 800; }.reader-section-title h2 { margin: 0; font-size: 16px; }.reader-section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }.topic-question-list { margin: 0; padding-left: 24px; color: #435169; font-size: 13px; line-height: 2; }.topic-markdown { margin: 0; white-space: pre-wrap; color: #3f4d64; background: transparent; font: 13px/2 inherit; }.reader-empty { padding: 22px; border: 1px dashed #dce1ea; border-radius: 9px; color: #8a94a6; background: #fafbfd; font-size: 10px; text-align: center; }.topic-children { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }.topic-children a { padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }.topic-children span, .topic-children b, .topic-children small { display: block; }.topic-children span { color: #758198; font-size: 7.5px; }.topic-children b { margin: 6px 0; font-size: 11px; }.topic-children small { color: #939baa; font-size: 8px; }.inline-notes { display: grid; gap: 10px; }.inline-notes article { padding: 15px; border-left: 3px solid #8294db; border-radius: 0 9px 9px 0; background: #f7f8fc; }.inline-notes header { display: flex; justify-content: space-between; }.inline-notes header span { color: #5e6f9f; font-size: 8px; font-weight: 800; }.inline-notes header small { color: #979fad; font-size: 8px; }.inline-notes blockquote { margin: 11px 0; padding-left: 11px; border-left: 2px solid #d7ddea; color: #6e798d; font-size: 10px; line-height: 1.7; }.inline-notes p { margin: 8px 0 0; color: #3f4c62; font-size: 11px; line-height: 1.75; }.topic-sidebar { display: grid; gap: 12px; }.topic-meta-card { padding: 18px; }.topic-meta-card h3 { margin: 0 0 13px; font-size: 12px; }.topic-meta-card dl { margin: 0; }.topic-meta-card dl div { padding: 8px 0; display: flex; justify-content: space-between; border-bottom: 1px solid #edf0f4; }.topic-meta-card dt, .topic-meta-card dd { margin: 0; font-size: 9px; }.topic-meta-card dt { color: #8993a6; }.topic-meta-card dd { color: #4d5a70; font-weight: 700; }.topic-progress { margin-top: 16px; }.topic-progress > div:first-child { margin-bottom: 8px; display: flex; justify-content: space-between; font-size: 9px; }.topic-progress small { margin-top: 7px; display: block; color: #929bab; font-size: 7.5px; }.write-note-button { width: 100%; padding: 15px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 11px; color: white; background: linear-gradient(120deg,#4f69c5,#3b83a0); text-align: left; box-shadow: 0 9px 23px rgba(66,99,178,.2); }.write-note-button > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.15); }.write-note-button b, .write-note-button small { display: block; }.write-note-button b { font-size: 11px; }.write-note-button small { margin-top: 3px; color: rgba(255,255,255,.68); font-size: 8px; }.topic-tags { display: flex; flex-wrap: wrap; gap: 6px; }.topic-tags span { padding: 5px 7px; border-radius: 99px; color: #6c7890; background: #f0f2f6; font-size: 8px; }.meta-note { color: #7d8799; font-size: 9px; line-height: 1.6; }.mini-versions { margin-top: 13px; display: grid; gap: 7px; }.mini-versions span { color: #8892a5; font-size: 8px; }.mini-versions b { margin-right: 5px; color: #56647b; }
.selection-action { position: fixed; z-index: 80; padding: 8px 11px; border: 0; border-radius: 7px; color: white; background: #25395f; box-shadow: 0 8px 20px rgba(16,29,53,.25); font-size: 10px; }.note-drawer-backdrop { position: fixed; inset: 0; z-index: 89; background: rgba(12,22,40,.32); backdrop-filter: blur(1px); }.note-drawer { position: fixed; z-index: 90; inset: 0 0 0 auto; width: min(430px, 100%); padding: 25px; color: var(--ink); background: white; box-shadow: -18px 0 50px rgba(20,32,56,.2); overflow-y: auto; }.note-drawer > header { display: flex; align-items: center; justify-content: space-between; }.note-drawer h2 { margin: 5px 0 0; }.note-drawer > header button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; color: #6e7a90; background: white; font-size: 20px; }.note-drawer form { margin-top: 25px; display: grid; gap: 17px; }.note-drawer label { display: grid; gap: 7px; color: #536076; font-size: 10px; font-weight: 700; }.note-drawer textarea, .note-drawer select { width: 100%; padding: 10px; border: 1px solid #dce1ea; border-radius: 8px; outline: 0; background: white; }.note-drawer textarea { min-height: 105px; resize: vertical; }.note-drawer .note-content-input { min-height: 180px; }.drawer-context { display: flex; gap: 7px; flex-wrap: wrap; }.drawer-context span { padding: 5px 8px; border-radius: 99px; color: #6d7890; background: #f0f2f6; font-size: 8px; }.note-save { width: 100%; }.drawer-open { overflow: hidden; }

.notes-shell { padding: 26px 0 60px; }.note-status-tabs { margin-bottom: 17px; display: flex; gap: 8px; }.note-status-tabs a { min-width: 120px; padding: 11px 13px; display: flex; justify-content: space-between; border: 1px solid var(--line); border-radius: 9px; color: #68758d; background: white; font-size: 10px; }.note-status-tabs a.active { color: white; border-color: #536bc4; background: #536bc4; }.notes-list { display: grid; gap: 12px; }.note-card { padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: white; }.note-card > header, .note-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; }.note-card > header div { display: flex; gap: 6px; }.note-card > header span { padding: 4px 7px; border-radius: 99px; font-size: 8px; }.note-kind { color: #536bc4; background: #edf0fd; }.note-class { color: #65728a; background: #f0f2f5; }.note-card > header small { color: #929baa; font-size: 8px; }.note-card blockquote { margin: 16px 0 0; padding: 11px 14px; border-left: 3px solid #bec8e8; color: #68758a; background: #f8f9fc; font-size: 10px; line-height: 1.7; }.note-card > p { margin: 15px 0 0; color: #344259; font-size: 12px; line-height: 1.8; }.note-card > footer { margin-top: 18px; padding-top: 13px; border-top: 1px solid #edf0f4; }.note-card > footer a span, .note-card > footer a b { display: inline; font-size: 9px; }.note-card > footer a span { margin-right: 6px; color: #8993a6; }.note-card > footer a b { color: #5064ad; }.note-card > footer form { margin: 0; }.notes-empty { margin-top: 30px; }
.topic-toggle { grid-template-columns: auto 1fr !important; align-items: center; padding: 9px 11px; border: 1px solid #dce1ea; border-radius: 8px; }.topic-toggle input { width: auto !important; }.topic-toggle b, .topic-toggle small { display: block; }.topic-toggle small { margin-top: 3px; color: #8b95a8; font-size: 8px; font-weight: 400; }

@media (max-width: 1050px) {
  .today-actions, .active-topic-grid { grid-template-columns: repeat(2, 1fr); }
  .topic-layout { grid-template-columns: 1fr; }.topic-sidebar { grid-template-columns: repeat(2, 1fr); }.write-note-button { min-height: 100%; }
  .domain-active-strip { grid-template-columns: 1fr 1fr; }.strip-title { grid-column: 1/-1; }
}
@media (max-width: 760px) {
  .today-actions, .active-topic-grid, .knowledge-lane-grid { grid-template-columns: 1fr; }.today-actions { margin-top: 0; }
  .domain-hero, .domain-focus-head, .topic-header { display: block; }.domain-hero-stat { margin-top: 20px; }.domain-focus-head .button, .topic-header-actions { margin-top: 16px; }
  .topic-page { width: min(100% - 28px, 720px); }.topic-reader { padding: 21px 18px 30px; }.topic-sidebar { grid-template-columns: 1fr; }.topic-children { grid-template-columns: 1fr; }
  .domain-active-strip { grid-template-columns: 1fr; }.note-status-tabs { overflow-x: auto; }.note-status-tabs a { min-width: 105px; }
}

/* v4 reading scale: the knowledge map is a reading interface, not a dense admin table. */
.app-main { font-size: 15px; }
.eyebrow { font-size: 12px; }
.side-brand b { font-size: 18px; }
.side-brand small { font-size: 12px; }
.side-nav a { font-size: 15px; }
.nav-label { font-size: 11px; }
.side-foot b { font-size: 13px; }
.side-foot small, .side-foot button { font-size: 11px; }
.domain-hero p, .domain-focus-head p { font-size: 16px; line-height: 1.75; }
.domain-hero-stat span { font-size: 13px; }
.domain-hero-stat small { font-size: 11px; line-height: 1.5; }
.subdomain-tabs a b { font-size: 15px; }
.subdomain-tabs a small { font-size: 11px; line-height: 1.45; }
.subdomain-tabs a > span { font-size: 12px; }
.domain-focus-head h2 { font-size: 32px; }
.strip-title span { font-size: 15px; }
.strip-title small { font-size: 12px; }
.domain-active-strip > a b { font-size: 15px; }
.domain-active-strip > a small { font-size: 12px; }
.domain-active-strip > a span { font-size: 11px; }
.knowledge-lane h3 { font-size: 17px; }
.knowledge-lane > header small { font-size: 12px; }
.knowledge-lane > header > span { font-size: 13px; }
.lane-node > div span, .lane-node > div em { font-size: 11px; }
.lane-node > b { font-size: 16px; }
.lane-node p { font-size: 13px; line-height: 1.65; }
.lane-node footer { font-size: 12px; }
.lane-empty { padding-block: 32px; }
.lane-empty b { font-size: 15px; }
.lane-empty p { font-size: 12px; }
.topic-breadcrumbs { font-size: 12px; }
.topic-label-row span { font-size: 11px; }
.topic-header h1 { font-size: 36px; }
.topic-header p { font-size: 16px; }
.selection-tip b { font-size: 14px; }
.selection-tip small { font-size: 12px; }
.reader-section-title span { font-size: 11px; }
.reader-section-title h2 { font-size: 22px; }
.topic-question-list, .topic-markdown { font-size: 16px; line-height: 1.95; }
.reader-empty { font-size: 13px; }
.topic-children span { font-size: 11px; }
.topic-children b { font-size: 15px; }
.topic-children small { font-size: 12px; }
.inline-notes header span, .inline-notes header small { font-size: 11px; }
.inline-notes blockquote { font-size: 13px; }
.inline-notes p { font-size: 14px; }
.topic-meta-card h3 { font-size: 15px; }
.topic-meta-card dt, .topic-meta-card dd, .topic-progress > div:first-child { font-size: 12px; }
.topic-progress small, .meta-note, .mini-versions span { font-size: 11px; }
.write-note-button b { font-size: 14px; }
.write-note-button small { font-size: 11px; }
.topic-tags span { font-size: 11px; }

/* One topic can hold many course packages; one package can hold many HTML chapters. */
.lesson-library { display: grid; gap: 16px; }
.linked-course { overflow: hidden; border: 1px solid #dce2ec; border-radius: 13px; background: #fbfcfe; }
.linked-course > header { padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e4e8ef; background: white; }
.linked-course > header > div { min-width: 0; }
.linked-course > header span { color: #526bc3; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.linked-course > header h3 { margin: 7px 0 6px; padding: 0; border: 0; font-size: 19px; }
.linked-course > header p { margin: 0; color: #6e7a8f; font-size: 13px; line-height: 1.65; }
.linked-chapters { padding: 8px 16px; }
.linked-chapters > a { padding: 13px 5px; display: grid; grid-template-columns: 35px minmax(0, 1fr) 20px; align-items: center; gap: 10px; border-bottom: 1px solid #e8ebf1; }
.linked-chapters > a:last-child { border-bottom: 0; }
.linked-chapters > a:hover b { color: #4f67be; }
.linked-chapters > a > span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; color: #526bc3; background: #edf1ff; font-size: 11px; font-weight: 800; }
.linked-chapters b, .linked-chapters small { display: block; }
.linked-chapters b { font-size: 14px; }
.linked-chapters small { margin-top: 4px; color: #8791a3; font-size: 11px; line-height: 1.5; }
.linked-chapters em { color: #7e8ba1; font-style: normal; }
.course-link-form { display: grid; gap: 9px; }
.course-link-form select { width: 100%; min-height: 40px; padding: 7px 9px; border: 1px solid #dce1ea; border-radius: 8px; color: #4d5a70; background: white; font-size: 12px; }

/* Unified multi-page course reader. */
.study-shell { min-height: 100vh; padding: 24px 26px 36px; background: #eef1f6; }
.study-topbar { margin-bottom: 14px; padding: 14px 17px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #dce2eb; border-radius: 13px; background: white; }
.study-title { min-width: 0; display: flex; align-items: center; gap: 18px; }
.study-title > a { flex: 0 0 auto; color: #5268b3; font-size: 13px; font-weight: 700; }
.study-title span { color: #7c879a; font-size: 11px; }
.study-title h1 { margin: 3px 0 0; overflow: hidden; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.study-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.study-layout { min-height: calc(100vh - 125px); display: grid; grid-template-columns: 270px minmax(0, 1fr); border: 1px solid #dce2eb; border-radius: 14px; overflow: hidden; background: white; box-shadow: 0 12px 34px rgba(28,42,72,.07); }
.chapter-sidebar { min-width: 0; border-right: 1px solid #dfe4ec; background: #f8f9fc; }
.chapter-sidebar-head { padding: 21px 18px 16px; border-bottom: 1px solid #e1e5ed; }
.chapter-sidebar-head b, .chapter-sidebar-head small { display: block; }
.chapter-sidebar-head b { margin-top: 7px; font-size: 17px; }
.chapter-sidebar-head small { margin-top: 4px; color: #8792a4; font-size: 11px; }
.chapter-sidebar nav { padding: 8px; display: grid; gap: 3px; }
.chapter-sidebar nav a { padding: 11px 10px; display: grid; grid-template-columns: 30px 1fr; gap: 9px; align-items: start; border: 1px solid transparent; border-radius: 9px; }
.chapter-sidebar nav a:hover { background: white; }
.chapter-sidebar nav a.active { border-color: #d6ddef; background: white; box-shadow: 0 5px 14px rgba(40,58,93,.06); }
.chapter-sidebar nav a > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; color: #6173b9; background: #e9edfb; font-size: 10px; font-weight: 800; }
.chapter-sidebar nav b, .chapter-sidebar nav small { display: block; }
.chapter-sidebar nav b { font-size: 13px; line-height: 1.45; }
.chapter-sidebar nav small { margin-top: 4px; color: #8b95a7; font-size: 10px; line-height: 1.4; }
.lesson-frame-wrap { min-width: 0; background: white; }
.lesson-frame-head { min-height: 62px; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e1e5ed; }
.lesson-frame-head span, .lesson-frame-head b { display: block; }
.lesson-frame-head span { color: #7f8a9d; font-size: 10px; }
.lesson-frame-head b { margin-top: 3px; font-size: 15px; }
.lesson-frame-head > small { max-width: 46%; color: #8791a4; font-size: 11px; text-align: right; }
.lesson-frame-wrap iframe { width: 100%; height: calc(100vh - 190px); min-height: 720px; display: block; border: 0; background: white; }

@media (max-width: 1050px) {
  .study-topbar { align-items: flex-start; }
  .study-layout { grid-template-columns: 225px minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .study-shell { padding: 12px; }
  .study-topbar, .study-title { display: block; }
  .study-title > div { margin-top: 10px; }
  .study-actions { margin-top: 13px; justify-content: flex-start; }
  .study-layout { display: block; }
  .chapter-sidebar { border-right: 0; border-bottom: 1px solid #dfe4ec; }
  .chapter-sidebar nav { max-height: 280px; overflow-y: auto; }
  .lesson-frame-wrap iframe { height: 76vh; min-height: 600px; }
  .lesson-frame-head { align-items: flex-start; }
  .linked-course > header { align-items: flex-start; flex-direction: column; }
}

/* Agent collaboration center */
.agent-page { padding-bottom: 80px; }
.agent-hero { min-height: 270px; padding: 48px clamp(38px, 6vw, 86px); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 36px; color: white; background: linear-gradient(120deg,#14213d 0%,#314d96 58%,#26868a 100%); }
.agent-hero::after { content:""; position:absolute; width:470px; height:470px; right:-170px; top:-250px; border:1px solid rgba(255,255,255,.15); border-radius:50%; box-shadow:0 0 0 70px rgba(255,255,255,.025),0 0 0 140px rgba(255,255,255,.018); }
.agent-hero > div { position:relative; z-index:2; }
.agent-hero h1 { margin:12px 0 13px; font-size:44px; letter-spacing:-.04em; }
.agent-hero p { max-width:760px; margin:0; color:#cdd9ef; font-size:17px; line-height:1.8; }
.agent-hero-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.agent-subnav { position:sticky; top:0; z-index:15; padding:0 clamp(38px,6vw,86px); display:flex; gap:26px; border-bottom:1px solid #dfe4ec; background:rgba(255,255,255,.95); backdrop-filter:blur(12px); }
.agent-subnav a { padding:16px 0 14px; color:#627089; font-size:13px; font-weight:700; border-bottom:2px solid transparent; }
.agent-subnav a:hover { color:#4d65bd; border-bottom-color:#6c82d7; }
.agent-metrics,.agent-section { width:min(1220px,calc(100% - 64px)); margin-inline:auto; }
.agent-metrics { margin-top:-24px; position:relative; z-index:3; display:grid; grid-template-columns:repeat(4,1fr); border:1px solid #dfe4ec; border-radius:14px; overflow:hidden; background:white; box-shadow:0 14px 35px rgba(29,45,77,.11); }
.agent-metrics article { min-height:128px; padding:22px; border-right:1px solid #e6e9ef; }
.agent-metrics article:last-child { border-right:0; }
.agent-metrics span,.agent-metrics b,.agent-metrics small { display:block; }
.agent-metrics span { color:#78849a; font-size:12px; font-weight:700; }
.agent-metrics b { margin:8px 0 4px; font-size:31px; }
.agent-metrics small { color:#949cab; font-size:11px; }
.agent-metrics .accent { color:white; background:linear-gradient(135deg,#506bc7,#338897); }
.agent-metrics .accent span,.agent-metrics .accent small { color:#dce6f7; }
.agent-section { padding-top:68px; scroll-margin-top:52px; }
.agent-section-head { margin-bottom:23px; display:flex; align-items:end; justify-content:space-between; gap:28px; }
.agent-section-head h2 { margin:7px 0 6px; font-size:28px; letter-spacing:-.03em; }
.agent-section-head p { margin:0; color:#788398; font-size:14px; line-height:1.7; }
.agent-workflow { padding:20px; display:grid; grid-template-columns:repeat(7,auto); align-items:center; gap:12px; border:1px solid #dfe4ec; border-radius:14px; background:white; }
.agent-workflow article { min-width:0; display:flex; align-items:flex-start; gap:12px; }
.agent-workflow article > span { flex:0 0 34px; height:34px; display:grid; place-items:center; border-radius:9px; color:#526bc3; background:#edf1ff; font-size:11px; font-weight:800; }
.agent-workflow b { font-size:15px; }.agent-workflow p { margin:5px 0 0; color:#7b879b; font-size:12px; line-height:1.55; }
.agent-workflow i { color:#a9b3c3; font-style:normal; }
.agent-entry-grid { margin-top:14px; display:grid; grid-template-columns:repeat(3,1fr); gap:13px; }
.agent-entry-grid a { min-height:145px; padding:19px; position:relative; border:1px solid #dfe4ec; border-radius:12px; background:#fbfcfe; }
.agent-entry-grid span,.agent-entry-grid b,.agent-entry-grid small { display:block; }.agent-entry-grid span { color:#536bc4; font-size:10px; font-weight:800; }.agent-entry-grid b { margin:9px 0 7px; font-size:15px; }.agent-entry-grid small { max-width:85%; color:#7d899c; font-size:12px; line-height:1.6; }.agent-entry-grid em { position:absolute; right:16px; bottom:15px; color:#5268b7; font-size:11px; font-style:normal; }
.agent-create-form,.agent-log-form { margin-bottom:17px; padding:20px; display:grid; grid-template-columns:repeat(3,1fr); gap:13px; border:1px solid #d9e0ed; border-radius:13px; background:#f8faff; }
.agent-create-form[hidden],.agent-log-form[hidden],.memory-edit-form[hidden] { display:none; }
.agent-create-form label,.agent-log-form label,.memory-edit-form label { display:grid; gap:6px; color:#56647b; font-size:11px; font-weight:700; }
.agent-create-form input,.agent-create-form textarea,.agent-log-form input,.agent-log-form textarea,.agent-log-form select,.memory-edit-form input,.memory-edit-form textarea { width:100%; padding:10px 11px; border:1px solid #d6ddea; border-radius:8px; outline:0; color:#344158; background:white; }
.agent-create-form textarea,.agent-log-form textarea { min-height:92px; resize:vertical; }.agent-create-form .wide,.agent-log-form .wide,.memory-edit-form .wide { grid-column:1/-1; }
.memory-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:13px; }
.memory-card { border:1px solid #dde2eb; border-radius:13px; background:white; }
.memory-card[open] { box-shadow:0 10px 28px rgba(30,46,78,.07); }
.memory-card summary { padding:19px; display:flex; align-items:center; justify-content:space-between; gap:18px; cursor:pointer; list-style:none; }
.memory-card summary::-webkit-details-marker { display:none; }.memory-card summary span { color:#536bc4; font-size:10px; font-weight:800; text-transform:uppercase; }.memory-card h3 { margin:6px 0 0; font-size:17px; }.memory-version { color:#68758c; font-size:12px; font-weight:800; text-align:right; }.memory-version small { margin-top:4px; display:block; color:#9aa2b0; font-size:9px; font-weight:500; }
.memory-card > p { margin:0; padding:0 19px 19px; color:#4e5b70; font-size:14px; line-height:1.85; }
.memory-card > footer { padding:12px 19px; display:flex; justify-content:space-between; gap:12px; border-top:1px solid #e8ebf0; color:#9099a8; font-size:10px; }
.memory-card > footer button { padding:0; border:0; color:#5368b3; background:transparent; font-weight:700; }
.memory-edit-form { margin:0 14px 14px; padding:15px; display:grid; grid-template-columns:1fr 1fr; gap:10px; border-radius:10px; background:#f4f6fb; }
.memory-edit-form textarea { min-height:125px; resize:vertical; }
.course-contract { padding:25px; display:grid; grid-template-columns:310px 1fr; gap:32px; border:1px solid #dce2eb; border-radius:14px; background:white; }
.contract-tree { padding:20px; display:grid; gap:9px; border-radius:11px; color:#dbe4f8; background:#182641; font:13px/1.4 "SFMono-Regular",Consolas,monospace; }
.contract-tree span { color:#88a3e6; }.contract-tree b { padding-left:20px; font-weight:500; }.course-contract h3 { margin:4px 0 13px; font-size:18px; }.course-contract ul { margin:0; padding-left:20px; color:#536076; font-size:14px; line-height:2; }
.agent-course-list { margin-top:13px; display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
.agent-course-list article { padding:17px 18px; display:flex; align-items:center; justify-content:space-between; gap:15px; border:1px solid #dfe3eb; border-radius:11px; background:white; }.agent-course-list span { color:#536bc4; font-size:10px; font-weight:800; }.agent-course-list h3 { margin:6px 0 3px; font-size:15px; }.agent-course-list small { color:#929baa; font-size:10px; }.agent-course-list article > div:last-child { display:flex; gap:7px; }.agent-course-list a { padding:7px 9px; border-radius:7px; color:#5267b2; background:#eef1fb; font-size:10px; font-weight:700; }
.agent-log-list { display:grid; gap:0; }.agent-log-list > article { display:grid; grid-template-columns:24px 1fr; gap:12px; }.log-rail { position:relative; display:flex; justify-content:center; }.log-rail::after { content:""; position:absolute; top:19px; bottom:-18px; width:1px; background:#d8deea; }.agent-log-list > article:last-child .log-rail::after { display:none; }.log-rail span { width:11px; height:11px; margin-top:18px; position:relative; z-index:2; border:3px solid #dfe5f5; border-radius:50%; background:#6178cf; }
.log-body { margin-bottom:13px; padding:16px 18px; border:1px solid #dfe3eb; border-radius:11px; background:white; }.log-body header { display:flex; justify-content:space-between; gap:12px; }.log-body header span { color:#536bc4; font-size:10px; font-weight:800; }.log-body time { color:#959eac; font-size:10px; }.log-body h3 { margin:8px 0 6px; font-size:15px; }.log-body > p { margin:0; color:#858fa1; font-size:11px; }.log-body details { margin-top:12px; padding-top:11px; border-top:1px solid #e9ecf1; }.log-body details summary { color:#596b9f; font-size:11px; cursor:pointer; }.log-body details div { margin-top:9px; display:grid; grid-template-columns:55px 1fr; gap:8px; }.log-body details b { font-size:10px; }.log-body details p { margin:0; color:#68758a; font-size:11px; line-height:1.6; white-space:pre-wrap; }
.skill-preview { max-height:520px; margin:0; padding:23px; overflow:auto; border:1px solid #d9dfeb; border-radius:13px; color:#dfe7f7; background:#16233d; font:12px/1.8 "SFMono-Regular",Consolas,monospace; white-space:pre-wrap; }

@media(max-width:1050px){.agent-metrics{grid-template-columns:repeat(2,1fr)}.agent-workflow{grid-template-columns:1fr}.agent-workflow i{display:none}.agent-entry-grid{grid-template-columns:1fr}.memory-grid{grid-template-columns:1fr}}
@media(max-width:760px){.agent-hero{display:block;padding:38px 24px}.agent-hero h1{font-size:34px}.agent-hero-actions{margin-top:20px;justify-content:flex-start}.agent-subnav{padding:0 20px;gap:18px;overflow-x:auto}.agent-metrics,.agent-section{width:min(100% - 28px,720px)}.agent-metrics{grid-template-columns:1fr 1fr}.agent-section-head{align-items:flex-start;flex-direction:column}.agent-create-form,.agent-log-form{grid-template-columns:1fr}.course-contract{grid-template-columns:1fr}.agent-course-list{grid-template-columns:1fr}.memory-edit-form{grid-template-columns:1fr}.agent-create-form .wide,.agent-log-form .wide,.memory-edit-form .wide{grid-column:auto}}
