/* Mobile is the default. Wider layouts enhance the same navigation and actions. */
:root {
  --bg: #f4f6f3;
  --paper: #ffffff;
  --soft: #edf3ef;
  --line: #dee5df;
  --muted: #57685e;
  --radius: 16px;
  --space: 16px;
  --nav-height: 68px;
  --layout-max: 1120px;
}
body { font-size: 16px; line-height: 1.65; }
h1 { font-size: 25px; letter-spacing: 0; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
.small, .field-label, .mini-label { font-size: 13px; }
.reading-diagnostics { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.65; margin: 12px 0; }
.demo-foot { display: block; text-align: center; }
.demo-foot > span { display: block; }
.icp-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 4px; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.police-link { gap: 6px; }
.police-link img { object-fit: contain; }
.brand > span:last-child { font-size: 16px; }
.sidebar { display: none; }
.workspace { margin-left: 0; padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.topbar { order: 0; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0; gap: 8px; }
.mobile-brand { display: flex; gap: 8px; align-items: center; text-decoration: none; font-size: 14px; white-space: nowrap; }
.mobile-brand .brand-mark { width: 28px; height: 28px; font-size: 20px; border-radius: 9px; }
.breadcrumb { display: none; }
.top-actions { gap: 2px; }
.assistant-entry { min-height: 44px; padding: 8px 10px; border: 0; background: transparent; font-size: 14px; }
.assistant-entry[aria-pressed=true] { background: var(--soft); }
.icon-button { background: transparent; width: 44px; min-width: 44px; height: 44px; }
main { order: 1; width: 100%; max-width: var(--layout-max); padding: 20px 16px; }
.page-head { margin-bottom: 18px; gap: 12px; align-items: center; }
.page-head > div { min-width: 0; }
.page-head > div > .eyebrow { display: none; }
.page-head p { font-size: 14px; margin-top: 6px; line-height: 1.6; }
.page-head:has(.date-label) { flex-wrap: wrap; }
.date-label { width: auto; min-width: 0; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.date-label input { margin-top: 0; max-width: 170px; }
.card, .projects .card { padding: 18px; border-radius: var(--radius); }
.card-head { gap: 12px; margin-bottom: 12px; }
.card-head h2 { font-size: 18px; }
.dashboard, .library-layout, .projects { grid-template-columns: minmax(0,1fr); gap: var(--space); }
.stack { gap: var(--space); }
.wide-card { margin-top: var(--space); }
.primary, .secondary, .text-button { min-height: 44px; font-size: 14px; padding: 10px 12px; }
.text-button { padding-inline: 4px; }
.task { grid-template-columns: 36px minmax(0,1fr) auto; gap: 10px; padding: 12px 0; }
.task-icon { width: 36px; height: 36px; border-radius: 10px; }
.task h3 { font-size: 16px; }
.task h3 small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.task p { font-size: 13px; }
.task .text-button { font-size: 14px; }
.task .text-button svg { display: none; }
.day-summary { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.day-summary .tag { margin: 0; }
.direction-card { background: var(--soft); }
.direction-card p { margin: 6px 0; color: var(--muted); font-size: 14px; }
.direction-card .text-button { margin-top: 4px; }
.project-preview { padding-top: 12px; margin-top: 12px; }
.project-symbol { width: 40px; height: 40px; margin-bottom: 8px; border-radius: 12px; }
.projects .project-meta { margin: 14px 0; padding-top: 12px; font-size: 13px; }
.subnav { display: flex; flex-wrap: nowrap; gap: 0; padding: 3px; background: var(--soft); border-radius: 12px; margin-bottom: 16px; }
.subnav a { flex: 1; min-width: 0; text-align: center; padding: 10px 5px; border: 0; background: transparent; font-size: 14px; border-radius: 9px; white-space: nowrap; }
.subnav a[aria-current=page] { background: var(--paper); color: var(--accent); font-weight: 600; }
.framework { grid-template-columns: minmax(0,1fr); gap: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.topic { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 2px 10px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 18px; }
.topic:last-child { border-bottom: 0; }
.topic:hover { transform: none; background: var(--soft); }
.topic:focus-visible { outline-offset: -3px; }
.topic-number { grid-row: 1 / 3; margin: 2px 0 0; font-size: 12px; }
.topic h3 { grid-column: 2; margin: 0; }
.topic p { grid-column: 2; line-height: 1.7; }
.topic .tags { display: none; }
.inline-details { border-top: 1px solid var(--line); margin-top: 10px; }
.inline-details summary, .ai-guide summary { cursor: pointer; min-height: 44px; padding: 10px 0; font-size: 14px; color: var(--muted); }
.inline-details p { font-size: 14px; margin: 4px 0 12px; line-height: 1.8; }
.context-copy, .chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.book-actions { width: 100%; justify-content: space-between; }
.planned-book { flex-direction: column; align-items: flex-start; gap: 8px; }
.empty { margin-top: 12px; padding: 20px 14px; }
.project-meta .row { align-items: flex-start; }
.music-intro { margin-bottom: var(--space); }
.music-intro .card-head { gap: 10px; }
.singer-heading h2 { font-size: 25px; }
.singer-mark { width: 48px; height: 64px; font-size: 30px; }
.music-timeline { margin-top: 6px; }
.music-story summary { min-height: 44px; font-weight: 600; cursor: pointer; }
.music-story p { margin: 12px 0; font-size: 15px; }
.music-controls { margin-top: 10px; }
.music-controls .secondary { flex: 1; }
.save-bar { order: 2; padding: 0 16px; border: 0; background: transparent; justify-content: flex-start; flex-wrap: wrap; }
.save-bar button { min-height: 44px; font-size: 12px; }
.save-bar:has(#conflict-entry:not([hidden])) { order: 0; background: var(--sand); border-bottom: 1px solid var(--line); }
.demo-foot { order: 3; padding: 0 16px 16px; text-align: center; font-size: 12px; }
.bottom-nav { display: flex; justify-content: space-around; gap: 0; position: fixed; bottom: 0; left: 0; right: 0; padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); min-height: var(--nav-height); background: var(--paper); border-top: 1px solid var(--line); z-index: 5; }
.bottom-nav .nav-item { flex: 1; min-width: 0; min-height: 60px; flex-direction: column; gap: 2px; padding: 5px 2px; font-size: 12px; border-radius: 10px; }
.bottom-nav svg { width: 22px; height: 22px; }
#toast { bottom: calc(var(--nav-height) + 12px + env(safe-area-inset-bottom)); }
dialog { padding: 18px; border-radius: var(--radius); width: min(760px,calc(100% - 24px)); max-height: calc(100dvh - 32px - env(safe-area-inset-top)); }
.modal-head { margin-bottom: 12px; }
.modal-head h2 { font-size: 19px; }
.modal-actions { margin-top: 16px; }
.modal-actions .primary, .modal-actions .secondary { flex: 1; }
.ai-workspace { max-width: 880px; margin: auto; display: grid; gap: var(--space); }
main[data-route=ai] > .page-head { max-width: 880px; margin-inline: auto; }
.ai-model-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: end; }
.ai-model-row .field-label { margin: 0 0 4px; font-size: 13px; }
.ai-model-row .model-select { margin: 0; padding: 9px 10px; font-size: 16px; min-height: 44px; }
.ai-model-row .text-button { margin-bottom: 1px; }
.ai-context { margin-top: 12px; border-block: 1px solid var(--line); }
.ai-context .context-bar { display: inline; padding: 0; border: 0; font-size: 14px; color: var(--muted); }
.ai-context .inline-details { margin: 0; border: 0; }
.ai-context .inline-details summary { min-height: 44px; }
.ai-start { padding: 14px 0 4px; }
.ai-start > p:first-child { font-size: 14px; font-weight: 600; }
.prompt-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.prompt-list .secondary { font-size: 13px; padding: 9px 10px; background: var(--soft); border: 0; }
.chat-bubble { margin: 16px 0; padding: 14px; font-size: 16px; line-height: 1.85; border-radius: 12px; }
.chat-user { margin-left: 20px; background: var(--bg); }
.chat-author { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.chat-bubble .small { margin-top: 8px; }
#chat-input { min-height: 140px; font-size: 16px; line-height: 1.7; padding: 12px; scroll-margin-block: 80px; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.composer-actions .primary { min-width: 112px; }
.chat-footer { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 8px; }
.chat-footer > span { font-size: 12px; min-width: 0; overflow-wrap: anywhere; }
.chat-footer .text-button { flex-shrink: 0; font-size: 13px; }
.ai-guide { scroll-margin-top: 76px; }
.ai-guide { padding-block: 6px; }
.ai-guide summary { color: var(--ink); font-weight: 600; }
.ai-guide summary span { font-weight: 400; display: block; padding-left: 17px; }
.ai-guide-body { border-top: 1px solid var(--line); padding-top: 12px; font-size: 15px; }
.ai-guide-body > p { margin-bottom: 12px; }
.ai-steps { padding-left: 22px; margin: 16px 0; }
.ai-steps li { padding: 0 0 14px 4px; }
.ai-steps strong { display: block; }
.ai-steps span { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.auth-screen .workspace { padding-bottom: 0; }
.auth-screen main { padding: 32px 16px; }
.auth-screen .demo-foot { text-align: center; }
@media (min-width:700px) {
  main { padding: 28px; }
  h1 { font-size: 28px; }
  .card, .projects .card { padding: 22px; }
  .dashboard, .projects { grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 20px; }
  .framework { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .topic:nth-child(odd) { border-right: 1px solid var(--line); }
  .topic:nth-last-child(-n+2) { border-bottom: 0; }
  .planned-book { flex-direction: row; align-items: center; }
  .book-actions { width: auto; }
  .save-bar, .demo-foot { padding-inline: 28px; }
  .ai-guide summary span { display: inline; padding-left: 12px; }
}
@media (min-width:1100px) {
  .sidebar { display: flex; width: 200px; padding: 28px 16px; }
  .sidebar .navigation { margin-top: 32px; gap: 6px; }
  .sidebar .brand { font-size: 22px; }
  .sidebar .brand small { letter-spacing: 0; }
  .sidebar-foot { padding: 16px 8px 0; }
  .workspace { margin-left: 200px; padding-bottom: 0; }
  .topbar { height: 64px; padding: 0 32px; }
  .mobile-brand { display: none; }
  .breadcrumb { display: block; }
  .bottom-nav { display: none; }
  main { padding: 32px; }
  .page-head { margin-bottom: 22px; }
  .save-bar, .demo-foot { padding-inline: 32px; max-width: var(--layout-max); width: 100%; margin-inline: auto; }
  #toast { bottom: 24px; }
  .auth-screen .mobile-brand { display: flex; }
  .auth-screen .workspace { margin-left: 0; }
}
@media (max-width:359px) {
  main { padding-inline: 12px; }
  .card, .projects .card { padding: 14px; }
  .topbar { padding-inline: 8px; }
  .task { gap: 8px; grid-template-columns: 30px minmax(0,1fr) auto; }
  .task-icon { width: 30px; height: 32px; }
  .task h3 { font-size: 15px; }
  .subnav a { font-size: 13px; }
  .ai-model-row { gap: 6px; }
}

.classroom-tools summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 650; }
.classroom-tools summary::after { content: '展开'; margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 400; }
.classroom-tools[open] summary::after { content: '收起'; }
.classroom-tool { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.classroom-tool h3 { margin: 0 0 8px; }

.guidance-card h3 { margin: 16px 0 8px; }
main[data-route="learning/path"] > .card + .card, main[data-route="health/schedule"] > .card + .card { margin-top: var(--space); }
.guide-question { font-size: 18px; font-weight: 600; line-height: 1.7; margin: 18px 0 12px; }
.route-week { padding: 18px 0; border-top: 1px solid var(--line); }
.route-week h3 { margin: 10px 0 6px; }
.route-week p { margin: 8px 0; }
.route-overview summary, .knowledge-overview summary, .catalog-more summary { cursor: pointer; min-height: 44px; line-height: 1.6; padding-block: 10px; font-weight: 600; }
.knowledge-overview .card-head { margin-top: 16px; }
.recommendation + .recommendation { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 24px; }
.catalog-more { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 8px; }
.catalog-more .recommendation { margin-top: 16px; }
#guide-form select, #movement-track, #movement-step { display: block; width: 100%; min-width: 0; min-height: 46px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 16px; }
.guidance-card .modal-actions { align-items: stretch; }
.guidance-card button:disabled { cursor: default; }
@media (max-width:699px) {
  .guidance-card .card-head { align-items: flex-start; gap: 8px; }
  .guidance-card .card-head h2 { flex: 1; }
  .guidance-card .modal-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .guidance-card .modal-actions button { min-width: 0; min-height: 44px; justify-content: center; line-height: 1.5; }
  .guidance-card .modal-actions button:last-child:nth-child(3) { grid-column: 1 / -1; }
  .guide-question { font-size: 17px; }
}
