* { box-sizing: border-box; }
body { margin: 0; background-color: var(--color-bg); background-image: radial-gradient(ellipse at 82% 6%, var(--glow-violet), transparent 46%), radial-gradient(ellipse at 32% 63%, var(--glow-cyan), transparent 48%), radial-gradient(ellipse at 98% 48%, var(--glow-rose), transparent 40%), radial-gradient(ellipse at 66% 100%, var(--glow-gold), transparent 46%); background-attachment: fixed; color: var(--color-ink); font: var(--font-size-body)/1.7 var(--font-body); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button { border: 0; color: inherit; background: transparent; }
button, input, textarea, select { border-radius: var(--app-radius); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; }
textarea, input, select { min-width: 0; color: var(--color-ink); border: 1px solid var(--color-line); background: var(--surface-control); padding: 10px 12px; }
textarea { resize: vertical; line-height: 1.8; }
textarea::placeholder, input::placeholder { color: var(--color-muted); opacity: 1; }
h1, h2, h3, p { margin: 0; }
h2, h3 { font-size: var(--font-size-heading); font-weight: 600; }
[hidden] { display: none !important; }
[data-icon] { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; flex: 0 0 auto; }
[data-icon] svg { width: 100%; height: 100%; }
.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; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 100; background: var(--color-paper); padding: 12px; border: 1px solid var(--color-accent); }
.skip-link:focus { top: 12px; }
.app-layout { min-height: 100dvh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.app-sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 38px 20px 24px; border-right: 1px solid var(--color-line); background: var(--surface-sidebar); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
.app-brand { display: flex; gap: 10px; align-items: center; margin: 0 0 52px; font-size: 20px; font-weight: 600; letter-spacing: -.6px; }
.app-brand__mark { width: 32px; height: 36px; color: var(--color-accent); }
.app-nav { display: flex; flex-direction: column; gap: 8px; }
.app-nav__link { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--app-radius); color: var(--color-muted); min-height: 48px; }
.app-nav__link:hover { background: var(--surface-hover); }
.app-nav__link--active { background: var(--surface-selected); color: var(--color-accent); font-weight: 600; box-shadow: var(--shadow-selected); }
.theme-switch { display: flex; gap: 3px; padding: 3px; margin: auto 12px 24px; border: 1px solid var(--color-line); border-radius: var(--app-radius); background: var(--surface-control); }
.theme-switch button { display: flex; flex: 1; align-items: center; justify-content: center; gap: 7px; padding: 7px 6px; min-height: 34px; font-size: 12px; border-radius: var(--app-radius-md); color: var(--color-muted); }
.theme-switch button[aria-pressed="true"] { background: var(--surface-selected); color: var(--color-ink); box-shadow: var(--shadow-selected); }
.theme-switch button:hover { color: var(--color-ink); }
.theme-switch [data-icon] { width: 14px; height: 14px; }
.app-sidebar__bottom { margin-top: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.account-link { min-width: 0; }
.account-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; width: 32px; height: 32px; border: 1px solid var(--color-line); border-radius: 50%; background: var(--surface-control); color: var(--color-accent); }
.account-link__copy { display: flex; flex-direction: column; min-width: 0; }
.account-avatar { overflow: hidden; font-size: 14px; font-weight: 600; }
.account-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.account-link__copy > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-link__status { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 400; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--color-success); flex-shrink: 0; }
.app-main { min-width: 0; padding: 38px clamp(30px, 4.5vw, 80px) 40px; }
.page-container { max-width: 1056px; margin: 0 auto; }
.page-topline { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--color-muted); font-size: 12px; min-height: 28px; }
.page-topline__time { display: inline-flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: var(--app-radius); background: var(--surface-secondary); border: 1px solid var(--color-line); }
.page-topline__time:hover { color: var(--color-accent); }
.page-hd { margin-top: 30px; margin-bottom: 30px; }
.page-hd h1 { font-size: var(--font-size-display); font-weight: 500; letter-spacing: -.8px; line-height: 1.4; }
.page-hd p { color: var(--color-muted); margin-top: 8px; }
.page-hd .page-hd__label { color: var(--color-accent); font-size: 12px; font-weight: 500; margin-top: 0; margin-bottom: 8px; }
.page-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 32px; padding-top: 20px; color: var(--color-muted); font-size: 12px; border-top: 1px solid var(--color-line); }
.btn { min-height: 42px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 9px 16px; font-weight: 500; border: 1px solid transparent; border-radius: var(--app-radius); white-space: nowrap; }
.btn--primary { background: var(--button-bg); color: var(--color-button); border-color: var(--border-control); box-shadow: var(--shadow-control); }
.btn--primary:hover:not(:disabled) { background: var(--button-hover); }
.btn--secondary { border-color: var(--border-control); background: var(--surface-control); color: var(--color-accent); }
.btn--secondary:hover:not(:disabled) { border-color: var(--border-hover); background: var(--surface-hover); }
.btn--quiet { color: var(--color-muted); padding: 8px 10px; }
.btn--quiet:hover:not(:disabled) { color: var(--color-accent); background: var(--color-soft); }
.btn--danger { color: var(--color-error); border-color: var(--border-danger); background: var(--surface-danger); }
.btn--small { min-height: 36px; padding: 6px 10px; font-size: 12px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 40px; border-radius: var(--app-radius); color: var(--color-muted); }
.icon-btn:hover { background: var(--color-soft); color: var(--color-accent); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.section-heading__title { display: flex; align-items: center; gap: 10px; }
.section-heading__title > [data-icon] { color: var(--color-accent); }
.section-heading__hint { font-size: 12px; color: var(--color-muted); font-weight: 400; }
.text-muted { color: var(--color-muted); }
.text-small { font-size: 12px; }
.empty-state { padding: 50px 20px 44px; text-align: center; }
.empty-state__icon { width: 48px; height: 48px; color: var(--color-muted); margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; font-weight: 500; }
.empty-state p { color: var(--color-muted); max-width: 350px; margin: 10px auto 20px; line-height: 1.9; }
.field { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 12px; margin-top: 14px; }
.field > label { text-align: right; color: var(--color-muted); font-size: 12px; }
.field input, .field textarea, .field select { width: 100%; }
.field--wide { grid-template-columns: 80px minmax(0,1fr); }
.field__pair { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.inline-error { color: var(--color-error); font-size: 12px; line-height: 1.8; margin-top: 12px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; background: var(--surface-notice); border: 1px solid var(--color-line); border-radius: var(--app-radius); color: var(--color-accent); font-size: 12px; line-height: 1.8; }
.notice > [data-icon] { margin-top: 2px; }
.notice--error { background: var(--surface-danger); border-color: var(--border-danger); color: var(--color-error); margin-bottom: 24px; }
.capture { min-width: 0; }
.capture__input { display: block; width: 100%; min-height: 174px; padding: 14px; border: 1px solid var(--border-control); border-radius: var(--app-radius); resize: vertical; font-size: 14px; background: var(--surface-control); }
.capture__input:focus-visible { outline-offset: 2px; background: var(--surface-hover); }
.capture__bottom { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.capture__actions { display: flex; gap: 8px; margin-left: auto; }
.capture__bottom .btn--primary { position: relative; padding-inline: 18px; }
.capture__bottom .btn--primary::before { content: ''; position: absolute; top: 0; left: 10px; right: 10px; height: 1px; background: var(--button-edge); pointer-events: none; }
.capture__count { color: var(--color-muted); font-size: 12px; }
.dialog { border: 1px solid var(--surface-border); border-radius: var(--app-radius-lg); padding: 0; width: min(620px, calc(100% - 32px)); max-height: calc(100dvh - 48px); background-color: var(--surface-modal); background-image: var(--surface-corner); color: var(--color-ink); box-shadow: var(--shadow-modal); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur)); }
.dialog::backdrop { background: var(--backdrop); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
body:has(.dialog[open]) { overflow: hidden; }
.dialog { overscroll-behavior: contain; }
.dialog__header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 28px 16px; }
.dialog__header h2 { font-size: 24px; font-weight: 500; }
.dialog__header p { color: var(--color-muted); margin-top: 6px; font-size: 12px; }
.dialog__body { padding: 0 28px 24px; }
.dialog__footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding-top: 20px; }
.dialog__footer .text-small { max-width: 220px; }
.result { border-top: 1px solid var(--color-line); padding: 20px 0; }
.result__heading { display: flex; justify-content: space-between; align-items: center; }
.result__tools { display: flex; align-items: center; gap: 2px; }
.result__preview { margin-top: 8px; }
.result__preview h3 { font-size: 20px; font-weight: 500; line-height: 1.6; overflow-wrap: anywhere; }
.result__preview > p { margin-top: 6px; color: var(--color-muted); overflow-wrap: anywhere; }
.result__suggestion { display: flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--color-muted); font-size: 12px; }
.result__suggestion [data-icon] { width: 14px; height: 14px; }
.result__number { display: flex; align-items: center; gap: 10px; color: var(--color-muted); font-size: 12px; }
.type-label { display: inline-flex; align-items: center; gap: 6px; color: var(--color-accent); background: var(--color-soft); padding: 2px 8px; border-radius: var(--app-radius-md); font-size: 12px; }
.field-hint { margin: 4px 0 0 60px; font-size: 12px; color: var(--color-muted); }
.reading-surface { position: relative; padding: 24px 28px; border: 1px solid var(--surface-border); border-radius: var(--app-radius-lg); background-color: var(--surface-primary); background-image: var(--surface-corner), var(--surface-reflection); box-shadow: var(--shadow-surface); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur)); }
.list-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--color-line); }
.list-tabs__tab { padding: 10px 0 14px; border-bottom: 2px solid transparent; border-radius: 0; color: var(--color-muted); white-space: nowrap; }
.list-tabs__tab[aria-selected="true"] { color: var(--color-ink); border-color: var(--color-accent); font-weight: 600; }
.list-empty { padding: 28px 0; font-size: 14px; color: var(--color-muted); }
.item-more { font-size: 12px; color: var(--color-muted); min-width: 0; }
.item-more > summary { cursor: pointer; width: fit-content; padding: 8px 4px; min-height: 36px; }
.item-more__body { padding-top: 8px; }
.item-more__actions { display: flex; flex-wrap: wrap; gap: 4px; }
.pool-row__footer .item-more[open], .todo-row__footer .item-more[open] { flex-basis: 100%; }
.item-original { margin-top: 8px; }
.item-original summary { cursor: pointer; padding-block: 8px; }
.item-original p { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; padding: 12px; background: var(--surface-control); border-radius: var(--app-radius-sm); }
.toast { position: fixed; bottom: 28px; left: calc(50% + 112px); transform: translateX(-50%); z-index: 50; background: var(--surface-toast); color: var(--color-toast); padding: 12px 16px; border: 1px solid var(--border-control); border-radius: var(--app-radius); display: flex; align-items: center; gap: 18px; max-width: min(640px, calc(100% - 32px)); font-size: 14px; box-shadow: var(--shadow-surface); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.toast__undo { color: var(--color-undo); padding: 2px 4px; white-space: nowrap; text-decoration: underline; }
.toast__close { color: var(--color-toast); min-width: 28px; min-height: 28px; }
.entry { padding: 48px; }
.record-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.record-actions .btn { min-height: 34px; font-size: 12px; padding: 6px 10px; }
.record-actions [data-icon] { width: 14px; height: 14px; }
.record-actions__ack { background: var(--color-soft); color: var(--color-accent); }
.record-actions__ack:hover { background: var(--surface-selected); }
.record-actions__soft { color: var(--color-muted); }
.record-actions__soft:hover { background: var(--color-soft); color: var(--color-accent); }
@media (min-width: 1500px) { .app-main { padding-top: 44px; } .page-hd { margin-top: 36px; margin-bottom: 34px; } }
@media (max-width: 1100px) { .app-layout { grid-template-columns: 192px minmax(0,1fr); } .app-sidebar { padding-inline: 14px; } .app-brand { font-size: 18px; gap: 6px; } .app-main { padding-inline: 28px; } .toast { left: calc(50% + 96px); } }
@media (max-width: 760px) {
  .app-layout { display: block; }
  .app-sidebar { height: auto; position: static; padding: 20px 24px 0; display: grid; grid-template-columns: 1fr auto; border-right: 0; border-bottom: 1px solid var(--color-line); background: var(--surface-sidebar); }
  .app-brand { margin: 0; font-size: 20px; }
  .app-nav { flex-direction: row; grid-column: 1; grid-row: 2; margin-top: 20px; gap: 16px; }
  .theme-switch { grid-column: 2; grid-row: 2; align-self: center; margin: 16px 0 4px; gap: 2px; }
  .theme-switch button { gap: 6px; }
  .app-nav__link { padding: 10px 0 12px; gap: 8px; border-radius: 0; }
  .app-nav .app-nav__link--active { background: transparent; border-bottom: 2px solid var(--color-accent); box-shadow: none; }
  .app-nav__link:hover { background: transparent; }
  .app-sidebar__bottom { grid-column: 2; grid-row: 1; flex-direction: row; align-items: center; gap: 10px; }
  .account-link__copy { display: none; }
  .app-sidebar__bottom .account-link { justify-content: center; min-width: 40px; border-radius: var(--app-radius); }
  .app-sidebar__bottom .app-nav__link { padding: 4px 0; min-height: 40px; font-size: 12px; }
  .app-main { padding: 26px 24px 32px; }
  .page-topline { align-items: flex-start; flex-wrap: wrap; }
  .page-hd { margin-top: 24px; margin-bottom: 24px; }
  .page-hd h1 { font-size: 26px; letter-spacing: -.6px; }
  .page-hd p { font-size: 12px; }
  .page-footer { flex-direction: column; gap: 4px; margin-top: 28px; }
  .toast { left: 50%; bottom: 20px; width: max-content; font-size: 12px; gap: 12px; }
  .dialog__header { padding: 20px 20px 16px; }
  .dialog__header h2 { font-size: 20px; }
  .dialog__body { padding: 0 20px 20px; }
  .dialog__footer { flex-wrap: wrap; }
  .dialog__footer .text-small { max-width: none; }
  .field__pair { grid-template-columns: minmax(0,1fr); }
  .empty-state { padding-inline: 0; }
  .reading-surface { padding: 18px; }
  .list-tabs { gap: 18px; }
  .list-tabs__tab { font-size: 12px; }
}
@media (max-width: 480px) { .app-main { padding-inline: 16px; } .app-sidebar { padding-inline: 16px; } .app-nav { gap: 14px; } .app-nav > a > [data-icon] { display: none; } .theme-switch button { gap: 4px; padding-inline: 5px; } .reading-surface { padding: 16px; } .list-tabs { gap: 16px; } .nav-settings-label { display: none; } .app-sidebar__bottom > .app-nav__link { min-width: 40px; justify-content: center; } }
@media (prefers-reduced-motion: no-preference) { .btn, .icon-btn, .app-nav__link, .capture__input { transition: background-color .16s ease, border-color .16s ease, color .16s ease; } .dialog[open] { animation: dialog-in .16s ease-out; } @keyframes dialog-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } } }
/* [视觉需求]：回退放在断点之后，手机与桌面同样遵循透明度偏好。 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root .reading-surface { background-color: var(--surface-primary-solid); }
  .app-sidebar { background: var(--surface-sidebar-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  :root .reading-surface { background-color: var(--surface-primary-solid); background-image: none; }
  :root .settings-preview { background-color: var(--surface-secondary-solid); background-image: none; }
  .capture__input, input, textarea, select { background: var(--surface-control-solid); }
  .app-sidebar { background: var(--surface-sidebar-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .dialog { background: var(--surface-modal-solid); }
  :root .reading-surface, .dialog { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .dialog::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .toast { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
/* [双主题视觉需求]：彩光仅沿主玻璃表面的一像素边缘折射，不覆盖文字与操作。 */
@supports (mask-composite: exclude) or (-webkit-mask-composite: xor) {
  .reading-surface::before, .dialog::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--prism-edge); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
}
