:root {
    color-scheme: light dark;
    --background: #f5f5f7;
    --surface: #fff;
    --field: #f5f5f7;
    --text: #1d1d1f;
    --secondary: #6e6e73;
    --line: #e5e5ea;
    --blue: #0071e3;
    --blue-hover: #0077ed;
    --tint: #eef5ff;
    --red: #d70015;
    --red-tint: #fff0f0;
    --green: #248a3d;
    --header: rgb(255 255 255 / 88%);
    --shadow: 0 8px 40px rgb(0 0 0 / 3%);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
    :root {
        --background: #000;
        --surface: #1c1c1e;
        --field: #2c2c2e;
        --text: #f5f5f7;
        --secondary: #a1a1a6;
        --line: #38383a;
        --blue: #2997ff;
        --blue-hover: #51aaff;
        --tint: #11283e;
        --red: #ff6961;
        --red-tint: #341c1e;
        --green: #30d158;
        --header: rgb(28 28 30 / 88%);
        --shadow: none;
    }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--text); font-size: 15px; line-height: 1.5; }
body:has(dialog[open]) { overflow: hidden; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button, input { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
input:focus-visible { outline-offset: -3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 34px; line-height: 1.2; letter-spacing: -.8px; font-weight: 650; }
h2 { font-size: 24px; letter-spacing: -.4px; font-weight: 650; }
h3 { font-size: 17px; font-weight: 600; }
small { font-size: 12px; }
.icon { width: 22px; height: 22px; flex: 0 0 auto; fill: currentColor; stroke: none; }
.skip-link { position: fixed; top: -100px; left: 20px; padding: 10px 16px; background: var(--surface); z-index: 10; border-radius: 10px; }
.skip-link:focus { top: 10px; }
.topbar { height: 66px; background: var(--header); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1120px; height: 100%; margin: auto; padding: 0 32px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 19px; font-weight: 600; letter-spacing: -.4px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 22px; height: 25px; }
@media (prefers-color-scheme: dark) { :root .brand img { filter: invert(1); } }
.topnav { display: flex; align-items: center; gap: 26px; font-size: 13px; white-space: nowrap; }
.topnav a { color: var(--secondary); }
.topnav a[aria-current="page"] { color: var(--text); }
.page { min-height: calc(100svh - 66px); }
.auth { max-width: 470px; margin: 0 auto; padding: 64px 24px 56px; text-align: center; }
.app-mark { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 24px; border-radius: 19px; background: var(--text); }
.app-mark img { width: 31px; height: 36px; filter: invert(1); }
@media (prefers-color-scheme: dark) { :root .app-mark img { filter: none; } }
.subtitle { margin-top: 12px; color: var(--secondary); line-height: 1.7; }
.auth-card { margin-top: 32px; padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); text-align: left; }
.field-group { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--surface); }
.field-group .field + .field { border-top: 1px solid var(--line); }
.field-group > #verification-field { border-top: 1px solid var(--line); }
.field { display: flex; align-items: center; position: relative; min-width: 0; }
.field > label { width: 100%; min-width: 0; padding-top: 9px; }
.field > label > span { display: block; color: var(--secondary); font-size: 11px; padding: 0 15px; }
.field input { width: 100%; height: 37px; border: 0; padding: 0 15px 8px; background: transparent; color: var(--text); border-radius: 0; min-width: 0; }
.field input::placeholder { color: var(--secondary); opacity: .75; }
.field:focus-within { box-shadow: inset 0 0 0 2px var(--blue); z-index: 1; }
.field:focus-within input { outline: none; }
.field:has(.reveal) input { padding-right: 42px; }
.reveal { position: absolute; right: 9px; bottom: 10px; width: 30px; height: 30px; display: grid; place-items: center; background: transparent; border: 0; color: var(--secondary); border-radius: 6px; }
.reveal .icon { width: 19px; height: 19px; }
.button { min-height: 44px; border: 0; border-radius: 11px; padding: 10px 20px; background: var(--blue); color: #fff; font-weight: 500; display: inline-flex; justify-content: center; align-items: center; gap: 9px; text-align: center; line-height: 1.5; }
.button:hover:not(:disabled) { background: var(--blue-hover); text-decoration: none; }
.button.secondary { background: var(--field); color: var(--text); }
.button.secondary:hover:not(:disabled) { background: var(--line); }
.button.destructive { background: var(--red); color: #fff; }
.button.full { width: 100%; margin-top: 22px; }
.button.pill { border-radius: 30px; }
.button .icon { width: 18px; height: 18px; }
.link-button { border: 0; background: transparent; padding: 0; color: var(--blue); font-size: inherit; }
.link-button:hover:not(:disabled) { text-decoration: underline; }
.form-note { color: var(--secondary); font-size: 12px; line-height: 1.7; margin: 10px 2px 0; }
.section-label { display: block; margin: 23px 3px 9px; color: var(--secondary); font-size: 12px; font-weight: 500; }
.section-label:first-child { margin-top: 0; }
.auth-switch { margin-top: 24px; text-align: center; font-size: 13px; color: var(--secondary); }
.message { padding: 12px 14px; border-radius: 10px; background: var(--red-tint); color: var(--red); font-size: 13px; line-height: 1.6; margin-top: 16px; overflow-wrap: anywhere; }
.message.success { color: var(--green); background: var(--field); }
.inline-action { padding: 12px 15px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; justify-content: space-between; font-size: 13px; }
.inline-action > span { font-size: 12px; color: var(--secondary); }
.register-auth { max-width: 510px; padding-top: 38px; }
.register-auth .app-mark { width: 52px; height: 52px; border-radius: 15px; margin-bottom: 20px; }
.register-auth .app-mark img { width: 25px; height: 29px; }
.register-auth h1 { font-size: 29px; }
.register-auth .auth-card { margin-top: 24px; }
.account-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); max-width: 1120px; margin: auto; padding: 48px 32px 64px; gap: 52px; }
.sidebar-profile { display: flex; align-items: center; gap: 12px; margin: 0 10px 26px; min-width: 0; }
.sidebar-profile .avatar { width: 45px; height: 45px; font-size: 18px; }
.sidebar-profile strong { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.sidebar-profile small { color: var(--secondary); font-size: 11px; }
.sidebar-nav { display: grid; gap: 6px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; color: var(--text); font-size: 14px; }
.sidebar-nav a:hover { background: var(--surface); text-decoration: none; }
.sidebar-nav a[aria-current="page"] { background: var(--tint); color: var(--blue); font-weight: 500; }
.sidebar-nav .icon { width: 20px; height: 20px; }
.sidebar-signout { margin: 28px 14px 0; color: var(--red); font-size: 13px; }
.account-content { min-width: 0; }
.account-content h1 { font-size: 30px; }
.account-content > section > h1 { margin-bottom: 28px; }
.profile-hero { text-align: center; padding: 10px 0 32px; }
.avatar { width: 92px; height: 92px; position: relative; border-radius: 50%; background: var(--tint); color: var(--blue); display: inline-grid; place-items: center; overflow: hidden; font-size: 34px; font-weight: 500; vertical-align: middle; flex: 0 0 auto; }
.avatar .icon { width: 54%; height: 54%; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-hero h1, .profile-hero h2 { margin-top: 16px; overflow-wrap: anywhere; }
.profile-hero p { color: var(--secondary); margin-top: 3px; overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.badge { background: var(--field); border: 1px solid var(--line); border-radius: 20px; padding: 4px 11px; font-size: 11px; color: var(--secondary); }
.group { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; margin-bottom: 20px; }
.group-heading { margin: 27px 15px 9px; font-size: 12px; font-weight: 500; color: var(--secondary); }
.row { display: flex; align-items: center; gap: 14px; min-height: 69px; padding: 16px 19px; width: 100%; color: var(--text); border: 0; background: transparent; text-align: left; }
a.row:hover, button.row:hover:not(:disabled) { text-decoration: none; background: var(--field); }
.row + .row { border-top: 1px solid var(--line); }
.row-copy { flex: 1; min-width: 0; }
.row-title { display: block; font-size: 14px; overflow-wrap: anywhere; }
.row-detail { display: block; margin-top: 3px; color: var(--secondary); font-size: 12px; overflow-wrap: anywhere; }
.row-value { color: var(--secondary); font-size: 13px; overflow-wrap: anywhere; min-width: 0; max-width: 60%; text-align: right; }
.row > .chevron { color: var(--secondary); width: 15px; height: 15px; }
.tile-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--blue); color: #fff; flex: 0 0 auto; }
.tile-icon .icon { width: 21px; height: 21px; }
.tile-icon.green { background: #34a853; }
.tile-icon.gray { background: #8e8e93; }
.tile-icon.red { background: var(--red); }
.danger-text { color: var(--red); }
.detail-form { padding: 22px; }
.detail-form .section-label { margin-top: 0; }
.profile-editor { display: flex; align-items: center; gap: 20px; padding: 24px; margin-bottom: 24px; }
.profile-editor .link-button { display: block; margin-top: 7px; font-size: 13px; }
.device-toolbar, .passkey-toolbar { border-top: 0; padding: 0 3px 14px; }
#devices-message, #passkeys-message { margin: 0 0 16px; }
.passkey-toolbar { margin-top: 16px; }
.passkey-delete { flex: 0 0 auto; min-height: 44px; padding: 8px 0 8px 8px; font-size: 13px; }
.info-note { color: var(--secondary); line-height: 1.8; font-size: 12px; padding: 0 4px; }
dialog { width: min(420px, calc(100% - 32px)); max-height: calc(100svh - 48px); padding: 27px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px rgb(0 0 0 / 18%); overflow-y: auto; }
dialog::backdrop { background: rgb(0 0 0 / 35%); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dialog-heading h2 { font-size: 21px; }
.close-button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; background: var(--field); color: var(--secondary); border-radius: 50%; }
.close-button .icon { width: 16px; height: 16px; }
.dialog-description { color: var(--secondary); font-size: 13px; margin-bottom: 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.captcha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.captcha-tile { position: relative; border: 3px solid transparent; padding: 0; border-radius: 13px; background: var(--field); overflow: hidden; aspect-ratio: 1; }
.captcha-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.captcha-tile[aria-pressed="true"] { border-color: var(--blue); }
.captcha-tile[aria-pressed="true"]::after { content: '✓'; display: grid; place-items: center; position: absolute; bottom: 6px; right: 6px; width: 23px; height: 23px; border: 2px solid #fff; background: var(--blue); color: #fff; border-radius: 50%; font-size: 13px; }
.captcha-status { color: var(--secondary); font-size: 12px; margin-top: 14px; }
.captcha-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; }
.captcha-actions .link-button { font-size: 13px; }
.crop-canvas { display: block; width: min(256px, 100%); height: auto; margin: 0 auto 20px; border-radius: 50%; background: var(--field); }
.zoom-label { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--secondary); }
.zoom-label input { width: 100%; accent-color: var(--blue); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .75s linear infinite; }
.button[aria-busy="true"]::before { content: ''; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner, .button[aria-busy="true"]::before { animation-duration: 1.8s; } }
@media (min-height: 900px) { .auth:not(.register-auth) { padding-top: 110px; } }
@media (max-width: 800px) {
    .account-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 28px; padding: 36px 24px; }
    .sidebar-profile { margin-left: 0; }
    .sidebar-profile strong { max-width: 115px; }
    .sidebar-nav a { font-size: 13px; padding: 11px 10px; gap: 9px; }
}
@media (max-width: 600px) {
    .topbar { height: 59px; }
    .topbar-inner { padding: 0 20px; gap: 12px; }
    .brand { font-size: 17px; gap: 9px; }
    .topnav { font-size: 12px; gap: 18px; }
    .page { min-height: calc(100svh - 59px); }
    .auth { padding: 40px 20px; }
    h1 { font-size: 29px; }
    .auth-card { padding: 22px; margin-top: 27px; }
    .register-auth { padding-top: 30px; }
    .register-auth h1 { font-size: 26px; }
    .account-layout { display: block; padding: 20px 20px 40px; }
    .sidebar-profile, .sidebar-signout { display: none; }
    .sidebar-nav { grid-template-columns: repeat(4, 1fr); gap: 4px; padding-bottom: 24px; }
    .sidebar-nav a { padding: 10px 3px; flex-direction: column; gap: 5px; font-size: 10px; text-align: center; }
    .account-content h1 { font-size: 26px; }
    .profile-hero { padding-top: 4px; }
    .row { padding: 15px; gap: 12px; }
    .row-value { max-width: 58%; font-size: 12px; }
    .detail-form { padding: 19px; }
    .profile-editor { padding: 20px; gap: 17px; }
    .profile-editor .avatar { width: 70px; height: 70px; }
    dialog { padding: 23px; }
}
