/* Shared theme selector; all miniature colors are independent of the active page theme. */
.theme-picker-trigger{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:44px;min-height:44px;padding:9px 14px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--ink-2);font:inherit;font-size:13px;line-height:1.5;white-space:nowrap;cursor:pointer}
.theme-picker-trigger:hover{border-color:var(--indigo);color:var(--indigo)}
.theme-picker-trigger svg,.theme-picker-close svg{display:block;flex:none}
.theme-picker-dialog{box-sizing:border-box;width:min(760px,calc(100% - 32px));max-width:none;max-height:calc(100dvh - 40px);margin:auto;padding:28px;border:1px solid var(--border-strong);border-radius:16px;background:var(--surface);color:var(--ink);box-shadow:var(--shadow-lift);overflow:auto;overscroll-behavior:contain;font-family:"Microsoft YaHei UI","PingFang SC",system-ui,sans-serif;line-height:1.6}
.theme-picker-dialog:not([open]){display:none}
.theme-picker-dialog *{box-sizing:border-box}
.theme-picker-dialog::backdrop{background:rgba(15,20,32,.52);backdrop-filter:blur(3px)}
.theme-picker-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin:0 0 24px}
.theme-picker-heading h2{margin:0;font-size:22px;line-height:1.45;letter-spacing:-.02em;font-weight:650;color:var(--ink)}
.theme-picker-heading p{margin:7px 0 0;color:var(--ink-2);font-size:13px}
.theme-picker-close{display:grid;place-items:center;flex:none;width:44px;min-height:44px;margin:-7px -7px 0 0;padding:0;border:1px solid var(--border);border-radius:8px;background:transparent;color:var(--ink-2);cursor:pointer}
.theme-picker-close:hover{background:var(--paper)}
.theme-picker-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.theme-picker-option{display:block;width:100%;min-width:0;min-height:44px;padding:7px;border:2px solid var(--border);border-radius:11px;background:var(--surface);color:var(--ink);text-align:left;font:inherit;line-height:1.5;cursor:pointer;transition:border-color .16s,box-shadow .16s}
.theme-picker-option:hover{border-color:var(--border-strong)}
.theme-picker-option[aria-pressed=true]{border-color:var(--indigo);box-shadow:0 0 0 1px var(--indigo)}
.theme-picker-option:disabled{cursor:wait;opacity:.8}
.theme-picker-option:focus-visible,.theme-picker-trigger:focus-visible,.theme-picker-close:focus-visible{outline:3px solid var(--indigo);outline-offset:4px}
.theme-picker-label{display:block;padding:14px 5px 7px}
.theme-picker-label-line{display:flex;align-items:center;justify-content:space-between;gap:6px}
.theme-picker-label strong{font-size:14px;font-weight:650}
.theme-picker-detail{display:block;margin-top:5px;color:var(--ink-3);font-size:11px}
.theme-picker-current{display:inline-flex;align-items:center;gap:3px;visibility:hidden;flex:none;color:var(--indigo);font-size:11px;font-weight:600}
.theme-picker-current svg{display:block}
.theme-picker-option[aria-pressed=true] .theme-picker-current{visibility:visible}
.theme-picker-status{min-height:1.6em;margin:21px 0 0;color:var(--ink-2);font-size:12px;overflow-wrap:anywhere}
.theme-picker-status[data-tone=error]{color:var(--danger)}
.theme-picker-notice{position:fixed;z-index:110;inset:auto 16px calc(20px + var(--app-safe-bottom-inset,env(safe-area-inset-bottom)));width:fit-content;max-width:min(560px,calc(100% - 32px));margin:0 auto;padding:12px 16px;border:1px solid var(--border-strong);border-radius:9px;background:var(--surface);color:var(--ink);box-shadow:var(--shadow-lift);font-size:13px;line-height:1.7;overflow-wrap:anywhere}
.theme-picker-notice[hidden]{display:none!important}
.theme-picker-notice[data-tone=error]{border-color:var(--danger);color:var(--danger)}
/* Preview tokens intentionally never use --paper, --ink or any current-theme variable. */
[data-preview-theme=classic]{--preview-paper:#f5f0e7;--preview-surface:#fffaf1;--preview-ink:#25283a;--preview-muted:#696674;--preview-border:#d6cbbd;--preview-action:#303b67;--preview-on-action:#fff;--preview-soft:#e6e7ef;color-scheme:light}
[data-preview-theme=light]{--preview-paper:#f5f6f8;--preview-surface:#fff;--preview-ink:#20242d;--preview-muted:#626977;--preview-border:#d2d6df;--preview-action:#174bc0;--preview-on-action:#fff;--preview-soft:#e9efff;color-scheme:light}
[data-preview-theme=dark]{--preview-paper:#181b22;--preview-surface:#20252e;--preview-ink:#f0f2f7;--preview-muted:#acb5c4;--preview-border:#424c5d;--preview-action:#a9c4ff;--preview-on-action:#142444;--preview-soft:#29354c;color-scheme:dark}
.theme-preview{display:block;overflow:hidden;width:100%;aspect-ratio:1.12;border:1px solid var(--preview-border);border-radius:5px;background:var(--preview-paper);color:var(--preview-ink);font-family:"Microsoft YaHei UI",system-ui,sans-serif;text-shadow:none;filter:none}
.theme-preview-top{display:flex;align-items:center;gap:5px;height:29px;padding:0 8px;border-bottom:1px solid var(--preview-border);background:var(--preview-surface);color:var(--preview-ink)}
.theme-preview-mark{display:grid;place-items:center;width:18px;height:18px;flex:none;border-radius:2px;background:var(--preview-action);color:var(--preview-on-action);font:6px Georgia,serif}
.theme-preview-brand{color:var(--preview-ink);font-size:6px;font-weight:700;white-space:nowrap}
.theme-preview-avatar{width:10px;height:10px;flex:none;margin-left:auto;border:1px solid var(--preview-border);border-radius:50%;background:var(--preview-soft)}
.theme-preview-page{display:flex;min-height:125px;background:var(--preview-paper);color:var(--preview-ink)}
.theme-preview-nav{display:flex;flex-direction:column;gap:10px;width:30px;flex:none;padding:15px 7px;border-right:1px solid var(--preview-border);background:var(--preview-surface)}
.theme-preview-nav i{display:block;width:14px;height:3px;background:var(--preview-border);border-radius:1px}
.theme-preview-nav i.is-selected{background:var(--preview-action)}
.theme-preview-content{display:block;min-width:0;flex:1;padding:13px 10px}
.theme-preview-title{display:block;color:var(--preview-ink);font-size:8px;font-weight:700;line-height:1.4;white-space:nowrap}
.theme-preview-subtitle{display:block;width:56%;height:3px;margin:6px 0 11px;border-radius:1px;background:var(--preview-border)}
.theme-preview-card{display:block;padding:10px;border:1px solid var(--preview-border);border-radius:4px;background:var(--preview-surface);color:var(--preview-ink)}
.theme-preview-word{display:block;color:var(--preview-ink);font:600 13px/1.2 Georgia,serif}
.theme-preview-definition{display:block;margin-top:5px;color:var(--preview-muted);font-size:5px;white-space:nowrap}
.theme-preview-action{display:flex;align-items:center;justify-content:space-between;margin-top:10px;padding:4px 6px;border-radius:2px;background:var(--preview-action);color:var(--preview-on-action);font-size:6px;line-height:1.4;white-space:nowrap}
.theme-preview-action b{color:var(--preview-on-action);font-weight:400}
.theme-preview-lines{display:flex;gap:6px;margin-top:8px}
.theme-preview-lines i{display:block;width:48%;height:5px;border-radius:1px;background:var(--preview-border)}
/* Account pages deliberately use one centered form with a compact brand header. */
.account-shell{display:flex;flex-direction:column}
.account-shell .aa-topbar{width:min(1200px,100%);padding:24px 36px}
.account-shell .account-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:0;align-content:center;align-items:center;flex:1;width:100%;max-width:500px;margin:0 auto;padding:32px 24px calc(64px + var(--app-safe-bottom-inset,env(safe-area-inset-bottom)))}
.account-shell .account-card{width:100%;padding:32px}
.account-shell .account-card-heading h1{margin:0;font-size:26px;font-weight:650;letter-spacing:-.035em;line-height:1.4}
.account-shell .aa-form-between .aa-link,.account-shell .aa-form-foot .aa-link,.account-shell .aa-return{display:inline-flex;align-items:center;min-height:44px}
@media(max-width:640px){
 .theme-picker-dialog{padding:21px 18px;max-height:calc(100dvh - 24px);width:calc(100% - 24px)}
 .theme-picker-heading{gap:12px;margin-bottom:20px}.theme-picker-heading h2{font-size:20px}.theme-picker-heading p{font-size:12px}
 .theme-picker-options{grid-template-columns:minmax(0,1fr);gap:12px}
 .theme-picker-option{display:grid;grid-template-columns:124px minmax(0,1fr);gap:12px;align-items:center;padding:7px}
 .theme-picker-label{padding:0 7px 0 0}.theme-picker-label-line{align-items:flex-start;flex-wrap:wrap;gap:6px}.theme-picker-detail{font-size:11px;line-height:1.7}
 .theme-preview{aspect-ratio:1.1}.theme-preview-top{height:21px;padding:0 5px;gap:3px}.theme-preview-mark{width:13px;height:13px;font-size:5px}.theme-preview-brand{font-size:5px}.theme-preview-avatar{width:8px;height:8px}.theme-preview-page{min-height:0}.theme-preview-nav{width:19px;padding:11px 5px;gap:8px}.theme-preview-nav i{width:8px;height:2px}.theme-preview-content{padding:8px 6px}.theme-preview-title{font-size:6px}.theme-preview-subtitle{height:2px;margin:4px 0 6px}.theme-preview-card{padding:6px}.theme-preview-word{font-size:10px}.theme-preview-definition{font-size:4px;margin-top:3px}.theme-preview-action{font-size:4px;margin-top:5px;padding:3px 4px}.theme-preview-lines{margin-top:5px;gap:4px}.theme-preview-lines i{height:3px}
 .theme-picker-status{margin-top:17px;min-height:3.2em}
 .account-shell .aa-topbar{padding:17px 20px;gap:12px}.account-shell .aa-brand{gap:9px;font-size:14px}.account-shell .aa-brand-mark{width:38px;height:38px;font-size:13px}.account-shell .theme-picker-trigger{gap:6px;padding:9px 10px;font-size:12px}
 .account-shell .account-layout{max-width:480px;padding:24px 20px calc(48px + var(--app-safe-bottom-inset,env(safe-area-inset-bottom)))}.account-shell .account-card{padding:27px 24px;border-radius:12px}.account-shell .account-card-heading h1{font-size:24px}
}
@media(max-width:350px){.theme-picker-option{grid-template-columns:104px minmax(0,1fr);gap:8px}.theme-picker-label strong{font-size:13px}.theme-picker-detail{font-size:10px}.account-shell .aa-topbar{padding-inline:14px}.account-shell .aa-brand{font-size:12px}.account-shell .account-layout{padding-inline:14px}.account-shell .account-card{padding-inline:20px}}
@media(prefers-reduced-motion:reduce){.theme-picker-option{transition:none}}
