/* Desktop learning studio. Small screens keep the original touch-first layout. */
.desktop-sidebar, .desktop-header, .desktop-welcome, .desktop-board-note, .desktop-input-guide { display: none; }
@media (min-width: 1100px) {
  :root { --bg: #f5f6f2; --ink: #253b34; --accent: #315f4e; --wood: #839b8d; --wood-deep: #2e5344; }
  body { padding-left: 224px; background: var(--bg); font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
  button, input, textarea { font-family: inherit; }
  button { transition: background .16s ease, border-color .16s ease, box-shadow .16s ease; }
  button:focus-visible, [tabindex]:focus-visible { outline: 3px solid #b77c31; outline-offset: 4px; }
  button:not(:disabled):hover { filter: brightness(.97); }
  .desktop-sidebar { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 224px; padding: 30px 18px 22px; background: #fffefa; border-right: 1px solid #e1e6de; z-index: 30; overflow-y: auto; }
  .desktop-brand { display: flex; align-items: center; gap: 10px; padding: 0 5px; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; font-size: 16px; font-weight: 650; }
  .brand-symbol { display: grid; place-items: center; width: 39px; height: 43px; background: #294e3f; color: #e8d5a0; border-radius: 5px 14px 5px 5px; font-family: "Songti SC", "SimSun", serif; font-size: 25px; }
  .desktop-brand small { display: block; font-size: 10px; font-weight: 400; color: #7c887e; margin-top: 5px; }
  .nav-caption { margin: 50px 15px 14px; font-size: 10px; letter-spacing: 3px; color: #859187; }
  .desktop-sidebar nav { display: grid; gap: 7px; }
  .desktop-sidebar nav button { display: flex; align-items: center; gap: 13px; width: 100%; border: 0; border-radius: 7px; text-align: left; padding: 13px 16px; background: none; font-size: 14px; color: #69776d; cursor: pointer; }
  .desktop-sidebar nav button span { font-size: 21px; line-height: 20px; width: 22px; text-align: center; }
  .desktop-sidebar nav button[aria-current="page"] { background: #e8eee7; color: #254e3d; font-weight: 600; }
  .sidebar-note { margin: 48px 16px 32px; color: #647868; }
  .note-rule { display: block; width: 25px; height: 2px; background: #c6ae72; margin-bottom: 20px; }
  .sidebar-note strong { font-family: "Songti SC", "SimSun", serif; font-size: 16px; font-weight: 500; line-height: 1.9; }
  .sidebar-note p { font-size: 10px; margin-top: 12px; color: #8b968b; letter-spacing: 1px; }
  .sidebar-bottom { margin-top: auto; padding: 20px 12px 0; border-top: 1px solid #e7ebe3; font-size: 11px; color: #66786b; }
  .sidebar-bottom small { display: block; font-size: 8px; letter-spacing: 1.2px; margin-top: 9px; color: #90998e; }
  .privacy-dot { display: inline-block; width: 6px; height: 6px; background: #789779; border-radius: 50%; margin-right: 5px; }
  .desktop-header { display: flex; justify-content: space-between; align-items: center; height: 72px; padding: 0 40px; background: #fffefa; border-bottom: 1px solid #e1e6de; color: #829084; font-size: 12px; }
  .desktop-header strong { color: #385544; font-weight: 500; }
  .header-divider { margin: 0 16px; color: #c4ccbf; }
  .desktop-method { font-size: 11px; letter-spacing: 1px; color: #778775; }
  .view { padding: 34px 40px 40px; min-height: calc(100vh - 72px); align-items: stretch; max-width: 1680px; margin: 0 auto; }
  .view > * { min-width: 0; }
  .topbar { width: 100%; margin-bottom: 26px; gap: 16px; }
  .topbar h2 { font-family: "Songti SC", "SimSun", serif; font-size: 26px; letter-spacing: 1px; font-weight: 600; }
  .topbar .back { font-size: 12px; border: 1px solid #d6dfd2; border-radius: 6px; padding: 7px 12px; background: #fffefa; }
  #view-home.active { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); grid-template-areas: "welcome welcome" "hero actions" "path review" "sync sync" "history history" "footer logout"; grid-template-rows: auto auto auto auto auto auto; align-content: start; column-gap: 24px; row-gap: 20px; }
  .desktop-welcome { grid-area: welcome; display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; gap: 20px; }
  .section-kicker { display: block; font-size: 10px; letter-spacing: 2px; color: #86927e; margin-bottom: 12px; }
  .desktop-welcome h2 { font-family: "Songti SC", "SimSun", serif; font-size: clamp(26px, 2.3vw, 38px); font-weight: 600; letter-spacing: 1px; }
  .desktop-welcome p { font-size: 12px; color: #82907e; line-height: 1.8; margin-top: 12px; }
  .workspace-tag { font-size: 10px; color: #88987c; white-space: nowrap; padding: 8px 12px; border-left: 2px solid #c6af77; }
  .home-board { grid-area: hero; width: 100%; background: #284b3e; padding: 0; border-radius: 9px; box-shadow: none; overflow: hidden; }
  .home-board-inner { position: relative; height: 100%; min-height: 290px; text-align: left; padding: 28px 32px; border-radius: 0; background: radial-gradient(ellipse at 95% 10%, #446952 0, transparent 55%), #284b3e; }
  .home-board-inner h1 { font-family: "PingFang SC", sans-serif; font-size: 13px; font-weight: 400; letter-spacing: 2px; color: #c0d0b7; }
  .home-board-inner h1 em { color: inherit; }
  .home-board-inner .underline, .home-board-inner > p { display: none; }
  .desktop-board-note { display: block; margin-top: 27px; }
  .desktop-board-note > span:first-child { font-family: "PingFang SC", sans-serif; font-size: 10px; color: #c1cbb3; letter-spacing: 2px; }
  .desktop-board-note strong { display: block; font-family: "Songti SC", "SimSun", serif; font-weight: 400; font-size: clamp(25px, 2.1vw, 34px); line-height: 1.65; margin: 10px 0 23px; color: #f1e8cf; }
  .board-signature { display: block; border-top: 1px solid #ffffff25; padding-top: 14px; font: 10px "PingFang SC", sans-serif; color: #bbccb6; letter-spacing: 1px; }
  .home-actions { grid-area: actions; width: 100%; flex-direction: column; margin: 0; gap: 14px; }
  .home-actions .card { position: relative; padding: 24px 25px; border-radius: 9px; border: 1px solid #dfe4d8 !important; background: #fffefa; color: #294d3b; display: flex; flex-direction: column; justify-content: center; }
  .home-actions .card::after { content: '↗'; position: absolute; right: 24px; top: 20px; font-size: 20px; color: #788d6e; }
  .home-actions .card-solve { background: #e9eddc; border-color: #dce1cd !important; }
  .card .icon { display: none; }
  .card .big { font-size: 20px; letter-spacing: 0; font-family: "Songti SC", "SimSun", serif; }
  .card .sub { font-size: 11px; color: #73806b; line-height: 1.8; max-width: 90%; letter-spacing: 0; }
  .home-path { grid-area: path; width: 100%; align-items: center; margin: 0; border: 1px solid #e0e5d9; border-radius: 8px; color: #71816a; background: #eef1e8; font-size: 11px; padding: 20px 10px; }
  .home-path span + span { border-color: #d3dccd; }
  .review-strip { grid-area: review; width: 100%; margin: 0; border: 1px solid #dfe4d8; box-shadow: none; background: #fffefa; border-radius: 8px; padding: 16px 18px; }
  .review-strip strong { font-size: 13px; }
  .review-strip span { font-size: 10px; color: #84907b; }
  .review-strip .review-mark { color: #6d8658; font-size: 26px; }
  .sync-card { grid-area: sync; width: 100%; margin: 0; padding: 13px 18px; border-color: #e1e6dc; background: transparent; border-radius: 8px; }
  .sync-card strong { font-size: 12px; }
  .sync-card span { line-height: 1.7; overflow-wrap: anywhere; color: #7c8b76; font-size: 11px; }
  .sync-card button { border-color: #c4cfba; border-radius: 5px; font-size: 11px; }
  .sync-card[data-state="error"] strong { color: #ab523a; }
  #btn-go-history { grid-area: history; justify-self: start; margin: 0; color: #708167; text-decoration: none; font-size: 11px; padding: 5px 0; }
  #btn-go-history::after { content: ' →'; }
  #home-footer { grid-area: footer; margin: 0; color: #8d9985; font-size: 10px; letter-spacing: 0; }
  #btn-device-logout { grid-area: logout; justify-self: end; margin: 0; font-size: 10px; color: #8d9985; }
  #view-input.active { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr); gap: 24px 36px; align-content: start; }
  #view-input > .topbar { grid-column: 1 / -1; margin-bottom: 6px; }
  .input-stage { width: 100%; margin: 0; padding: 28px; background: #fffefa; border: 1px solid #dde4d7; border-radius: 10px; align-self: start; }
  .photo-zone { padding: 60px 22px; border: 1.5px dashed #acbaa1; border-radius: 8px; background: #f5f7f0; line-height: 1.8; }
  .photo-zone:hover { background: #edf2e5; }
  .photo-zone .icon { font-size: 28px; margin-bottom: 20px; }
  .photo-zone .hint { font-size: 17px; }
  .photo-zone .sub { font-size: 11px; color: #8c9782; margin-top: 10px; }
  #btn-start { border-radius: 6px; font-size: 14px; letter-spacing: 1px; }
  .desktop-input-guide { display: block; padding: 25px 4px; }
  .desktop-input-guide h3 { font-family: "Songti SC", "SimSun", serif; font-size: 26px; font-weight: 500; line-height: 1.65; }
  .desktop-input-guide ol { list-style: decimal-leading-zero; padding-left: 26px; margin-top: 27px; }
  .desktop-input-guide li { padding-left: 8px; margin-bottom: 23px; color: #8e9e80; font-size: 12px; }
  .desktop-input-guide strong { color: #476240; font-weight: 500; }
  .desktop-input-guide p, .guide-footnote { color: #7b8a71; line-height: 1.9; font-size: 11px; margin-top: 6px; }
  .guide-footnote { border-top: 1px solid #dce3d4; padding-top: 18px; }
  .mistake-book, .history-list { width: 100%; }
  .mistake-overview { grid-template-columns: 180px 1fr; gap: 20px; margin-bottom: 26px; }
  .mistake-score, .mistake-focus { border: 1px solid #dbe3d4; padding: 24px; border-radius: 8px; }
  .mistake-score { background: #284b3e; border-color: #284b3e; }
  .mistake-score strong { font-family: "Georgia", serif; font-size: 40px; }
  .mistake-focus { background: #fffefa; color: var(--ink); }
  .mistake-focus .eyebrow, .mistake-focus p { color: #7a8b70; }
  .mistake-focus h3 { font-family: "Songti SC", "SimSun", serif; font-size: 22px; }
  .mistake-tabs { border-bottom: 1px solid #dfe5d7; gap: 12px; margin-bottom: 18px; }
  .mistake-tabs button { border: 0; border-radius: 5px; font-size: 12px; background: transparent; padding: 10px 14px; }
  .mistake-tabs button.active { background: #e1e9da; color: #345632; }
  #mistake-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  #mistake-list > .history-empty, #mistake-list > .review-reason { grid-column: 1 / -1; }
  .mistake-item, .practice-card { border: 1px solid #dce4d4; background: #fffefa; border-radius: 8px; padding: 22px; margin-bottom: 0; }
  .mistake-item h3 { font-size: 15px; font-weight: 500; }
  .mistake-actions button, .practice-buttons button { border-radius: 5px; border-color: #c3d0b7; font-size: 11px; }
  .review-reason { background: #f1f3e8; border-left-width: 2px; color: #778363; }
  .history-item { border: 1px solid #dce4d4; border-radius: 8px; background: #fffefa; box-shadow: none; }
  .history-empty { padding: 60px 30px; border: 1px dashed #cdd8c1; border-radius: 8px; color: #859478; }
  .lesson-layout { width: 100%; gap: 18px; }
  .lesson-layout .board-frame { padding: 9px; border-radius: 8px; box-shadow: 0 5px 20px #233f3012; background: #2e4d3d; }
  .speech-panel { width: clamp(230px, 23vw, 310px); border: 1px solid #dce3d5; border-radius: 8px; background: #fffefa; }
  .speech-head { border-bottom: 1px solid #e1e7d9; background: #f0f3e9; }
  .controls { width: 100%; justify-content: flex-start; gap: 8px; }
  .controls button { border-radius: 5px; font-size: 11px; padding: 7px 10px; }
  .ask-bar { width: 100%; max-width: none; }
  .ask-bar input { border: 1px solid #cdd8c2; border-radius: 6px; background: #fffefa; }
  .ask-bar button { border-radius: 6px; }
  #knowledge-card { width: 100%; max-width: none; border-radius: 8px; box-shadow: none; }
  .lesson-actions { justify-content: flex-start; width: 100%; }
  .lesson-actions button { border-radius: 5px; }
  .practice-stage { width: min(860px, 100%); margin: 0 auto; }
  .practice-card { padding: 32px; }
  #view-player #ask-overlay { overflow-y: auto; }
  @media (max-width: 1279px) {
    body { padding-left: 192px; }
    .desktop-sidebar { width: 192px; padding-inline: 12px; }
    .desktop-brand { font-size: 14px; }
    .desktop-brand small { font-size: 9px; }
    .view { padding-inline: 26px; }
    .desktop-header { padding-inline: 26px; }
    .workspace-tag { display: none; }
    .home-board-inner { padding-inline: 25px; }
    .speech-panel { width: 230px; }
    #view-player #ask-overlay { position: fixed; inset: 100px 15% 50px calc(192px + 6%); z-index: 40; background: #203d32; border-radius: 12px; }
  }
}
@media (prefers-reduced-motion: reduce) { .desktop-sidebar *, .home-actions .card { transition: none; } }

/* A calmer two-family hierarchy: clear sans-serif UI, serif only on the hero. */
@media (min-width: 1100px) {
  :root { --studio-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }
  body { font-family: var(--studio-font); font-size: 16px; line-height: 1.65; }
  .desktop-welcome h2, .topbar h2, .card .big, .desktop-input-guide h3,
  .mistake-focus h3, .sidebar-note strong, .speech-panel, .speech-panel .kai {
    font-family: var(--studio-font); letter-spacing: 0; font-weight: 500;
  }
  .desktop-welcome h2 { font-size: clamp(28px, 2.35vw, 36px); line-height: 1.45; }
  .topbar h2 { font-size: 28px; }
  .card .big { font-size: 23px; }
  .desktop-input-guide h3 { font-size: 27px; }
  .desktop-brand { font-size: 17px; }
  .desktop-brand small { font-size: 11px; line-height: 1.6; }
  .brand-symbol { flex-shrink: 0; }
  .desktop-sidebar nav button { font-size: 16px; }
  .nav-caption, .section-kicker, .workspace-tag, .desktop-method { font-size: 13px; letter-spacing: 1px; }
  .desktop-header { font-size: 14px; }
  .sidebar-note strong { font-size: 17px; }
  .sidebar-note p, .sidebar-bottom { font-size: 12px; letter-spacing: 0; }
  .sidebar-bottom small { font-size: 9px; }
  .desktop-welcome p, .card .sub, .home-path { font-size: 15px; color: #62725d; }
  .card .sub { max-width: 100%; line-height: 1.8; margin-top: 9px; }
  .home-board-inner h1 { font-family: var(--studio-font); font-size: 15px; }
  .desktop-board-note > span:first-child { font-family: var(--studio-font); font-size: 14px; }
  .board-signature { font: 14px/1.8 var(--studio-font); letter-spacing: 0; }
  .desktop-board-note strong { font-size: clamp(29px, 2.25vw, 36px); }
  .review-strip strong, .sync-card strong { font-size: 16px; line-height: 1.6; }
  .review-strip .review-copy > span, .sync-card span { font-size: 14px; line-height: 1.8; color: #66765f; }
  .review-strip .review-arrow { font-size: 20px; }
  .sync-card button, .topbar .back, #btn-go-history { font-size: 14px; }
  #home-footer, #btn-device-logout { font-size: 12px; color: #6b7963; }
  .photo-zone .hint { font-size: 20px; }
  .photo-zone .sub, .desktop-input-guide p, .guide-footnote { font-size: 14px; color: #65755b; }
  .desktop-input-guide li { font-size: 16px; }
  #btn-start { font-size: 17px; }
  #input-status, .mistake-meta, .mistake-detail, .review-reason, .mistake-focus p { font-size: 14px; line-height: 1.8; }
  .mistake-item h3 { font-size: 18px; line-height: 1.7; }
  .mistake-score span, .mistake-focus .eyebrow { font-size: 13px; }
  .mistake-tabs button, .mistake-actions button, .practice-buttons button,
  .controls button, .lesson-actions button { font-size: 14px; }
  #speech-lines .line, #question-lines .qa-q, #question-lines .qa-a { font-family: var(--studio-font); font-size: 16px; line-height: 1.85; }
  .question-panel { width: 100%; background: #fffefa; border-color: #dce3d5; }
  .speech-head .role { font-size: 12px; }
  .history-item .meta { font-size: 14px; }
  #view-home.active { row-gap: 22px; }
  .home-path { padding-inline: 8px; }
  @media (max-width: 1279px) {
    .desktop-brand { font-size: 15px; gap: 7px; }
    .desktop-brand small { font-size: 10px; }
    .home-path { font-size: 13px; }
    .desktop-board-note strong { font-size: 29px; }
  }
}
