:root {
  color-scheme: light dark;
  --bg: #F5F1EA;
  --text: #24211D;
  --secondary: #7C766C;
  --weak: #A8A196;
  --line: #D9D2C6;
  --accent: #B5532F;
  --danger: #B23A2B;
  --bar: #B6AEA1;
  --hairline: 1px;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Noto Serif CJK SC", serif;
  --latin: "New York", "Iowan Old Style", Georgia, serif;
  font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
@media (min-resolution: 2dppx) { :root { --hairline: .5px; } }
@media (prefers-color-scheme: dark) {
  :root { --bg: #211F1B; --text: #EBE3D5; --secondary: #A79D8E; --weak: #8C8377; --line: #514B42; --accent: #DE9270; --danger: #E58273; --bar: #6D6559; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 24px; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; min-height: 44px; color: var(--accent); background: none; border: 0; padding: 0 8px; }
button:disabled, input:disabled { cursor: wait; opacity: .55; }
input { min-width: 0; color: var(--text); background: none; border: 0; border-radius: 0; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; }
h1 { font-size: 40px; line-height: 48px; letter-spacing: 2px; }
h2 { font-size: 22px; line-height: 32px; }
.muted { color: var(--secondary); }
.weak { color: var(--weak); }
.error, .danger { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
main { max-width: 704px; padding: 0 32px; margin: 0 auto; }
.panel { padding-top: 32px; padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
.page-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 24px; border-bottom: var(--hairline) solid var(--line); margin-bottom: 24px; }
.page-heading > p { font-size: 10px; letter-spacing: .12em; white-space: nowrap; }
.week-chart { display: grid; grid-template-columns: repeat(7,1fr); column-gap: 16px; margin: 16px 0 32px; }
.day { display: flex; align-items: center; flex-direction: column; }
.day-value { font-family: var(--latin); font-size: 11px; color: var(--secondary); line-height: 16px; height: 16px; margin-bottom: 8px; }
.bar-track { height: 40px; width: 100%; display: flex; justify-content: center; align-items: flex-end; }
.bar { display: block; width: 4px; background: var(--bar); }
.day-label { font-size: 10px; line-height: 16px; margin-top: 8px; color: var(--secondary); }
.current .bar { background: var(--accent); }
.current .day-label, .current .day-value { color: var(--accent); }
.section-group + .section-group { margin-top: 32px; }
.group-title { margin-bottom: 12px; font-family: inherit; font-size: 13px; line-height: 20px; font-weight: 400; letter-spacing: .06em; color: var(--secondary); }
.group { background: none; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 56px; padding: 16px 0; text-align: left; position: relative; }
.row + .row { border-top: var(--hairline) solid var(--line); }
.child-name { font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 32px; color: var(--text); }
#profiles .group { border-top: var(--hairline) solid var(--line); border-bottom: var(--hairline) solid var(--line); }
.observation { display: block; min-height: 0; padding: 0; }
.observation + .observation { border-top: 0; margin-top: 24px; }
.observation h3 { font-size: 13px; line-height: 20px; font-weight: 400; color: var(--secondary); letter-spacing: .06em; margin-bottom: 8px; }
.observation p { font-size: 14px; line-height: 26px; letter-spacing: .01em; overflow-wrap: anywhere; }
.english { font-family: var(--latin); font-size: 18px; font-style: italic; color: var(--accent); }
.observation.weak h3 { color: var(--secondary); }
.words { display: flex; flex-wrap: wrap; align-items: center; column-gap: 20px; row-gap: 4px; margin: -8px 0; }
.word { position: relative; font-family: var(--latin) !important; font-style: italic; font-size: 19px; line-height: 28px; padding: 8px 0; min-height: 0; text-align: left; white-space: nowrap; }
.word::after { content: ""; position: absolute; inset: 0 -8px; }
.group-note { font-size: 13px; color: var(--weak); }
.footnote { margin: 12px 0 0; color: var(--weak); font-size: 12px; line-height: 1.8; }
.session { border-bottom: var(--hairline) solid var(--line); }
.session-toggle { list-style: none; cursor: pointer; display: block; padding: 24px 0; min-height: 72px; }
.session-toggle::-webkit-details-marker { display: none; }
.session-meta { display: flex; align-items: baseline; gap: 16px; }
.session-time { font-size: 12px; color: var(--secondary); }
.session-topic { margin-top: 8px; font-size: 14px; line-height: 26px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.session-body { padding-bottom: 8px; }
.session[open] .session-body { animation: expand 150ms ease-out; }
@keyframes expand { from { opacity: 0; } to { opacity: 1; } }
.transcript { font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", sans-serif; font-style: normal; }
.transcript p + p { margin-top: 12px; }
.transcript .assistant { color: var(--secondary); }
.transcript .user { color: var(--text); }
.session-body > .danger { margin-top: 24px; }
.field-label { flex-shrink: 0; color: var(--text); }
.field-value { color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: auto; font-size: 14px; }
.chevron { color: var(--weak); font-size: 22px; }
.switch-row { cursor: pointer; }
.switch-control { position: relative; flex: 0 0 48px; height: 28px; }
.switch-control input { position: absolute; top: -8px; left: -4px; width: 56px; height: 44px; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-track { display: block; height: 28px; width: 48px; border-radius: 16px; background: var(--line); }
.switch-track::after { content: ""; display: block; position: relative; left: 3px; top: 3px; width: 22px; height: 22px; background: var(--bg); border-radius: 50%; }
.switch-control input:checked + .switch-track { background: var(--accent); }
.switch-control input:checked + .switch-track::after { left: 23px; }
.switch-control input:focus-visible + .switch-track { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 3px; }
#notification-time { min-height: 44px; margin: -8px 0; width: 80px; text-align: right; color: var(--accent); }
#notification-time::-webkit-calendar-picker-indicator { display: none; }
.select-field { min-height: 44px; margin: -8px 0; max-width: 60%; text-align: right; color: var(--accent); background: transparent; border: 0; font: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 18px; background-image: linear-gradient(45deg,transparent 50%,var(--accent) 50%),linear-gradient(135deg,var(--accent) 50%,transparent 50%); background-position: calc(100% - 10px) 20px,calc(100% - 5px) 20px; background-size: 5px 5px,5px 5px; background-repeat: no-repeat; }
.select-field option { color: var(--text); background: var(--bg); }
#panel-settings .group { border-top: var(--hairline) solid var(--line); border-bottom: var(--hairline) solid var(--line); }
.primary { background: var(--accent); color: var(--bg); border-radius: 3px; min-height: 48px; width: 100%; font-weight: 500; }
.secondary { color: var(--accent); }
.login { max-width: 400px; margin: 0 auto; padding-top: max(80px,calc(32svh - 80px)); padding-bottom: 40px; }
.login-mark { font-size: 36px; line-height: 48px; letter-spacing: 1px; }
.login-subtitle { font-size: 13px; margin-top: 8px; letter-spacing: .12em; }
.login-fields { margin: 32px 0; }
.login-fields .row { display: block; padding: 0; border: 0; }
.login-fields .row + .row { margin-top: 24px; }
.login-fields label > span { font-size: 13px; color: var(--secondary); }
.login-fields input { display: block; text-align: left; width: 100%; min-height: 48px; border-bottom: var(--hairline) solid var(--line); }
.login-fields input::placeholder { color: var(--weak); opacity: 1; }
.login .error { font-size: 14px; margin-bottom: 12px; }
.sheet { position: fixed; inset: auto 0 0; width: min(100%,600px); max-height: 90svh; padding: 36px 32px calc(24px + env(safe-area-inset-bottom)); margin: 0 auto; border: 0; border-radius: 12px 12px 0 0; color: var(--text); background: var(--bg); overflow: auto; }
.sheet::before { content: ""; position: absolute; top: 12px; left: calc(50% - 16px); width: 32px; height: 3px; border-radius: 2px; background: var(--line); }
.sheet::backdrop { background: #0006; }
.sheet > p { margin-top: 12px; font-size: 14px; }
.dialog-actions { display: flex; gap: 16px; margin-top: 24px; }
.dialog-actions button { flex: 1; min-height: 48px; }
#delete-dialog .dialog-actions { gap: 32px; }
#cancel-delete { color: var(--text); }
#confirm-delete { color: var(--danger); font-weight: 600; }
.word-sheet { text-align: center; }
#enlarged-word { font-family: var(--latin); font-size: 56px; font-weight: 400; font-style: italic; line-height: 1.2; color: var(--accent); overflow-wrap: anywhere; }
.word-sheet button { margin-top: 16px; width: 100%; }
#edit-value { width: 100%; margin-top: 24px; padding: 12px 0; border-bottom: var(--hairline) solid var(--line); min-height: 48px; }
#edit-hint { font-size: 13px; margin: 8px 0 24px; }
/* 修改账号/密码弹窗改为屏幕正中（覆盖 .sheet 的底部抽屉样式） */
#credentials-dialog { inset: 0; margin: auto; max-height: 90svh; padding-bottom: 24px; border-radius: 12px; }
#credentials-dialog::before { display: none; }
#credentials-dialog input { display: block; width: 100%; min-height: 48px; padding: 12px 0; margin-top: 16px; border-bottom: var(--hairline) solid var(--line); }
#credentials-dialog input::placeholder { color: var(--weak); opacity: 1; }
.credentials-note { font-size: 13px; margin: 12px 0 0; }
#credentials-hint { font-size: 13px; margin: 12px 0 0; }
/* 选项行下方的说明文字（如音箱状态、语言说明） */
.row-note { margin-top: -6px; padding-bottom: 14px; color: var(--weak); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.row-note:empty { display: none; }
.row-note + .row { border-top: var(--hairline) solid var(--line); }
/* 对话语言提示词展示块 */
.prompt-block { border-top: var(--hairline) solid var(--line); padding: 12px 0 16px; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prompt-title { font-size: 12px; letter-spacing: .06em; color: var(--secondary); }
.linklike { min-height: 32px; font-size: 13px; padding: 0 4px; }
.prompt-text { margin-top: 6px; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; white-space: pre-wrap; }
/* 提示词编辑弹窗（屏幕正中，同账号弹窗） */
#language-dialog { inset: 0; margin: auto; max-height: 90svh; padding-bottom: 24px; border-radius: 12px; }
#language-dialog::before { display: none; }
#language-dialog textarea { display: block; width: 100%; min-height: 110px; margin-top: 16px; padding: 12px 0; border: 0; border-bottom: var(--hairline) solid var(--line); background: none; color: var(--text); font: inherit; line-height: 1.7; resize: vertical; }
.lang-dialog-mode { font-size: 13px; margin: 12px 0 0; }
#language-dialog-hint { font-size: 13px; margin: 12px 0 0; }
.toast { position: fixed; z-index: 5; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 40px); width: max-content; padding: 12px 16px; border: var(--hairline) solid var(--line); background: var(--bg); font-size: 14px; }
@media (min-width: 760px) {
  .panel { padding-bottom: 48px; }
  .toast { bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
a { color: var(--accent); text-decoration: none; }
.home-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.home-heading > div { flex: 1; min-width: 0; }
.home-heading h1 { font-family: var(--latin); font-size: 40px; line-height: 48px; letter-spacing: 0; }
.home-heading p { font-size: 12px; margin-top: 4px; }
.manage-link { display: flex; align-items: center; min-height: 44px; font-size: 13px; }
.child-switch { display: flex; flex-wrap: wrap; gap: 0 24px; }
.child-switch button { color: var(--weak); padding: 0; font: inherit; font-family: var(--latin) !important; text-align: left; max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
.child-switch button[aria-current] { color: var(--text); }
.learning-section + .learning-section { margin-top: 24px; }
.recap { font-size: 14px; line-height: 26px; }
.meta { font-size: 12px; margin-top: 8px; }
#expression .english { font-size: 20px; line-height: 28px; }
#expression .observation + .observation { margin-top: 16px; }
.week-total { font-family: var(--serif); font-size: 30px; line-height: 40px; }
.week-total .number { font-family: var(--latin); font-size: 38px; }
.week-chart { margin: 12px 0; }
.day { padding: 0; color: var(--secondary); }
.day:disabled { cursor: default; opacity: 1; }
.bar-track { height: 32px; }
.day-value { margin-bottom: 4px; }
.day-label { margin-top: 4px; }
.week-comparison { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; min-height: 18px; }
.word-group { display: flex; align-items: baseline; gap: 20px; }
.word-group + .word-group { margin-top: 8px; }
.word-group > span { flex-shrink: 0; font-size: 12px; color: var(--secondary); }
.word-group .words { column-gap: 16px; }
#records { margin-top: 8px; }
.record-day { margin-top: 24px; scroll-margin-top: 24px; }
.day-heading { display: flex; justify-content: space-between; font-weight: 400; font-size: 12px; color: var(--secondary); padding-bottom: 12px; border-bottom: var(--hairline) solid var(--line); }
.session-toggle { position: relative; padding: 16px 20px 16px 0; min-height: 64px; }
.session-toggle::after { content: '›'; position: absolute; right: 0; top: 20px; font-size: 22px; color: var(--weak); }
.session[open] > .session-toggle::after { transform: rotate(90deg); }
.session-topic { margin-top: 4px; }
.session-body { padding: 8px 0 20px; }
.back { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; margin-bottom: 16px; }
.lined { border-top: var(--hairline) solid var(--line); border-bottom: var(--hairline) solid var(--line); }
#manage-children a { color: var(--text); }
#history-end { min-height: 1px; }
@media (max-width: 370px) { main { padding: 0 24px; } .week-total { font-size: 27px; } }
