:root {
  color-scheme: light;
  --bg: #f5f5f7; --surface: #ffffff; --surface-solid: #ffffff;
  --text: #1d1d1f; --muted: #636366; --line: #e5e5ea;
  --blue: #0071e3; --blue-text: #005bb8; --blue-soft: #e8f2ff; --focus: #0071e3;
  --orange: #a45b28; --orange-soft: #fff2df; --red: #b74c43; --red-soft: #fff0ed;
  --green: #35795b; --radius: 11px; --shadow: 0 8px 28px #00000006;
  --control-height: 40px;
  font-family: "Microsoft YaHei UI", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
.client-diagnostic-heading { font-size: 20px; font-weight: 600; padding: 8px 0; cursor: pointer; }
.client-diagnostic-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0 18px; margin: 12px 0 20px; }
.client-diagnostic-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.client-diagnostic-filters > .client-diagnostic-actions { grid-column: 1 / -1; margin-top: 8px; }
.client-diagnostic-table { margin-top: 14px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.client-diagnostic-table table { width: 100%; border-collapse: collapse; min-width: 660px; }
.client-diagnostic-table th, .client-diagnostic-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.client-diagnostic-table th { font-size: 14px; color: var(--muted); font-weight: 600; }
.client-diagnostic-table tr:last-child td { border-bottom: 0; }
.client-diagnostic-table td small { display: block; color: var(--muted); }
.client-diagnostic-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.client-diagnostic-detail { margin-top: 28px; }
.client-diagnostic-detail .view-head { align-items: center; margin-bottom: 8px; }
.client-diagnostic-detail h3 { margin: 0; }
.client-diagnostic-detail pre { font: inherit; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 32rem; overflow: auto; margin: 12px 0 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); tab-size: 4; }
@media(max-width:700px) { .client-diagnostic-filters { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; } .client-diagnostic-pager { align-items: flex-start; flex-direction: column; } }
@media(max-width:420px) { .client-diagnostic-filters { grid-template-columns: minmax(0,1fr); } }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 15px; line-height: 1.65; }
html { scroll-padding-top: 80px; scrollbar-gutter: stable; }
button, a, summary { touch-action: manipulation; }
.skip-link { position: fixed; top: 10px; left: 16px; z-index: 100; padding: 9px 16px; border-radius: var(--radius); background: var(--surface); color: var(--blue-text); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid #0071e366; outline-offset: 3px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 30px; line-height: 1.3; letter-spacing: -.8px; margin-bottom: 9px; }
h2 { font-size: 20px; line-height: 1.4; }
h3 { font-size: 16px; }
a { color: var(--blue-text); text-underline-offset: 3px; }
.muted, .hint, .reading-note { color: var(--muted); }
.hint, .reading-note { font-size: 14px; line-height: 1.7; }
.hint { margin: 0; }
.danger-text { color: var(--red); }
.app-loading { min-height: 100dvh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup img { width: 48px; height: 48px; object-fit: contain; }
.brand-lockup strong { display: block; font-size: 22px; letter-spacing: -.5px; line-height: 1.3; }
.brand-lockup small { display: block; font-size: 14px; letter-spacing: 1.3px; opacity: .62; margin-top: 4px; }
.field { display: grid; align-content: start; gap: 6px; margin: 12px 0; }
.field label, .label { font-size: 14px; font-weight: 600; color: #515154; line-height: 22px; min-height: 22px; }
input, textarea, select { width: 100%; min-width: 0; min-height: var(--control-height); border: 1px solid #d2d2d7; background: #ffffff; color: var(--text); padding: 7px 12px; border-radius: var(--radius); transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #737377; opacity: 1; }
textarea { min-height: 150px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #0071e316; outline: 0; }
.field > input:not([type=checkbox]):not([type=radio]), .field > select, .password-field > input { height: var(--control-height); min-height: var(--control-height); line-height: 24px; padding: 7px 12px; }
.password-field > input { padding-right: 64px; }
/* The custom visibility button also keeps the login mascot in sync. */
.password-field > input::-ms-reveal { display: none; }
input[type=checkbox], input[type=radio] { flex: none; width: 16px; height: 16px; min-height: 16px; padding: 0; margin: 0; accent-color: var(--blue); }
.password-field { position: relative; }
.password-field input { padding-right: 64px; }
.password-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); min-height: 32px; padding: 4px 9px; font-size: 14px; color: var(--muted); border: 0; border-radius: 7px; background: transparent; }
.password-toggle:hover { background: var(--blue-soft); }
.form-error { color: var(--red); min-height: 19px; font-size: 14px; margin: 10px 0; }
.form-error:empty { min-height: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: var(--control-height); padding: 7px 15px; font-weight: 600; font-size: 14px; line-height: 1.5; color: var(--text); background: var(--surface); border: 1px solid #d2d2d7; border-radius: var(--radius); text-decoration: none; transition: background .15s, border-color .15s, transform .15s; }
.btn svg, .button-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { background: #f0f0f5; border-color: #b8b8bf; }
.btn:active { transform: translateY(1px); }
.btn.primary, .btn.send { background: var(--blue); color: #ffffff; border-color: var(--blue); }
.btn.primary:hover, .btn.send:hover { background: #0067cf; border-color: #0067cf; }
.btn.danger { color: var(--red); border-color: #edd7d1; }
.btn.danger:hover { background: var(--red-soft); border-color: #d9ada5; }
.btn.block { width: 100%; min-height: 44px; font-size: 14px; }
.btn.icon { width: 36px; min-height: 36px; padding: 0; font-size: 23px; }
.btn.send { min-height: 44px; font-size: 14px; }
.btn.send.is-warning { background: var(--orange); border-color: var(--orange); }
.btn.send.is-urgent { background: var(--red); border-color: var(--red); }
.shell { min-height: 100dvh; display: grid; grid-template-columns: 228px minmax(0,1fr); grid-template-rows: 64px minmax(0,1fr); }
.sidebar { grid-column: 1; grid-row: 1 / -1; background: #eef2f7; color: #1d1d1f; border-right: 1px solid #e0e6ee; padding: 24px 14px 18px; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; overflow: auto; scrollbar-width: thin; z-index: 30; }
.sidebar .brand-lockup { margin: 0 10px 20px; }
.sidebar .brand-lockup > div { min-width: 0; }
.sidebar .brand-lockup small { white-space: nowrap; font-size: 12px; }
.sidebar .brand-lockup strong { font-size: 18px; }
.sidebar .brand-lockup img { width: 43px; height: 43px; }
.nav { display: grid; gap: 4px; }
.nav-group-label { color: #59687b; font-size: 12px; letter-spacing: .5px; padding: 16px 14px 8px; }
.nav-group-label:first-child { padding-top: 0; }
.nav button { display: flex; align-items: center; gap: 12px; color: #62626a; text-align: left; min-height: 44px; padding: 9px 14px; border: 0; background: transparent; border-radius: 9px; font-size: 15px; font-weight: 500; transition: background .15s, color .15s; }
.nav button:hover { background: #e2e6ed; color: #1d1d1f; }
.nav button.active { background: #dceafd; color: #005bb8; font-weight: 700; }
.nav button.active::after { content: ""; width: 5px; height: 5px; background: #0071e3; border-radius: 50%; margin-left: auto; }
.nav-icon { display: flex; width: 19px; height: 19px; flex: none; }
.nav-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-note { margin: auto 10px 0; padding-top: 18px; }
.sidebar-note .note-leaf { display: none; }
.sidebar-note strong { font-size: 12px; display: block; color: #62626a; font-weight: 500; margin: 7px 0 4px; }
.sidebar-note p { font-size: 12px; color: #636366; margin: 0; }
.topbar { grid-column: 2; grid-row: 1; position: sticky; top: 0; z-index: 20; background: #f8fafff5; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 30px; }
.topbar .spacer { flex: 1; }
.breadcrumb { display: flex; gap: 12px; font-size: 14px; color: #636366; }
.breadcrumb strong { color: #515154; font-weight: 600; }
.topbar-date { color: var(--muted); font-size: 14px; }
.user-block { display: flex; align-items: center; gap: 10px; }
.user-avatar { background: #e8f2ff; width: 38px; height: 38px; flex: none; border: 1px solid #d5e5f8; border-radius: 50%; color: var(--blue-text); display: grid; place-items: center; font-size: 14px; font-weight: 700; letter-spacing: -.3px; }
.user-meta { line-height: 1.5; }
.user-meta strong, .user-meta span { display: block; font-size: 13px; }
.user-meta span { color: var(--muted); font-size: 12px; }
#logoutButton { background: transparent; font-size: 14px; padding: 6px 10px; min-height: 32px; border-color: transparent; color: var(--muted); }
#logoutButton:hover { background: var(--blue-soft); }
.menu-toggle, .sidebar-close, .nav-backdrop, .mobile-brand { display: none; }
main { grid-column: 2; grid-row: 2; min-width: 0; padding: 26px 30px 52px; }
.view { max-width: 1320px; margin: 0 auto; overflow-anchor: none; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.view-head > div { min-width: 0; }
.view-head h1, .view-head h2 { margin: 0; }
.view-head h1 + p, .view-head h2 + p { margin-top: 6px; }
.view-head p { color: var(--muted); font-size: 14px; max-width: 620px; line-height: 1.8; margin: 0; }
.page-kicker { color: #636366; font-size: 14px; letter-spacing: .5px; display: block; }
.toolbar { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.toolbar .field { margin: 0; min-width: 150px; }
.toolbar > .btn, .control-actions > .btn, .schedule-item > .btn { min-height: var(--control-height); }
.reading-filter { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1.45fr) auto auto; align-items: end; padding: 18px 20px; border: 1px solid var(--line); background: var(--surface); border-radius: 13px; margin-bottom: 18px; gap: 13px; }
.reading-filter .field { flex: 1; min-width: 0; }
.reading-filter .field:nth-child(3) { flex: 1.45; }
.period-shortcuts { display: flex; align-items: stretch; height: var(--control-height); background: #efeff4; padding: 3px; border-radius: 9px; gap: 2px; }
.period-shortcuts .btn { border: 0; background: transparent; min-height: 0; padding: 7px 11px; font-size: 14px; color: #636366; }
.period-shortcuts .btn.active { background: #ffffff; color: var(--blue-text); box-shadow: 0 1px 4px #00000008; }
.reading-overview { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; margin-bottom: 21px; }
.metric { border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; background: var(--surface); position: relative; overflow: hidden; }
.metric:first-child { background: #ffffff; border-color: #e5e5ea; }
.metric-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 14px; }
.metric-symbol { width: 28px; height: 28px; border-radius: 8px; background: #eef5ff; display: grid; place-items: center; color: #0071e3; }
.metric-symbol svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.metric strong { display: block; color: #1d1d1f; font-size: 30px; font-weight: 650; line-height: 1.5; font-variant-numeric: tabular-nums; margin: 8px 0 4px; letter-spacing: -.8px; }
.metric strong small { font-size: 15px; font-weight: 400; letter-spacing: 0; color: #636366; margin: 0 4px; }
.reading-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; }
.panel-heading h2 { margin: 0; font-size: 16px; }
.panel-heading p { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.panel-heading > span { color: #636366; font-size: 14px; white-space: nowrap; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); scrollbar-width: thin; }
.reading-panel .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 14px; }
th { padding: 14px 17px; color: #636366; background: #fafafc; font-size: 14px; font-weight: 500; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 18px 17px; border-bottom: 1px solid #efeff4; vertical-align: middle; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover:not(.grade-divider) { background: #fafcff; }
.control-device-table { min-width: 1120px; table-layout: fixed; }
.control-device-table th:first-child { width: 265px; }
.control-device-table th:nth-child(2) { width: 115px; }
.control-device-table th:nth-child(3), .control-device-table th:nth-child(4) { width: 100px; }
.control-device-table th:nth-child(5) { width: 120px; }
.control-device-table th:nth-child(6) { width: 220px; }
.control-device-table th:last-child { width: 140px; }
.control-device-table td { overflow-wrap: break-word; }
.control-device-table td:nth-child(3), .control-device-table td:nth-child(4), .control-device-table td:nth-child(5), .control-device-table .btn { white-space: nowrap; }
#controlDevices .table-wrap:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
#readingRanking table { min-width: 900px; }
#readingRanking th, #readingRanking td, #readingDaily th, #readingDaily td { white-space: nowrap; }
#readingRanking td:nth-child(7), #readingRanking td:nth-child(8), #readingDaily td:last-child { white-space: normal; }
#readingRanking td:nth-child(2) { font-weight: 600; min-width: 117px; }
#readingRanking td:nth-child(5) { font-weight: 650; color: var(--blue-text); }
#readingRanking td:nth-child(7) { min-width: 122px; max-width: 170px; }
#readingRanking td:nth-child(8) { min-width: 134px; max-width: 185px; font-size: 14px; color: #636366; }
.rank-marker { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: #f2f2f7; font-size: 14px; color: #636366; }
.rank-marker[data-rank="1"] { background: #f7eac8; color: #9f792d; }
.rank-marker[data-rank="2"] { background: #e9eeec; color: #668071; }
.rank-marker[data-rank="3"] { background: #f4e8df; color: #a6846c; }
.mode-tag { display: inline-block; margin: 2px 3px 2px 0; padding: 3px 6px; border: 1px solid #e0e7f1; border-radius: 5px; font-size: 14px; color: #38618e; background: #f1f5fb; white-space: nowrap; }
.ratio-cell { display: grid; gap: 5px; min-width: 50px; font-size: 14px; }
.ratio-bar { height: 3px; border-radius: 3px; background: #e8edf5; overflow: hidden; }
.ratio-bar span { display: block; height: 100%; background: #80b4ed; }
.report-note { padding: 12px 23px; margin: 0; border-top: 1px solid var(--line); background: #fafafc; font-size: 14px; color: #636366; }
.reading-rule-status { display: flex; gap: 9px; align-items: center; padding: 13px 17px; background: #edf4fc; border-radius: 10px; margin: 0 0 20px; font-size: 14px; color: #355d89; }
.reading-rule-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #78a9dc; flex: none; }
.reading-rule-status[data-enabled="false"] { color: var(--orange); background: var(--orange-soft); }
.reading-rule-status[data-enabled="false"]::before { background: var(--orange); }
.reading-settings, .daily-details { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); margin: 18px 0; overflow: hidden; }
.reading-settings > summary, .daily-details > summary { min-height: 44px; padding: 10px 22px; font-weight: 600; font-size: 14px; cursor: pointer; }
.reading-settings > summary small, .daily-details > summary small { color: #636366; font-size: 14px; font-weight: 400; margin-left: 12px; }
.reading-settings[open] > summary, .daily-details[open] > summary { border-bottom: 1px solid var(--line); }
#readingSettingsForm { padding: 5px 22px 22px; }
.reading-settings .toolbar { margin: 18px 0; }
.reading-settings .toolbar > label { display: flex; align-items: center; gap: 8px; min-height: var(--control-height); }
.reading-settings input[type=checkbox] { width: 16px; min-height: 16px; }
.reading-period { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.reading-days { display: flex; gap: 5px; flex-wrap: wrap; }
.reading-days label { display: flex; align-items: center; gap: 5px; font-size: 14px; padding: 5px 7px; background: #f1f5fb; border-radius: 6px; }
.reading-period input[type=time] { width: 112px; }
.reading-period input[type=time], .reading-period > .btn { height: var(--control-height); min-height: var(--control-height); line-height: 24px; }
#readingAddPeriod { margin: 16px 0 20px; }
.reading-mode-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 0; }
.reading-mode-fields label { display: grid; gap: 7px; font-size: 14px; }
.daily-details .table-wrap { border: 0; border-radius: 0; }
.daily-details .empty { border: 0; }
.control-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; border: 1px solid var(--line); background: var(--surface); padding: 23px; border-radius: 16px; margin-bottom: 18px; }
.control-actions .field { margin: 0; min-width: 170px; }
.control-actions select { min-width: 190px; }
.control-actions input { width: 170px; }
.device-overview { display: flex; gap: 12px; margin-bottom: 20px; color: #636366; font-size: 14px; }
.device-overview strong { color: var(--blue); }
.console-layout { display: grid; grid-template-columns: minmax(0,1.8fr) minmax(260px,.9fr); gap: 20px; align-items: start; }
.console-layout > *, .side-panel { min-width: 0; }
.compose, .plain-section { background: var(--surface); border: 1px solid var(--line); padding: 16px 20px; border-radius: 16px; }
.compose h2, .plain-section h2 { font-size: 16px; margin-bottom: 20px; }
.target-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 12px; margin-bottom: 20px; }
.target-row .field { margin: 0; }
.presence { display: flex; align-items: center; gap: 9px; min-height: var(--control-height); padding: 0 13px; background: #f1f5fb; border: 1px solid var(--line); border-radius: 9px; white-space: nowrap; font-size: 14px; color: #636366; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #aaaab0; flex: none; }
.dot.online { background: var(--green); box-shadow: 0 0 0 3px #e3f4ea; }
.mode-picker { display: flex; gap: 4px; background: #f0f0f5; border-radius: 10px; padding: 4px; margin: 0 0 20px; }
.mode-button { flex: 1 1 0; min-width: 0; color: #636366; border: 0; background: transparent; font-size: 14px; border-radius: 7px; padding: 10px 12px; }
.mode-button.selected { color: var(--blue-text); background: var(--surface); box-shadow: 0 1px 4px #0000000a; font-weight: 600; }
.composer-modes { display: grid; margin-bottom: 25px; }
.composer-panel { grid-area: 1 / 1; min-width: 0; align-self: start; }
.composer-panel[inert] { visibility: hidden; pointer-events: none; }
.text-composer { display: grid; gap: 12px; }
.text-composer > .field, .text-composer > .phrases { margin: 0; }
.phrases { display: flex; gap: 7px; flex-wrap: wrap; margin: 10px 0 25px; }
.phrase { background: #f5f5fa; border: 1px solid #e5e5ea; color: #636366; border-radius: 7px; padding: 7px 9px; font-size: 14px; }
.phrase:hover { background: var(--blue-soft); border-color: #bcd6f3; }
.level-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 20px 0 10px; }
.level-heading .hint { font-size: 14px; }
.level-picker { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.level-option { display: flex; gap: 8px; align-items: flex-start; padding: 13px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; }
.level-option input { position: absolute; opacity: 0; width: 1px; min-height: 1px; }
.level-option:has(input:focus-visible) { outline: 3px solid #0071e366; outline-offset: 2px; }
.level-option.selected { border-color: #78afe5; background: var(--blue-soft); }
.level-option.warning.selected { border-color: #d8b791; background: var(--orange-soft); }
.level-option.urgent.selected { border-color: #d8aaa0; background: var(--red-soft); }
.level-icon { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: #0071e3; color: #fff; font-size: 14px; }
.warning .level-icon { background: #c38d58; }
.urgent .level-icon { background: #bd7b70; }
.level-option strong { display: block; font-size: 14px; }
.level-option small { color: #636366; font-size: 14px; display: block; margin-top: 4px; line-height: 1.6; }
.level-option.disabled { opacity: .45; cursor: not-allowed; }
.advanced { border-top: 1px solid var(--line); margin: 23px 0; }
.advanced summary { font-size: 14px; cursor: pointer; padding-top: 16px; color: #636366; }
.options-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.voice-composer { display: grid; gap: 12px; padding: 18px; background: #fafaff; border: 1px dashed #d8e2f0; border-radius: 10px; }
.record-button { min-height: 44px; color: #fff; background: var(--blue); border: 0; border-radius: 9px; font-weight: 600; }
.record-button.recording { background: var(--red); }
.voice-preview { width: 100%; height: 42px; }
.voice-actions, .classroom-voice-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.voice-actions .btn, .classroom-voice-actions .btn { flex: 1; }
.side-panel { display: grid; gap: 20px; }
.delivery { border: 1px solid var(--line); border-left: 3px solid #d2d2d7; padding: 15px; border-radius: 8px; background: #f8f8fc; min-height: 90px; }
.delivery strong { font-size: 14px; }
.delivery p { margin-top: 8px; font-size: 14px; }
.delivery.sent { border-left-color: var(--orange); background: var(--orange-soft); }
.delivery.received, .delivery.displayed { border-left-color: #719cc5; background: #f0f6fc; }
.delivery.acknowledged { border-left-color: var(--green); background: #edf5e8; }
.delivery.offline, .delivery.failed { border-left-color: var(--red); background: var(--red-soft); }
.recent-list { display: grid; }
.recent-item { border-top: 1px solid var(--line); padding: 13px 0; }
.recent-item:first-child { border-top: 0; padding-top: 0; }
.recent-item p { margin: 7px 0; font-size: 14px; overflow-wrap: anywhere; }
.meta-row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; min-width: 175px; }
.row-actions .btn { padding: 5px 8px; font-size: 14px; min-height: 36px; border-radius: 8px; }
.status, .level-badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 5px; color: #81916f; background: #eff4e8; font-size: 14px; white-space: nowrap; }
.status.enabled, .status.acknowledged { color: var(--green); background: #e9f2e4; }
.status.received, .status.displayed { color: #41668b; background: #edf4fb; }
.status.disabled, .status.offline, .status.failed, .level-badge.urgent { color: var(--red); background: var(--red-soft); }
.status.sent, .level-badge.warning { color: var(--orange); background: var(--orange-soft); }
.grade-filter { display: inline-flex; align-items: stretch; min-height: 48px; padding: 3px; border-radius: 8px; background: #efeff4; gap: 2px; }
.grade-filter button { border: 0; background: transparent; color: #636366; min-height: 33px; font-size: 14px; padding: 6px 12px; border-radius: 6px; }
.grade-filter button.active { background: var(--surface); color: var(--blue-text); font-weight: 600; }
.grade-divider td { background: #f3f6fc; font-size: 14px; color: #566a80; padding: 10px 17px; }
.class-toolbar, .class-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.class-toolbar { justify-content: space-between; margin: 0 0 18px; }
.action-menu { position: relative; }
.action-menu > summary { list-style: none; cursor: pointer; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu[open] > summary { background: var(--blue-soft); border-color: #a8caed; color: #0065bd; }
.action-menu-content { position: absolute; top: calc(100% + 8px); right: 0; z-index: 15; min-width: 180px; display: grid; gap: 3px; padding: 6px; border: 1px solid #dde5ef; border-radius: 12px; background: #fff; box-shadow: 0 8px 28px #1736541c; }
.action-menu-content .btn { justify-content: flex-start; border: 0; background: transparent; font-weight: 500; }
.action-menu-content .btn:hover { background: #f0f6ff; }
.user-role-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.user-role-tab { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 7px 13px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #606d7e; font-size: 14px; }
.user-role-tab:hover { background: #eaf0f7; }
.user-role-tab[aria-pressed=true] { border-color: #c8ddf4; background: #e8f2ff; color: #0065c9; font-weight: 600; }
.user-tab-count { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .8; }
.users-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.users-filterbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 16px 18px 0; }
.user-search { flex: 1 1 220px; max-width: 390px; }
.users-filterbar select { width: auto; min-width: 118px; }
.users-filterbar > .btn { margin-left: auto; font-weight: 400; color: var(--muted); border-color: transparent; }
.users-resultbar { display: flex; align-items: center; gap: 12px; padding: 11px 20px; color: var(--muted); font-size: 12px; min-height: 42px; }
.user-pending-link { border: 0; border-radius: 5px; padding: 3px 7px; background: #fff5df; color: #8d5c10; font-size: 12px; }
.users-table-wrap { border: 0; border-radius: 0; }
.users-table { table-layout: fixed; width: 100%; min-width: 800px; }
.users-table th { font-size: 12px; color: #5c6b7e; font-weight: 500; padding: 11px 20px; background: #f7f9fc; }
.users-table th:nth-child(1) { width: 24%; }
.users-table th:nth-child(2) { width: 14%; }
.users-table th:nth-child(3) { width: 30%; }
.users-table th:nth-child(4) { width: 11%; }
.users-table th:nth-child(5) { width: 21%; }
.users-table td { padding: 13px 20px; font-size: 14px; vertical-align: middle; overflow-wrap: anywhere; }
.users-table tbody tr:hover { background: #f8fbff; }
.user-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.user-identity > div { min-width: 0; }
.user-list-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: #f0f4f9; color: #4e6783; font-size: 14px; font-weight: 500; }
.user-identity strong { display: block; font-size: 14px; font-weight: 600; color: #243448; }
.user-identity small, .user-scope small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; line-height: 1.5; color: #627082; }
.user-identity small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role-badge { display: inline-block; white-space: nowrap; border-radius: 5px; padding: 3px 7px; font-size: 12px; background: #f1f4f8; color: #536477; }
.user-role-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.user-role-badge.role-principal { background: #e9effa; color: #465f98; }
.user-role-badge.role-director { background: #e6f3f2; color: #347574; }
.user-role-badge.role-grade_leader { background: #edf1fe; color: #5b66a3; }
.user-unassigned { color: #9b6b1e; }
.user-row-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.user-row-actions .btn { min-height: 34px; padding: 5px 9px; font-size: 13px; font-weight: 500; }
.user-row-actions .user-edit { background: transparent; border-color: transparent; color: #0065c9; }
.users-table .status { font-size: 12px; }
.users-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 10px 20px; font-size: 12px; color: var(--muted); }
.users-pagination > div { display: flex; align-items: center; gap: 12px; }
.users-pagination .btn { min-height: 32px; padding: 4px 9px; font-weight: 400; font-size: 12px; }
.user-permission-guide { margin-top: 18px; color: var(--muted); font-size: 13px; }
.user-permission-guide summary { cursor: pointer; padding: 6px 0; width: fit-content; }
.user-permission-guide dl { display: grid; gap: 8px; margin: 12px 0; }
.user-permission-guide dl > div { display: flex; gap: 16px; }
.user-permission-guide dt { flex: 0 0 84px; color: #415469; }
.user-permission-guide dd { margin: 0; }
.user-actions-popover { position: fixed; inset: auto; margin: 0; min-width: 160px; padding: 6px; border: 1px solid #dde5ef; border-radius: 10px; background: #fff; box-shadow: 0 8px 28px #1736541c; }
.user-actions-popover:popover-open { display: grid; gap: 2px; }
.user-actions-popover .btn { justify-content: flex-start; min-height: 38px; border: 0; background: transparent; font-weight: 400; }
.user-actions-popover .btn:hover { background: #f0f6ff; }
.user-menu-title { color: var(--muted); font-size: 12px; padding: 5px 10px 7px; border-bottom: 1px solid var(--line); margin-bottom: 3px; }
.staff-class-picker { display: grid; gap: 8px; max-height: 250px; overflow: auto; padding: 0 4px 4px 0; }
.staff-scope { min-width: 0; border: 0; padding: 0; }
.staff-scope > legend { padding: 0; margin-bottom: 8px; }
.staff-class-picker .staff-class-grade { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.staff-class-grade h3 { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.staff-class-picker .check-item { padding: 7px; min-height: 36px; font-size: 13px; }
@media (max-width: 700px) {
  .users-filterbar { gap: 8px; padding: 12px 12px 0; }
  .user-search { flex-basis: 100%; max-width: none; }
  .users-filterbar select { flex: 1; min-width: 90px; }
  .users-filterbar > .btn { padding-inline: 6px; }
  .user-role-tabs { gap: 3px; }
  .user-role-tab { padding: 7px 9px; min-height: 44px; }
  .users-table td { padding-inline: 13px; }
  .users-pagination { padding: 10px 12px; }
  .users-pagination .btn, .user-row-actions .btn { min-height: 44px; }
  .staff-class-picker .staff-class-grade { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
.empty { display: grid; place-items: center; text-align: center; gap: 7px; padding: 48px 22px; border: 1px dashed #e1e1e7; background: #fafafc; border-radius: 12px; color: #636366; font-size: 14px; }
.empty::before { content: ""; width: 37px; height: 28px; border: 1px solid #d2d2d7; border-top: 4px solid #e5e5ea; border-radius: 5px; margin-bottom: 8px; }
.reading-panel .empty { border: 0; border-radius: 0; }
.classroom-voice-list { display: grid; gap: 13px; }
.classroom-voice-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 23px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.classroom-voice-item h3 { margin: 0; font-size: 15px; }
.classroom-voice-item p { font-size: 14px; color: var(--muted); margin: 7px 0 0; }
.classroom-voice-player { display: grid; gap: 8px; min-width: 230px; }
.classroom-voice-player audio { width: min(360px,100%); height: 40px; }
.quiet-status { background: #f0f7ff; border: 1px solid #dce9f8; border-radius: 12px; padding: 16px 20px; margin-bottom: 20px; }
.quiet-status.active { background: var(--orange-soft); border-color: #e9d6bd; }
.quiet-status strong, .quiet-status span { display: block; font-size: 14px; }
.quiet-status span { font-size: 14px; color: var(--muted); margin-top: 5px; }
.schedule-list { display: grid; gap: 11px; }
.schedule-item { display: grid; grid-template-columns: minmax(140px,1fr) 120px 120px auto; align-items: end; gap: 12px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.schedule-item .field { margin: 0; }
.weekday-picker { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.weekday-picker label { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: #f9faf5; font-size: 14px; }
.weekday-picker input { width: 16px; min-height: 16px; margin: 0; }
.settings-device-section { margin-top: 30px; }
.settings-device-section .view-head { padding-top: 22px; border-top: 1px solid var(--line); }
.load-more { margin-top: 16px; }
dialog { padding: 0; width: min(580px,calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto; color: var(--text); background: var(--surface); border: 1px solid #e5e5ea; border-radius: 16px; box-shadow: 0 24px 90px #00000020; }
dialog::backdrop { background: #00000040; backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 8px 23px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; background: var(--surface); }
.dialog-head .btn.icon { width: var(--control-height); min-height: var(--control-height); }
.dialog-head h2 { font-size: 17px; margin: 0; }
.dialog-body { padding: 4px 23px 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 8px 23px; border-top: 1px solid var(--line); background: #fafafc; position: sticky; bottom: 0; z-index: 1; }
.dialog-actions .btn { min-height: var(--control-height); }
.confirm-summary { border: 1px solid var(--line); padding: 16px; border-radius: 10px; margin: 18px 0; background: #fafafc; }
.confirm-summary p { font-size: 14px; margin: 0 0 8px; overflow-wrap: anywhere; }
.confirm-summary p:last-child { margin: 0; }
.quiet-warning { margin: 14px 0; padding: 16px; background: var(--orange-soft); border-radius: 9px; font-size: 14px; }
.quiet-warning p { margin: 8px 0 0; }
.check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; max-height: 300px; overflow: auto; }
.check-item { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 9px; font-size: 14px; background: #fafafc; }
.check-item input { width: 16px; min-height: 16px; margin: 0; }
.code-box { text-align: center; background: #f0f6ff; border: 1px dashed #bfd7f3; border-radius: 10px; padding: 22px; font: 700 29px/1.4 Consolas, monospace; letter-spacing: 3px; margin-bottom: 17px; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 8px; width: min(390px,calc(100vw - 40px)); }
.toast { padding: 10px 14px; border-radius: 10px; background: #313136; color: #fff; font-size: 14px; box-shadow: 0 8px 32px #00000024; animation: rise .18s ease-out; }
.preview-notice { padding: 8px 12px; font-size: 12px; color: #735a30; border: 1px solid #eadfc8; background: #fffbf3; border-radius: 8px; margin-bottom: 20px; }
@media(min-width:1600px) { main { padding: 39px 48px 60px; } .topbar { padding: 0 48px; } .metric { padding: 25px 28px; } }
@media(max-width:1150px) { .shell { grid-template-columns: 210px minmax(0,1fr); } main { padding: 26px 23px 42px; } .topbar { padding: 0 23px; } .topbar-date { display: none; } .console-layout { grid-template-columns: minmax(0,1fr) 260px; gap: 17px; } .level-picker { grid-template-columns: 1fr; } .level-option small { margin: 1px 0 0; } .metric { padding: 18px; } .metric strong { font-size: 26px; } .view-head { flex-wrap: wrap; } .reading-filter { gap: 10px; } }
@media(max-width:880px) {
  .shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: 256px; height: 100dvh; transform: translateX(-100%); transition: transform .2s; padding-top: 31px; visibility: hidden; }
  .nav-open .sidebar { transform: translateX(0); visibility: visible; }
  body.nav-open { overflow: hidden; }
  .sidebar-close { display: inline-flex; position: absolute; right: 8px; top: 8px; border: 0; background: transparent; color: #62626a; }
  .nav-backdrop { display: none; position: fixed; inset: 0; background: #00000040; border: 0; z-index: 25; }
  .nav-open .nav-backdrop { display: block; }
  .topbar { height: 65px; gap: 10px; padding: 0 20px; }
  .menu-toggle { display: inline-flex; background: transparent; border: 0; color: #1d1d1f; }
  .menu-toggle svg { width: 21px; height: 21px; }
  .mobile-brand { display: block; font-size: 16px; font-weight: 700; }
  .breadcrumb { display: none; }
  main { padding: 25px 22px 45px; }
  .console-layout { grid-template-columns: 1fr; }
  .level-picker { grid-template-columns: repeat(3,1fr); }
}
@media(max-width:620px) {
  .topbar { padding: 0 13px; }
  .user-meta { display: none; }
  .user-avatar { width: 34px; height: 34px; font-size: 13px; }
  .user-block { gap: 0; }
  main { padding: 23px 15px 35px; }
  h1 { font-size: 25px; }
  .view-head { gap: 12px; margin-bottom: 20px; }
  .view-head > div { width: 100%; }
  .view-head > .btn { min-height: 37px; }
  .view-head p { font-size: 14px; }
  .reading-filter { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 15px; gap: 12px 10px; }
  .reading-filter .field { min-width: 0; }
  .reading-filter .field:nth-child(3) { grid-column: 1 / -1; }
  .period-shortcuts { width: 100%; }
  .period-shortcuts .btn { flex: 1; }
  .reading-filter > .btn { width: 100%; }
  .reading-overview { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .metric:first-child { grid-column: 1 / -1; }
  .metric { padding: 17px 18px; }
  .metric:first-child strong { font-size: 32px; }
  .metric strong { margin: 8px 0 4px; font-size: 28px; }
  .metric-heading { font-size: 14px; }
  .panel-heading { padding: 17px; }
  .panel-heading > span { display: none; }
  .report-note { padding: 12px 17px; }
  .reading-settings > summary, .daily-details > summary { padding: 10px 17px; }
  .reading-settings > summary small, .daily-details > summary small { display: block; margin: 5px 0 0 15px; }
  #readingSettingsForm { padding: 4px 17px 20px; }
  .reading-mode-fields { grid-template-columns: 1fr; }
  .toolbar .field { min-width: 0; flex: 1 1 140px; }
  .view-head .toolbar { gap: 9px; }
  .target-row { grid-template-columns: 1fr; gap: 11px; }
  .presence { width: max-content; min-height: 34px; }
  .compose, .plain-section { padding: 16px 18px; }
  .level-picker { grid-template-columns: 1fr; }
  .options-row { gap: 10px; }
  .control-actions { padding: 18px; gap: 11px; }
  .control-actions .field { width: 100%; }
  .control-actions input, .control-actions select { width: 100%; min-width: 0; }
  .control-actions .btn { flex: 1 1 125px; }
  .classroom-voice-item { grid-template-columns: 1fr; padding: 20px; }
  .classroom-voice-player { min-width: 0; }
  .classroom-voice-player audio { width: 100%; }
  .schedule-item { grid-template-columns: 1fr 1fr; padding: 17px; }
  .schedule-item > .field:first-child { grid-column: 1 / -1; }
  .check-grid { grid-template-columns: 1fr; }
  dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
  .dialog-head { padding: 8px 18px; }
  .dialog-body { padding: 4px 18px 12px; }
  .dialog-actions { padding: 8px 18px; }
  .grade-filter button { padding: 7px 10px; }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.metric:first-child strong { color: #0071e3; }
.nav button { font-size: 15px; }
table { font-size: 15px; line-height: 1.65; }
.metric-heading { font-size: 14px; }
.view-head h1 { font-weight: 650; }
.topbar { backdrop-filter: blur(20px); }
.sidebar .brand-lockup small { color: #62626a; opacity: 1; letter-spacing: .4px; }

/* Readable Chinese typography at both desktop and whiteboard sizes. */
.btn { font-size: 15px; }
input, select, textarea { font-size: 15px; }
.field label, .label { font-size: 14px; }
h1 { font-size: 28px; font-weight: 650; letter-spacing: -.4px; }
.panel-heading h2, .compose h2, .plain-section h2 { font-size: 18px; }
.reading-settings > summary, .daily-details > summary { font-size: 16px; }
.row-actions .btn { padding: 6px 10px; font-size: 14px; }
.nav-icon { width: 21px; }
.brand-lockup small { letter-spacing: .2px; }
@media(max-width:620px) { h1 { font-size: 28px; } .reading-filter > .btn { font-size: 15px; } }
@media (max-width: 620px), (pointer: coarse) {
  :root { --control-height: 44px; }
  .btn.icon, #logoutButton, .view-head > .btn, .row-actions .btn { min-height: 44px; }
  .btn.icon { min-width: 44px; }
  .password-toggle { min-height: 44px; }
  .check-item, .weekday-picker label, .reading-days label { min-height: 44px; }
}
.device-detail { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 190px; }
.device-detail span { overflow-wrap: anywhere; }
.device-code { font-variant-numeric: tabular-nums; color: #0071e3; font-weight: 600; white-space: nowrap; }
dialog.wide-dialog { width: min(820px, calc(100vw - 32px)); }
#classRolloverDialog .options-row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin: 18px 0; }
#classRolloverDialog .options-row .field { margin: 0; }
#classRolloverPreset { min-height: var(--control-height); }
.rollover-rows { max-height: 45vh; overflow: auto; border: 1px solid #e5e5ea; border-radius: 12px; }
.rollover-rows table { min-width: 520px; }
.rollover-rows td:last-child { min-width: 250px; }
.rollover-rows input[type=checkbox] { width: 18px; height: 18px; }
