:root {
  --workspace-bar-height: 66px;
  --ws-ink: #13221d;
  --ws-muted: #52645d;
  --ws-paper: #f4f7f5;
  --ws-line: #d8e3dd;
  --ws-white: #ffffff;
  --ws-accent: #147055;
  --ws-accent-hover: #0e5842;
  --ws-blue: #1d64c2;
  --ws-peach: #d4651f;
  --ws-violet: #6a44c4;
  --ws-focus: #198262;
  --ws-radius: 14px;
  --ws-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body.workspace { margin: 0; color: var(--ws-ink); background: var(--ws-paper); font: 15px/1.58 var(--ws-font); }
.workspace *, .workspace *::before, .workspace *::after, .workspace-nav *, .workspace-nav *::before, .workspace-nav *::after { box-sizing: border-box; }
.workspace button, .workspace input, .workspace select, .workspace textarea { font: inherit; color: inherit; }
.workspace button { cursor: pointer; }
.workspace a, .workspace-nav a { color: inherit; text-decoration: none; }
.workspace :focus-visible, .workspace-nav :focus-visible { outline: 2px solid var(--ws-focus); outline-offset: 2px; }
.workspace [hidden] { display: none !important; }
.workspace svg, .workspace-nav svg { flex: 0 0 auto; vertical-align: middle; }
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 20; padding: 8px 12px; background: #fff; border-radius: 8px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

/* 顶部统一导航 */
.workspace-nav { position: sticky; top: 0; z-index: 16; min-height: var(--workspace-bar-height); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--ws-line); color: var(--ws-ink); font: 14px/1.35 var(--ws-font); }
.workspace-bar { width: min(calc(100% - 40px), 1380px); min-height: calc(var(--workspace-bar-height) - 1px); margin-inline: auto; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
.workspace-brand { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.brand-dot { width: 12px; height: 12px; border-radius: 4px; background: linear-gradient(135deg, #169870, #2374e1); box-shadow: 0 2px 6px rgba(22,152,112,.35); }
.brand-sub { border-inline-start: 1px solid var(--ws-line); padding-inline-start: 10px; color: var(--ws-muted); font-size: 12px; font-weight: 560; }
.workspace-tabs { display: flex; align-items: center; justify-content: center; gap: 6px; }
.workspace-tabs a { min-height: 40px; padding: 0 14px; border-radius: 10px; display: inline-flex; align-items: center; gap: 7px; color: var(--ws-muted); white-space: nowrap; font-weight: 650; transition: all .15s ease; }
.workspace-tabs a:hover { background: #edf3ef; color: var(--ws-ink); }
.workspace-tabs a[aria-current=page] { background: #e3f4ec; color: var(--ws-accent); }
.workspace-tabs a.tab-tone-blue[aria-current=page] { background: #e6f0fd; color: var(--ws-blue); }
.workspace-tabs a.tab-tone-peach[aria-current=page] { background: #fdf0e4; color: var(--ws-peach); }
.workspace-tabs a.tab-tone-violet[aria-current=page] { background: #efeafd; color: var(--ws-violet); }

.workspace-right { display: flex; align-items: center; gap: 10px; justify-self: end; }
.engine-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; border: 1px solid transparent; }
.engine-pill.is-loading { background: #eff2f0; color: #61716a; }
.engine-pill.is-sim { background: #fff7e6; color: #8c520a; border-color: #f3d79e; }
.engine-pill.is-live { background: #e4f7ee; color: #12664b; border-color: #a6dfc5; }

.workspace-nav .workspace-account { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 4px 10px; border-radius: 10px; font-size: 13px; color: var(--ws-ink); background: #f2f6f3; border: 1px solid var(--ws-line); white-space: nowrap; }
.workspace-nav .workspace-account:hover { border-color: #9dc0b1; background: #e9f2ec; }
.workspace-nav .workspace-account-menu { position: relative; padding: 0; display: block; background: transparent; border: 0; }
.workspace-account-menu summary { display: flex; align-items: center; gap: 7px; padding: 4px 10px 4px 6px; border-radius: 10px; background: #f2f6f3; border: 1px solid var(--ws-line); cursor: pointer; list-style: none; }
.workspace-account-menu summary::-webkit-details-marker { display: none; }
.acct-avatar, .preset-avatar { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; background: #147055; }
.acct-avatar.role-teacher, .preset-avatar.role-teacher { background: #1d64c2; }
.acct-name { font-weight: 680; max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
.acct-role { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: #dfeee7; color: #126047; font-weight: 680; }
.workspace-account-options { position: absolute; right: 0; top: calc(100% + 6px); min-width: 196px; background: #fff; border: 1px solid var(--ws-line); border-radius: 12px; box-shadow: 0 14px 32px rgba(17,36,28,.13); padding: 6px; display: grid; gap: 2px; z-index: 30; }
.acct-meta { padding: 8px 10px; border-bottom: 1px solid #edf2ee; margin-bottom: 4px; }
.acct-meta strong { overflow-wrap: anywhere; display: block; font-size: 14px; }
.acct-meta small { color: var(--ws-muted); font-size: 12px; }
.workspace-account-options a, .workspace-account-options button { border: 0; background: none; color: inherit; font: inherit; text-align: start; padding: 8px 10px; border-radius: 8px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 560; }
.workspace-account-options a:hover, .workspace-account-options button:hover { background: #f0f6f2; }
.workspace-account-options button.danger-item { color: #b43427; }
.workspace-account-options button.danger-item:hover { background: #fdf0ee; }

/* 页面主容器 */
.workspace-page { width: min(calc(100% - 40px), 1240px); margin-inline: auto; padding-block: 30px 56px; outline: none; }
.workspace-page.workspace-full { width: min(calc(100% - 28px), 1460px); padding-block: 14px 18px; }

/* 通用按钮与色系 */
.tone-mint { --tone-bg: #dff4ea; --tone-ink: #116248; --tone-solid: #289872; }
.tone-blue { --tone-bg: #e3f0fd; --tone-ink: #1858ad; --tone-solid: #3b82e6; }
.tone-peach { --tone-bg: #fdeee0; --tone-ink: #a64a12; --tone-solid: #e4833f; }
.tone-violet { --tone-bg: #eee8fd; --tone-ink: #5a36b0; --tone-solid: #8861e6; }

.ws-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: fit-content; min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 10px; color: var(--ws-ink); background: #fff; font-size: 13.5px; line-height: 1.3; font-weight: 660; transition: all .15s ease; }
.ws-button.btn-sm { min-height: 33px; padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.ws-button.btn-xs { min-height: 28px; padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.ws-button.primary { background: var(--ws-accent); color: #fff; border-color: var(--ws-accent); }
.ws-button.primary:hover { background: var(--ws-accent-hover); }
.ws-button.secondary { border-color: #c8d9cf; color: var(--ws-accent); background: #fff; }
.ws-button.secondary:hover, .ws-button.secondary[aria-pressed=true] { background: #e6f4ec; border-color: #77b599; }
.ws-button.quiet { color: var(--ws-muted); background: transparent; }
.ws-button.quiet:hover { background: #eaf0ec; color: var(--ws-ink); }
.ws-button:disabled, .ws-button:disabled:hover { background: #eef2ef; color: #4b5d54; border-color: #c4d0c8; cursor: not-allowed; }
.ws-icon-button { border: 1px solid var(--ws-line); background: #fff; border-radius: 9px; width: 34px; height: 34px; display: inline-grid; place-items: center; color: var(--ws-muted); }
.ws-icon-button:hover { background: #eef4f0; color: var(--ws-ink); }
.ws-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.ws-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 24px; }
.ws-kicker { color: var(--ws-accent); font-size: 12.5px; font-weight: 720; margin-bottom: 4px; }
.ws-heading h1 { margin: 0; font-size: 32px; line-height: 1.18; font-weight: 800; }
.ws-heading p { margin: 6px 0 0; color: var(--ws-muted); font-size: 14.5px; }
.empty-state { display: grid; place-items: center; min-height: 180px; padding: 28px; background: #fff; border: 1px dashed var(--ws-line); color: var(--ws-muted); border-radius: var(--ws-radius); text-align: center; }

/* 学生首页 */
body.workspace-home { background: radial-gradient(circle at 12% 8%, #e8f7f0 0%, transparent 38%), radial-gradient(circle at 90% 14%, #e9f1fe 0%, transparent 36%), #f5f8f6; }
.workspace-home-nav .workspace-bar { grid-template-columns: 1fr auto; }
.home-page { width: min(calc(100% - 40px), 1160px); padding-block: 20px 36px; }
.home-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 16px; flex-wrap: wrap; }
.hero-kicker { display: inline-flex; padding: 4px 12px; border-radius: 999px; background: #e1f4ea; color: #12674c; font-size: 12.5px; font-weight: 720; margin-bottom: 10px; }
.home-hero h1 { margin: 0; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.18; font-weight: 820; letter-spacing: -.015em; }
.home-hero p { margin: 6px 0 0; color: var(--ws-muted); font-size: 15.5px; max-width: 620px; }
.home-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-cta { min-height: 42px; padding-inline: 18px; font-size: 14px; }

.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.home-entry { display: flex; flex-direction: column; gap: 9px; padding: 12px 18px; background: #fff; border: 1.5px solid var(--ws-line); border-radius: 18px; box-shadow: 0 8px 26px rgba(17,40,30,.045); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.home-entry:hover { transform: translateY(-2px); border-color: var(--tone-solid); box-shadow: 0 14px 32px rgba(17,40,30,.08); }
.entry-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.entry-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--tone-ink); background: var(--tone-bg); }
.entry-pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--tone-bg); color: var(--tone-ink); }
.entry-copy h2 { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 800; }
.entry-copy p { margin: 2px 0 0; color: var(--ws-muted); font-size: 14px; line-height: 1.55; }
.entry-live-preview { padding: 8px 12px; border-radius: 12px; background: var(--tone-bg); color: var(--tone-ink); display: grid; gap: 2px; margin-top: auto; }
.entry-live-preview .mini-tag { font-size: 11.5px; font-weight: 750; opacity: .85; }
.entry-live-preview strong { font-size: 15.5px; }
.entry-live-preview span { font-size: 12.5px; opacity: .9; }
.home-quick-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 2px; }
.home-quick-chips a { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 9px; background: rgba(255,255,255,.88); color: var(--ws-ink); font-size: 12.5px; font-weight: 650; border: 1px solid rgba(0,0,0,.07); transition: background .14s; }
.home-quick-chips a:hover { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.entry-footer { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 2px; }
.home-entry.tone-mint .entry-footer { margin-top: auto; }
.home-entry.tone-blue .ws-button.primary, .home-hero .ws-button.primary.tone-blue { background: var(--ws-blue); border-color: var(--ws-blue); }
.home-entry.tone-blue .ws-button.primary:hover, .home-hero .ws-button.primary.tone-blue:hover { background: var(--tone-ink); }
.home-entry.tone-peach .ws-button.primary { background: var(--ws-peach); border-color: var(--ws-peach); }
.home-entry.tone-violet .ws-button.primary { background: var(--ws-violet); border-color: var(--ws-violet); }


/* 双栏工作台（创意工坊和课堂任务） */
.workbench-shell { display: flex; flex-direction: column; gap: 12px; height: calc(100dvh - var(--workspace-bar-height) - 32px); min-height: 620px; }
.workbench-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: #fff; border: 1px solid var(--ws-line); border-radius: 14px; }
.workbench-title-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.workbench-title-group h1 { margin: 0; font-size: 19px; font-weight: 800; }
.workbench-description { font-size: 13px; color: var(--ws-muted); }
.workbench-top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.split-workbench { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.18fr); gap: 14px; }
.chat-pane, .canvas-pane { min-height: 0; min-width: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--ws-line); border-radius: 16px; overflow: hidden; box-shadow: 0 6px 22px rgba(16,38,28,.04); }

/* 左侧对话流 */
.chat-stream { flex: 1; min-height: 0; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(180deg, #fbfdfb 0%, #ffffff 100%); }
.chat-welcome { margin: auto 0; padding: 8px 4px; display: grid; gap: 12px; }
.welcome-orb { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #168663, #2472db); box-shadow: 0 8px 18px rgba(24,114,219,.2); }
.welcome-orb.is-violet { background: linear-gradient(135deg, #6a44c4, #2874db); }
.chat-welcome h2 { margin: 0; font-size: 21px; font-weight: 800; }
.chat-welcome p { margin: 0; color: var(--ws-muted); font-size: 13.8px; }
.idea-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.idea-card { text-align: start; padding: 12px 13px; border-radius: 12px; border: 1px solid #d9e5df; background: #f8fbf9; display: grid; gap: 4px; transition: all .15s; }
.idea-card:hover { border-color: var(--ws-blue); background: #f0f6fe; transform: translateY(-1px); }
.idea-badge { width: fit-content; font-size: 11px; font-weight: 720; padding: 2px 7px; border-radius: 999px; background: #e3f0fd; color: #1958ad; }
.idea-card strong { font-size: 14px; }
.idea-card small { color: var(--ws-muted); font-size: 12px; line-height: 1.4; }

.msg-row { display: flex; gap: 10px; align-items: flex-start; }
.msg-row.is-user { justify-content: flex-end; }
.ai-avatar { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #168663, #2472db); flex: 0 0 auto; margin-top: 2px; }
.ai-avatar.is-violet { background: linear-gradient(135deg, #6a44c4, #2874db); }
.msg-bubble { max-width: 88%; padding: 11px 14px; border-radius: 14px; font-size: 14px; line-height: 1.6; }
.user-bubble { background: #147055; color: #fff; border-bottom-right-radius: 4px; }
.ai-bubble { background: #f3f7f5; color: var(--ws-ink); border: 1px solid #e1ebe5; border-bottom-left-radius: 4px; width: 100%; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-time { display: block; margin-top: 4px; font-size: 11px; opacity: .72; text-align: end; }
.msg-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 6px; border-top: 1px solid #e2ece6; font-size: 11.5px; color: var(--ws-muted); }

/* 思考状态与耗时折叠框 */
.thinking-box { margin-bottom: 8px; background: #fff; border: 1px solid #dce6e0; border-radius: 10px; padding: 6px 10px; font-size: 12.5px; color: var(--ws-muted); }
.thinking-box summary { cursor: pointer; display: flex; align-items: center; gap: 7px; font-weight: 650; list-style: none; }
.thinking-box summary::-webkit-details-marker { display: none; }
.thinking-box summary b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ws-blue); }
.think-spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #b9d7ca; border-top-color: #147055; animation: spin .75s linear infinite; }
.thinking-box.is-done .think-spinner { animation: none; border: 0; background: #169870; width: 8px; height: 8px; }
.thinking-box.is-error .think-spinner { animation: none; border: 0; background: #c53b2b; width: 8px; height: 8px; }
.think-steps { margin: 7px 0 2px; padding-left: 18px; display: grid; gap: 3px; font-size: 12px; color: #546860; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 异步视频任务条 */
.async-jobs { padding: 8px 14px; background: #f2f7ff; border-top: 1px solid #d7e5fb; display: grid; gap: 6px; }
.async-jobs { max-height: 170px; overflow-y: auto; }
.async-job { display: grid; gap: 5px; font-size: 12.5px; }
.async-job-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.async-job-heading strong { overflow-wrap: anywhere; }
.async-job-dismiss { flex: none; }
.async-job span { color: var(--ws-muted); }
.async-job progress { width: 100%; height: 8px; accent-color: var(--ws-accent, #245bb7); }
.job-bar { height: 5px; border-radius: 999px; background: #d6e4fb; overflow: hidden; }
.job-bar span { display: block; height: 100%; background: linear-gradient(90deg, #1d64c2, #179871); transition: width .4s ease; }

/* 快捷追问与输入栏 */

.chat-composer { padding: 12px 14px; border-top: 1px solid var(--ws-line); background: #fff; }
.composer-box { border: 1.5px solid #cbd9d1; border-radius: 14px; background: #fbfdfb; padding: 10px 12px 8px; transition: border-color .15s; }
.composer-box:focus-within { border-color: var(--ws-accent); background: #fff; box-shadow: 0 0 0 3px rgba(20,112,85,.1); }
.composer-box textarea { width: 100%; border: 0; outline: none; background: transparent; resize: none; min-height: 48px; max-height: 150px; font-size: 14.5px; line-height: 1.5; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.composer-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.composer-status { font-size: 12.5px; color: #9c4a14; }
.send-btn { min-height: 35px; padding: 6px 14px; }

/* 右侧实时画布 */
.canvas-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--ws-line); background: #fafcfa; flex-wrap: wrap; }
.canvas-title-wrap { overflow-wrap: anywhere; max-width: 100%; flex-wrap: wrap; display: flex; align-items: center; gap: 8px; min-width: 0; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #c2cec7; flex: 0 0 auto; }
.live-dot.is-live { background: #19a273; box-shadow: 0 0 0 3px rgba(25,162,115,.18); }
.live-dot.is-pulse { animation: pulse-ring .8s ease; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(25,162,115,.6); } 100% { box-shadow: 0 0 0 11px rgba(25,162,115,0); } }
.version-select { border: 1px solid #cbd9d1; border-radius: 8px; padding: 3px 8px; background: #fff; font-size: 12px; font-weight: 650; max-width: 170px; }
.canvas-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.viewport-switch { display: inline-flex; background: #eaf0ec; padding: 2px; border-radius: 8px; gap: 2px; }
.vp-btn { border: 0; background: transparent; padding: 4px 9px; border-radius: 6px; font-size: 12px; font-weight: 650; color: var(--ws-muted); }
.vp-btn.is-active { background: #fff; color: var(--ws-ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.canvas-body { flex: 1; min-height: 0; background: #edf2ef; display: flex; align-items: stretch; justify-content: center; padding: 12px; overflow: hidden; }
.canvas-stage { position: relative; width: 100%; height: 100%; background: #f5f8f6; border-radius: 12px; overflow: hidden; border: 1px solid #d2ded7; box-shadow: 0 8px 24px rgba(15,38,28,.08); transition: max-width .2s ease; }
.canvas-stage.viewport-tablet { max-width: 720px; }
.canvas-body .canvas-stage { height: auto; }
.canvas-body .canvas-iframe { position: absolute; inset: 0; }
.canvas-iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.canvas-empty { margin: auto; max-width: 380px; text-align: center; padding: 24px; color: var(--ws-muted); }
.canvas-empty-icon { width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 16px; background: #dfeee6; color: var(--ws-accent); display: grid; place-items: center; }
.canvas-empty h3 { margin: 0 0 8px; color: var(--ws-ink); font-size: 18px; }
.canvas-empty p { margin: 0; font-size: 13.5px; }

/* 实时代码搭建画面（流式构建视图 & 源码视图） */
.build-live-stage { width: 100%; height: 100%; display: flex; flex-direction: column; background: #0f1b18; color: #dff5eb; border-radius: 12px; overflow: hidden; border: 1px solid #224036; }
.build-live-head { display: flex; align-items: center; gap: 10px; padding: 11px 15px; background: #142621; border-bottom: 1px solid #234238; font-size: 13px; }
.build-live-head strong { display: block; color: #f1fbf7; }
.build-live-head small { display: block; color: #95b8aa; font-size: 12px; margin-top: 2px; }
.build-line-count { margin-left: auto; padding: 3px 9px; border-radius: 999px; background: #1c3a30; color: #7ae2b8; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.build-code-stream { flex: 1; margin: 0; padding: 16px; overflow: auto; font: 12.5px/1.62 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; color: #c7ecd9; white-space: pre-wrap; word-break: break-word; }

.canvas-media-bar { border-top: 1px solid var(--ws-line); background: #f8fbf9; padding: 10px 14px; display: grid; gap: 8px; }
.media-bar-head { font-size: 12px; font-weight: 700; color: #16664c; display: flex; align-items: center; gap: 6px; }
.media-bar-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.media-chip-card { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #d8e5de; border-radius: 10px; padding: 7px 10px; min-width: 240px; }
.media-chip-card img, .media-chip-card video { width: 54px; height: 42px; object-fit: cover; border-radius: 6px; background: #eef3f0; }
.media-chip-card strong { display: block; font-size: 12.5px; margin-bottom: 3px; }
.media-chip-card audio { height: 28px; width: 180px; }

/* 任务页与任务创作台 */
.tasks-page { padding-top: 18px; }
.tasks-page .ws-heading { margin-bottom: 15px; }
.tasks-page .empty-state p { margin-block: 0; }
.segments { display: inline-flex; flex-wrap: wrap; gap: 0 2px; }
.segments button { display: grid; place-items: center; min-height: 44px; border: 0; padding: 0; background: transparent; color: var(--ws-muted); font-size: 12.5px; font-weight: 650; }
.segments button span { padding: 5px 10px; border-radius: 7px; background: #e8efea; line-height: 1.45; }
.segments button[aria-pressed=true] span { background: #d7ede1; color: var(--ws-accent); }
.segments button:hover span { background: #deebe3; }

.task-rows { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.task-row { display: grid; grid-template-columns: minmax(0,1fr) max-content; align-items: center; gap: 13px; padding: 14px 15px; width: 100%; border: 1.5px solid var(--ws-line); border-radius: 14px; background: #fff; color: var(--ws-ink); text-decoration: none; text-align: start; transition: border-color .15s; }
.task-row:hover { border-color: #7ab59a; }
.task-icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: var(--tone-bg); color: var(--tone-ink); }
.task-row-copy { display: grid; gap: 2px; min-width: 0; }
.task-row-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ws-muted); }
.task-row-copy strong { font-size: 16px; font-weight: 760; }
.task-row-tail { display: flex; align-items: center; gap: 6px; color: var(--ws-muted); }

.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.meta-pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--tone-bg, #edf3ef); color: var(--tone-ink, var(--ws-ink)); }

.criteria { background: #f5f8f6; border-inline-start: 3px solid #2b9772; padding: 10px 13px; border-radius: 0 10px 10px 0; margin: 0 0 14px; }
.criteria > span { color: var(--ws-accent); font-size: 12px; font-weight: 750; display: block; }
.criteria > p { margin: 4px 0 0; font-size: 13.5px; color: var(--ws-ink); }

/* 课堂任务抽屉与条幅 */
.task-stage-nav ol { display: flex; gap: 20px; margin: 0; padding: 0; list-style: none; }
.task-stage-nav li { position: relative; flex: 1 1 0; min-width: 0; }
.task-stage-nav li + li::before { content: '→'; position: absolute; inset: 50% auto auto -17px; transform: translateY(-50%); color: var(--ws-muted); }
.task-stage-nav button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; height: 100%; padding: 8px 12px; border: 1px solid var(--ws-line); border-radius: 10px; background: #fff; text-align: start; font-size: 13px; }
.task-stage-nav button span { flex-shrink: 0; color: var(--ws-muted); }
.task-stage-nav button:hover { border-color: #7ab59a; }
.task-stage-nav button[aria-current=step] { border-color: var(--ws-accent); background: #eaf6ef; color: #10563f; }
.task-stage-nav button[aria-current=step] span { color: var(--ws-accent); }
.task-workbench-shell .split-workbench { min-height: 510px; }
.cap-badge { font-size: 12px; font-weight: 720; padding: 4px 10px; border-radius: 999px; background: var(--tone-bg); color: var(--tone-ink); }
.task-drawer { background: #fff; border: 1.5px solid #b8d8c8; border-radius: 14px; padding: 16px 18px; box-shadow: 0 10px 26px rgba(17,44,32,.07); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.drawer-head strong { display: block; font-size: 15.5px; }
.drawer-head small { color: var(--ws-muted); font-size: 12.5px; }
.drawer-sample-stage { height: 340px; }
.drawer-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.drawer-steps li { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; background: #f6faf7; border: 1px solid #dde9e2; border-radius: 10px; font-size: 13px; }
.step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--ws-accent); color: #fff; font-size: 12px; font-weight: 760; display: inline-grid; place-items: center; flex: 0 0 auto; }

.drawer-quiz-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 9px; }
.quiz-opt-btn { text-align: start; padding: 11px 13px; border-radius: 11px; border: 1.5px solid #d5e2db; background: #fafcfa; font-size: 13.5px; display: flex; gap: 7px; }
.quiz-opt-btn:hover { border-color: var(--ws-accent); background: #eff8f3; }
.quiz-opt-btn.is-selected { border-color: var(--ws-accent); background: #dff4ea; color: #0f563f; font-weight: 680; }
.quiz-feedback { margin: 10px 0 0; padding: 9px 12px; border-radius: 9px; font-size: 13px; font-weight: 620; }
.quiz-feedback.is-ok { background: #e3f6ec; color: #126046; }
.quiz-feedback.is-warn { background: #fff5e3; color: #8c520a; }

.drawer-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.drawer-card-grid .card-full { grid-column: 1 / -1; }
.ethics-check { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #fff7eb; border: 1px solid #f0d7b1; font-size: 13px; font-weight: 620; color: #7c4410; }
.ethics-check input { width: 17px; height: 17px; accent-color: var(--ws-accent); }

.task-mission-strip { padding: 11px 16px; background: #f2f9f5; border-bottom: 1px solid #dcebe2; }
.mission-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; font-size: 13px; }
.mission-strip-head strong { flex: 1 1 200px; }
.task-mission-strip p { margin: 0; font-size: 13px; color: #364d44; }
.cap-callouts { padding: 12px 14px; border-radius: 12px; background: var(--tone-bg); color: var(--tone-ink); }
.cap-callouts strong { display: block; font-size: 14px; margin-bottom: 3px; }
.cap-callouts p { margin: 0; color: inherit; opacity: .92; font-size: 13px; }
.quick-prompt-list { display: grid; gap: 8px; }
.quick-prompt-btn { text-align: start; padding: 10px 12px; border-radius: 11px; border: 1px solid #d4e3da; background: #f9fcfa; font-size: 13px; font-weight: 600; display: grid; gap: 3px; transition: all .14s; }
.quick-prompt-btn:hover { border-color: var(--ws-accent); background: #ecf7f1; }
.q-tag { font-size: 11px; font-weight: 720; color: var(--ws-violet); }
.teacher-feedback-banner { padding: 10px 14px; border-radius: 10px; background: #fff5e3; border: 1px solid #f0d098; color: #7a4709; font-size: 13.5px; }
.locked-banner { padding: 14px 16px; background: #edf5f0; border-top: 1px solid var(--ws-line); font-size: 13.5px; font-weight: 650; color: #165e46; }

/* 自由聊天页 */
.free-chat-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 14px; }
.free-chat-sidebar { display: grid; gap: 10px; align-content: start; overflow-y: auto; }
.sidebar-card { background: #fff; border: 1px solid var(--ws-line); border-radius: 14px; padding: 16px; }
.sidebar-card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 760; }
.sidebar-card ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 13px; color: var(--ws-muted); }
.free-chat-sidebar [data-chat-list] { max-height: 156px; overflow-y: auto; }
.free-chat-main .chat-welcome { margin-block: clamp(18px, 15vh, 120px) auto; }

/* 我的作品页 */
.works-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.works-list { display: grid; gap: 10px; }
.work-row { display: grid; grid-template-columns: 44px minmax(0,1fr) auto auto; gap: 14px; align-items: center; padding: 15px 17px; background: #fff; border: 1px solid var(--ws-line); border-radius: 14px; }
.work-row h2 { overflow-wrap: anywhere; margin: 0; font-size: 16.5px; }
.work-row p { margin: 3px 0 0; color: var(--ws-muted); font-size: 12.5px; }
.local-work-label { color: var(--ws-muted); font-size: 12.5px; }

/* 徽章 */
.work-badge { min-width: 64px; width: fit-content; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 9px; border-radius: 999px; color: #4d5f55; background: #edf1ee; font-size: 12px; font-weight: 680; white-space: nowrap; }
.work-badge > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.work-badge.state-doing, .work-badge.state-draft { color: #1a58a8; background: #e6f0fd; }
.work-badge.state-ready { color: #365578; background: #edf3fa; }
.work-badge.state-revision, .work-badge.state-returned { color: #9c530a; background: #fff3de; }
.work-badge.state-submitted, .work-badge.state-saved, .work-badge.state-approved { color: #12664b; background: #e1f5eb; }
.work-badge.classroom-state.state-submitted { color: #1a58a8; background: #e6f0fd; }

/* 表单与旧版兼容 */
.ws-field { display: grid; gap: 5px; font-size: 13px; font-weight: 650; }
.ws-field input, .ws-field textarea, .ws-field select { width: 100%; border: 1px solid #cbd9d1; padding: 8px 10px; border-radius: 9px; background: #fff; color: var(--ws-ink); font-size: 14px; }
.ws-field textarea { resize: vertical; }
.editor-error { margin: 0; color: #b43427; font-size: 13px; }
.ws-back { display: inline-flex; align-items: center; gap: 6px; color: var(--ws-muted); font-weight: 650; font-size: 13px; margin-bottom: 12px; }
.editor-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.playbox { background: var(--tone-bg, #e3f4ec); color: var(--tone-ink, #115e45); border-radius: 12px; }
.play-content { padding: 20px; }
.play-choices { display: flex; gap: 8px; flex-wrap: wrap; }

/* 弹窗（账号切换 + 放大试玩） */
.nv-modal { box-sizing: border-box; width: min(calc(100% - 28px), 560px); max-height: 88dvh; border: 1px solid var(--ws-line); border-radius: 16px; padding: 0; background: #fff; color: var(--ws-ink); box-shadow: 0 22px 54px rgba(13,34,26,.22); }
.nv-modal::backdrop { background: rgba(15,32,25,.48); backdrop-filter: blur(2px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--ws-line); padding: 13px 18px; }
.dialog-head h2 { font-size: 17px; margin: 0; }
.dialog-body { padding: 16px 18px; overflow: auto; }
.switch-dialog-body { display: grid; gap: 16px; }
.switch-tip { margin: 0; font-size: 13.5px; color: var(--ws-muted); }
.switch-presets h3, .switch-form h3 { margin: 0 0 9px; font-size: 14px; }
.switch-preset-grid { display: grid; gap: 8px; }
.switch-preset-card { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 11px; border: 1.5px solid var(--ws-line); background: #f9fcfa; text-align: start; }
.switch-preset-card:hover { border-color: var(--ws-accent); background: #edf8f2; }
.switch-preset-card.is-current { border-color: var(--ws-accent); background: #e3f5ec; }
.preset-copy strong { display: block; font-size: 14px; }
.preset-copy small { color: var(--ws-muted); font-size: 12px; }
.preset-badge { font-size: 12px; font-weight: 700; color: var(--ws-accent); }
.switch-form { display: grid; gap: 10px; border-top: 1px solid var(--ws-line); padding-top: 14px; }

#notice { display: flex; position: fixed; z-index: 40; right: 20px; bottom: 20px; gap: 8px; align-items: center; padding: 11px 16px; background: #144d3b; color: #fff; border-radius: 11px; font-size: 13.5px; box-shadow: 0 10px 26px rgba(15,44,32,.24); }

.workspace :is(button, summary, select, .ws-button, .workspace-brand, .workspace-tabs a,
  .workspace-account, .workspace-account-options a, .home-quick-chips a, .ws-back, .ws-text-link,
  .media-chip-card a, audio) { min-height: 44px; }
.workspace :is(button, summary, select, .ws-button, .workspace-tabs a, .workspace-account) { min-width: 44px; }
.workspace .thinking-box summary { min-height: 44px; }
.workspace .ws-text-link, .workspace .media-chip-card a { display: inline-flex; align-items: center; }

/* 平板与窄屏响应式 */
@media (max-width: 1040px) {
  .brand-sub { display: none; }
  .workspace-bar { grid-template-columns: minmax(0,1fr) auto; grid-template-rows: minmax(54px,auto) auto; gap: 0 8px; }
  .workspace-home-nav .workspace-bar { grid-template-rows: minmax(54px,auto); }
  .workspace-tabs { grid-area: 2 / 1 / 3 / -1; justify-content: start; padding-bottom: 6px; }
  .workbench-shell { gap: 10px; }
  .free-chat-main { grid-row: 1; }
  .chat-stream { max-height: min(56dvh, 570px); }
  .canvas-body { min-height: 420px; }
  .media-bar-list { flex-wrap: wrap; }
  .media-bar-list { max-height: 180px; overflow: auto; }
  .split-workbench { grid-template-columns: minmax(0,1fr); }
  .workbench-shell { height: auto; min-height: 0; }
  .chat-pane { min-height: 460px; }
  .canvas-pane { min-height: 520px; }
  .free-chat-layout { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 760px) {
  .workspace-bar { width: calc(100% - 24px); }
  .workspace-tabs { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; }
  .workspace-tabs a { padding: 0 8px; font-size: 12.5px; }
  .home-grid, .idea-cards, .drawer-card-grid { grid-template-columns: 1fr; }
  .work-row { grid-template-columns: 40px minmax(0,1fr); }
  .task-stage-nav ol { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  .task-stage-nav li + li::before { content: none; }
}

.ws-text-link { color: var(--ws-accent); font-weight: 700; }
.sample-actions { margin-bottom: 14px; }
.empty-connect { margin-top: 14px; }
.criteria.connect-criteria { margin: 0; }
.connect-actions { margin-top: 10px; }
.switch-form.connect-form { border-top: 0; padding-top: 4px; }
.connect-payment { margin-top: 4px; }
.task-drawer-actions { margin-top: 12px; }
.teacher-demo-pane { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.teacher-demo-description { margin: 4px 0 0; }
.teacher-task-tags { margin-bottom: 6px; }
.teacher-board-heading { margin-bottom: 10px; }
.teacher-notice-actions { justify-content: center; margin-top: 12px; }

.project-preview-page, .project-preview, .project-preview iframe { width: 100%; height: 100%; margin: 0; border: 0; }
.project-preview { background: #f5f8f6; }
.project-preview iframe { display: block; }
.preview-status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 16px; background: #f5f8f6; color: var(--ws-muted); text-align: center; font: 14px/1.5 var(--ws-font); }

@media (max-width: 530px) {
  .workspace-right { gap: 4px; }
  .engine-pill { white-space: normal; padding-inline: 6px; text-align: center; }
  .acct-role { display: none; }
}
.project-preview [hidden] { display: none; }

.switch-dialog-body { max-height: min(74dvh, 620px); }
.switch-form input { min-height: 44px; }
.switch-preset-card:disabled { cursor: default; }

.drawer-sample-stage.drawer-sample-card { height: auto; min-height: 0; }

.composer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment-button { font-size: 17px; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.attachment-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px; border: 1px solid var(--ws-line); border-radius: 8px; font-size: 12px; }
.attachment-chip img { width: 30px; height: 30px; object-fit: cover; border-radius: 4px; }
.attachment-chip span { max-width: 14ch; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.attachment-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; min-width: 28px; min-height: 28px; font-size: 18px; }
.draft-drawer { background: #fff; border-bottom: 1px solid var(--ws-line); padding: 8px 16px; }
.draft-drawer summary { width: max-content; cursor: pointer; font-size: 14px; font-weight: 650; }
.draft-list { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 3px; }
.draft-list p { margin: 4px 0; color: var(--ws-muted); font-size: 13px; }
.draft-card { display: flex; align-items: center; gap: 8px; padding: 6px; flex: 0 0 auto; border: 1px solid var(--ws-line); border-radius: 10px; }
.draft-open { display: flex; align-items: center; gap: 8px; text-align: left; }
.draft-open img { width: 38px; height: 38px; object-fit: cover; border-radius: 5px; }
.draft-open span { display: grid; gap: 2px; }
.draft-open strong { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-open small { color: var(--ws-muted); }
