:root {
  color-scheme: light;
  --paper: #edf1f5;
  --surface: #fff;
  --ink: #202a36;
  --muted: #657180;
  --line: #e2e6eb;
  --blue: #375eaa;
  --error: #a43732;
  --green: #2e694b;
  --radius: 5px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.6; }
a { color: var(--blue); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, a, input, summary { touch-action: manipulation; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid #6c8ac5; outline-offset: 3px; }
main:focus { outline: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.4; font-weight: 650; }
img { max-width: 100%; }
.page-width { width: min(1080px, calc(100% - 48px)); margin-inline: auto; }
.muted { color: var(--muted); }
.small, .label-small { font-size: 12px; }
.label-small { color: var(--muted); }
.email-value { overflow-wrap: anywhere; }
.skip-link { position: fixed; top: 10px; left: 10px; padding: 8px 14px; background: #fff; color: var(--ink); transform: translateY(-160%); z-index: 20; }
.skip-link:focus { transform: translateY(0); }
.site-header { height: 76px; background: #263d5b; color: #fff; }
.header-inner { width: min(1080px, calc(100% - 48px)); height: 100%; margin: auto; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 650; letter-spacing: .2px; color: #fff; white-space: nowrap; line-height: 1.3; }
.brand img { flex-shrink: 0; object-fit: contain; }
.brand small { display: block; margin-top: 4px; color: #c8d1df; font-size: 11px; font-weight: 400; letter-spacing: .8px; }
.brand:hover { text-decoration: none; }
.brand-context { margin-left: auto; color: #d0d9e6; font-size: 13px; }
.header-nav { display: flex; align-items: center; gap: 24px; font-size: 13px; min-width: 0; }
.header-nav:empty { display: none; }
.header-nav a { color: #d5dce6; }
.header-nav a[aria-current] { color: #fff; }
.header-account { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-footer { margin: 24px auto 0; padding-bottom: 25px; }
.footer-inner { width: min(1080px, calc(100% - 48px)); margin: auto; display: flex; justify-content: space-between; gap: 16px; color: #727d8b; font-size: 11px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 20px; border: 1px solid var(--blue); border-radius: var(--radius); background: var(--blue); color: #fff; font-size: 13px; font-weight: 550; line-height: 1.6; text-align: center; }
.button:hover { background: #2d4e90; border-color: #2d4e90; color: #fff; text-decoration: none; }
.button-full { width: 100%; min-height: 42px; font-size: 14px; }
.button-small { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.button:disabled { background: #e5e9ef; border-color: #e5e9ef; color: #687382; }
.button-secondary { background: #fff; color: var(--blue); border-color: #bdcbe0; }
.button-secondary:hover { background: #eaf0f9; color: #294d8d; border-color: #95add0; }
.button-danger { background: #fff; border-color: #d8b5b2; color: var(--error); }
.button-danger:hover { background: #a43732; border-color: #a43732; }
.button-plain { display: inline; padding: 0; border: 0; background: none; color: var(--blue); font-size: 13px; text-align: left; }
.button-plain:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link, .inline-link { font-size: 13px; }
.back-link { display: table; margin: 20px auto 0; font-size: 13px; }
.auth-route main { width: min(1120px, calc(100% - 64px)); min-height: calc(100vh - 118px); margin: 0 auto; padding: 42px 0 32px; background: #fff; border-inline: 1px solid var(--line); }
.auth-page { width: min(600px, calc(100% - 64px)); margin: 0 auto; }
.auth-panel { background: #fff; }
.auth-panel-body { padding: 0; }
.auth-heading { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.auth-heading h1 { margin: 0 0 6px; font-size: 23px; }
.auth-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-form { width: min(100%, 400px); margin: 0 0 25px; }
.auth-panel-body > form:not(.auth-form) { max-width: 400px; margin-bottom: 25px; }
.auth-form .button-full, .auth-panel-body > .button-full, .auth-panel-body > form .button-full { width: auto; min-width: 110px; padding-inline: 25px; font-size: 13px; }
.auth-switch { margin: 0; border-top: 1px solid var(--line); padding: 18px 0 0; color: var(--muted); font-size: 13px; }
.auth-switch a { margin-left: 5px; font-weight: 550; }
.registration-invite { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border: 1px solid #dce3ec; border-radius: 4px; background: #f5f7fa; }
.registration-invite h2 { margin: 0 0 4px; font-size: 15px; }
.registration-invite p { margin: 0; color: var(--muted); font-size: 12px; }
.registration-invite .button { flex-shrink: 0; }
.auth-route .site-footer { width: min(1120px, calc(100% - 64px)); min-height: 42px; margin: 0 auto; padding: 0 0 24px; background: #fff; border-inline: 1px solid var(--line); }
.auth-route .footer-inner { width: min(600px, calc(100% - 64px)); justify-content: flex-end; gap: 5px 12px; }
.auth-route .messages { width: min(600px, calc(100% - 64px)); margin-top: 0; }
.auth-route .messages + .auth-page { margin-top: 22px; }
.form-field { margin-bottom: 19px; }
.form-field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 550; }
.form-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.form-label-row label { margin: 0; }
.form-label-row a { font-size: 12px; }
.field-optional { margin-left: 7px; color: var(--muted); font-size: 11px; font-weight: 400; }
.form-field input:not([type=checkbox]), .form-field select, .form-field textarea { display: block; width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #cbd2dc; border-radius: var(--radius); background: #fff; color: var(--ink); font-size: 14px; line-height: 1.6; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--blue); outline: 2px solid #375eaa24; outline-offset: 0; }
.form-field input::placeholder { color: #7a8491; }
.field-help, .help-text { margin-top: 6px; color: var(--muted); font-size: 12px; }
.field-help ul, .help-text ul { margin: 5px 0 0; padding-left: 18px; }
.field-has-error input { border-color: var(--error) !important; }
.field-errors { margin-top: 6px; color: var(--error); font-size: 12px; }
.field-errors ul, .form-errors ul { margin: 0; padding: 0; list-style: none; }
.form-errors { padding: 10px 12px; margin-bottom: 20px; border: 1px solid #e3beba; border-radius: var(--radius); background: #fff4f3; color: var(--error); font-size: 13px; }
.mail-preview { margin: 17px 0 0; color: var(--muted); font-size: 12px; }
.auth-panel-body > p { color: var(--muted); font-size: 13px; }
.messages { margin-top: 24px; }
.notice { margin-bottom: 18px; padding: 12px 15px; border: 1px solid #d5deec; border-radius: var(--radius); background: #f0f4fa; color: #43556e; font-size: 13px; }
.notice a { text-decoration: underline; }
.notice-success { border-color: #c7dece; background: #f0f7f1; color: #2e694b; }
.notice-error, .notice-warning { border-color: #e3c7b3; background: #fff6ed; color: #7b4d28; }
.notice-neutral { border-color: var(--line); background: #f6f7f9; color: var(--muted); }
.account-layout { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 30px; align-items: start; margin-top: 32px; }
.account-sidebar { padding-top: 8px; }
.account-sidebar h2 { margin: 0 0 15px; font-size: 16px; }
.account-sidebar nav { display: grid; gap: 4px; }
.account-sidebar nav a { padding: 9px 12px; border-radius: var(--radius); color: #586475; font-size: 13px; }
.account-sidebar nav a[aria-current] { background: #e5ebf5; color: #2e5499; font-weight: 550; }
.sidebar-logout { margin-top: 22px; padding: 18px 12px 0; border-top: 1px solid var(--line); }
.sidebar-logout button { color: var(--muted); }
.account-content { min-width: 0; padding: 25px 28px 28px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.page-heading { margin-bottom: 23px; }
.page-heading h1 { margin: 0 0 6px; font-size: 24px; overflow-wrap: anywhere; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.summary-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 22px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; }
.summary-row p { margin: 0; color: var(--muted); font-size: 12px; }
.settings-section { display: grid; grid-template-columns: 1fr 1.7fr; gap: 25px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.section-intro h2 { margin: 0 0 7px; font-size: 15px; }
.section-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.settings-form { max-width: 430px; min-width: 0; }
.account-details { min-width: 0; }
.account-details dl { margin: 0 0 18px; }
.account-details dl > div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; margin-bottom: 12px; font-size: 13px; }
.account-details dt { color: var(--muted); }
.account-details dd { margin: 0; }
.account-details .inline-link { margin-left: 8px; font-size: 12px; }
.status-dot:before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #9b783a; vertical-align: middle; }
.status-positive:before { background: var(--green); }
.character-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.character-toolbar h2 { margin: 0 0 4px; font-size: 15px; }
.character-toolbar p { margin: 0; font-size: 12px; color: var(--muted); }
.character-toolbar .button { white-space: nowrap; }
.character-list { border-top: 1px solid var(--line); }
.character-row { padding: 19px 0; border-bottom: 1px solid var(--line); }
.character-mainline { display: flex; align-items: center; gap: 13px; }
.character-portrait { width: 48px; height: 48px; flex-shrink: 0; border-radius: var(--radius); object-fit: cover; background: #e9edf2; }
.character-identity { min-width: 0; }
.character-name-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.character-name-line h3 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.character-identity p { margin: 4px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.character-separator { margin-inline: 5px; color: #9ca5b1; }
.tag { padding: 1px 6px; border-radius: 3px; border: 1px solid #cfdbef; color: #3b5f9b; background: #f2f5fb; font-size: 10px; white-space: nowrap; }
.tag-muted { border-color: var(--line); background: #f6f7f9; color: var(--muted); }
.character-status { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 14px; margin: 17px 0; }
.character-status dt { margin-bottom: 3px; font-size: 11px; color: var(--muted); }
.character-status dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.character-check-note { margin-bottom: 15px; padding: 9px 12px; background: #fff6ed; color: #7b4d28; border-radius: var(--radius); font-size: 12px; }
.character-actions { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-top: 15px; }
.character-actions .button-plain { font-size: 12px; }
.unbind-details { max-width: 100%; text-align: right; }
.unbind-details summary { color: var(--error); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.unbind-form { max-width: 390px; margin-top: 12px; padding: 15px; border: 1px solid #e3c5c2; border-radius: var(--radius); text-align: left; }
.unbind-form p { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.checkbox-label { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; font-size: 12px; }
.checkbox-label input { width: 15px; height: 15px; margin: 3px 0 0; flex-shrink: 0; accent-color: var(--blue); }
.refresh-form { margin-top: 17px; }
.character-unbound .character-portrait { filter: grayscale(1); opacity: .65; }
.character-unbound h3 { color: var(--muted); }
.empty-state { padding: 34px 15px; border-block: 1px solid var(--line); text-align: center; }
.empty-state h2, .empty-state h3 { margin-bottom: 7px; font-size: 15px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.character-rules { margin-top: 24px; }
.character-rules h2 { margin-bottom: 10px; font-size: 13px; }
.character-rules ul { padding-left: 18px; margin-bottom: 0; color: var(--muted); font-size: 12px; }
.character-rules li { margin-bottom: 6px; }
@media (max-width: 800px) {
  .brand-context { display: none; }
  .header-nav { margin-left: auto; }
  .account-layout { grid-template-columns: 1fr; gap: 18px; margin-top: 21px; }
  .account-sidebar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 0; }
  .account-sidebar h2 { display: none; }
  .account-sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .account-sidebar nav a { padding: 8px 10px; }
  .sidebar-logout { margin: 0 0 0 auto; padding: 0; border: 0; }
  .account-content { padding: 23px; }
  .character-toolbar { align-items: flex-start; }
}
@media (max-width: 600px) {
  .site-header { height: 70px; }
  .header-inner, .page-width, .footer-inner { width: calc(100% - 32px); }
  .header-inner { gap: 14px; }
  .brand { font-size: 18px; }
  .brand img { width: 42px; height: 42px; }
  .brand small { font-size: 10px; }
  .header-nav { gap: 15px; font-size: 12px; }
  .header-account { max-width: 100px; }
  .auth-route { background: #fff; }
  .auth-route main { width: 100%; min-height: calc(100vh - 112px); padding: 28px 0; border: 0; }
  .auth-page { width: calc(100% - 40px); }
  .auth-route .site-footer { width: 100%; border: 0; }
  .auth-route .footer-inner, .auth-route .messages { width: calc(100% - 40px); }
  .auth-panel-body { padding: 0; }
  .auth-heading { padding-bottom: 14px; }
  .registration-invite { flex-direction: column; align-items: flex-start; gap: 15px; padding: 18px; }
  .account-content { padding: 21px 18px; }
  .settings-section { grid-template-columns: 1fr; gap: 17px; margin-top: 21px; padding-top: 21px; }
  .settings-form { max-width: none; }
  .page-heading h1 { font-size: 23px; }
  .character-toolbar { flex-direction: column; gap: 13px; }
  .character-status { grid-template-columns: 1fr 1fr; }
  .character-status > div:last-child { grid-column: 1 / -1; }
  .character-actions { flex-wrap: wrap; }
  .unbind-details[open] { width: 100%; text-align: left; }
  .unbind-form { max-width: none; }
}
@media (max-width: 370px) {
  .header-nav { gap: 10px; }
  .header-account { max-width: 76px; }
  .account-sidebar nav a { padding-inline: 8px; font-size: 12px; }
  .sidebar-logout { margin-left: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; transition: none !important; }
}
