/* 颜色技术基础·实训助教。宽屏使用主内容左侧安全留白，窄屏降到底部。 */
:root{--tutor-blue:#1769d2;--tutor-ink:#0d1b2a;--tutor-muted:#50657d;--tutor-line:#b7cce5;--tutor-glass:rgba(248,251,255,.86);--tutor-glass-strong:rgba(244,249,255,.96);--tutor-width:320px}
.tutor-launcher{position:fixed;z-index:55;top:128px;left:12px;width:min(var(--tutor-width),calc(100vw - 24px));pointer-events:auto}
.tutor-launcher button{display:flex;align-items:center;gap:12px;width:100%;min-height:76px;padding:14px 15px;border:1px solid rgba(153,187,221,.86);border-radius:16px;background:var(--tutor-glass);box-shadow:0 14px 38px rgba(33,83,132,.13);backdrop-filter:blur(20px) saturate(135%);-webkit-backdrop-filter:blur(20px) saturate(135%);color:var(--tutor-ink);text-align:left;transition:transform .2s,box-shadow .2s,background .2s}
.tutor-launcher button:hover,.tutor-launcher button:focus-visible{transform:translateY(-2px);background:rgba(255,255,255,.96);box-shadow:0 18px 44px rgba(33,83,132,.2)}
.tutor-launcher button>span:nth-child(2){display:flex;flex-direction:column;gap:3px;min-width:0}
.tutor-launcher strong{font-size:18px;font-weight:800;line-height:1.45;white-space:normal}
.tutor-launcher small{font-size:16px;color:var(--tutor-muted);line-height:1.5}
.tutor-launcher-arrow{margin-left:auto;color:var(--tutor-blue);font-size:21px;line-height:1;flex:none}
.tutor-launcher-mark{position:relative;display:block;width:30px;height:30px;flex:none}
.tutor-launcher-mark i{position:absolute;display:block;width:19px;height:19px;border-radius:50%;mix-blend-mode:multiply;opacity:.82}
.tutor-launcher-mark i:nth-child(1){left:0;top:0;background:#79a9ee}.tutor-launcher-mark i:nth-child(2){right:0;top:0;background:#84c8d5}.tutor-launcher-mark i:nth-child(3){left:5px;bottom:0;background:#9aaee5}
.coach-dialog[open]{position:fixed;z-index:60;top:128px;left:12px;width:min(var(--tutor-width),calc(100vw - 24px));max-height:min(650px,calc(100dvh - 152px));margin:0;padding:0;border:1px solid rgba(153,187,221,.9);border-radius:20px;background:var(--tutor-glass-strong);box-shadow:0 24px 70px rgba(33,83,132,.22);backdrop-filter:blur(24px) saturate(140%);-webkit-backdrop-filter:blur(24px) saturate(140%);overflow:auto;color:var(--tutor-ink);overscroll-behavior:contain}
.coach-dialog[open] .dialog-heading{position:sticky;top:0;z-index:1;min-height:58px;padding:14px 18px;background:rgba(244,249,255,.92);border-bottom:1px solid var(--tutor-line);backdrop-filter:blur(18px)}
.coach-dialog[open] .dialog-heading>div{font-size:18px;font-weight:800;color:var(--tutor-ink)}
.coach-dialog[open] .dialog-heading>div svg{stroke:var(--tutor-blue)}
.coach-dialog[open] .dialog-heading>div>span{font-size:15px;font-weight:600;color:var(--tutor-muted);margin-left:8px}
.coach-dialog[open] .coach-context{padding:20px 20px 14px}
.coach-dialog[open] .coach-context .eyebrow{font-size:15px;color:var(--tutor-blue)}
.coach-dialog[open] .coach-context h3{font-size:21px;font-weight:800;line-height:1.5;margin-top:7px}
.coach-dialog[open] .coach-context p{font-size:18px;line-height:1.75;color:var(--tutor-muted);margin-top:8px}
.coach-dialog[open] .coach-modes{gap:8px;padding:0 20px 17px}
.coach-dialog[open] .coach-modes button{font-size:16px;font-weight:700;border:1px solid #b5cbe6;border-radius:999px;padding:8px 12px;background:#e2edfc;color:#1e4d79}
.coach-dialog[open] .coach-modes button:hover,.coach-dialog[open] .coach-modes button:focus-visible{background:#d3e5fb;border-color:#84aede}
.coach-dialog[open]>textarea{display:block;width:calc(100% - 40px);min-height:112px;margin-inline:20px;padding:13px 14px;font-size:18px;line-height:1.8;background:rgba(255,255,255,.82);border:1px solid #b7cce5;border-radius:10px;color:var(--tutor-ink)}
.coach-dialog[open]>textarea::placeholder{color:#7890a8}
.coach-dialog[open] .coach-send{display:flex;align-items:center;gap:14px;padding:14px 20px}
.coach-dialog[open] .coach-send small{font-size:16px;line-height:1.65;color:var(--tutor-muted)}
.coach-dialog[open] .coach-send .button{font-size:16px;min-height:42px;padding:9px 14px;gap:9px}
.coach-dialog[open] #coach-output{max-height:270px;overflow:auto;padding:0 20px 20px}
.coach-dialog[open] .coach-answer{padding:17px;background:rgba(226,237,252,.9);border-left:3px solid #4b91ad;border-radius:0 11px 11px 0;font-size:18px}
.coach-dialog[open] .coach-answer .eyebrow{font-size:15px;color:#315e89}
.coach-dialog[open] .coach-answer strong{font-size:18px;font-weight:800;display:block;margin-top:10px}
.coach-dialog[open] .coach-answer p{font-size:18px;line-height:1.85;margin-top:10px}
.coach-dialog[open] .coach-answer small{display:block;font-size:15px;color:var(--tutor-muted);margin-top:12px}
.coach-dialog[open] .coach-answer .text-link{font-size:16px;margin-top:13px}
.coach-dialog[open] .coach-welcome{padding:16px 17px;background:rgba(231,241,253,.72);border:1px solid #c4d8ef;border-radius:12px;color:var(--tutor-ink)}
.coach-dialog[open] .coach-welcome .eyebrow{font-size:15px;color:var(--tutor-blue)}
.coach-dialog[open] .coach-welcome p{font-size:16px;line-height:1.8;margin-top:8px}
.coach-dialog[open] .coach-welcome ul{margin:10px 0 0;padding-left:20px;color:#315e89;font-size:16px;line-height:1.9}
.coach-dialog[open] .coach-welcome small{display:block;margin-top:11px;color:var(--tutor-muted);font-size:15px;line-height:1.7}
body:has(.coach-dialog[open]) #tutor-launcher{opacity:.24;pointer-events:none}
/* 宽屏：完整面板位于 .wrap 左侧的安全留白。 */
@media(min-width:1960px){.tutor-launcher,.coach-dialog[open]{left:calc((100vw - 1272px)/2 - 332px);width:320px}}
/* 中等桌面：入口收成左边缘窄栏；展开面板只使用现有左侧余量。 */
@media(min-width:1400px) and (max-width:1959px){
  .tutor-launcher{top:132px;left:0;width:48px}
  .tutor-launcher button{width:48px;min-height:120px;padding:12px 8px;flex-direction:column;justify-content:center;gap:8px;border-radius:0 14px 14px 0}
  .tutor-launcher strong{font-size:18px;line-height:1.3;writing-mode:vertical-rl;text-orientation:mixed}
  .tutor-launcher small,.tutor-launcher-arrow{display:none}
  .coach-dialog[open]{top:128px;left:0;right:auto;width:max(48px,min(320px,calc((100vw - 1272px)/2 - 12px)));max-height:min(650px,calc(100dvh - 152px));border-radius:0 20px 20px 0}
}
/* 小桌面：底部窄面板保留完整输入控件，标题与首屏实验不被覆盖。 */
@media(max-width:1399px){.tutor-launcher{top:auto;bottom:18px;left:16px;width:min(300px,calc(100vw - 32px))}.coach-dialog[open]{top:auto;right:16px;bottom:18px;left:auto;width:min(360px,calc(100vw - 32px));max-height:min(590px,58dvh)}}
@media(max-width:760px){.tutor-launcher{left:12px;right:12px;bottom:12px;width:auto}.tutor-launcher button{min-height:62px;padding:11px 13px;border-radius:14px}.tutor-launcher strong{font-size:18px}.tutor-launcher small{font-size:15px}.coach-dialog[open]{left:12px;right:12px;bottom:12px;width:auto;max-height:52dvh;border-radius:16px}.coach-dialog[open] .coach-context{padding:16px 17px 11px}.coach-dialog[open] .coach-context h3{font-size:18px}.coach-dialog[open] .coach-context p{font-size:16px}.coach-dialog[open] .coach-modes{padding:0 17px 14px}.coach-dialog[open]>textarea{width:calc(100% - 34px);margin-inline:17px;min-height:86px;font-size:16px}.coach-dialog[open] .coach-send{padding:12px 17px;gap:10px}.coach-dialog[open] .coach-send small{font-size:15px;max-width:58%}.coach-dialog[open] #coach-output{padding-inline:17px}}
@media(prefers-reduced-motion:reduce){.tutor-launcher button{transition:none}}

/* 最终课程主题覆盖：experience.css 保留了旧的中性色规则，必须在最后一层统一字体和色板。 */
:root{
  --paper:#edf4ff;
  --panel:#f8fbff;
  --ink:#102a43;
  --muted:#536d82;
  --line:#c5d8ec;
  --accent:#1b70d3;
  --accent-light:#deedfc;
  --dark:#132231;
  --sans:"Microsoft YaHei","微软雅黑","PingFang SC","Noto Sans CJK SC","Segoe UI",Arial,sans-serif;
  --serif:var(--sans);
}
html,body{background:var(--paper);color:var(--ink);font-family:var(--sans)}
body{font-size:16px;line-height:1.8;letter-spacing:0}
h1,h2,h3,h4,h5,h6,p,button,input,textarea,select,summary,label,a,li,dt,dd{font-family:var(--sans)}
h1,h2,h3,h4,h5,h6{color:var(--ink);font-weight:750}
.site-header{background:rgba(237,244,255,.97);border-color:var(--line)}
.brand{font-family:var(--sans);font-size:18px;font-weight:750;letter-spacing:.02em}
.brand small{font-family:var(--sans);font-size:15px;letter-spacing:.14em;color:var(--muted)}
.site-header nav>a{font-size:18px;font-weight:650;color:#405b74}
.site-header nav>a:hover,.site-header nav>a[aria-current]{color:var(--accent)}
.search-trigger{font-size:18px;background:rgba(248,251,255,.75);border-color:#b8cde4;color:#405b74}
.wrap{width:min(1272px,calc(100% - 80px))}
.eyebrow{font-family:var(--sans);font-size:16px;font-weight:700;letter-spacing:.08em;color:#41627c}
.quiet,.small-note{font-size:18px;color:var(--muted)}
.text-link,.text-button{font-size:18px;font-weight:700;color:var(--accent)}
.button{font-size:18px;font-weight:700;border-radius:8px}
.button.primary{background:var(--accent);box-shadow:0 8px 18px rgba(27,112,211,.16)}
.button.primary:hover{background:#125ab4}
.button.outline{border-color:#a9c4df;background:rgba(248,251,255,.64)}
.button.outline:hover{background:#deedfc}
.page-heading h1,.math-heading h1,.lesson-heading h1{font-family:var(--sans);font-weight:800;letter-spacing:0}
.page-heading h1{font-size:clamp(42px,5vw,72px)}
.page-heading>p,.lesson-heading>p{font-size:16px;color:#405b74}
.lesson-heading h1{font-size:clamp(38px,4vw,58px);line-height:1.3}
.hero h1,.ex-hero h1{font-family:var(--sans);font-weight:800;letter-spacing:0}
.hero-intro,.ex-lead{font-size:16px;color:#405b74;line-height:1.9}
.hero-stats strong{font-family:var(--sans);font-weight:800;color:var(--accent)}
.section-title h2,.ex-section-heading h2{font-family:var(--sans);font-weight:800;color:var(--ink)}
.chapter-heading h3,.lab-card h3,.quiz-card h3,.step-content h2,.transfer-task h3{font-weight:800}
.chapter-heading p,.chapter-heading>span,.lab-card p,.scenario p,.objective>p,.step-content>p,.takeaways ul{font-size:18px;color:var(--muted)}
.lab-card,.quiz-card{background:rgba(248,251,255,.9);border-color:#c4d8ec;border-radius:10px}
.prediction,.formula-expression,.transfer-task,.closing-note,.sources-layout aside,.review-finished{background:#e1eefb;border-color:#bfd5eb}
.prediction-options button,.quiz-options button{background:#f8fbff;border-color:#b5cbe5;font-size:18px}
.prediction-options button:hover:not(:disabled),.prediction-options button.selected,.quiz-options button:hover:not(:disabled){background:#deedfc;border-color:#82acd5}
.formula-expression{font-family:"Cambria Math","STIX Two Math",var(--sans);font-size:23px}
textarea{font-family:var(--sans);font-size:18px;background:#f8fbff;border-color:#b5cbe5}
.ex-hero-stage,.ex-story-stage{background:#e3effa;border-color:#bfd6eb}
.ex-stage-top,.ex-stage-caption{border-color:#c4d9ec;color:#4b6880}
.ex-running-line,.ex-bridge,.ex-review-entry,.ex-current-task,.ex-challenge{background:#e1eefb;border-color:#bfd5eb}
.ex-section-heading p,.ex-map-heading p,.ex-step-body,.ex-story-copy p,.ex-project p{color:var(--muted)}
.ex-section-heading h2,.ex-map-heading h1,.ex-journey-title h1,.ex-story-copy h2,.ex-finish h2{font-family:var(--sans);font-weight:800;color:var(--ink)}
.ex-button-dark{background:var(--accent);color:#fff}
.ex-button-dark:hover{background:#125ab4}
.site-footer{background:#e1eefb;border-color:#bfd5eb}
dialog::backdrop{background:transparent;backdrop-filter:none}
.coach-dialog::backdrop{background:transparent;backdrop-filter:none}

/* 中等桌面保持左侧边缘入口；完整面板只在用户主动打开后浮出，不改变主内容宽度。 */
@media(min-width:900px) and (max-width:1959px){
  .tutor-launcher{top:116px;bottom:auto;left:0;width:52px}
  .tutor-launcher button{width:52px;min-height:126px;padding:12px 8px;flex-direction:column;justify-content:center;gap:8px;border-radius:0 14px 14px 0}
  .tutor-launcher strong{font-size:18px;line-height:1.3;writing-mode:vertical-rl;text-orientation:mixed}
  .tutor-launcher small,.tutor-launcher-arrow{display:none}
  .coach-dialog[open]{top:116px;bottom:auto;left:0;right:auto;width:max(48px,min(320px,calc((100vw - 1272px)/2 - 12px)));max-height:min(680px,calc(100dvh - 132px));border-radius:0 20px 20px 0}
}
@media(max-width:899px) and (min-width:761px){
  .tutor-launcher{top:104px;bottom:auto;left:0;width:48px}
  .tutor-launcher button{width:48px;min-height:112px;padding:10px 7px;flex-direction:column;justify-content:center;gap:7px;border-radius:0 14px 14px 0}
  .tutor-launcher strong{font-size:16px;line-height:1.3;writing-mode:vertical-rl;text-orientation:mixed}
  .tutor-launcher small,.tutor-launcher-arrow{display:none}
  .coach-dialog[open]{top:104px;bottom:auto;left:0;right:auto;width:48px;max-height:calc(100dvh - 120px);border-radius:0 16px 16px 0}
}
@media(max-width:760px){
  .wrap{width:calc(100% - 36px)}
  body{font-size:18px}
  .site-header nav>a{font-size:16px}
  .page-heading h1{font-size:40px}
  .lesson-heading h1{font-size:34px}
  .hero h1,.ex-hero h1{font-size:44px}
  .hero-intro,.ex-lead,.page-heading>p,.lesson-heading>p{font-size:18px}
  .tutor-launcher{top:auto;bottom:12px;left:12px;right:12px;width:auto}
  .tutor-launcher button{min-height:64px;padding:11px 13px;border-radius:14px}
  .tutor-launcher strong{font-size:18px;writing-mode:horizontal-tb}
  .tutor-launcher small{display:block;font-size:15px}
  .tutor-launcher-arrow{display:block;font-size:19px}
  .coach-dialog[open]{top:auto;bottom:12px;left:12px;right:12px;width:auto;max-height:54dvh;border-radius:16px}
}

/* 安全区按首页 ex-wrap 的 1536px 最大宽度计算。100vw 含滚动条，额外留 24px。 */
/* 2250px 起左右留白足够容纳 320px 面板与 16px 内容间距；临界宽度继续走窄边缘策略，避免面板被视口裁切。 */
@media(min-width:2250px){
  .tutor-launcher,.coach-dialog[open]{left:calc((100vw - 1536px)/2 - 344px);width:320px}
}
@media(min-width:900px) and (max-width:2249px){
  .tutor-launcher{top:116px;bottom:auto;left:0;width:52px}
  .coach-dialog[open]{top:116px;bottom:auto;left:0;right:auto;width:max(48px,min(320px,calc((100vw - 1536px)/2 - 24px)));max-height:min(680px,calc(100dvh - 132px));border-radius:0 20px 20px 0}
}

/* 对话流：每条提问和回答都保留在浮层内，便于学生回看上一轮依据。 */
.coach-context-note{display:block;margin-top:9px;color:var(--tutor-muted);font-size:15px;line-height:1.7}
.coach-message{display:flex;flex-direction:column;gap:5px;max-width:94%;margin:0 0 12px;padding:11px 13px;border:1px solid var(--tutor-line);border-radius:12px;font-size:16px;line-height:1.8}
.coach-message p{margin:0;white-space:normal;overflow-wrap:anywhere}
.coach-message-label{font-size:15px;font-weight:800;letter-spacing:.03em;color:var(--tutor-muted)}
.coach-message-user{margin-left:auto;background:#dcecff;border-color:#b7d0ee;color:var(--tutor-ink);border-radius:12px 12px 3px 12px}
.coach-message-user .coach-message-label{color:#2560a3}
.coach-message-assistant{margin-right:auto;background:rgba(248,251,255,.9);border-radius:12px 12px 12px 3px}
.coach-message-assistant .coach-message-label{color:#315e89}
.coach-message-error{background:#fff4ee;border-color:#e5c1ad;color:#70402b}
.coach-message-error .coach-message-label{color:#9b5b3e}
.coach-pending{margin:0 0 12px;padding:9px 12px;color:var(--tutor-muted);font-size:15px;line-height:1.7;border-left:2px solid var(--tutor-blue);background:rgba(226,237,252,.56);border-radius:0 8px 8px 0}
.coach-dialog[open] #coach-output{display:flex;flex-direction:column}

/* 900px 以上也保留可输入的对话宽度。入口仍在左侧边缘，打开后浮层不改变主内容的文档流。 */
@media(min-width:761px) and (max-width:2199px){
  .coach-dialog[open]{left:56px;right:auto;width:min(360px,calc(100vw - 72px));max-height:min(680px,calc(100dvh - 132px));}
}

/* 对话窗口可以放大，便于阅读多轮回答和输入较长的实训记录。 */
.coach-dialog[open] .dialog-heading-actions{display:flex;align-items:center;gap:7px;margin-left:auto}
.coach-dialog[open] .dialog-heading>div.dialog-heading-actions{font-size:inherit;font-weight:400;color:inherit}
.coach-dialog[open] .coach-size-toggle{min-height:32px;padding:5px 9px;border:1px solid #b7cce5;border-radius:8px;background:#e8f1fc;color:#245a8b;font:700 12px/1.2 var(--sans);cursor:pointer;white-space:nowrap}
.coach-dialog[open] .coach-size-toggle:hover,.coach-dialog[open] .coach-size-toggle:focus-visible{background:#d8e9fb;border-color:#82aede}
.coach-dialog.coach-dialog-large[open]{max-height:min(820px,calc(100dvh - 96px))}
.coach-dialog.coach-dialog-large[open] #coach-output{max-height:min(460px,42dvh)}
.coach-dialog.coach-dialog-large[open]>textarea{min-height:150px}
@media(min-width:2250px){.coach-dialog.coach-dialog-large[open]{left:calc((100vw - 1536px)/2 - 344px);width:min(620px,calc(100vw - 32px));}}
@media(min-width:761px) and (max-width:2249px){.coach-dialog.coach-dialog-large[open]{left:56px;right:auto;width:min(620px,calc(100vw - 72px));}}
@media(max-width:760px){.coach-dialog[open] .dialog-heading-actions{gap:4px}.coach-dialog[open] .coach-size-toggle{min-height:30px;padding-inline:7px;font-size:15px}.coach-dialog.coach-dialog-large[open]{left:12px;right:12px;width:auto;max-height:min(78dvh,calc(100dvh - 24px))}.coach-dialog.coach-dialog-large[open] #coach-output{max-height:32dvh}.coach-dialog.coach-dialog-large[open]>textarea{min-height:120px}}
