:root {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: #1c2333;
  background: #f5f7fa;
  font-size: 15px;
  line-height: 1.55;
  --primary: #3b8eea;
  --primary-dark: #2f76ca;
  --primary-soft: #eef4ff;
  --bg: #f5f7fa;
  --surface: #fff;
  --line: #e3e8ef;
  --text: #1c2333;
  --muted: #78869a;
  --ok: #2ea658;
  --warn: #cb8611;
  --danger: #d84a3d;
  --shadow: 0 1px 3px rgb(28 35 51 / .06);
  --radius: 9px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--bg); }
body { color: var(--text); }
body::before { content: ""; position: fixed; left: 0; right: 0; top: 0; height: 3px; background: var(--primary); z-index: 50; }
.app-shell { min-height: 100dvh; display: flex; }
.sidebar { width: 248px; flex: 0 0 248px; background: var(--surface); border-right: 1px solid #e1e6ed; display: flex; flex-direction: column; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 16px; }
.mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: #315fbb; color: white; font-size: 20px; font-weight: 800; box-shadow: var(--shadow); }
.brand-copy { font-size: 17px; font-weight: 700; white-space: nowrap; letter-spacing: .1px; }
.brand-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
#nav { flex: 1; padding: 7px 10px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
#nav button { width: 100%; min-height: 44px; border: 0; border-radius: 8px; padding: 0 14px; background: transparent; color: #35445b; text-align: left; font-weight: 550; }
#nav button:hover { background: #f4f7fc; box-shadow: none; }
#nav button.on { background: #eef3ff; color: #315fbb; font-weight: 700; }
.sidebar-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px 18px; color: #9aa3b5; font-size: 12px; border-top: 1px solid #f0f2f5; }
.service-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px #e8f6ec; }
.workspace { min-width: 0; flex: 1; display: flex; flex-direction: column; }
header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid #e1e6ed; }
.header-title { font-size: 18px; font-weight: 650; white-space: nowrap; }
#identity { display: flex; align-items: center; gap: 9px; color: #5b6478; font-size: 13px; white-space: nowrap; }
#identity button { min-height: 32px; padding: 5px 10px; font-size: 12px; }
main { width: 100%; max-width: 1450px; margin: 0 auto; padding: 28px 34px 54px; }
h1, h2, h3, p { margin: 0 0 10px; }
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.02em; }
h2 { font-size: 18px; line-height: 1.3; }
h3 { font-size: 15px; }
.title { margin: 0 0 24px; }
.eyebrow { color: #59779f; font: 700 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .14em; text-transform: uppercase; }
.sub, small { color: var(--muted); font-size: 13px; }
.bar, .row, .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bar { justify-content: space-between; }
.actions { margin: 15px 0 12px; }
button, .button { cursor: pointer; min-height: 38px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: #35445b; padding: 8px 13px; font: inherit; font-weight: 600; transition: .15s ease; }
button:hover, .button:hover { border-color: #9fc2ef; background: #f7faff; box-shadow: 0 2px 8px rgb(30 71 123 / .06); }
button:active, .button:active { transform: translateY(1px); }
button.primary { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 3px 8px rgb(59 142 234 / .2); }
button.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
button:disabled { opacity: .55; cursor: wait; box-shadow: none; }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: var(--text); padding: 9px 10px; font: inherit; outline: none; }
input:focus, textarea:focus, select:focus { border-color: #76aaf0; box-shadow: 0 0 0 3px rgb(59 142 234 / .12); }
textarea { min-height: 96px; resize: vertical; }
label { display: block; margin-bottom: 14px; color: #405067; font-size: 13px; font-weight: 650; }
label > * { display: block; margin-top: 6px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr); gap: 22px; align-items: start; }
.task-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); gap: 22px; align-items: start; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.band { margin-bottom: 18px; padding: 21px 22px 15px; border: 1px solid #e3e8ef; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-head h2 { margin-bottom: 4px; }
.step-tag { flex: none; padding: 4px 8px; border: 1px solid #dce7f7; border-radius: 5px; color: #5d7da7; background: #f6f9ff; font: 700 10px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; }
.source-band label { margin-bottom: 16px; }
.source-band textarea { min-height: 72px; padding: 13px 14px; border-color: #b9c9dc; background: #fbfdff; }
.source-band textarea:focus { background: #fff; }
.source-band .actions { justify-content: flex-end; }
.creator-band { position: sticky; top: 18px; }
.teacher-preview { display: grid; grid-template-columns: minmax(150px, 0.78fr) minmax(0, 1.22fr); gap: 14px; margin: 2px 0 18px; }
.preview-frame { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border: 1px solid #dce5f1; border-radius: 9px; background: #f1f5fa; }
.preview-frame img { width: 100%; height: 100%; display: block; object-fit: cover; }
.preview-frame span { position: absolute; left: 8px; bottom: 8px; padding: 3px 6px; border-radius: 4px; background: rgb(28 35 51 / .72); color: white; font-size: 11px; }
.preview-frame > .avatar-placeholder { position: absolute; inset: 0; width: auto; height: auto; border-radius: 0; }
.avatar-placeholder.large { display: flex; flex-direction: column; gap: 7px; color: #60718a; }
.avatar-placeholder.large b { display: grid; place-items: center; width: 54px; aspect-ratio: 1; border: 1px solid #d5dfeb; border-radius: 50%; background: #fff; color: #315fbb; font-size: 24px; }
.avatar-placeholder.large small { text-align: center; font-size: 11px; font-weight: 400; }
.teacher-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: start; }
.teacher-card { display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 0 8px; min-height: 58px; padding: 7px; border: 1px solid #dce5f1; border-radius: 7px; background: #fff; text-align: left; }
.teacher-card img { grid-row: 1 / span 2; width: 36px; height: 44px; border-radius: 5px; object-fit: cover; }
.avatar-placeholder { grid-row: 1 / span 2; display: grid; place-items: center; width: 36px; height: 44px; border-radius: 5px; background: #edf2f8; color: #718198; font-weight: 700; }
.preview-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 10px; color: #526279; text-align: center; font-weight: 700; }
.preview-placeholder small { font-size: 11px; font-weight: 400; }
.teacher-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.teacher-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.teacher-card.selected { border-color: #6da5e7; background: #f0f6ff; box-shadow: 0 0 0 2px rgb(59 142 234 / .12); }
.create-modal { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(180px, .85fr); gap: 20px; }
.modal-kicker { margin-bottom: 8px; color: #5d7da7; font: 700 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; }
.modal-note { margin-bottom: 18px; }
.create-side { padding: 14px; border: 1px solid #e3eaf4; border-radius: 8px; background: #f8faff; }
.create-side > strong { display: block; margin-bottom: 5px; }
.mini-teachers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 15px; }
.mini-teachers .teacher-card { background: #fff; }
.mini-teachers .teacher-card img, .mini-teachers .teacher-card .avatar-placeholder { width: 34px; height: 42px; }
.mini-teachers .teacher-card .avatar-placeholder small { display: none; }
.create-teacher-preview { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #e3eaf4; }
.create-teacher-preview img, .create-teacher-preview .avatar-placeholder { width: 52px; height: 62px; border-radius: 6px; }
.create-teacher-preview > div { min-width: 0; }
.create-teacher-preview strong, .create-teacher-preview small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.create-teacher-preview strong { margin-bottom: 4px; font-size: 13px; }
.create-teacher-preview small { font-size: 11px; line-height: 1.5; }
.band > h2 { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid #edf0f4; }
.band > h2::before { content: ""; width: 5px; height: 18px; border-radius: 4px; background: var(--primary); }
.list { overflow: hidden; border: 1px solid #e3e8ef; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.item { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 16px; min-height: 78px; padding: 16px 18px; border: 0; border-bottom: 1px solid #edf0f4; border-radius: 0; text-align: left; background: #fff; }
.item:last-child { border-bottom: 0; }
.item:hover { background: #f8faff; box-shadow: none; }
.item strong { display: block; margin-bottom: 4px; font-size: 15px; }
.item > div:first-child { min-width: 0; }
.badge { flex: none; padding: 4px 9px; border-radius: 999px; background: #eef4ff; color: #315fbb; font-size: 12px; font-weight: 700; white-space: nowrap; }
.empty { padding: 44px 18px; color: var(--muted); text-align: center; }
.asset { padding: 12px 0; border-top: 1px solid #edf0f4; overflow-wrap: anywhere; }
.asset summary { cursor: pointer; font-weight: 700; }
.asset pre, .link { max-height: 280px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: #405067; font: inherit; }
.asset video { display: block; width: 100%; max-height: 340px; margin-top: 10px; border-radius: 7px; background: #1c2333; }
.asset audio { display: block; width: 100%; margin-top: 10px; }
.asset a { color: var(--primary-dark); font-size: 13px; font-weight: 650; }
.job { padding: 11px 0; border-top: 1px solid #edf0f4; }
.job:first-child { border-top: 0; }
.job progress { display: block; width: 100%; height: 7px; margin-top: 8px; accent-color: var(--primary); }
.warn { color: var(--danger); }
.scroll { overflow-x: auto; border: 1px solid #e3e8ef; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 13px 14px; border-bottom: 1px solid #edf0f4; text-align: left; white-space: nowrap; }
th { background: #f8f9fb; color: #78869a; font-size: 12px; font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.compact { max-width: 230px; }
.login-shell { min-height: calc(100dvh - 3px); display: grid; place-items: center; padding: 32px 18px; background: radial-gradient(800px 500px at 15% -10%, #e2ecff 0, transparent 62%), var(--bg); }
.login { width: min(410px, 100%); margin: 0; padding: 32px; border: 1px solid #e3e8ef; border-radius: 14px; background: #fff; box-shadow: 0 12px 34px rgb(28 35 51 / .10); }
.login::before { content: "AI"; display: grid; place-items: center; width: 45px; height: 45px; margin-bottom: 17px; border-radius: 11px; background: #315fbb; color: #fff; font-weight: 800; box-shadow: var(--shadow); }
.login h1 { margin-bottom: 20px; }
.login .eyebrow { margin-bottom: 8px; }
.login button.primary { width: 100%; margin-top: 4px; }
dialog { width: min(760px, calc(100vw - 28px)); border: 1px solid #e3e8ef; border-radius: 12px; padding: 24px; background: #fff; box-shadow: 0 20px 60px rgb(28 35 51 / .18); }
dialog::backdrop { background: rgb(28 35 51 / .28); }
#toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; max-width: min(90vw, 440px); transform: translateX(-50%); padding: 10px 16px; border-radius: 8px; background: #28364c; color: #fff; box-shadow: 0 7px 18px rgb(28 35 51 / .22); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #d08a38; outline-offset: 2px; }

body.auth-mode .app-shell { display: block; }
body.auth-mode .sidebar, body.auth-mode .workspace > header { display: none; }
body.auth-mode .workspace { min-height: 100dvh; }
body.auth-mode main { max-width: none; padding: 0; }

@media (max-width: 1100px) {
  .sidebar { width: 220px; flex-basis: 220px; }
  main { padding-inline: 24px; }
  header { padding-inline: 24px; }
}
@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; height: auto; border-right: 0; border-bottom: 1px solid #e1e6ed; }
  .brand { padding: 12px 16px; }
  .brand-copy small, .sidebar-foot { display: none; }
  #nav { flex-direction: row; padding: 0 10px 8px; overflow-x: auto; }
  #nav button { width: auto; min-width: max-content; min-height: 40px; padding-inline: 14px; }
  header { min-height: 64px; padding: 0 16px; }
  main { padding: 22px 14px 42px; }
  .grid, .task-layout { display: flex; flex-direction: column; gap: 0; }
  .grid > div, .task-layout > div { width: 100%; }
  .creator-band { position: static; }
  h1 { font-size: 26px; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .mark { width: 34px; height: 34px; border-radius: 9px; font-size: 17px; }
  .brand { font-size: 17px; }
  #identity { gap: 7px; font-size: 12px; }
  #identity button { min-height: 30px; padding: 4px 8px; }
  h1 { font-size: 23px; }
  .band { padding: 18px 15px 12px; }
  .duo { gap: 8px; }
  button, .button { min-height: 42px; padding-inline: 11px; }
  input, textarea, select { font-size: 16px; }
  .item { min-height: 72px; padding: 13px 12px; }
  .item .badge { align-self: flex-start; }
  .login { padding: 26px 19px; }
  .create-modal { grid-template-columns: 1fr; }
  .teacher-preview { grid-template-columns: minmax(112px, .7fr) minmax(0, 1.3fr); }
  .preview-frame { max-width: none; }
  .teacher-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-teachers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dialog { padding: 18px; }
}
