/* Public source: approved profile layout; theme tokens belong to theme-global.css. */
#page-profile { --profile-muted: var(--th-text-2); }
#page-profile [hidden] { display: none !important; }
#page-profile .hidden { display: none !important; }
#page-profile { letter-spacing: 0; }
#page-profile h2 { font-size: 15px; font-weight: 600; color: var(--th-text); }
#page-profile button, .site-theme-options label { min-height: 36px; }
#page-profile button:not([role="tab"]) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 6px; padding: 8px 12px; font-size: 12px; }
#page-profile button:disabled { opacity: .5; cursor: not-allowed; }
#page-profile svg { width: 15px; height: 15px; flex-shrink: 0; }
#page-profile :focus-visible, .site-theme-options :focus-visible { outline: 2px solid var(--th-accent); outline-offset: 3px; }
.profile-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-tabs { display: flex; border-bottom: 1px solid var(--th-border); gap: 24px; }
.profile-tabs button { flex: 0 0 auto; padding: 12px 0; border-bottom: 2px solid transparent; font-size: 13px; color: var(--profile-muted); }
.profile-tabs button[aria-selected="true"] { color: var(--th-text); border-bottom-color: var(--th-accent); }
.profile-pane { max-width: 780px; color: var(--th-text); font-size: 13px; }
.profile-feedback { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-height: 22px; font-size: 12px; color: var(--profile-muted); }
.profile-feedback:has(span:empty):not(:has(button:not([hidden]):not(.hidden))) { display: none; }
#page-profile [data-error="true"] { color: var(--th-danger); }
.profile-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 4px 0 24px; border-bottom: 1px solid var(--th-border); }
.profile-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.profile-identity > div:last-child { min-width: 0; }
#profile-avatar { width: 42px; height: 42px; border-radius: 8px; flex: 0 0 42px; display: grid; place-items: center; background: var(--th-surface-subtle); border: 1px solid var(--th-border); color: var(--th-accent); font-size: 18px; font-weight: 600; }
#profile-username { overflow-wrap: anywhere; }
#profile-role { color: var(--profile-muted); font-size: 12px; }
.profile-finances { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; flex-shrink: 0; }
.profile-finances dt { color: var(--profile-muted); font-size: 12px; }
.profile-finances dd { margin-top: 6px; font-size: 17px; font-variant-numeric: tabular-nums; }
.profile-setting-row, .profile-details > div { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 20px; align-items: center; min-height: 58px; padding: 12px 0; border-bottom: 1px solid var(--th-border); }
.profile-details dt, .profile-setting-row > label { color: var(--profile-muted); }
.profile-details dd { min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
#page-profile input[type="text"] { min-width: 0; max-width: 100%; border: 1px solid var(--th-border); border-radius: 6px; padding: 9px 12px; color: var(--th-text); font-size: 13px; letter-spacing: 0; }
#profile-nickname { width: 100%; max-width: 400px; }
#page-profile .profile-inline-link { color: var(--th-accent); padding: 4px 0; }
.profile-form-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 24px; font-size: 12px; color: var(--profile-muted); }
.profile-security-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#totp-status-badge { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--profile-muted); }
#totp-status-badge[data-enabled="true"] { color: var(--th-success); }
.profile-section-title { margin-top: 32px; }
/* 登录设备列表: 单行描述 + 当前设备标记 / 退出按钮 */
.profile-session-list { list-style: none; padding: 0; margin: 12px 0 0; }
.profile-session-item { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--th-border); }
.profile-session-item > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profile-session-item strong { color: var(--th-text); font-weight: 600; font-size: 13px; }
.profile-session-item small { color: var(--profile-muted); font-size: 12px; overflow-wrap: anywhere; }
.profile-session-current { color: var(--th-success); font-size: 12px; white-space: nowrap; }
.profile-session-empty { padding: 12px 0; color: var(--profile-muted); font-size: 13px; }
.profile-totp-panel { margin-top: 18px; }
.profile-totp-secret { display: flex; align-items: center; gap: 20px; }
#totp-qr-canvas { width: 132px; height: 132px; flex-shrink: 0; background: #fff; border-radius: 6px; }
.profile-totp-secret > div { min-width: 0; }
.profile-totp-secret label { color: var(--profile-muted); font-size: 12px; }
#totp-secret-display { display: block; overflow-wrap: anywhere; margin-top: 8px; user-select: all; }
.profile-totp-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.profile-totp-actions input { width: 120px; }
.profile-notification-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 56px; padding: 14px 0; border-bottom: 1px solid var(--th-border); cursor: pointer; }
.profile-notification-row small { margin-left: 8px; color: var(--profile-muted); font-size: 12px; }
.profile-notification-row input { width: 32px; height: 18px; flex: 0 0 32px; appearance: none; border: 1px solid var(--th-text-2); border-radius: 12px; background: var(--th-surface-muted); position: relative; cursor: pointer; }
.profile-notification-row input::after { content: ''; width: 12px; height: 12px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: var(--th-text-2); }
/* index.html's console-page-v3 inputs use !important backgrounds; switches must keep their checked state. */
#page-profile .profile-notification-row input:checked { background: var(--th-accent) !important; border-color: var(--th-accent) !important; }
.profile-notification-row input:checked::after { left: 16px; background: #fff; }
.profile-notification-row input:disabled { opacity: .5; cursor: not-allowed; }
.site-theme-fields { margin: 0; padding: 0 0 12px; border: 0; font-size: 13px; color: var(--th-text); }
.site-theme-fields legend { margin-bottom: 10px; }
.site-theme-options { display: flex; gap: 12px 24px; flex-wrap: wrap; }
.site-theme-options label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.site-theme-options input { accent-color: var(--th-accent); }
.site-theme-swatch { width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--th-text-2); }
#site-default-theme-status { font-size: 12px; color: var(--th-text-2); }
@media (max-width: 600px) {
  .profile-tabs { gap: 18px; }
  .profile-tabs button { font-size: 12px; }
  .profile-summary { align-items: flex-start; flex-direction: column; gap: 18px; }
  .profile-finances { width: 100%; }
  .profile-setting-row, .profile-details > div { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; }
  .profile-totp-secret { align-items: flex-start; flex-wrap: wrap; }
}
