/* 对比版本：仅覆盖控件与内页密度，保留首页主视觉及原素材。 */
:root {
  --control-ink: #151b3d;
  --control-secondary: #606987;
  --control-placeholder: #77809a;
  --control-line: #e5e1ef;
  --control-accent: #7950f8;
  --control-focus: #6c43e8;
  --control-soft: #f6f3ff;
  --control-error: #b83f63;
  --control-success: #217c69;
  --control-radius: 12px;
  --tab-content-height: 68px;
}

button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(121, 80, 248, .25);
  outline-offset: 3px;
}

/* Safe area is extra space below the tab content, never taken from its icons. */
.bottom-nav {
  height: calc(var(--tab-content-height) + env(safe-area-inset-bottom, 0px));
  padding: 6px 24px calc(6px + env(safe-area-inset-bottom, 0px));
}
.nav-item { min-height: 54px; gap: 2px; font-size: 12px; }
.nav-item:active { background: rgba(121, 80, 248, .045); border-radius: 12px; }
.app-main { padding-bottom: calc(var(--tab-content-height) + env(safe-area-inset-bottom, 0px)); }

/* The supplied page artwork and top spacing remain in their original positions. */
#appShell[data-route]:not([data-route="home"]) .screen {
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: calc(34px + env(safe-area-inset-bottom, 0px));
}
#appShell[data-route]:not([data-route="home"]) .header-title {
  margin-right: 70px;
  text-align: left;
}
#appShell[data-route]:not([data-route="home"]) .header-title strong {
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: 0;
  font-weight: 650;
}
.header-back { flex-basis: 44px; width: 44px; height: 44px; border-radius: 12px; font-size: 34px; }
.header-back:active { background: rgba(121, 80, 248, .07); }
.page-intro { margin-bottom: 24px; }
.page-intro h1 { font-size: 28px; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.page-intro p { margin-top: 9px; color: var(--control-secondary); font-size: 15px; line-height: 1.65; }
#appShell[data-route]:not([data-route="home"]) h2 { font-size: 20px; line-height: 1.4; letter-spacing: -.015em; }
#appShell[data-route]:not([data-route="home"]) h3 { font-size: 17px; line-height: 1.45; }
.section-heading { gap: 10px; margin: 26px 0 12px; align-items: center; }
.section-heading p { margin-top: 5px; color: var(--control-secondary); font-size: 13px; line-height: 1.6; }
.helper, .muted { color: var(--control-secondary); }
.helper { font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.eyebrow { font-size: 11px; line-height: 1.5; }
.text-link { min-height: 44px; font-size: 14px; line-height: 1.4; }
.text-link:active { color: var(--control-focus); opacity: .75; }

.card { border: 1px solid var(--control-line); border-radius: 16px; background: #fff; }
.inset { padding: 16px; }
.pill { min-height: 26px; padding: 4px 8px; border-radius: 7px; font-size: 12px; line-height: 1.4; font-weight: 600; }
.pill.pending { color: #6841c9; background: #f0eaff; }
.pill.approved { color: var(--control-success); background: #eaf7f1; }
.pill.change { color: var(--control-error); background: #ffedf2; }
.pill.neutral { color: #626b82; background: #f0f2f6; }
.pill.locked { color: #fff; background: #7950f8; }

/* Keep the textured home CTA intact; simplify only interior and modal actions. */
#appShell[data-route]:not([data-route="home"]) .button,
.modal .button {
  min-height: 48px;
  padding: 10px 16px;
  border-radius: var(--control-radius);
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: 0;
  font-weight: 600;
  transition: background-color .14s ease, border-color .14s ease, opacity .14s ease;
}
#appShell[data-route]:not([data-route="home"]) .button.primary,
.modal .button.primary { color: #fff; background: #7950f8; border: 1px solid #7950f8; box-shadow: none; }
#appShell[data-route]:not([data-route="home"]) .button.secondary,
.modal .button.secondary { color: #6841d3; background: #fff; border: 1px solid #d8cbf6; }
#appShell[data-route]:not([data-route="home"]) .button.ghost,
.modal .button.ghost { color: var(--control-secondary); background: transparent; border-color: transparent; }
#appShell[data-route]:not([data-route="home"]) .button.danger,
.modal .button.danger { color: var(--control-error); background: #fff4f7; border: 1px solid #efc4d0; }
#appShell[data-route]:not([data-route="home"]) .button.small,
.modal .button.small { min-height: 44px; padding: 9px 12px; font-size: 14px; }
#appShell[data-route]:not([data-route="home"]) .button:hover:not(:disabled),
.modal .button:hover:not(:disabled) { transform: none; }
#appShell[data-route]:not([data-route="home"]) .button.primary:active:not(:disabled),
.modal .button.primary:active:not(:disabled) { background: #6940e0; border-color: #6940e0; }
#appShell[data-route]:not([data-route="home"]) .button.secondary:active:not(:disabled),
.modal .button.secondary:active:not(:disabled) { background: #f4efff; }
#appShell[data-route]:not([data-route="home"]) .button.danger:active:not(:disabled),
.modal .button.danger:active:not(:disabled) { background: #ffe7ee; }
#appShell[data-route]:not([data-route="home"]) .button:disabled,
.modal .button:disabled { color: #778098; background: #eceef3; border: 1px solid #e3e5eb; opacity: 1; }
#appShell[data-route]:not([data-route="home"]) .button[aria-busy="true"],
.modal .button[aria-busy="true"] { cursor: progress; }
.action-row { gap: 10px; margin-top: 20px; }
.action-row > .button { min-width: 0; }

/* Form fields keep 16px input text, including on small iPhone viewports. */
.form-stack { gap: 18px; }
.field { gap: 7px; min-width: 0; }
.field label { color: var(--control-ink); font-size: 15px; line-height: 1.5; font-weight: 600; }
.field input, .field select, .field textarea, .input {
  min-width: 0;
  min-height: 48px;
  border: 1px solid #dcd5ee;
  border-radius: var(--control-radius);
  padding: 11px 13px;
  color: var(--control-ink);
  background: #fff;
  font-size: 16px;
  line-height: 1.5;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: var(--control-accent);
  box-shadow: 0 0 0 3px rgba(121, 80, 248, .085);
}
.field input::placeholder, .field textarea::placeholder { color: var(--control-placeholder); }
.field input:disabled, .field select:disabled, .field textarea:disabled {
  color: #737b91;
  background: #f2f3f7;
  border-color: #e2e4eb;
  opacity: 1;
  -webkit-text-fill-color: #737b91;
}
.field input.invalid, .field textarea.invalid, .field select.invalid {
  border-color: var(--control-error);
  background: #fff8fa;
}
.field textarea { min-height: 124px; resize: vertical; }
.field-meta { gap: 8px; color: var(--control-secondary); font-size: 12px; line-height: 1.5; }
.error { min-height: 0; color: var(--control-error); font-size: 13px; line-height: 1.5; }
.error:not(:empty) { min-height: 20px; }
.required { color: var(--control-error); }
.info-callout { gap: 8px; padding: 13px; border: 1px solid #e7e0f6; border-radius: 12px; color: var(--control-secondary); background: #f8f6ff; font-size: 14px; line-height: 1.65; }
.info-callout b { flex-shrink: 0; color: #6841c9; }
.demo-fill { min-height: 44px; font-size: 14px; }
.stepper { gap: 7px; margin-bottom: 24px; color: var(--control-secondary); font-size: 13px; }
.stepper span { flex: 0 0 26px; width: 26px; height: 26px; font-size: 13px; }
.stepper b { font-size: 13px; font-weight: 600; white-space: normal; line-height: 1.4; }
.stepper i { min-width: 12px; }
#appShell[data-route="form"] .page-intro { margin-bottom: 18px; }
#appShell[data-route="form"] .stepper { margin-bottom: 24px; }
#appShell[data-route="form"] .form-stack { gap: 17px; }
#appShell[data-route="form"] .field { gap: 7px; }
#appShell[data-route="form"] .form-stack:before,
#appShell[data-route="form"] .form-stack .field:nth-of-type(3):before { font-size: 19px; line-height: 1.4; }
#appShell[data-route="form"] .form-stack .field:nth-of-type(3):before { margin-top: 12px; }
#appShell[data-route="form"] .class-number-row { gap: 7px; font-size: 16px; }
#appShell[data-route="form"] .class-number-row input,
#appShell[data-route="form"] .class-number-row select { width: 64px; flex: 0 0 64px; min-height: 48px; font-size: 16px; }
#appShell[data-route="form"] .class-number-hint { color: var(--control-secondary); font-size: 12px; }
#appShell[data-route="form"] .form-stack .action-row .ghost { min-height: 44px; font-size: 14px; }

.filter-row { gap: 8px; margin-bottom: 15px; padding-bottom: 2px; }
.filter { min-height: 44px; padding: 9px 13px; border: 1px solid var(--control-line); border-radius: 11px; color: var(--control-secondary); font-size: 14px; line-height: 1.5; }
.filter.active { border-color: #7950f8; background: #7950f8; }
.filter:active:not(:disabled) { filter: brightness(.95); }
.song-stats { margin-bottom: 18px; padding: 16px 8px; border: 1px solid var(--control-line); border-radius: 16px; }
.song-stats strong { font-size: 26px; }
.song-stats span { color: var(--control-secondary); font-size: 13px; }
.song-list { gap: 12px; }
.song-card { min-height: 92px; padding: 16px; border: 1px solid var(--control-line); border-radius: 16px; }
.song-card:active, .staff-row:active, button.card:active { background: #faf8ff; }
.song-card .song-top > div { min-width: 0; }
.song-card h3 { max-width: 100%; font-size: 17px; }
.song-card p { color: var(--control-secondary); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.song-card .song-meta { gap: 6px 12px; margin-top: 12px; padding-right: 18px; color: var(--control-secondary); font-size: 12px; line-height: 1.5; }
.song-card .song-arrow { right: 15px; bottom: 15px; font-size: 22px; }
.empty-state { padding: 28px 18px; border: 1px dashed #d3c9e9; border-radius: 16px; color: var(--control-secondary); }
.empty-state strong { font-size: 16px; }
.empty-state p { font-size: 14px; line-height: 1.65; }
.detail-hero { padding: 18px; border: 1px solid var(--control-line); border-radius: 16px; }
#appShell[data-route]:not([data-route="home"]) .detail-hero h2 { font-size: 23px; overflow-wrap: anywhere; }
.detail-hero p { color: var(--control-secondary); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.detail-facts { column-gap: 14px; margin-top: 16px; }
.detail-facts > * { min-width: 0; }
.detail-fact { padding: 12px 0; }
.detail-fact small { color: var(--control-secondary); font-size: 12px; }
.detail-fact strong { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.reason-card { border-width: 1px; border-radius: 12px; padding: 14px; }
.reason-card small { color: var(--control-error); font-size: 13px; }
.reason-card p { color: var(--control-secondary); font-size: 15px; overflow-wrap: anywhere; }
.subsection-head { gap: 8px; margin-bottom: 10px; }
.subsection-head strong { font-size: 16px; }
.subsection-head small { color: var(--control-secondary); font-size: 12px; }

.schedule-day { border: 1px solid var(--control-line); border-radius: 16px; }
.schedule-day + .schedule-day { margin-top: 14px; }
.schedule-day-head { gap: 8px; padding: 14px 16px; }
.schedule-day-head strong { font-size: 17px; }
.schedule-day-head small { color: var(--control-secondary); font-size: 12px; }
.schedule-row { grid-template-columns: 25px minmax(0, 1fr) auto; gap: 9px; min-height: 66px; padding: 12px 14px; }
.schedule-no { color: var(--control-secondary); font-size: 14px; font-variant-numeric: tabular-nums; }
.schedule-copy strong { font-size: 15px; }
.schedule-copy span { color: var(--control-secondary); font-size: 12px; line-height: 1.5; }
.schedule-row.empty .schedule-copy strong,
.schedule-row.empty .schedule-copy span { color: #7b8298; }

.stats { margin-top: 16px; padding: 14px 4px; border: 1px solid var(--control-line); border-radius: 16px; }
.stat { min-width: 0; padding: 4px 6px; }
.stat small { color: var(--control-secondary); font-size: 12px; }
.stat strong { margin-top: 6px; font-size: 26px; font-variant-numeric: tabular-nums; }
.staff-toolbar { gap: 10px; margin-top: 16px; }
.staff-toolbar .button { min-width: 0; }
.staff-banner { padding: 14px; border: 1px solid #e7e0f6; border-radius: 12px; color: var(--control-secondary); font-size: 13px; }
.staff-list { gap: 9px; margin-top: 12px; }
.staff-section-label { margin: 14px 2px 2px; font-size: 15px; }
.staff-section-label small { color: var(--control-secondary); font-size: 12px; }
.staff-row { grid-template-columns: 22px minmax(0, 1fr) auto 12px; gap: 8px; min-height: 76px; padding: 12px; border: 1px solid var(--control-line); border-radius: 14px; }
.staff-row .position { font-size: 14px; }
.staff-row .staff-copy strong { font-size: 15px; }
.staff-row .staff-copy span { margin-top: 4px; color: var(--control-secondary); font-size: 12px; line-height: 1.5; }
.chevron { font-size: 22px; }
.time-card, .window-card { padding: 16px; border: 1px solid var(--control-line); border-radius: 16px; background: #fff; box-shadow: none; }
.window-card-head { gap: 8px; }
.window-card-head strong { font-size: 20px; }
.window-kicker { color: var(--control-secondary); font-size: 12px; }
.window-times { gap: 12px; margin-top: 14px; padding-top: 14px; }
.window-time { grid-template-columns: 84px minmax(0, 1fr); gap: 8px; }
.window-time small { color: var(--control-secondary); font-size: 12px; line-height: 1.6; }
.window-time strong { font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }

.slot-legend { gap: 8px 12px; font-size: 12px; line-height: 1.6; }
.slot-day { padding: 14px; border: 1px solid var(--control-line); border-radius: 16px; }
.slot-day + .slot-day { margin-top: 12px; }
.slot-day-head { align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.slot-day-head strong { flex-shrink: 0; font-size: 16px; line-height: 1.5; }
.slot-day-head span { color: var(--control-secondary); font-size: 12px; line-height: 1.5; text-align: right; overflow-wrap: anywhere; }
.slot-button { min-width: 0; min-height: 68px; padding: 11px 12px; border: 1px solid #dcd5ee; border-radius: 12px; }
.slot-button strong { font-size: 15px; line-height: 1.4; }
.slot-button small { margin-top: 5px; color: var(--control-secondary); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.slot-button:active:not(:disabled) { background: #f5f0ff; }
.slot-button.selected { box-shadow: none; }
.slot-button.occupied, .slot-button.reserved, .slot-button.closed { opacity: 1; }
.slot-button.occupied { color: #72788a; background: #f2f3f7; }
.slot-button.reserved { color: #a44263; background: #fff2f6; border-color: #eed5de; }
.slot-button.closed { color: #73778a; background: #f1f1f5; border-color: #e3e3eb; }
.slot-button .text-link { min-height: 44px; display: inline-flex; align-items: center; font-size: 12px; }
.slot-day.is-closed { background: #faf9fc; }
#appShell[data-route="reservations"] .slot-grid { gap: 10px; }
#appShell[data-route="slot"] .slot-context { padding: 14px; border-radius: 12px; }
#appShell[data-route="slot"] .slot-context strong { font-size: 17px; }
#appShell[data-route="slot"] .slot-context span { font-size: 14px; }
#appShell[data-route="slot"] .slot-day-tabs { gap: 4px; margin-bottom: 20px; padding: 4px; border-radius: 12px; }
#appShell[data-route="slot"] .slot-day-tabs .filter { min-height: 44px; border-radius: 9px; font-size: 14px; }
#appShell[data-route="slot"] .slot-day-head strong { font-size: 18px; }
#appShell[data-route="slot"] .slot-day-head span { font-size: 12px; }
#appShell[data-route="slot"] .slot-grid { gap: 10px; }
#appShell[data-route="slot"] .slot-button { min-height: 70px; padding: 12px; border-width: 1px; border-radius: 12px; }
#appShell[data-route="slot"] .slot-button strong { font-size: 16px; }
#appShell[data-route="slot"] .slot-button small { margin-top: 5px; font-size: 13px; }
#appShell[data-route="slot"] .slot-legend { margin-top: 18px; font-size: 12px; }
#appShell[data-route="slot"] .slot-summary { padding: 14px; border-width: 1px; border-radius: 12px; }
#appShell[data-route="slot"] .slot-summary strong { font-size: 16px; }
.slot-summary small { font-size: 12px; }

#appShell[data-route="feedback"] .form-stack:before { font-size: 19px; line-height: 1.5; }
#appShell[data-route="feedback"] .feedback-category { min-height: 44px; padding: 9px 13px; border-width: 1px; border-radius: 11px; font-size: 14px; }
#appShell[data-route="feedback"] .field textarea { min-height: 156px; }
#appShell[data-route="feedback"] .button.primary { margin-top: 8px; }
.login-card { padding: 18px; border: 1px solid var(--control-line); border-radius: 16px; }
.login-card h1 { font-size: 28px; line-height: 1.3; }
#appShell[data-route="login"] .login-card h2 { font-size: 24px; }
#appShell[data-route="login"] .login-card { margin-top: 10px; }
#appShell[data-route="login"] .login-card .eyebrow { color: #785bad; font-size: 12px; }
#appShell[data-route="login"] .login-card:after { margin: 22px 0 0; font-size: 13px; line-height: 1.6; }
.demo-credentials { flex-wrap: wrap; gap: 8px; margin: 16px 0; padding: 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.demo-credentials code { color: #6841c9; font-size: 13px; overflow-wrap: anywhere; }
.lock-note { padding: 13px; border-radius: 12px; color: var(--control-secondary); font-size: 13px; line-height: 1.65; }
#appShell[data-route="prep"] .song-list .card { border-radius: 16px; }
#appShell[data-route="prep"] .song-list .song-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#appShell[data-route="prep"] .action-row { grid-template-columns: minmax(0, 1fr); }
#appShell[data-route="prep"] .action-row > .button { width: 100%; }
#appShell[data-route="profile"] .screen > div.card { padding: 18px 16px; }
#appShell[data-route="profile"] .screen > div.card:before { width: 48px; height: 48px; margin-right: 14px; border-radius: 15px; font-size: 24px; }
#appShell[data-route="profile"] .screen > div.card h2 { font-size: 22px; }
#appShell[data-route="profile"] .profile-stats { margin-top: 16px; border: 1px solid var(--control-line); border-radius: 16px; padding: 16px 8px; }
#appShell[data-route="profile"] .profile-stats strong { font-size: 26px; }
#appShell[data-route="profile"] .profile-stats span { color: var(--control-secondary); font-size: 13px; }
#appShell[data-route="profile"] .screen > .song-list .card { min-height: 78px; }
#appShell[data-route="profile"] .song-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* Existing modal hosts stay above the fixed tab bar and demo capsule. */
.modal-layer {
  z-index: 1100;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(18, 19, 41, .42);
}
body:has(.modal-layer:not([hidden])) { overflow: hidden; }
.modal {
  width: min(100%, 430px);
  max-height: min(88vh, 840px);
  max-height: min(88dvh, 840px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 20px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -8px 36px rgba(18, 19, 41, .1);
}
.modal-head { align-items: flex-start; gap: 8px; margin-bottom: 20px; }
.modal-head h2 { font-size: 21px; line-height: 1.4; }
.modal-head > button { flex: 0 0 44px; width: 44px; height: 44px; margin: -7px -8px 0 0; border-radius: 12px; font-size: 26px; color: var(--control-secondary); }
.modal-head > button:active { background: #f2eefb; }
.modal .eyebrow { margin-bottom: 4px; color: #785bad; font-size: 11px; }
.modal .helper { font-size: 13px; }
.modal .filter-row { flex-wrap: wrap; overflow: visible; margin-bottom: 4px; }
.modal .filter-row label.filter { flex: 1 0 42%; font-size: 14px; }
.modal input[type="checkbox"] { min-height: 0; width: 19px; height: 19px; accent-color: #7950f8; }
.setting-toggle { padding: 13px; border: 1px solid var(--control-line); border-radius: 12px; }
.setting-toggle label { gap: 10px; }
.setting-toggle strong { font-size: 14px; line-height: 1.5; }
.setting-toggle small { color: var(--control-secondary); font-size: 12px; line-height: 1.6; }
.demo-clock { margin-top: 20px; padding: 14px; border-color: #d9d0ee; border-radius: 12px; }
.demo-clock-head strong { font-size: 14px; }
.demo-clock p { color: var(--control-secondary); font-size: 12px; line-height: 1.6; }
.clock-actions { gap: 8px; }
.modal .clock-actions .button { min-height: 44px; padding: 8px 12px; font-size: 13px; }
.toast { z-index: 1200; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); max-width: min(calc(100vw - 40px), 370px); padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; }

/* Overflow guards only: homepage composition, titles, CTA and artwork stay intact. */
.home-meta { flex-wrap: wrap; }
.home-meta > div:first-child { flex: 1 1 190px; }
.home-meta strong { white-space: normal; overflow-wrap: anywhere; }
.home-remaining { flex: 0 0 auto; }
.home-song small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 360px) {
  #appShell[data-route]:not([data-route="home"]) .screen { padding-left: 16px; padding-right: 16px; }
  .page-intro h1 { font-size: 28px; }
  .page-intro p { font-size: 15px; }
  .stepper { gap: 5px; }
  .stepper b { font-size: 12px; }
  .stat { padding-left: 4px; padding-right: 4px; }
  .stat small { font-size: 11px; }
  .staff-row { gap: 6px; padding: 12px 10px; }
  .staff-row .pill { padding-left: 6px; padding-right: 6px; font-size: 11px; }
  .window-time { grid-template-columns: 76px minmax(0, 1fr); }
  .schedule-row { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 7px; padding-left: 12px; padding-right: 12px; }
  .schedule-row .pill { font-size: 11px; }
  .modal { padding-left: 16px; padding-right: 16px; }
}
