/* Mobile browsing layer only. Fine-pointer desktop and all print styles keep
   their original cascade; mobile React wrappers retain every control/draft. */
@media screen and (max-width:640px), screen and (max-width:960px) and (hover:none) and (pointer:coarse) {
  #root [code-path$="Layout.tsx:94:5"] { display:block; }
  #root aside[code-path$="Layout.tsx:98:7"] {
    position:relative; inset:auto; width:calc(100% - 16px); height:auto;
    margin:8px 8px 0; border:1px solid var(--dy-line);
    border-radius:16px 6px 16px 6px; overflow:hidden;
  }
  #root aside[code-path$="Layout.tsx:98:7"]::before { opacity:.035; width:80px; height:90px; bottom:6px; }
  #root [code-path$="Layout.tsx:99:9"] { padding:8px 12px 6px; }
  #root [code-path$="Layout.tsx:100:11"] { max-width:calc(100% - 142px); min-height:31px; gap:7px; }
  #root [code-path$="Layout.tsx:101:13"] { width:28px; height:28px; flex-shrink:0; border-radius:10px 4px 10px 4px; font-size:15px; }
  #root [code-path$="Layout.tsx:104:13"] { min-width:0; }
  #root [code-path$="Layout.tsx:105:15"] { font-size:13px; line-height:18px; letter-spacing:0; white-space:nowrap; }
  #root [code-path$="Layout.tsx:106:15"] { margin-top:2px; font-size:9px; line-height:11px; white-space:nowrap; }

  /* The class selector and its existing manager share a compact row. Reserve a
     separate right-hand lane for the longest running/resting timer state. */
  #root [code-path$="Layout.tsx:112:9"] { padding:0 10px 6px; }
  #root [code-path$="Layout.tsx:113:11"] {
    position:relative; display:grid; grid-template-columns:minmax(0,1fr) 32px;
    align-items:center; gap:4px; padding:4px 6px; margin-right:140px;
    border-radius:10px 4px 10px 4px; min-width:0;
  }
  #root [code-path$="Layout.tsx:114:13"] { display:contents; }
  #root [code-path$="Layout.tsx:115:15"] {
    position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0;
  }
  #root [code-path$="Layout.tsx:116:15"] {
    grid-column:2; grid-row:1; display:flex; justify-content:center; align-items:center;
    min-width:32px; min-height:34px; padding:6px; border-radius:7px;
  }
  #root [code-path$="Layout.tsx:132:15"] {
    grid-column:1; grid-row:1; width:100%; max-width:100%; min-width:0;
    height:34px; padding:5px 3px; font-size:16px; line-height:20px;
    border-radius:7px 3px 7px 3px;
  }
  #root [code-path$="Layout.tsx:125:15"] {
    grid-column:1; grid-row:1; min-width:0; min-height:34px;
    padding:3px 4px; font-size:11px; line-height:15px; white-space:normal;
  }
  #root [code-path$="Layout.tsx:24:5"] {
    position:absolute; top:16px; right:20px; z-index:30;
    padding:3px 7px; gap:3px; border-radius:14px; box-shadow:var(--dy-shadow);
  }
  #root [code-path$="Layout.tsx:24:5"]::before { display:none; }
  #root [code-path$="Layout.tsx:26:9"] { width:26px; height:26px; min-width:26px; min-height:26px; }
  #root [code-path$="Pomodoro.tsx:171:7"] {
    position:absolute; top:59px; right:20px; z-index:25;
    max-width:128px; min-height:36px; padding:3px 4px; gap:2px;
    border-radius:12px; box-shadow:var(--dy-shadow); white-space:nowrap;
  }
  #root [code-path$="Pomodoro.tsx:172:9"] { min-width:26px; min-height:28px; justify-content:center; flex-shrink:0; }
  #root [code-path$="Pomodoro.tsx:172:9"] svg { width:22px; height:22px; }
  #root [code-path$="Pomodoro.tsx:176:11"] { font-size:10.5px; line-height:16px; letter-spacing:-.2px; }
  #root [code-path$="Pomodoro.tsx:182:11"] { font-size:9px; line-height:16px; }
  #root [code-path$="Pomodoro.tsx:186:9"] { min-width:22px; min-height:28px; padding:0; flex-shrink:0; }

  /* Four frequent destinations stay at the viewport bottom. The remaining
     pages and existing account actions live in the native top-layer chooser. */
  #root .deyu-mobile-navigation { min-width:0; padding:0; }
  #root .deyu-mobile-bottom-bar {
    position:fixed; inset:auto 0 0; z-index:40; width:100%; min-width:0;
    padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px));
    border-top:1px solid var(--dy-line); background:var(--dy-surface);
    box-shadow:0 -5px 22px var(--art-shadow,#583d7710);
  }
  #root .deyu-mobile-primary-nav {
    display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:3px;
    width:100%; max-width:560px; min-width:0; padding:0; margin:0 auto;
  }
  #root .deyu-mobile-primary-nav::before, #root .deyu-mobile-other-nav::before { display:none; }
  #root :is(.deyu-mobile-primary-nav,.deyu-mobile-other-nav) .deyu-mobile-nav-item,
  #root .deyu-mobile-more-toggle {
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    width:100%; min-width:0; min-height:54px; margin:0 !important; padding:5px 2px; gap:3px;
    border:1px solid transparent; border-radius:10px 4px 10px 4px;
    background:transparent; color:var(--dy-muted); box-shadow:none;
    font:inherit; font-size:11px; font-weight:500; line-height:16px; text-align:center;
    letter-spacing:0; cursor:pointer;
  }
  #root :is(.deyu-mobile-primary-nav,.deyu-mobile-other-nav) .deyu-mobile-nav-item--active,
  #root .deyu-mobile-more-toggle.deyu-mobile-nav-item--active,
  #root .deyu-mobile-more-toggle[aria-expanded="true"] {
    border-color:var(--dy-line); background:var(--dy-soft); color:var(--dy-accent-strong); font-weight:650;
  }
  #root .deyu-mobile-nav-icon { display:block; flex:none; font-size:20px; line-height:22px; }
  #root .deyu-mobile-nav-label { display:block; max-width:100%; min-width:0; white-space:nowrap; }
  #root .deyu-mobile-current-page { margin:0 0 4px; color:var(--dy-accent-strong); font-size:10px; line-height:14px; text-align:center; overflow-wrap:anywhere; }
  #root .deyu-mobile-other-dialog {
    position:fixed; inset:0; width:min(calc(100vw - 24px),430px); max-width:none;
    max-height:calc(100dvh - 28px); box-sizing:border-box; margin:auto; padding:14px;
    border:1px solid var(--dy-line); border-radius:22px 7px 22px 7px;
    background:var(--dy-surface); color:var(--dy-ink); box-shadow:0 22px 70px #101c2333;
    overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin;
  }
  #root .deyu-mobile-other-dialog::backdrop { background:#12202c80; backdrop-filter:blur(5px); }
  #root .deyu-mobile-other-heading { position:sticky; top:-14px; z-index:1; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:0 0 8px; margin:0 0 6px; background:var(--dy-surface); }
  #root .deyu-mobile-other-heading h2 { margin:0; font:inherit; font-size:16px; font-weight:650; line-height:24px; }
  #root .deyu-mobile-other-close { display:flex; align-items:center; justify-content:center; min-width:40px; min-height:40px; padding:7px; border:1px solid var(--dy-line); border-radius:10px; background:var(--art-paper,var(--dy-soft)); color:var(--dy-accent-strong); font:inherit; font-size:15px; cursor:pointer; }
  #root .deyu-mobile-other-nav { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; min-width:0; padding:0; margin:0; }
  #root .deyu-mobile-other-nav .deyu-mobile-nav-item { min-height:72px; padding:8px 4px; gap:5px; border-color:var(--dy-line); background:var(--art-paper,var(--dy-soft)); }
  #root .deyu-mobile-other-nav .deyu-mobile-nav-item--active { background:var(--dy-soft); border-color:var(--dy-accent); }
  #root .deyu-mobile-other-nav .deyu-mobile-nav-label { white-space:normal; overflow-wrap:anywhere; }
  #root :is(.deyu-mobile-primary-nav,.deyu-mobile-other-dialog) button:focus-visible { outline:2px solid var(--dy-accent); outline-offset:2px; }
  #root .deyu-mobile-account { margin-top:14px; padding-top:12px; border-top:1px solid var(--dy-line); }
  #root .deyu-mobile-account [code-path$="Layout.tsx:167:9"] { display:block; margin:0; padding:0; border:0; background:transparent; }
  #root .deyu-mobile-account [code-path$="Layout.tsx:168:11"] { min-width:0; margin:0 0 9px; padding:0; border:0; background:transparent; }
  #root .deyu-mobile-account [code-path$="Layout.tsx:169:13"] { display:block; margin-bottom:2px; font-size:10px; color:var(--dy-muted); }
  #root .deyu-mobile-account [code-path$="Layout.tsx:170:13"] { max-width:none; white-space:normal; overflow-wrap:anywhere; font-size:12px; line-height:18px; }
  #root .deyu-mobile-account [code-path$="Layout.tsx:172:15"] { font-size:11px; line-height:17px; }
  #root .deyu-mobile-account [code-path$="Layout.tsx:175:11"] { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; gap:8px; }
  #root .deyu-mobile-account [code-path$="Layout.tsx:175:11"] button { min-width:0; min-height:42px; padding:8px; font-size:12px; white-space:nowrap; }

  #root [code-path$="Layout.tsx:193:7"],
  #root main[code-path$="Layout.tsx:193:7"]:has([code-path$="Layout.tsx:207:5"]) { margin-left:0; min-width:0; padding:12px 10px calc(110px + env(safe-area-inset-bottom,0px)); }
  #root [code-path$="Layout.tsx:194:9"] { min-width:0; max-width:100%; }
  #root [code-path$="Layout.tsx:207:5"] { padding:11px 12px; margin-bottom:11px; gap:8px; border-radius:13px 5px 13px 5px; }
  #root [code-path$="Layout.tsx:209:9"] { font-size:19px; line-height:1.4; }
  #root [code-path$="Layout.tsx:210:18"] { margin-top:3px; font-size:11px; line-height:1.6; overflow-wrap:anywhere; }
  #root [code-path$="Layout.tsx:207:5"] > div { min-width:0; max-width:100%; }
  #root [code-path$="ui-kit.tsx:6:5"] { padding:12px; border-radius:13px 5px 13px 5px; }
  #root [code-path$="ui-kit.tsx:32:5"] { min-height:38px; padding:7px 10px; font-size:12px; line-height:20px; }
  #root main :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),select,textarea) {
    min-width:0; max-width:100%; box-sizing:border-box; font-size:16px;
  }
  #root main :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),select) { min-height:36px; }
  #root main button[class~="text-xs"], #root main button[class~="text-[11px]"] { min-height:32px; }
  #root main label { line-height:1.5; }

  /* Browse first: editor cards retain their controls and draft state, but start
     behind the explicit React-controlled mobile disclosure. */
  #root .deyu-mobile-fold { min-width:0; margin-bottom:12px; border:1px solid var(--dy-line); border-radius:13px 5px 13px 5px; background:var(--dy-surface); box-shadow:var(--dy-shadow); }
  #root .deyu-mobile-fold-toggle {
    display:flex; align-items:center; justify-content:space-between; width:100%; min-height:44px;
    gap:10px; padding:11px 12px; border:0; border-radius:inherit;
    color:var(--dy-ink); background:transparent; text-align:left; font:inherit; font-size:13px; line-height:20px;
  }
  #root .deyu-mobile-fold-toggle > span:first-child { min-width:0; }
  #root .deyu-mobile-fold-toggle strong { font-size:13px; font-weight:600; }
  #root .deyu-mobile-fold-toggle[aria-expanded="true"] { background:var(--art-paper,var(--dy-soft)); border-bottom:1px solid var(--dy-line); border-bottom-left-radius:0; border-bottom-right-radius:0; }
  #root .deyu-mobile-fold-hint { display:block; margin-top:3px; color:var(--dy-muted); font-size:11px; line-height:17px; overflow-wrap:anywhere; }
  #root .deyu-mobile-fold-state { flex-shrink:0; white-space:nowrap; font-size:11px; color:var(--dy-accent-strong); }
  #root .deyu-mobile-fold-content { min-width:0; padding:12px; }
  #root .deyu-mobile-fold-content[hidden] { display:none !important; }
  #root .deyu-mobile-fold-content > [code-path$="ui-kit.tsx:6:5"] { padding:0; border:0; border-radius:0; box-shadow:none; background:transparent; margin:0; }
  #root .deyu-mobile-fold-content > [code-path$="ui-kit.tsx:6:5"]::before { display:none; }
  #root .deyu-mobile-fold-content :is([class~="grid-cols-3"],[class~="grid-cols-4"]) { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #root [code-path$="Todos.tsx:41:9"] > [code-path$="ui-kit.tsx:58:5"] { min-width:0; max-width:100%; width:100%; flex-basis:100%; }
  #root .deyu-mobile-saved-preview { padding:12px 12px 0; }
  #root .deyu-mobile-saved-preview h3 { margin:0 0 7px; color:var(--dy-ink); font-size:13px; font-weight:600; }
  #root .deyu-mobile-saved-preview p { margin:0 0 12px; color:var(--dy-ink); font-size:13px; line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
  #root .deyu-mobile-readonly-note {
    margin:0 0 12px; padding:9px 11px; border-left:3px solid var(--dy-accent);
    border-radius:7px 3px 7px 3px; background:var(--art-paper,var(--dy-soft));
    color:var(--dy-muted); font-size:11px; line-height:1.7; overflow-wrap:anywhere;
  }

  /* Wide lists scroll within their own card, never force the whole page wide. */
  #root main :is(div,section):has(> table) { min-width:0; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:thin; overscroll-behavior-x:contain; }
  #root main table { min-width:560px; font-size:12px; }
  #root main th { padding:8px 10px; font-size:11px; line-height:18px; white-space:nowrap; }
  #root main td { padding:7px 10px; font-size:12px; line-height:19px; vertical-align:top; }
  #root main td:first-child { white-space:nowrap; }
  #root main td button { min-height:32px; padding:4px 6px; }
  #root [code-path$="ui-kit.tsx:6:5"]:has(> table[code-path$="Students.tsx:166:11"])::before,
  #root [code-path$="ui-kit.tsx:6:5"]:has(> table[code-path$="Homework.tsx:378:11"])::before,
  #root [code-path$="Scores.tsx:982:15"]::before {
    content:"左右滑动查看完整表格 →"; position:sticky; left:0; top:auto; z-index:1;
    display:block; width:100%; height:auto; box-sizing:border-box; padding:8px 10px;
    color:var(--dy-muted); background:var(--art-paper,var(--dy-surface));
    font-size:11px; line-height:18px; border-bottom:1px solid var(--dy-line);
    pointer-events:none;
  }

  #root [code-path$="Homework.tsx:219:9"] { gap:10px; }
  #root [code-path$="Homework.tsx:232:13"] { flex-wrap:wrap; gap:5px; }
  #root [code-path$="Homework.tsx:234:17"] { min-height:34px; padding:6px 8px; font-size:11px; }
  #root [code-path$="Homework.tsx:245:11"] { margin-left:0; flex-wrap:wrap; gap:6px 12px; font-size:12px; }
  #root [code-path$="Homework.tsx:306:11"] { align-items:flex-start; gap:8px; }
  #root [code-path$="Homework.tsx:307:13"] { font-size:12px; line-height:1.7; overflow-wrap:anywhere; }
  #root [code-path$="Homework.tsx:330:11"] { gap:5px; }
  #root button[code-path$="Homework.tsx:334:17"],
  #root button[code-path$="Scores.tsx:1226:23"] {
    min-height:32px; max-width:100%; padding:5px 8px; font-size:12px; line-height:20px;
    white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere;
  }
  #root [code-path$="Homework.tsx:317:19"] { min-height:32px; padding:5px 7px; }
  #root [code-path$="Homework.tsx:315:15"] { flex-wrap:wrap; }
  #root [code-path$="Scores.tsx:1183:9"] { padding:10px; }
  #root [code-path$="Scores.tsx:1187:11"] {
    width:calc(100vw - 20px); height:calc(100dvh - 20px); max-height:calc(100dvh - 20px);
    padding:12px; overflow-y:auto; border-radius:14px;
  }
  #root [code-path$="Scores.tsx:1191:13"] { gap:8px; margin-bottom:12px; }
  #root [code-path$="Scores.tsx:1192:15"] { min-width:0; font-size:14px; line-height:22px; }
  #root [code-path$="Scores.tsx:1193:15"] { min-width:34px; min-height:34px; flex-shrink:0; }
  #root [code-path$="Scores.tsx:1200:13"] { flex:none; flex-direction:column; min-height:0; gap:12px; }
  #root [code-path$="Scores.tsx:1201:15"] { flex:none; width:100%; min-width:0; min-height:240px; height:clamp(240px,42dvh,360px); }
  #root [code-path$="Scores.tsx:1201:15"] .recharts-legend-wrapper,
  #root [code-path$="Scores.tsx:1201:15"] .recharts-default-legend,
  #root [code-path$="Scores.tsx:1201:15"] .recharts-legend-item-text {
    font-size:12px !important; line-height:20px !important; padding-bottom:4px !important;
  }
  #root [code-path$="Scores.tsx:1201:15"] .recharts-default-legend {
    white-space:normal; overflow:visible; text-overflow:clip;
  }
  #root [code-path$="Scores.tsx:1201:15"] .recharts-legend-item { white-space:normal; }
  #root [code-path$="Scores.tsx:1201:15"] .recharts-legend-wrapper svg { width:14px !important; height:14px !important; }
  #root [code-path$="Scores.tsx:1201:15"] .recharts-cartesian-axis-tick text { font-size:11px !important; }
  #root [code-path$="Scores.tsx:1201:15"] .recharts-cartesian-axis .recharts-label,
  #root [code-path$="Scores.tsx:1201:15"] .recharts-label-list text { font-size:10px !important; }
  #root [code-path$="Scores.tsx:1210:15"] { flex:none; width:100%; max-width:100%; min-width:0; }
  #root [code-path$="Scores.tsx:1214:17"] { min-height:36px; font-size:16px; }
  #root [code-path$="Scores.tsx:1220:17"] {
    display:grid; grid-template-columns:repeat(auto-fit,minmax(96px,1fr));
    align-content:start; gap:5px; flex:none; max-height:180px; overflow-y:auto; padding-right:4px;
  }
  #root [code-path$="Scores.tsx:1220:17"] > button { margin:0 !important; }

  #root [code-path$="Dashboard.tsx:53:5"]::before { margin-bottom:12px; font-size:14px; }
  #root [code-path$="Dashboard.tsx:55:7"] { min-height:0; padding:15px; margin-bottom:12px; }
  #root [code-path$="Dashboard.tsx:61:13"] { font-size:21px; }
  #root [code-path$="Dashboard.tsx:89:7"] { gap:9px; margin-bottom:12px; }
  #root [code-path$="Dashboard.tsx:96:11"] { min-height:112px; padding:12px; }
  #root [code-path$="Dashboard.tsx:97:13"] { margin-bottom:10px; }
  #root [code-path$="Dashboard.tsx:99:15"] { font-size:24px; }
  #root [code-path$="Dashboard.tsx:107:7"] { gap:11px; }
  #root [code-path$="Dashboard.tsx:107:7"] > div { min-height:128px; padding:14px; }
  #root [code-path$="Talks.tsx:194:9"] { gap:10px; }
  #root [code-path$="ui-kit.tsx:168:5"] { padding:20px 12px; }
  #root [code-path$="ui-kit.tsx:150:7"] { max-width:calc(100vw - 20px); max-height:calc(100dvh - 24px); padding:16px; overflow-y:auto; }
  #root [code-path$="Layout.tsx:198:7"] { position:absolute; }
  #deyu-cloud-sync { margin-top:18px; }
  #deyu-cloud-sync .deyu-cloud-card { padding:14px; }
  #deyu-cloud-sync .deyu-cloud-button { min-height:38px; }
  #root #deyu-cloud-sync .deyu-cloud-field input { font-size:16px; }
  #deyu-cloud-sync .deyu-cloud-fields, #deyu-cloud-sync .deyu-cloud-metadata,
  #deyu-cloud-sync .deyu-cloud-preview-grid { grid-template-columns:minmax(0,1fr); gap:10px; }
}
