/* ==============================================================
   西津湿地 AI 教学助手
   原生 CSS：基础变量 → 页面骨架 → 配色课堂 → 问答 / 备课 → 响应式
   无外部字体、图标库或网络资源；优先采用设备上的中文系统字体。
   ============================================================== */
:root {
  --background-blur: 4px;
  --theme-hue: 207; --theme-saturation: 75%;
  --page: hsl(var(--theme-hue) var(--theme-saturation) 97%);
  --paper: hsl(var(--theme-hue) var(--theme-saturation) 96%);
  --theme-soft: hsl(var(--theme-hue) var(--theme-saturation) 89%);
  --theme-subtle: hsl(var(--theme-hue) var(--theme-saturation) 93%);
  --ink: hsl(var(--theme-hue) 22% 18%);
  --muted: hsl(var(--theme-hue) 18% 36%);
  --accent: hsl(var(--theme-hue) var(--theme-saturation) 26%);
  --accent-dark: hsl(var(--theme-hue) var(--theme-saturation) 20%);
  --line: hsl(var(--theme-hue) 35% 82%);
  --radius: 20px; --shadow: 0 5px 22px hsl(var(--theme-hue) 30% 25% / .05);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink); font-size: 15px; line-height: 1.6;
  font-synthesis: none; text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); isolation: isolate; }
/* Separate fixed layers keep the photo soft while the classroom stays sharp.
   Overscan prevents transparent edges at the maximum blur radius. */
.page-background { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.page-background::before { content: ""; position: absolute; inset: -72px; background: url("assets/wetland-background.png") center center / cover no-repeat; filter: blur(var(--background-blur)); }
.page-background::after { content: ""; position: absolute; inset: 0; background: hsl(var(--theme-hue) var(--theme-saturation) 97% / .62); }
button, input, textarea, select { font: inherit; }
button, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; }
button, a, input, select, textarea { outline-offset: 4px; }
:focus-visible { outline: 3px solid var(--accent); }
button { touch-action: manipulation; }
button:disabled:not(.palette-item) { opacity: .5; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 18px; line-height: 1.5; font-weight: 750; }
h3 { font-size: 16px; }
svg { flex-shrink: 0; }
.icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -70px; left: 12px; z-index: 100; background: #fff; padding: 10px 18px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.site-header { background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1432px; margin: 0 auto; min-height: 92px; padding: 14px 36px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 49px; height: 52px; display: flex; align-items: flex-start; justify-content: center; position: relative; border-radius: 16px; background: var(--accent); color: #fff; padding-top: 7px; overflow: hidden; }
.brand-mark .icon { width: 31px; height: 31px; stroke-width: 1.3; }
.brand-water { position: absolute; width: 35px; height: 9px; bottom: 7px; left: 7px; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); border-radius: 50%; transform: rotate(-5deg); }
.brand strong { display: block; font-size: 22px; letter-spacing: .5px; font-weight: 800; }
.brand-ai { font-size: 21px; letter-spacing: 0; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; letter-spacing: .6px; }
.header-meta { display: flex; align-items: center; gap: 16px; font-size: 12px; }
.lesson-badge { color: var(--muted); }
.mock-badge { display: inline-flex; align-items: center; gap: 7px; background: var(--paper); color: var(--muted); padding: 6px 12px; border: 1px solid var(--line); border-radius: 30px; font-size: 11px; white-space: nowrap; }
.mock-badge > span:first-child { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.page-shell { max-width: 1432px; margin: 0 auto; padding: 22px 36px 0; }
.appearance-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 12px; }
.offline-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--muted); font-size: 12px; }
.offline-notice a { font-weight: 650; }
.theme-control { display: flex; align-items: center; gap: 10px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); max-width: 100%; }
.theme-control label { font-size: 12px; font-weight: 650; white-space: nowrap; }
#theme-color { flex-shrink: 0; width: 36px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; background: white; }
#theme-color::-webkit-color-swatch-wrapper { padding: 0; }
#theme-color::-webkit-color-swatch { border: 0; border-radius: 4px; }
#theme-color::-moz-color-swatch { border: 0; border-radius: 4px; }
#theme-color-value { font: 11px ui-monospace, Consolas, monospace; color: var(--muted); }
#reset-theme { border: 0; border-left: 1px solid var(--line); padding: 5px 0 5px 10px; background: transparent; color: var(--accent); font-size: 11px; white-space: nowrap; }
#reset-theme:hover { text-decoration: underline; }
.background-control { display: grid; grid-template-columns: auto minmax(80px, 1fr) 38px; align-items: center; gap: 12px; width: min(100%, 330px); padding: 7px 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.94); }
.background-control label { font-size: 12px; font-weight: 650; white-space: nowrap; }
.background-control output { font-size: 12px; color: var(--accent-dark); font-variant-numeric: tabular-nums; text-align: right; }
.background-control #background-blur { height: 30px; --track: linear-gradient(90deg, var(--theme-subtle), var(--accent)); }
.main-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--theme-subtle); padding: 5px; gap: 5px; border-radius: 16px; }
.main-tab { border: 0; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 49px; background: transparent; border-radius: 12px; color: var(--muted); transition: background .18s, color .18s; }
.main-tab > span { font-weight: 700; font-size: 15px; }
.main-tab > small { font-size: 11px; color: var(--muted); }
.main-tab:hover { background: rgba(255,255,255,.65); }
.main-tab.is-active { background: #fff; color: var(--accent-dark); box-shadow: 0 2px 8px hsl(var(--theme-hue) 30% 35% / .06); }
.main-tab.is-active[data-tab="studio"] { background: var(--accent); color: white; }
.main-tab.is-active[data-tab="studio"] .tab-badge { background: rgba(255,255,255,.15); color: #fff; }
.tab-badge { border-radius: 5px; padding: 2px 7px; }
.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 29px 0 24px; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: 1.5px; line-height: 1.6; }
.intro-copy h1 { font-size: clamp(25px, 2.6vw, 35px); font-weight: 800; letter-spacing: -.6px; line-height: 1.45; margin: 5px 0 7px; }
.title-dot { color: var(--muted); }
.intro-copy > p:last-child { color: var(--muted); font-size: 13px; }
#assistant { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding-right: 4px; }
.assistant-bubble { background: rgba(255,255,255,.84); border: 1px solid var(--line); padding: 11px 15px; border-radius: 14px 14px 4px 14px; }
.assistant-bubble strong { display: block; font-size: 12px; font-weight: 650; }
.assistant-bubble span { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--muted); font-size: 10px; }
.assistant-bubble span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.mascot { position: relative; flex-shrink: 0; width: 90px; height: 104px; overflow: hidden; border: 3px solid #fff; border-radius: 24px; background: var(--theme-subtle); box-shadow: 0 3px 12px hsl(var(--theme-hue) 30% 35% / .12); animation: portrait-bob 4s ease-in-out infinite; }
.mascot-portrait { position: absolute; display: block; width: 320%; max-width: none; height: auto; left: -134%; top: -12%; }
#assistant[data-state="thinking"] .mascot { animation: portrait-think .85s ease-in-out infinite; }
#assistant[data-state="thinking"] .assistant-bubble span::before { background: var(--accent); animation: blink .7s infinite; }
#assistant[data-state="answering"] .mascot { box-shadow: 0 0 0 3px var(--line), 0 3px 12px hsl(var(--theme-hue) 30% 35% / .12); }
@keyframes portrait-bob { 50% { translate: 0 -3px; } }
@keyframes portrait-think { 50% { rotate: 3deg; } }
@keyframes blink { 50%{opacity:.3} }

/* 通用卡片和按钮 */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 21px 23px 17px; }
.card-heading h2 { display: flex; align-items: center; gap: 9px; }
.card-heading h2 .icon { color: var(--accent); }
.small-note { font-size: 11px; color: var(--muted); font-weight: 400; }
.small-pill { font-size: 10px; padding: 3px 9px; background: var(--paper); color: var(--muted); border-radius: 6px; white-space: nowrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 17px; min-height: 42px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 650; text-decoration: none; transition: background .15s, transform .15s; }
.button:not(:disabled):active { transform: translateY(1px); }
.button-primary { background: var(--accent); color: #fff; box-shadow: 0 3px 7px hsl(var(--theme-hue) 30% 35% / .08); }
.button-primary:not(:disabled):hover { background: var(--accent-dark); }
.button-light { border-color: var(--line); background: #fff; color: var(--ink); }
.button-light:not(:disabled):hover { background: var(--paper); }
.button-dark { background: var(--accent); color: #fff; }
.button-dark:hover { background: var(--accent-dark); }
.button .icon { width: 17px; height: 17px; }
.text-button { background: none; padding: 0; border: 0; font-size: 11px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--accent-dark); }
.subtle { color: var(--muted); }
.card-footnote { font-size: 10px; color: var(--muted); line-height: 1.7; }

/* 配色课堂 */
.classroom-steps { display: flex; margin: 0 0 19px; padding: 0; list-style: none; gap: 33px; color: var(--muted); font-size: 12px; }
.classroom-steps li { display: flex; align-items: center; gap: 9px; }
.classroom-steps li:not(:last-child)::after { content: ""; width: 40px; height: 1px; background: var(--theme-soft); margin-left: 20px; }
.classroom-steps li > span { font-size: 10px; background: var(--theme-subtle); color: var(--muted); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.classroom-steps .is-current { color: var(--accent-dark); font-weight: 650; }
.classroom-steps .is-current > span, .classroom-steps .is-done > span { background: var(--theme-soft); color: var(--accent-dark); }
.classroom-steps .is-done { color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 334px; gap: 23px; align-items: start; }
.art-column, .controls-column { min-width: 0; display: grid; gap: 18px; }
.canvas-card { padding-bottom: 4px; }
.canvas-heading { padding-top: 17px; padding-bottom: 16px; }
.view-switch { display: inline-flex; flex-shrink: 0; padding: 3px; background: var(--paper); border-radius: 9px; gap: 3px; }
.view-switch button { min-height: 30px; padding: 4px 13px; background: transparent; border: 0; border-radius: 7px; font-size: 11px; color: var(--muted); }
.view-switch button.is-active { background: white; color: var(--accent-dark); box-shadow: 0 1px 4px var(--line); font-weight: 650; }
.canvas-wrap { position: relative; margin: 0 18px; border: 1px solid #dfe7da; border-radius: 12px; overflow: hidden; background: white; }
#wetland-canvas { display: block; width: 100%; height: auto; aspect-ratio: 5032 / 2816; cursor: crosshair; touch-action: pan-y; }
.canvas-mode { position: absolute; z-index: 1; top: 12px; left: 12px; padding: 4px 10px; background: rgba(255,255,255,.9); border: 1px solid hsl(var(--theme-hue) 30% 35% / .9); border-radius: 7px; font-size: 10px; color: var(--muted); pointer-events: none; }
.canvas-caption { padding: 11px 21px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 10px; color: var(--muted); }
.canvas-caption > span:first-child { display: flex; align-items: center; color: var(--muted); gap: 5px; font-size: 11px; }
.canvas-caption strong { color: var(--ink); font-weight: 650; }
.selection-dot { width: 9px; height: 9px; border-radius: 3px; background: #fff; border: 1px solid #aec29e; display: inline-block; margin-right: 1px; }
.work-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 22px; border-top: 1px solid var(--line); }
.work-actions p { font-size: 12px; color: var(--muted); }
.work-actions .text-button { margin-top: 3px; font-size: 10px; }
.work-actions .button { flex-shrink: 0; }
.download-fallback { display: block; font-size: 11px; margin: 0 22px 14px; }
.generate-card { background: var(--theme-subtle); border: 1px solid var(--line); border-radius: var(--radius); padding: 21px 23px 17px; position: relative; overflow: hidden; }
.generate-card::after { content: ""; position: absolute; right: -15px; top: -22px; width: 95px; height: 95px; border: 1px solid hsl(var(--theme-hue) 30% 35% / .16); border-radius: 50%; box-shadow: 0 0 0 14px hsl(var(--theme-hue) 30% 35% / .07), 0 0 0 28px hsl(var(--theme-hue) 30% 35% / .06); pointer-events: none; }
.overline { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; letter-spacing: .5px; }
.overline .icon { width: 15px; height: 15px; }
.generate-card h2 { margin: 9px 0 6px; font-size: 20px; }
.generate-card p { font-size: 12px; color: var(--muted); line-height: 1.9; }
.generate-button { width: 100%; margin-top: 16px; min-height: 44px; font-size: 14px; }
.generate-button[aria-busy="true"] .icon { animation: rotate 1.5s linear infinite; }
.generate-button:disabled { opacity: .75 !important; }
.generate-note { display: block; color: var(--muted); font-size: 9px; text-align: center; margin-top: 8px; letter-spacing: .4px; }
@keyframes rotate { to { transform: rotate(360deg); } }
.rgb-card { padding: 0 22px 18px; }
.rgb-card .card-heading { padding: 20px 0 17px; }
.rgb-tag { font-size: 10px; font-weight: 650; background: var(--paper); color: var(--muted); padding: 3px 7px; border-radius: 5px; letter-spacing: 1px; }
.field-label { display: flex; justify-content: space-between; gap: 5px; font-size: 11px; margin-bottom: 7px; color: var(--muted); }
.field-label > span { color: var(--muted); font-size: 10px; }
#region-select { width: 100%; border: 1px solid var(--line); border-radius: 8px; height: 38px; background: var(--paper); color: var(--ink); padding: 0 10px; font-size: 13px; }
.color-preview { display: flex; gap: 12px; align-items: center; background: var(--paper); padding: 11px; border-radius: 10px; margin: 13px 0 17px; }
.current-swatch { width: 51px; height: 51px; flex-shrink: 0; border: 3px solid #fff; box-shadow: 0 0 0 1px #dce3d5; border-radius: 11px; background: white; transition: background-color .05s; }
.color-preview .small-note { display: block; font-size: 9px; margin-bottom: 1px; }
#rgb-value { display: block; font-size: 13px; font-weight: 650; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: -.35px; }
#current-color-name { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.channel { margin-top: 13px; }
.channel:first-of-type { margin-top: 0; }
.channel-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.channel-label label { font-size: 12px; color: var(--muted); }
.channel-label b { display: inline-block; width: 21px; font-size: 12px; }
.channel-r b { color: #bd685a; }.channel-g b { color: #5c8d5b; }.channel-b b { color: #578fb0; }
.channel-label input[type="number"] { width: 56px; height: 29px; padding: 3px 5px; text-align: center; border-radius: 6px; border: 1px solid var(--line); background: var(--paper); font-family: ui-monospace, Consolas, monospace; color: var(--muted); font-size: 12px; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="range"] { --track: linear-gradient(90deg, #f1f1f1, var(--theme-soft)); display: block; width: 100%; height: 22px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: var(--track); border: 1px solid hsl(var(--theme-hue) 30% 35% / .12); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 8px; background: var(--track); border: 1px solid hsl(var(--theme-hue) 30% 35% / .12); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: #fff; border: 2px solid var(--line); box-shadow: 0 1px 3px hsl(var(--theme-hue) 30% 30% / 0.20); }
input[type="range"]::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 2px solid var(--line); box-shadow: 0 1px 3px hsl(var(--theme-hue) 30% 30% / 0.20); }
fieldset:disabled { opacity: .45; }
fieldset:disabled input { cursor: not-allowed; }
.range-ends { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); margin-top: 4px; }
.range-ends > span:nth-child(2) { letter-spacing: .3px; }
.editor-help { font-size: 10px; line-height: 1.9; color: var(--muted); margin-top: 14px; }
.restore-button { margin-top: 12px; border: 0; background: var(--paper); color: var(--muted); min-height: 33px; width: 100%; font-size: 10px; border-radius: 7px; }
.restore-button:not(:disabled):hover { background: var(--theme-subtle); }
.editor-lock-note { font-size: 11px; color: #8b763b; background: #faf5e5; padding: 9px 10px; border-radius: 8px; margin-bottom: 14px; }
.editor-lock-note button { display: block; margin-top: 4px; }
.rgb-card.attention { animation: focus-card 1.2s ease; }
@keyframes focus-card { 30%{box-shadow:0 0 0 5px hsl(var(--theme-hue) 30% 30% / 0.33);} }
.learning-note { display: flex; gap: 14px; align-items: flex-start; padding: 12px 5px 0; }
.learning-note h3 { font-size: 12px; font-weight: 650; margin-bottom: 5px; }
.learning-note p { font-size: 10px; color: var(--muted); line-height: 1.9; }
.rgb-circles { display: flex; flex-shrink: 0; padding-left: 3px; padding-top: 4px; }
.rgb-circles i { display: grid; place-items: center; font-style: normal; font-size: 9px; width: 24px; height: 24px; border: 2px solid var(--page); border-radius: 50%; margin-left: -4px; color: #fff; background: #cd8c77; }.rgb-circles i:nth-child(2){background:#89aa71}.rgb-circles i:nth-child(3){background:#7eacc1}
.palette-card .card-heading { padding-bottom: 12px; }
.palette-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 0 21px; }
.palette-item { min-width: 0; text-align: left; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 8px; min-height: 62px; background: var(--paper); position: relative; }
.palette-item:hover:not(:disabled) { background: var(--paper); border-color: var(--line); }
.palette-item.is-selected { border-color: var(--line); background: var(--theme-subtle); box-shadow: 0 0 0 1px var(--line) inset; }
.palette-item:disabled { color: var(--muted); background: var(--paper); border-color: var(--line); }
.palette-swatch { width: 30px; height: 34px; flex-shrink: 0; border-radius: 7px; border: 1px solid hsl(var(--theme-hue) 30% 35% / .1); background: var(--paper); }
.palette-item:disabled .palette-swatch { background: repeating-linear-gradient(135deg, var(--paper), var(--paper) 5px, var(--theme-subtle) 5px, var(--theme-subtle) 6px); }
.palette-text { min-width: 0; }
.palette-text strong { font-size: 11px; font-weight: 650; display: block; }
.palette-text strong span { color: var(--muted); font-size: 9px; margin-left: 5px; font-weight: 400; }
.palette-text small { font-size: 9px; font-family: ui-monospace, Consolas, monospace; color: var(--muted); display: block; white-space: nowrap; margin-top: 2px; letter-spacing: -.5px; }
.palette-card .card-footnote { padding: 12px 23px 17px; }
.reflection-card { display: flex; align-items: flex-start; gap: 16px; padding: 22px; border-radius: var(--radius); background: var(--theme-subtle); border: 1px solid var(--line); }
.reflection-icon { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--theme-soft); color: var(--muted); font-weight: 800; font-family: Georgia, serif; font-size: 20px; margin-top: 3px; }
.reflection-body .eyebrow { font-size: 9px; color: var(--muted); letter-spacing: 1.2px; }
.reflection-body h2 { margin: 3px 0 8px; color: var(--ink); font-size: 18px; }
.reflection-body > p:not(.eyebrow) { font-size: 12px; color: var(--muted); line-height: 1.9; }
.reflection-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 15px 0 7px; }
.reflection-actions .button { min-height: 36px; font-size: 11px; padding: 7px 13px; }
.reflection-actions .button-light { background: var(--paper); border-color: var(--line); color: var(--muted); }
.reflection-actions .button[aria-pressed="true"] { background: var(--theme-soft); border-color: var(--line); color: var(--ink); }
.reflection-body p.reflection-feedback { font-size: 10px; color: var(--muted); }

/* 湿地问答 */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 306px; gap: 22px; align-items: start; }
.chat-card > .card-heading { border-bottom: 1px solid var(--line); }
.chat-log { height: 418px; min-height: 320px; overflow-y: auto; overscroll-behavior: contain; padding: 24px; scrollbar-width: thin; scrollbar-color: var(--accent) var(--theme-subtle); }
.message { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 22px; }
.message-avatar { position: relative; overflow: hidden; width: 33px; height: 33px; flex-shrink: 0; display: grid; place-items: center; background: var(--theme-subtle); border-radius: 11px; color: var(--muted); font-size: 11px; }
.message-portrait { position: absolute; width: 340%; max-width: none; height: auto; left: -145%; top: -23%; }
.message-avatar .icon { width: 19px; height: 19px; }
.message-content { max-width: 88%; min-width: 0; }
.message-name { display: block; font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.message-bubble { padding: 14px 17px; background: var(--paper); border: 1px solid var(--line); border-radius: 0 14px 14px 14px; font-size: 13px; color: var(--muted); line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user { flex-direction: row-reverse; }
.message.user .message-avatar { background: var(--theme-subtle); color: var(--muted); }
.message.user .message-name { text-align: right; }
.message.user .message-bubble { background: var(--theme-subtle); border-color: var(--line); border-radius: 14px 0 14px 14px; color: var(--muted); }
.message-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 7px; }
.speak-button { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border: 0; border-radius: 5px; background: transparent; font-size: 10px; color: var(--muted); }
.speak-button:hover { background: var(--theme-subtle); }
.speak-button .icon { width: 13px; height: 13px; }
.message-grounding { font-size: 9px; color: var(--muted); }
.message-sources { font-size: 10px; color: var(--muted); margin-top: 7px; line-height: 1.8; }
.web-sources { padding: 10px 12px; border: 1px solid var(--line); background: var(--theme-subtle); border-radius: 9px; overflow-wrap: anywhere; }
.web-sources ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 5px; }
.web-sources summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.web-sources a { display: inline; margin: 0; }
#teacher-result .web-sources { margin-top: 18px; font-size: 12px; }
.message-sources a { margin-right: 10px; }
.message.pending .message-bubble { color: var(--muted); }
.message.is-streaming .message-bubble { color: var(--ink); }
.reasoning-panel { margin: 0 0 9px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--theme-subtle); color: var(--muted); font-size: 11px; }
.reasoning-panel summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.reasoning-content { margin-top: 8px; max-height: 150px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.teaching-stream-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 2; color: var(--ink); }
.is-streaming .reasoning-panel summary::after { content: " ●"; animation: blink 1s ease-in-out infinite; }
.stream-error { margin-top: 9px; padding: 9px 11px; background: var(--theme-subtle); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; font-size: 11px; }
.chat-form { padding: 17px 22px 15px; border-top: 1px solid var(--line); background: var(--paper); }
#chat-input { display: block; resize: vertical; width: 100%; min-height: 76px; max-height: 180px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); padding: 12px 14px; line-height: 1.8; font-size: 13px; }
#chat-input::placeholder { color: var(--muted); }
.chat-form-actions { display: flex; align-items: center; gap: 12px; margin: 11px 0 8px; }
.input-count { margin-left: auto; font-size: 10px; color: var(--muted); }
.chat-form-actions .button { font-size: 11px; min-height: 37px; padding: 7px 12px; }
#voice-question[aria-pressed="true"] { color: #af6e47; border-color: #dfc19f; background: #fff4e8; }
#voice-question[aria-pressed="true"] .icon { animation: blink 1s infinite; }
.chat-sidebar { display: grid; gap: 18px; }
.question-card { padding: 22px 21px; }
.question-card h2 { margin: 7px 0 16px; }
.sample-questions { display: grid; gap: 9px; }
.sample-questions button { text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.sample-questions button .icon { width: 14px; height: 14px; }
.sample-questions button:hover:not(:disabled) { background: var(--theme-subtle); border-color: var(--line); }
.knowledge-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--theme-subtle); }
.knowledge-card > .icon { color: var(--muted); }
.knowledge-card h2 { font-size: 16px; margin: 8px 0; }
.knowledge-card > p { font-size: 12px; line-height: 1.9; color: var(--muted); }
.knowledge-status { font-size: 10px; color: var(--muted); margin: 14px 0; overflow-wrap: anywhere; }
.knowledge-card details { border-top: 1px solid var(--line); padding-top: 11px; }
.knowledge-card summary { font-size: 11px; color: var(--muted); cursor: pointer; }
.knowledge-card details p { font-size: 10px; margin: 10px 0; }
.knowledge-card details .button { min-height: 34px; font-size: 10px; }
.knowledge-download { display: block; font-size: 10px; margin-top: 10px; }
#knowledge-preview { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 10px; max-height: 220px; overflow-y: auto; margin: 12px 0 0; padding: 10px; background: rgba(255,255,255,.5); color: var(--muted); border-radius: 8px; }
.sidebar-reminder { color: var(--muted); font-size: 10px; line-height: 1.8; padding: 0 9px; }

/* 教师备课 */
.teacher-context { display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: 11px; background: var(--theme-subtle); border: 1px solid var(--line); border-radius: 12px; padding: 13px 19px; margin-bottom: 22px; }
.teacher-context .icon { color: var(--muted); width: 17px; height: 17px; }
.teacher-context strong { color: var(--muted); margin-right: 9px; }
.teacher-context span:last-child { margin-left: auto; }
.teacher-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 22px; align-items: start; }
.teacher-menu > .eyebrow { margin: 0 0 13px 3px; }
#teacher-actions { display: grid; gap: 10px; }
.teacher-action { display: flex; align-items: center; text-align: left; gap: 12px; width: 100%; border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 15px; min-height: 79px; box-shadow: var(--shadow); }
.teacher-action > span:first-child { font-family: Georgia, serif; font-size: 22px; color: var(--muted); background: var(--theme-subtle); border-radius: 10px; display: grid; place-items: center; width: 40px; height: 43px; flex-shrink: 0; }
.teacher-action strong { display: block; font-size: 13px; font-weight: 650; }
.teacher-action small { font-size: 10px; color: var(--muted); display: block; margin-top: 2px; }
.teacher-action:hover:not(:disabled), .teacher-action.is-active { border-color: var(--line); background: var(--theme-subtle); }
.teacher-action.is-active { box-shadow: 0 0 0 1px var(--line) inset; }
.teacher-menu-note { padding: 21px 16px; font-size: 11px; line-height: 1.9; color: var(--muted); }
.teacher-result-card { min-height: 534px; }
.teacher-result-card .card-heading { padding: 23px 28px 19px; border-bottom: 1px solid var(--line); }
.teacher-result-card .card-heading .eyebrow { font-size: 10px; letter-spacing: 1px; display: block; margin-bottom: 6px; }
.teacher-result-card .card-heading h2 { font-size: 19px; }
.teacher-result { padding: 25px 29px; min-height: 367px; }
.teacher-empty { display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 27px 0; }
.empty-book { width: 68px; height: 68px; background: var(--theme-subtle); color: var(--muted); border: 1px solid var(--line); border-radius: 22px; display: grid; place-items: center; transform: rotate(-7deg); margin-bottom: 22px; }
.empty-book .icon { width: 33px; height: 33px; stroke-width: 1.4; }
.teacher-empty h3 { color: var(--muted); font-size: 17px; }
.teacher-empty p { color: var(--muted); font-size: 12px; margin: 10px 0 21px; line-height: 1.9; }
.empty-tags { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; }
.empty-tags span { font-size: 10px; border: 1px solid var(--line); color: var(--muted); border-radius: 30px; padding: 4px 10px; }
.teaching-section { margin-bottom: 23px; }
.teaching-section:last-child { margin-bottom: 3px; }
.teaching-section h3 { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.teaching-section h3::before { content: ""; width: 4px; height: 14px; border-radius: 3px; background: var(--accent); }
.teaching-section p { white-space: pre-wrap; color: var(--muted); font-size: 13px; line-height: 2; overflow-wrap: anywhere; }
.teacher-result-actions { border-top: 1px solid var(--line); padding: 17px 28px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.teacher-result-actions .button { font-size: 11px; min-height: 36px; padding: 7px 11px; }
.teacher-result-actions > span { color: var(--muted); font-size: 10px; margin-left: auto; }
.teacher-loading { padding: 15px 29px 0; color: var(--muted); font-size: 12px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 27px 2px 28px; margin-top: 16px; color: var(--muted); font-size: 10px; border-top: 1px solid var(--line); }
.site-footer > span:first-child { display: flex; align-items: center; gap: 7px; }
.site-footer .icon { width: 14px; height: 14px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 12px 19px; border-radius: 13px; background: var(--accent); border: 1px solid var(--line); color: #fff; font-size: 13px; z-index: 60; max-width: min(560px, calc(100vw - 32px)); width: max-content; box-shadow: 0 6px 26px hsl(var(--theme-hue) 30% 30% / 0.20); text-align: center; }
.noscript-message { position: fixed; bottom: 20px; left: 20px; right: 20px; padding: 20px; background: #fff2de; border: 1px solid #e5c58b; color: #735631; z-index: 80; }

/* 手机与平板：不隐藏功能，保持触控目标和页面宽度稳定。 */
@media (min-width: 1380px) {
  .palette-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1120px) {
  .header-inner { padding: 14px 25px; }.page-shell { padding-left: 25px; padding-right: 25px; }
  .header-meta .lesson-badge { display: none; }
  .main-tab > small:not(.tab-badge) { display: none; }
  .assistant-bubble { padding: 10px 12px; }.assistant-bubble strong { font-size: 11px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 306px; gap: 18px; }
  .palette-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .canvas-heading { padding-left: 18px; padding-right: 18px; }.canvas-heading h2 { font-size: 16px; }
  .view-switch button { padding: 4px 9px; }
  .canvas-caption { font-size: 9px; gap: 7px; flex-wrap: wrap; }
  .work-actions { padding: 14px 18px; }.work-actions .button { font-size: 11px; padding: 9px 12px; }
  .rgb-card { padding-left: 19px; padding-right: 19px; }
  .generate-card { padding-left: 20px; padding-right: 20px; }
  .reflection-card { padding: 19px; gap: 11px; }
  .teacher-context { gap: 12px; }.teacher-context span:last-child { display: none; }
  .chat-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
}
@media (max-width: 900px) {
  .page-intro { padding-top: 24px; padding-bottom: 22px; }
  .assistant-bubble { display: none; }.mascot { transform: scale(.9); transform-origin: right center; }
  .workspace { grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; }
  .canvas-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .canvas-heading .view-switch { align-self: flex-end; margin-top: -8px; }
  .canvas-wrap { margin: 0 12px; }
  .work-actions { flex-direction: column; align-items: stretch; gap: 9px; }
  .work-actions > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
  .work-actions .text-button { font-size: 9px; }.work-actions p { font-size: 10px; }
  .reflection-icon { display: none; }
  .palette-card .card-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .palette-list { grid-template-columns: minmax(0,1fr); }
  .palette-item { min-height: 52px; }.palette-text strong { display: inline; }.palette-text strong span { font-size: 10px; }
  .teacher-layout { grid-template-columns: 208px minmax(0,1fr); gap: 16px; }
  .teacher-action { padding: 12px; gap: 9px; }.teacher-action strong { font-size: 12px; }
  .chat-layout { grid-template-columns: minmax(0,1fr); }
  .chat-sidebar { grid-template-columns: 1fr 1fr; }.sidebar-reminder { grid-column: 1/-1; }
  .main-tab { gap: 8px; }.main-tab > span { font-size: 14px; }
}
@media (max-width: 700px) {
  :root { font-size: 14px; }
  .header-inner { min-height: 85px; padding: 14px 17px; gap: 7px; }
  .brand { gap: 9px; }.brand-mark { width: 39px; height: 44px; border-radius: 13px; }.brand-mark .icon { width: 26px; height: 26px; }.brand-water { width: 28px; left: 6px; bottom: 6px; height: 7px; }
  .brand strong { font-size: 17px; letter-spacing: 0; }.brand-ai { font-size: 17px; }.brand small { font-size: 8px; letter-spacing: 0; margin-top: 4px; }
  .header-meta { align-self: flex-start; padding-top: 4px; }.mock-badge { font-size: 8px; padding: 4px 7px; gap: 4px; }.mock-badge > span:first-child { width: 4px; height: 4px; }
  .page-shell { padding: 15px 16px 0; }
  .main-tabs { gap: 3px; padding: 4px; border-radius: 12px; }.main-tab { flex-wrap: wrap; gap: 5px; min-height: 48px; padding: 8px 3px; border-radius: 8px; }.main-tab .icon { width: 16px; height: 16px; }.main-tab > span { font-size: 12px; }.main-tab > small { display: none; }
  .page-intro { gap: 7px; padding: 20px 0; align-items: center; }.intro-copy { flex: 1; min-width: 0; }.intro-copy h1 { font-size: clamp(22px,4.7vw,28px); letter-spacing: -.7px; line-height: 1.5; margin: 4px 0 6px; }.intro-copy > p:last-child { font-size: 11px; line-height: 1.85; }.eyebrow { font-size: 9px; letter-spacing: .8px; }
  #assistant { width: 57px; padding-right: 0; }.mascot { transform: scale(.7); transform-origin: right center; margin-left: -24px; }
  .classroom-steps { gap: 0; justify-content: space-between; margin-bottom: 15px; font-size: 10px; }.classroom-steps li { gap: 6px; }.classroom-steps li > span { width: 20px; height: 20px; font-size: 8px; }.classroom-steps li:not(:last-child)::after { display: none; }
  /* 单列手机：先看画板、请AI建议，再评议，最后操作RGB和查看配色清单。 */
  .workspace { display: flex; flex-direction: column; gap: 16px; }.art-column, .controls-column { display: contents; }
  .canvas-card { order: 1; width: 100%; }.generate-card { order: 2; width: 100%; }.rgb-card { order: 4; width: 100%; }.reflection-card { order: 3; width: 100%; }.palette-card { order: 5; width: 100%; }.learning-note { order: 6; width: 100%; }
  .canvas-heading { align-items: center; flex-direction: row; gap: 7px; padding: 14px; }.canvas-heading h2 { font-size: 14px; gap: 6px; }.canvas-heading h2 .icon { width: 17px; height: 17px; }.canvas-heading .view-switch { align-self: auto; margin-top: 0; }.view-switch button { font-size: 10px; min-height: 29px; padding: 4px 9px; }
  .canvas-wrap { margin: 0 10px; border-radius: 8px; }.canvas-mode { font-size: 8px; padding: 3px 7px; top: 8px; left: 8px; }.canvas-caption { padding: 10px 14px; font-size: 8px; }.canvas-caption > span:first-child { font-size: 10px; }
  .work-actions { padding: 13px 14px; flex-direction: row; align-items: center; }.work-actions > div { display: block; }.work-actions .button { font-size: 10px; padding: 8px 9px; min-height: 37px; gap: 5px; }.work-actions .button .icon { width: 15px; height: 15px; }.work-actions p { font-size: 10px; }.work-actions .text-button { font-size: 8px; }
  .generate-card { display: grid; grid-template-columns: 1fr auto; padding: 18px 19px; column-gap: 10px; }.generate-card .overline { grid-column: 1/-1; font-size: 9px; }.generate-card h2 { margin: 6px 0; font-size: 18px; }.generate-card p { font-size: 10px; grid-column: 1; }.generate-button { grid-column: 2; grid-row: 2/4; align-self: center; margin: 0; padding: 9px 12px; font-size: 12px; }.generate-note { grid-column: 1/-1; text-align: left; margin-top: 9px; font-size: 8px; }
  .rgb-card { padding: 0 20px 18px; }.rgb-card .card-heading { padding-top: 18px; }.field-label { font-size: 12px; }.field-label > span { font-size: 10px; }#region-select { height: 42px; font-size: 14px; }.color-preview { padding: 13px; gap: 14px; }.current-swatch { width: 57px; height: 54px; }#rgb-value { font-size: 16px; }#current-color-name { font-size: 11px; }.color-preview .small-note { font-size: 10px; }
  .channel-label input[type="number"] { height: 33px; width: 61px; font-size: 14px; }.channel-label label { font-size: 13px; }.channel { margin-top: 15px; }input[type="range"] { height: 29px; }input[type="range"]::-webkit-slider-thumb { width: 23px; height: 23px; margin-top: -8px; }input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; }.editor-help { font-size: 11px; }.restore-button { min-height: 38px; font-size: 11px; }
  .reflection-card { padding: 19px; }.reflection-body h2 { font-size: 18px; }.reflection-actions { gap: 7px; }.reflection-actions .button { min-height: 40px; font-size: 11px; padding: 8px 12px; }.reflection-body p.reflection-feedback { font-size: 10px; }
  .palette-card .card-heading { flex-direction: row; align-items: center; padding: 18px 17px 13px; gap: 8px; }.palette-card .card-heading h2 { font-size: 15px; }.palette-card .small-note { font-size: 9px; }.palette-list { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0 15px; gap: 8px; }.palette-item { padding: 8px 7px; gap: 7px; min-height: 63px; }.palette-swatch { width: 28px; height: 34px; }.palette-text strong { display: block; font-size: 11px; }.palette-text strong span { font-size: 9px; margin-left: 3px; }.palette-text small { font-size: 8px; }.palette-card .card-footnote { padding-left: 17px; padding-right: 17px; }
  .learning-note h3 { font-size: 13px; }.learning-note p { font-size: 11px; }
  .chat-card .card-heading { padding: 17px 18px; }.chat-card h2 { font-size: 16px; }.chat-log { height: 360px; padding: 19px 14px; }.message { gap: 8px; }.message-content { max-width: calc(100% - 40px); }.message-bubble { font-size: 12px; padding: 12px 13px; }.message-avatar { width: 30px; height: 30px; }.message-sources { font-size: 9px; }.chat-form { padding: 14px 15px; }.chat-form-actions .button { min-height: 39px; }.chat-form .card-footnote { font-size: 9px; }.chat-sidebar { grid-template-columns: 1fr; }.sidebar-reminder { font-size: 10px; }
  .question-card { padding: 19px; }.sample-questions { grid-template-columns: 1fr 1fr; gap: 8px; }.sample-questions button { font-size: 10px; padding: 11px 10px; }.question-card h2 { font-size: 17px; margin-top: 5px; }
  .teacher-context { flex-wrap: wrap; font-size: 9px; padding: 11px 13px; gap: 5px 9px; margin-bottom: 17px; }.teacher-context > span:nth-of-type(2) { margin-left: auto; }.teacher-context strong { margin-right: 4px; }
  .teacher-layout { grid-template-columns: 1fr; gap: 17px; }.teacher-menu > .eyebrow { display: none; }#teacher-actions { grid-template-columns: 1fr 1fr; gap: 8px; }.teacher-action { min-height: 65px; padding: 10px; gap: 8px; }.teacher-action > span:first-child { width: 29px; height: 36px; border-radius: 8px; font-size: 18px; }.teacher-action strong { font-size: 11px; }.teacher-action small { font-size: 8px; }.teacher-action:last-child { grid-column: 1/-1; min-height: 55px; }.teacher-menu-note { display: none; }
  .teacher-result-card .card-heading { padding: 19px; align-items: flex-start; }.teacher-result-card .card-heading h2 { font-size: 17px; }.teacher-result-card .small-pill { font-size: 8px; padding: 3px 5px; }.teacher-result { padding: 22px 19px; }.teaching-section p { font-size: 12px; }.teacher-result-actions { padding: 15px 18px; }.teacher-result-actions > span { margin-left: 0; width: 100%; font-size: 9px; }.teacher-empty h3 { font-size: 15px; }.teacher-empty p { font-size: 11px; }.empty-tags span { font-size: 9px; }
  .site-footer { flex-direction: column; align-items: center; text-align: center; gap: 7px; padding: 24px 0; margin-top: 23px; font-size: 9px; }.toast { font-size: 12px; bottom: 16px; padding: 12px 15px; }
}
@media (max-width: 360px) {
  .header-inner { padding-left: 12px; padding-right: 12px; }.brand strong { font-size: 15px; }.brand-ai { font-size: 15px; }.brand small { font-size: 7px; }.mock-badge { padding: 3px 5px; font-size: 7px; }
  .page-shell { padding-left: 12px; padding-right: 12px; }.main-tab .icon { display: none; }.main-tab > span { font-size: 11px; }#assistant { display: none; }.intro-copy h1 { font-size: 23px; }.classroom-steps { font-size: 9px; }.classroom-steps li { gap: 4px; }
  .palette-list { grid-template-columns: 1fr; }.palette-text strong { display: inline; }.palette-text small { font-size: 10px; }.canvas-heading h2 { font-size: 12px; }.canvas-heading h2 .icon { display: none; }.generate-button { padding: 8px 9px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
