:root {
  color-scheme: light;
  --paper: #f5f3ed;
  --surface: #fffefa;
  --ink: #17202b;
  --muted: #68717a;
  --line: #d5d3cb;
  --blue: #174ea6;
  --blue-dark: #103872;
  --words: #d8f0df;
  --words-ink: #125b3c;
  --mt: #f7df9a;
  --mt-ink: #674a00;
  --oj: #e6e9ee;
  --danger: #a42b2b;
  --focus: #d14d18;
  --resume-empty: #17202b;
  --radius: 8px;
  --shadow: 0 14px 34px rgba(27, 35, 45, .09);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #11151a;
  --surface: #191f26;
  --ink: #f2f0e9;
  --muted: #aab1ba;
  --line: #343b43;
  --blue: #72a6ff;
  --blue-dark: #94baff;
  --words: #193d2d;
  --words-ink: #a6e7c1;
  --mt: #4a3d18;
  --mt-ink: #f5d77c;
  --oj: #292f37;
  --danger: #ff8f8f;
  --focus: #ff9d74;
  --resume-empty: #202a35;
  --shadow: 0 16px 38px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); letter-spacing: 0; }
button, input { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
::selection { color: #fff; background: var(--blue); }
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--line); border: 3px solid var(--paper); border-radius: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip-link { position: fixed; left: 16px; top: -80px; z-index: 20; background: var(--ink); color: var(--paper); padding: 10px 14px; }
.skip-link:focus { top: 12px; }
.masthead { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(20px, 5vw, 72px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 92%, transparent); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; font-size: 18px; }
.brand-mark { width: 27px; height: 27px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 3px; padding: 4px; background: var(--ink); border-radius: 6px; }
.brand-mark span { display: block; background: var(--surface); border-radius: 1px; }
.brand-mark span:nth-child(1) { height: 8px; }
.brand-mark span:nth-child(2) { height: 16px; }
.brand-mark span:nth-child(3) { height: 12px; }
.mast-actions, .network-state, .account-button { display: flex; align-items: center; }
.mast-actions { gap: 10px; }
.network-state { gap: 7px; color: var(--muted); font-size: 13px; }
.network-state svg { width: 16px; height: 16px; }
.network-state[data-state="synced"] { color: var(--words-ink); }
.network-state[data-state="syncing"] svg { animation: turn 1s linear infinite; }
.network-state[data-state="attention"] { color: var(--danger); }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; }
.icon-button svg { width: 18px; }
.account-button { gap: 7px; border: 0; background: var(--ink); color: var(--paper); border-radius: 6px; min-height: 38px; padding: 0 13px; font-weight: 700; cursor: pointer; }
.account-button svg { width: 17px; }

.workspace { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: clamp(44px, 7vw, 88px) 0 72px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(330px, 5fr); gap: clamp(36px, 5vw, 72px); align-items: start; }
.section-heading { margin-bottom: 31px; }
.section-heading h1 { max-width: 720px; margin: 0 0 10px; font-family: "Songti SC", "Noto Serif SC", Georgia, serif; font-size: 60px; line-height: 1.08; font-weight: 700; letter-spacing: 0; text-wrap: balance; }
.section-heading p { margin: 0; max-width: 62ch; color: var(--muted); line-height: 1.7; }

.resume-band { min-height: 142px; display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; padding: 26px 28px; color: #fff; background: var(--blue-dark); text-decoration: none; border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease; }
.resume-band:hover { transform: translateY(-2px); box-shadow: 0 20px 44px rgba(20, 48, 86, .17); }
.resume-band.is-empty { background: var(--resume-empty); }
.resume-icon { width: 50px; height: 50px; display: grid; place-items: center; background: rgba(255,255,255,.14); border-radius: 50%; }
.resume-icon svg { width: 21px; fill: currentColor; }
.resume-copy { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.resume-copy small { opacity: .74; }
.resume-copy strong { font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.resume-copy > span { opacity: .82; line-height: 1.5; }
.resume-arrow { width: 23px; }

.product-list { margin-top: 24px; border-top: 1px solid var(--line); }
.product-row { min-height: 108px; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding-left .2s cubic-bezier(.2,.8,.2,1), filter .2s ease; }
.product-row:hover { padding-left: 28px; filter: saturate(1.08); }
.product-row.words { background: var(--words); color: var(--words-ink); }
.product-row.mt { background: var(--mt); color: var(--mt-ink); }
.product-row.oj { background: var(--oj); }
.product-code, .product-mark { width: 46px; height: 46px; }
.product-code { display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-weight: 900; font-size: 14px; }
.product-mark { object-fit: contain; }
.product-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.product-copy strong { font-size: 21px; }
.product-copy span { line-height: 1.45; opacity: .8; }
.product-action { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; white-space: nowrap; }
.product-action svg { width: 18px; }
.product-badge { justify-self: end; margin-right: 4px; padding: 5px 9px; border: 1px solid currentColor; border-radius: 999px; font-size: 12px; }
.product-row.oj { grid-template-columns: 52px minmax(0, 1fr) auto auto; }

.passport-panel { position: sticky; top: 106px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.passport-head { display: flex; gap: 15px; padding: 24px; border-bottom: 1px solid var(--line); }
.passport-head h2 { margin: 0 0 4px; font-size: 20px; }
.passport-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.passport-symbol { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: var(--blue); border-radius: 50%; }
.passport-symbol svg { width: 19px; }
.auth-tabs { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid var(--line); }
.auth-tab { min-height: 46px; border: 0; border-right: 1px solid var(--line); color: var(--muted); background: transparent; cursor: pointer; }
.auth-tab:last-child { border-right: 0; }
.auth-tab.is-active { color: var(--ink); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); font-weight: 800; box-shadow: inset 0 -3px var(--blue); }
.auth-form { display: grid; gap: 16px; padding: 24px; }
.auth-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
.auth-form input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--paper); }
.auth-form input:focus { border-color: var(--blue); outline: 3px solid color-mix(in srgb, var(--blue) 25%, transparent); }
.field-hint { margin: -3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.form-error { padding: 10px 12px; color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border-radius: 6px; font-size: 13px; line-height: 1.5; }
.primary-button { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 15px; border: 0; border-radius: 6px; color: #fff; background: var(--blue); font-weight: 800; cursor: pointer; }
.primary-button:hover { background: color-mix(in srgb, var(--blue) 88%, #000); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; }
.primary-button svg { width: 18px; }
.primary-button[aria-busy="true"] svg { animation: turn 1s linear infinite; }

.account-summary { min-height: 88px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 20px 24px; }
.account-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); font-weight: 900; }
.account-summary div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.account-summary strong { overflow: hidden; text-overflow: ellipsis; }
.account-summary div span { color: var(--muted); font-size: 12px; }
.account-actions { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.account-actions button { min-height: 76px; display: grid; place-items: center; align-content: center; gap: 7px; border: 0; border-right: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 12px; }
.account-actions button:last-child { border-right: 0; }
.account-actions button:hover { background: color-mix(in srgb, var(--blue) 7%, var(--surface)); }
.account-actions svg { width: 19px; }
.account-detail { padding: 20px 24px 24px; }
.account-detail h3 { margin: 0 0 14px; font-size: 16px; }
.account-detail form { display: grid; gap: 12px; }
.account-detail label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; }
.account-detail input { min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
.device-list { margin: 0; padding: 0; list-style: none; }
.device-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.device-item:first-child { border-top: 0; }
.device-item strong, .device-item span { display: block; }
.device-item span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.device-item button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }

.site-footer { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px clamp(20px,5vw,72px); color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
dialog { width: min(460px, calc(100% - 32px)); padding: 0; color: var(--ink); background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: 0 24px 70px rgba(0,0,0,.28); }
dialog::backdrop { background: rgba(12,18,25,.62); backdrop-filter: blur(5px); }
.dialog-content { display: grid; gap: 16px; padding: 30px; }
.dialog-content h2, .dialog-content p { margin: 0; }
.dialog-content p { color: var(--muted); line-height: 1.6; }
.dialog-icon { width: 46px; height: 46px; display: grid; place-items: center; color: var(--words-ink); background: var(--words); border-radius: 50%; }
.dialog-content output { padding: 14px; border: 1px dashed var(--blue); border-radius: 6px; background: var(--paper); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; text-align: center; font-size: 14px; }
.copy-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; }
.copy-button svg { width: 17px; }
.confirm-check { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.confirm-check input { width: 18px; height: 18px; accent-color: var(--blue); }

@keyframes turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 860px) {
  .workspace { width: min(680px, calc(100% - 32px)); grid-template-columns: 1fr; padding-top: 40px; }
  .passport-panel { position: static; }
  .section-heading h1 { font-size: 44px; }
}

@media (max-width: 560px) {
  .masthead { min-height: 60px; padding: 0 16px; }
  .network-state span, .account-button span { display: none; }
  .account-button { width: 38px; padding: 0; justify-content: center; }
  .workspace { width: 100%; padding: 30px 0 48px; gap: 36px; }
  .section-heading { padding: 0 20px; margin-bottom: 24px; }
  .section-heading h1 { font-size: 36px; }
  .resume-band { min-height: 154px; margin: 0 16px; padding: 22px; grid-template-columns: auto 1fr; }
  .resume-arrow { display: none; }
  .resume-copy strong { font-size: 19px; }
  .product-list { margin-top: 22px; }
  .product-row { min-height: 104px; grid-template-columns: 44px minmax(0,1fr) auto; padding: 18px 20px; gap: 14px; }
  .product-row:hover { padding-left: 20px; }
  .product-code, .product-mark { width: 40px; height: 40px; }
  .product-action { width: 36px; height: 36px; justify-content: center; border: 1px solid currentColor; border-radius: 50%; font-size: 0; }
  .product-copy strong { font-size: 18px; }
  .product-copy span { font-size: 13px; }
  .product-row.oj { grid-template-columns: 44px minmax(0,1fr) auto; }
  .product-badge { display: none; }
  .passport-panel { border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .site-footer { align-items: flex-start; flex-direction: column; }
}
