/* 辅导台横屏左右布局（John 2026-10-12）—— 配合 split-layout.js。只在 body.v2-split-layout 时生效。 */
body[data-tutor-ui="2"].v2-split-layout #main .main-shell{display:flex;flex-direction:column;min-height:0;overflow:hidden}
body[data-tutor-ui="2"].v2-split-layout #main .v2-split-row{flex:1;min-height:0;display:grid;grid-template-columns:var(--v2-left-w,420px) 14px minmax(0,1fr);padding:0 0 12px}
body[data-tutor-ui="2"].v2-split-layout #main .v2-split-row.is-dragging{cursor:col-resize;user-select:none}
body[data-tutor-ui="2"].v2-split-layout #main .v2-split-row.is-dragging iframe,
body[data-tutor-ui="2"].v2-split-layout #main .v2-split-row.is-dragging canvas{pointer-events:none}

/* 左栏 */
body[data-tutor-ui="2"].v2-split-layout #main .v2-left{display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-problem{flex:0 1 auto;min-height:0;max-height:min(28%,220px,var(--v2-problem-limit,220px));overflow:auto;background:var(--paper,#fffef9);border:1px solid var(--line,#d8ddd1);border-radius:18px;box-shadow:0 3px 12px #253f300f}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-problem.is-resized{flex:none;height:var(--v2-problem-h);max-height:var(--v2-problem-limit,220px)}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-problem:has(#board-problem.hidden){display:none}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-problem #board-problem{border:0;padding:14px 18px 16px;margin:0;max-height:none;overflow:visible}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-problem #bq-text{font-size:18px;line-height:1.8;margin:6px 0 0}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-problem:has(#bq-text.hidden){height:42px!important;max-height:42px!important;overflow:hidden;border-radius:12px}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-problem:has(#bq-text.hidden) #board-problem{padding:5px 14px!important}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-problem:has(#bq-text.hidden) .bp-head{margin:0}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-problem:has(#bq-text.hidden) .pane-tag::after{content:' · 已收起'}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-problem:has(#bq-text.hidden) :is(#bq-thumb,#bq-more){display:none!important}
body[data-tutor-ui="2"].v2-split-layout #main #bq-toggle{min-height:28px;padding:3px 10px;border-radius:8px;border:1px solid #b8c9ae;background:#f3f6ee;color:#315b40;font-weight:650}
body[data-tutor-ui="2"].v2-split-layout #main .v2-problem-split{position:relative;flex:none;height:16px;margin:-6px 0;cursor:row-resize;touch-action:none;outline:none}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-problem:has(#board-problem.hidden)+.v2-problem-split,
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-problem:has(#bq-text.hidden)+.v2-problem-split{display:none}
body[data-tutor-ui="2"].v2-split-layout #main .v2-problem-split::before{content:'';position:absolute;left:calc(50% - 28px);top:7px;width:56px;height:3px;border-radius:3px;background:#adc0a5;transition:background .12s,width .12s,left .12s}
body[data-tutor-ui="2"].v2-split-layout #main .v2-problem-split:hover::before,
body[data-tutor-ui="2"].v2-split-layout #main .v2-problem-split.is-dragging::before{left:calc(50% - 38px);width:76px;background:var(--accent,#446c4a)}
body[data-tutor-ui="2"].v2-split-layout #main .v2-problem-split:focus-visible::before{outline:2px solid var(--accent,#446c4a);outline-offset:3px}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left.is-resizing-problem{user-select:none;cursor:row-resize}

/* 对话记录：常驻，不再是浮层 */
body[data-tutor-ui="2"].v2-split-layout #main .v2-left > .v2-transcript{display:flex!important;flex-direction:column;position:relative;inset:auto;top:auto;bottom:auto;width:auto;flex:1 1 0;min-height:150px;z-index:auto;box-shadow:none;border:1px solid var(--line,#d8ddd1);border-radius:18px;overflow:hidden;background:var(--paper,#fffef9)}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left > .v2-transcript .v2-sheet-head{padding:10px 16px}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left > .v2-transcript .v2-sheet-head h3{font-size:14px}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left > .v2-transcript .v2-sheet-head button{display:none}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left > .v2-transcript #messages{padding:14px 16px}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left > .v2-transcript .msg{font-size:15px;line-height:1.75;max-width:92%}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left > .v2-transcript .msg.bot:last-of-type{background:#fff8df;box-shadow:inset 0 0 0 1px #e3cf8c}

/* 输入区和工具栏放在左栏底部；最新回复已在对话里，黄条和「对话记录」按钮不再需要 */
body[data-tutor-ui="2"].v2-split-layout #main .v2-left > .session-dock{flex:none;position:relative;bottom:auto;padding:0;margin:0;min-height:0;background:transparent}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left .v2-text-reply{display:none!important}
/* 输入框下面那行「你：……」回显：对话已常驻左栏，横屏里不再重复一遍（iPad mini 横屏实测省出 25px） */
body[data-tutor-ui="2"].v2-split-layout #main .v2-left .v2-input-receipt{display:none!important}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left > .session-dock{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left > .session-dock > #v2-composer{flex:0 0 100%}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left > .session-dock > .source-tools{margin-left:auto}

/* 分隔栏 */
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-split{position:relative;cursor:col-resize;touch-action:none;outline:none}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-split::before{content:'';position:absolute;top:18%;bottom:18%;left:6px;width:2px;border-radius:2px;background:var(--line,#d8ddd1);transition:background .12s,top .12s,bottom .12s}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-split::after{content:'';position:absolute;top:50%;left:3px;width:8px;height:40px;margin-top:-20px;border-radius:6px;background:var(--paper,#fffef9);border:1px solid #b4c5af;box-sizing:border-box}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-split:hover::before,
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-split.is-dragging::before{background:var(--accent,#446c4a);top:0;bottom:0}
body[data-tutor-ui="2"].v2-split-layout #main .v2-left-split:focus-visible::after{outline:2px solid var(--accent,#446c4a);outline-offset:2px}

/* 右栏：板书占满高度 */
body[data-tutor-ui="2"].v2-split-layout #main .v2-split-row > .workbench{min-width:0;min-height:0;height:100%;padding:0;margin:0;display:flex;flex-direction:column}
body[data-tutor-ui="2"].v2-split-layout #main .v2-split-row > .workbench > .learning-canvas{flex:1;min-height:0;height:auto;max-height:none}
body[data-tutor-ui="2"].v2-split-layout #main .learning-canvas.has-history{display:flex;flex-direction:column}
body[data-tutor-ui="2"].v2-split-layout #main .learning-canvas .v2-split{display:none!important}

/* ── 手机端按钮梳理（配合 split-layout.js 第二段）── */
html.ui2-phone body.v2-phone-dock #main .session-dock .source-tools{display:flex;align-items:center;gap:6px}
html.ui2-phone body.v2-phone-dock #main .source-tools #v2-capture-entry{order:1}
html.ui2-phone body.v2-phone-dock #main .source-tools #btn-submit-work{order:2}
html.ui2-phone body.v2-phone-dock #main .source-tools #v2-switch-problem{order:3}
html.ui2-phone body.v2-phone-dock #main .source-tools #btn-solved{order:4}
html.ui2-phone body.v2-phone-dock #main .source-tools .v2-tools-entry{order:5;margin-left:auto}
html.ui2-phone body.v2-phone-dock #main:not(#v2p-a):not(#v2p-b) .source-tools #v2-capture-entry{width:auto!important;min-width:96px!important;padding:0 16px!important;gap:6px!important;flex-direction:row!important}
html.ui2-phone body.v2-phone-dock #main:not(#v2p-a):not(#v2p-b) .source-tools #v2-capture-entry .v2-action-label{display:inline!important;position:static!important;width:auto!important;height:auto!important;clip:auto!important;clip-path:none!important;overflow:visible!important;font-size:15px!important;font-weight:650!important;white-space:nowrap!important}
html.ui2-phone body.v2-phone-dock #main .v2-tools .v2-phone-tray{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
html.ui2-phone body.v2-phone-dock #main:not(#v2p-a):not(#v2p-b) .v2-phone-tray > :not([hidden]){display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:10px!important;width:auto!important;min-width:0!important;height:auto!important;min-height:64px!important;margin:0!important;padding:10px 16px!important;border:1px solid var(--line,#d8ddd1)!important;border-radius:16px!important;background:#f7f6f0!important;box-shadow:none!important;color:#273b32!important;font-size:16px!important;font-weight:600!important;text-decoration:none!important}
html.ui2-phone body.v2-phone-dock #main:not(#v2p-a):not(#v2p-b) .v2-phone-tray > [hidden]{display:none!important}

/* ── 手机横屏紧凑版（body.v2-split-compact，配合 split-layout.js；10-12 第二轮）──
   手机横屏只有 330–380px 高：左栏 = 精简顶栏 + 对话 + 输入 + 工具，右栏 = 板书满高。
   tutor-mobile.css 里手机规则大多带 !important，这里用 #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) 提一级优先级盖过去。 */
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main.app-shell{padding-top:0!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .main-shell{height:100dvh!important;max-height:100dvh!important;min-height:0!important;padding:0 max(8px,env(safe-area-inset-right)) 0 max(8px,env(safe-area-inset-left))!important;box-sizing:border-box}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-split-row{grid-template-columns:var(--v2-left-w,320px) 12px minmax(0,1fr)!important;padding:6px 0 max(6px,env(safe-area-inset-bottom))!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left{gap:6px!important}
/* 精简顶栏：菜单 + 新辅导 + 电话/文字 */
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .topbar{position:static!important;display:flex!important;align-items:center!important;gap:6px!important;height:44px!important;min-height:44px!important;padding:0!important;margin:0!important;flex:none!important;background:transparent!important;box-shadow:none!important;border:0!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .topbar > .page-heading{display:none!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .topbar > .top-actions{display:flex!important;margin-left:auto!important;gap:6px!important;align-items:center!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .topbar > .top-actions > :not(.mode-switch):not(#btn-new-chat){display:none!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .topbar :is(.v2-nav-toggle,#btn-new-chat){width:42px!important;min-width:42px!important;height:42px!important;min-height:42px!important;padding:0!important;font-size:0!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .topbar .mode-switch{padding:2px!important;margin:0!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .topbar .mode-switch button{width:40px!important;min-width:40px!important;height:38px!important;min-height:38px!important;padding:2px!important}
/* 对话 */
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .v2-transcript{position:relative!important;inset:auto!important;flex:1 1 0!important;min-height:60px!important;height:auto!important;border-radius:14px!important;z-index:auto!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .v2-transcript .v2-sheet-head{display:none!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .v2-transcript #messages{padding:8px 10px!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .v2-transcript .msg{font-size:14px!important;line-height:1.55!important;max-width:94%!important}
/* 输入 + 工具 */
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .session-dock{position:relative!important;bottom:auto!important;display:flex!important;flex-wrap:wrap!important;gap:6px!important;padding:0!important;margin:0!important;min-height:0!important;height:auto!important;background:transparent!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .session-dock > #v2-composer{flex:0 0 100%!important;padding:5px!important;min-height:0!important;border-radius:14px!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left #v2-composer :is(#btn-mic,#btn-send,.ui2m-compose-toggle){min-height:40px!important;height:40px!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left #v2-composer #chat-input{min-height:40px!important;font-size:15px!important;padding:8px 10px!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .session-dock > .source-tools{flex:1 1 100%!important;display:flex!important;justify-content:space-between!important;gap:4px!important;margin:0!important;padding:0!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .session-dock > .source-tools > *{width:42px!important;min-width:42px!important;height:42px!important;min-height:42px!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .session-dock > .source-tools > #v2-capture-entry{width:auto!important;min-width:84px!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .session-dock > :is(.v2-text-reply,.mentor-actions){display:none!important}
/* 右栏板书 */
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-split-row > .workbench{height:100%!important;padding:0!important;margin:0!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-split-row > .workbench > .learning-canvas{height:100%!important;max-height:none!important;min-height:0!important;flex:1 1 auto!important;display:flex!important;flex-direction:column!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .learning-canvas > #board-panel{flex:1 1 auto!important;height:auto!important;min-height:0!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .learning-canvas > .canvas-head{min-height:0!important;padding:4px 8px!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-problem{padding:8px 0!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-problem #bq-text{font-size:15px!important;line-height:1.55!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .topbar > .mentor{display:none!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left .v2-input-receipt{display:none!important}
/* 板书头一行：‹ STEP › ＋ 全屏 ＋ …（和竖屏手机同款），下载/打印收起 */
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .learning-canvas > .canvas-head{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;gap:6px!important;height:auto!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .learning-canvas > .canvas-head .canvas-name{display:none!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .learning-canvas > .canvas-head .board-page-nav{display:flex!important;flex:1 1 auto!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:flex-start!important;gap:6px!important;min-width:0!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .learning-canvas > .canvas-head .board-page-nav > button{width:42px!important;min-width:42px!important;height:40px!important;min-height:40px!important;padding:0!important;font-size:0!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .learning-canvas > .canvas-head .board-page-nav > button:first-of-type::after{content:'‹';font-size:24px;line-height:1}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .learning-canvas > .canvas-head .board-page-nav > button:nth-of-type(2)::after{content:'›';font-size:24px;line-height:1}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .learning-canvas > .canvas-head .board-page-nav > button:nth-of-type(n+3){display:none!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .learning-canvas > .canvas-head .board-page-nav > span{font-size:11px!important;white-space:nowrap!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .learning-canvas > .canvas-head .canvas-actions{display:flex!important;flex:none!important;gap:6px!important;margin:0!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .learning-canvas > .canvas-head .canvas-actions > *{height:40px!important;min-height:40px!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .session-dock > .source-tools > *{flex:0 0 42px!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left > .session-dock > .source-tools > #v2-capture-entry{flex:0 0 auto!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) .v2-left #v2-composer :is(#btn-mic,#btn-send,.ui2m-compose-toggle){flex:0 0 auto!important;width:44px!important;min-width:44px!important;padding:0!important}
/* 手机横屏高度最缺：图和讲解左右并排（板书默认窄于 700px 就上下叠，横屏里图只剩一半能看见） */
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-page-stage:not(:has(#jxgbox.hidden)){grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;gap:10px!important}
/* 题目在横屏手机上先只占一行，点一下展开 / 收回（split-layout.js 切换 .v2-bq-open） */
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-problem:not(.v2-bq-open) #bq-text{display:-webkit-box!important;-webkit-line-clamp:1!important;-webkit-box-orient:vertical!important;overflow:hidden!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-problem{cursor:pointer;padding:4px 0 6px!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-problem .bp-head{display:none!important}

/* ── 手机字号随屏宽自适应（John 10-12：省空间）──
   以 iPhone 15（393 宽）为基准：题目 16px、步骤标题 17px、步骤正文 15.5px；Pro Max 稍大，SE 稍小；
   不低于 14px，孩子看得清。横屏紧凑版另有更小的题目字号（上面）。 */
html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) #board-problem #bq-text{font-size:clamp(15px,4.1vw,17px)!important;line-height:1.6!important}
html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) #board-notes .bl-title{font-size:clamp(16px,4.4vw,18px)!important;line-height:1.45!important}
html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) #board-notes .note-line{font-size:clamp(14.5px,3.95vw,16.5px)!important;line-height:1.6!important}
html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) #board-notes .bl-result{font-size:clamp(16px,4.4vw,18px)!important}
html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) #messages .msg{font-size:clamp(14px,3.7vw,15px)!important;line-height:1.6!important}
/* 输入框下面的「你：……」回显只留一行 */
html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) .v2-input-receipt{font-size:13px!important;line-height:1.4!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:100%!important}

/* ── 手机竖屏：板书 = 顶栏和输入区之间剩下的全部高度 ──
   原来画布写死 clamp(460px, 100dvh-218px, 730px)，iPhone 15 上实际只剩 403px，
   画布底部 57px 压在黄条和输入框下面（图的底边、讲解第一行都被盖住）。改成跟着剩余空间走，SE 到 Pro Max 都贴合。 */
@media (orientation:portrait){
 html.ui2-phone:not(.ui2m-board-full-on) body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) .main-shell > .workbench{flex:1 1 auto!important;min-height:0!important;grid-template-rows:minmax(0,1fr)!important}
 html.ui2-phone:not(.ui2m-board-full-on) body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) .main-shell > .workbench > .learning-canvas,
 html.ui2-phone:not(.ui2m-board-full-on) body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) .main-shell > .workbench > .learning-canvas.has-history{height:auto!important;min-height:0!important;max-height:none!important}
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) .main-shell > .session-dock{flex:none!important}
}

/* ── 手机竖屏输入行：两种状态各自一套明确的格子 ──
   说话状态：键盘 | 「点一下说话」占满 | 💬；打字状态：🎤 | 输入框占满 | 发送 | 💬。
   原来是 48×4+149 的固定格子，打字状态输入框只有 48px 宽（看不见自己打的字）。 */
@media (orientation:portrait){
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b):not(#v2f-c) #v2-composer{grid-template-columns:44px minmax(0,1fr) 48px!important;column-gap:8px!important}
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b):not(#v2f-c) #v2-composer.ui2m-kbd{grid-template-columns:44px minmax(0,1fr) 48px 48px!important}
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b):not(#v2f-c) #v2-composer > .ui2m-compose-toggle{grid-column:1!important;grid-row:1!important}
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b):not(#v2f-c) #v2-composer > :is(#btn-mic,#chat-input){grid-column:2!important;grid-row:1!important;width:auto!important;min-width:0!important;max-width:none!important;justify-self:stretch!important}
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b):not(#v2f-c) #v2-composer > #btn-send{grid-column:3!important;grid-row:1!important}
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b):not(#v2f-c) #v2-composer > #v2-history-btn{grid-column:-2!important;grid-row:1!important}
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b):not(#v2f-c) #v2-composer > .v2-input-receipt{grid-column:1/-1!important}
}
@media (orientation:portrait){
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b):not(#v2f-c) #v2-composer > #btn-send{font-size:0!important}
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b):not(#v2f-c) #v2-composer > #btn-send :not(svg):not(svg *){display:none!important}
}

/* ── 手机竖屏省空间（iPhone SE 实测板书只剩 ~200px）── */
@media (orientation:portrait){
 /* 题目卡去掉「📘 题目」标签那一行，收起按钮浮在右上角 */
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) #board-problem{position:relative!important}
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) #board-problem .bp-head .pane-tag{display:none!important}
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) #board-problem .bp-head{position:absolute!important;top:4px!important;right:0!important;margin:0!important;padding:0!important;z-index:2}
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) #board-problem #bq-text{padding-right:52px!important;margin-top:4px!important}
 /* 提示气泡放到上方（原来压在板书的图上） */
 html.ui2-phone #ui2m-toast{top:calc(64px + env(safe-area-inset-top))!important;bottom:auto!important}
}
@media (orientation:portrait) and (max-height:620px){
 /* 矮屏（SE、带底栏的 Safari）：回复黄条一行、输入回显不占行 */
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b):not(#v2f-c) .v2-text-reply:not(.is-expanded) p{height:1.6em!important;max-height:1.6em!important;overflow:hidden!important}
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b):not(#v2f-c) .v2-input-receipt{display:none!important}
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b):not(#v2f-c) .v2-text-reply:not(.is-expanded){grid-template-rows:auto!important;align-items:center!important;min-height:0!important;height:auto!important}
 /* 题目先显示两行，点题目展开 / 收回 */
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b):not(#v2f-c) #board-problem:not(.v2-bq-open) #bq-text{display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important}
}
/* 手机打开「我们的对话」时，上方板书预览条显示图，不重复显示题干（题干就是对话第一条） */
@media (orientation:portrait){
 html.ui2-phone body[data-tutor-ui="2"] #main:not(#v2f-a):not(#v2f-b) .learning-canvas.has-history #board-problem{display:none!important}
}
/* 横屏手机：图形工具（旋转/放大/缩小/撤销/重做/复位）排成一行，可左右滑，提示文字收起 */
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-facts{flex-wrap:nowrap!important;overflow-x:auto!important;gap:6px!important;padding:4px 0!important;-webkit-overflow-scrolling:touch;scrollbar-width:none}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-facts .bw-solid-camera{flex-wrap:nowrap!important;gap:6px!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-facts .bw-solid-camera > :not(button){display:none!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-facts button{flex:none!important;min-height:40px!important;padding:0 12px!important}
/* iPad 竖拿（触屏、非手机、≤1023 宽）：板书头一行放下，Leo 名字下的小字不再折三行 */
@media (orientation:portrait) and (max-width:1023px){
 html.ui2-touch:not(.ui2-phone) body[data-tutor-ui="2"] #main .learning-canvas > .canvas-head .canvas-name{display:none!important}
html.ui2-touch:not(.ui2-phone) body[data-tutor-ui="2"] #main #v2-mentor-sub{display:none!important}
}

/* Reading controls live with the conversation in wide layout and in the canvas head elsewhere. */
body[data-tutor-ui="2"] #main .v2-read-controls{display:inline-flex;align-items:center;gap:2px;flex:none;padding:3px;border:1px solid var(--line,#d8ddd1);border-radius:10px;background:var(--paper,#fffef9);color:var(--ink,#273b32)}
body[data-tutor-ui="2"] #main .v2-read-controls button{display:grid!important;place-items:center;width:32px;min-width:32px;height:32px;min-height:32px;padding:0!important;border:0!important;border-radius:7px;background:transparent!important;color:inherit!important;box-shadow:none!important;font:700 20px/1 system-ui!important}
body[data-tutor-ui="2"] #main .v2-read-controls button:hover:not(:disabled){background:#e7ecdf!important}
body[data-tutor-ui="2"] #main .v2-read-controls button:focus-visible{outline:2px solid var(--accent,#446c4a);outline-offset:1px}
body[data-tutor-ui="2"] #main .v2-read-controls button:disabled{opacity:.35;cursor:default}
body[data-tutor-ui="2"] #main .v2-read-value{min-width:35px;text-align:center;font:600 11px/1 system-ui;white-space:nowrap}
body[data-tutor-ui="2"].v2-split-layout #main .v2-transcript .v2-sheet-head .v2-read-controls{margin-left:auto}
@media(max-width:700px){body[data-tutor-ui="2"] #main .v2-read-value{display:none}body[data-tutor-ui="2"] #main .v2-read-controls button{width:30px;min-width:30px}}
body[data-tutor-ui="2"] #main #board-panel #board-problem:has(#bq-text.hidden){height:44px!important;max-height:44px!important;overflow:hidden!important;padding:4px 8px!important}
body[data-tutor-ui="2"] #main #board-panel #board-problem:has(#bq-text.hidden) .bp-head{margin:0}
body[data-tutor-ui="2"] #main #board-panel #board-problem:has(#bq-text.hidden) :is(#bq-thumb,#bq-more){display:none!important}
@media(max-width:700px){
 html.ui2-phone body[data-tutor-ui="2"] #main#main#main #board-problem:has(#bq-text.hidden){height:40px!important;min-height:40px!important;max-height:40px!important;padding:4px 8px!important;overflow:hidden!important}
 html.ui2-phone body[data-tutor-ui="2"] #main#main#main #board-problem:has(#bq-text.hidden) .bp-head{position:static!important;display:flex!important;align-items:center!important;margin:0!important;padding:0!important}
 html.ui2-phone body[data-tutor-ui="2"] #main#main#main #board-problem:has(#bq-text.hidden) .pane-tag{display:inline-flex!important;position:static!important;font-size:12px!important}
 html.ui2-phone body[data-tutor-ui="2"] #main#main#main #board-problem:has(#bq-text.hidden) .pane-tag::after{content:' · 已收起'}
 html.ui2-phone body[data-tutor-ui="2"] #main#main#main #board-problem:has(#bq-text.hidden) #bq-toggle{margin-left:auto!important}
 html.ui2-phone body[data-tutor-ui="2"] #main#main#main #board-problem:has(#bq-text.hidden) :is(#bq-thumb,#bq-more){display:none!important}
}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-problem #bq-text.hidden{display:none!important}
/* The compact landscape question still needs a reachable collapse button. */
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-problem{position:relative!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-problem:not(:has(#bq-text.hidden)) .bp-head{display:flex!important;position:absolute!important;top:0;right:0;z-index:2;margin:0!important;padding:0!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-problem:not(:has(#bq-text.hidden)) .bp-head .pane-tag{display:none!important}
html.ui2-phone body[data-tutor-ui="2"].v2-split-compact #main:not(#v2c-a):not(#v2c-b):not(#v2c-c) #board-problem:not(:has(#bq-text.hidden)) #bq-text{padding-right:58px!important}

/* Existing phone styles use several ID selectors and !important. Repeated #main keeps this explicit
   reader preference above them without changing their default responsive typography. */
body[data-tutor-ui="2"][data-v2-reading-size] #main#main#main#main#main :is(#bq-text,#bp-text){font-size:var(--v2-read-problem)!important}
body[data-tutor-ui="2"][data-v2-reading-size] #main#main#main#main#main #messages :is(.msg.bot,.msg.user){font-size:var(--v2-read-chat)!important}
body[data-tutor-ui="2"][data-v2-reading-size] #main#main#main#main#main #chat-input{font-size:var(--v2-read-input)!important}
body[data-tutor-ui="2"][data-v2-reading-size] #main#main#main#main#main #board-notes .bl-title{font-size:var(--v2-read-board-title)!important}
body[data-tutor-ui="2"][data-v2-reading-size] #main#main#main#main#main #board-notes .note-line{font-size:var(--v2-read-board-line)!important}
body[data-tutor-ui="2"][data-v2-reading-size] #main#main#main#main#main #board-notes .bl-result{font-size:var(--v2-read-board-result)!important}
body[data-tutor-ui="2"][data-v2-reading-size] #main#main#main#main#main #board-notes .note-formula{font-size:var(--v2-read-board-formula)!important}
body[data-tutor-ui="2"][data-v2-reading-size] #main#main#main#main#main #board-notes :is(.note-kcard p,.qw-concept > div:nth-child(3),.qw-outline > div,.qw-table table){font-size:var(--v2-read-board-card)!important}
body[data-tutor-ui="2"][data-v2-reading-size] #main#main#main#main#main #board-knowledge .kn-title{font-size:var(--v2-read-knowledge-title)!important}
body[data-tutor-ui="2"][data-v2-reading-size] #main#main#main#main#main :is(#board-knowledge .kn-card p,.reading-paragraph p,.reading-question){font-size:var(--v2-read-knowledge-line)!important}
/* 横屏左右布局：左栏按钮 48px（主题默认 60px，左栏 420–480 宽时「做出来了」会单独掉到第二行、输入框被挤窄） */
body[data-tutor-ui="2"].v2-split-layout:not(.v2-split-compact) #main:not(#v2w-a):not(#v2w-b):not(#v2w-c) .v2-left > .session-dock > .source-tools{gap:6px!important}
body[data-tutor-ui="2"].v2-split-layout:not(.v2-split-compact) #main:not(#v2w-a):not(#v2w-b):not(#v2w-c) .v2-left > .session-dock :is(.source-tools > *,#btn-solved){flex:0 0 48px!important;width:48px!important;min-width:48px!important;height:48px!important;min-height:48px!important}
body[data-tutor-ui="2"].v2-split-layout:not(.v2-split-compact) #main:not(#v2w-a):not(#v2w-b):not(#v2w-c) .v2-left #v2-composer :is(#btn-mic,.qm-aloud,#btn-read-aloud,#btn-send){width:48px!important;min-width:48px!important;height:48px!important;min-height:48px!important}
/* 输入框占位文字只占一行（左栏窄时「在这里问 Leo…」会折成两行露半截） */
body[data-tutor-ui="2"].v2-split-layout #main .v2-left #chat-input::placeholder{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.ui2-phone body[data-tutor-ui="2"] #main #chat-input::placeholder{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ── 语音模式左右布局（body.v2-split-voice；P0 10-12）──
   .workbench 摊平成网格的直接成员：头像栏（.mentor）在左栏顶部，.v2-left 在它下面，板书占右栏两行高。 */
body[data-tutor-ui="2"].v2-split-layout.v2-split-voice #main .v2-split-row{grid-template-rows:auto minmax(0,1fr)!important;row-gap:10px}
body[data-tutor-ui="2"].v2-split-layout.v2-split-voice #main .v2-split-row > .workbench{display:contents!important}
body[data-tutor-ui="2"].v2-split-layout.v2-split-voice #main .v2-split-row > .v2-left{grid-column:1;grid-row:2;min-height:0}
body[data-tutor-ui="2"].v2-split-layout.v2-split-voice #main .v2-split-row > .v2-left-split{grid-column:2;grid-row:1 / span 2}
body[data-tutor-ui="2"].v2-split-layout.v2-split-voice #main .v2-split-row > .workbench > .learning-canvas{grid-column:3;grid-row:1 / span 2;height:auto!important;min-height:0!important;max-height:none!important;margin:0!important}
/* 头像栏：紧凑横排 —— 小头像 | Leo · 状态 / 通话按钮 */
body[data-tutor-ui="2"].v2-split-layout.v2-split-voice #main:not(#v2v-a) .v2-split-row > .workbench > .mentor{grid-column:1;grid-row:1;display:grid!important;grid-template-columns:96px minmax(0,1fr)!important;grid-template-rows:auto auto auto!important;column-gap:14px;row-gap:4px;align-items:center;width:auto!important;height:auto!important;min-height:0!important;max-height:none!important;margin:0!important;padding:10px 14px!important;background:var(--paper,#fffef9);border:1px solid var(--line,#d8ddd1);border-radius:18px;box-shadow:0 3px 12px #253f300f;overflow:hidden}
body[data-tutor-ui="2"].v2-split-layout.v2-split-voice #main:not(#v2v-a) .mentor > .portrait-stage{grid-column:1;grid-row:1 / span 3;width:96px!important;height:116px!important;min-height:0!important;margin:0!important}
body[data-tutor-ui="2"].v2-split-layout.v2-split-voice #main:not(#v2v-a) .mentor > .portrait-stage :is(#leo-view,canvas,.portrait-art){width:96px!important;height:116px!important}
body[data-tutor-ui="2"].v2-split-layout.v2-split-voice #main:not(#v2v-a) .mentor > .mentor-title{position:static!important;inset:auto!important;grid-column:2;grid-row:1;margin:0!important}
body[data-tutor-ui="2"].v2-split-layout.v2-split-voice #main:not(#v2v-a) .mentor > .mentor-message{grid-column:2;grid-row:2;margin:0!important;padding:0!important;min-height:0!important;height:auto!important}
body[data-tutor-ui="2"].v2-split-layout.v2-split-voice #main:not(#v2v-a) .mentor > .mentor-message #v2-mentor-copy{display:none!important}
body[data-tutor-ui="2"].v2-split-layout.v2-split-voice #main:not(#v2v-a) .mentor > .v2-student-line{display:none!important}
body[data-tutor-ui="2"].v2-split-layout.v2-split-voice #main:not(#v2v-a) .mentor > .mentor-actions{grid-column:2;grid-row:3;display:flex!important;flex-wrap:wrap;gap:8px;margin:0!important;padding:0!important;height:auto!important}
/* 对话常驻左栏后，头像栏里的「全部消息」开关多余 */
body[data-tutor-ui="2"].v2-split-layout.v2-split-voice #main .mentor #v2-all-messages{display:none!important}
