:root {
  color-scheme: dark;
  --bg:#151613; --sidebar:#191a17; --panel:#20211d; --surface:#252620; --border:#35372e;
  --fg:#f1ede3; --text:var(--fg); --muted:#b3afa3; --dim:#938e81;
  --gold:#dfb772; --accent:var(--gold); --gold-dark:#322614; --danger:#e5a29a; --radius:13px;
  font-family:Inter,"Microsoft YaHei UI","Microsoft YaHei","PingFang SC",system-ui,sans-serif;
  line-height:1.55; font-size:14px;
}
*, *::before, *::after { box-sizing:border-box }
body { margin:0; background:var(--bg); color:var(--fg) }
[hidden] { display:none!important }
a { color:var(--gold); text-underline-offset:3px }
button, input, select, textarea { font:inherit }
button { cursor:pointer }
button:disabled { cursor:not-allowed; opacity:.55 }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color:transparent }
:focus-visible { outline:2px solid #f2cf8f; outline-offset:3px }
main:focus { outline:none }
img { max-width:100% }
h1,h2,h3,p { margin-top:0 }
h1,h2,h3 { line-height:1.28 }
p:last-child { margin-bottom:0 }
hr { border:0; border-top:1px solid var(--border) }
input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea {
  background:#171815; color:var(--fg); border:1px solid #414338; border-radius:8px; padding:9px 11px;
  min-height:42px; max-width:100%; min-width:0;
}
input::placeholder,textarea::placeholder { color:#9e998b }
input[type=checkbox],input[type=radio] { accent-color:var(--gold); width:17px; height:17px; flex:none; margin:0 }
select { text-overflow:ellipsis }
summary { cursor:pointer }
code { overflow-wrap:anywhere }
.skip { position:fixed; top:8px; left:8px; transform:translateY(-150%); z-index:20; background:var(--fg); color:var(--bg); padding:8px 12px }
.skip:focus { transform:none }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap }
.shell { display:grid; grid-template-columns:229px minmax(0,1fr); min-height:100vh }
.sidebar { position:sticky; top:0; height:100dvh; display:flex; flex-direction:column; background:var(--sidebar); border-right:1px solid #303127; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; z-index:4 }
.brand { display:flex; gap:10px; align-items:center; padding:21px 15px 18px 18px; color:var(--fg); text-decoration:none; flex:none }
.brand img { flex:none }
.brand strong,.brand small { display:block; white-space:nowrap }
.brand strong { font-size:15px; letter-spacing:.055em }
.brand small { margin-top:2px; font-size:11px; letter-spacing:.15em; color:#c6a36e }
.sidebar nav { padding:0 12px 12px; flex:1 }
.nav-group + .nav-group { margin-top:13px }
.nav-title { color:#a7a091; padding:5px 9px 6px; font-size:11px; letter-spacing:.12em }
.nav-group a { display:flex; gap:11px; align-items:center; padding:6px 10px; margin:2px 0; min-height:33px; text-decoration:none; color:#cbc8be; border-radius:7px; border:1px solid transparent; font-size:13px }
.nav-group a svg { color:#a9a28f; flex:none }
.nav-group a:hover { background:#292a23; color:#fff }
.nav-group a[aria-current] { background:#392e1f; border-color:#534128; color:#efd3a1; font-weight:650 }
.nav-group a[aria-current] svg { color:var(--gold) }
.side-bottom { display:flex; align-items:center; gap:7px; min-height:44px; text-decoration:none; color:var(--muted); white-space:nowrap; font-size:12px; border-top:1px solid var(--border); padding:10px 15px }
.side-bottom span:last-child { margin-left:auto; color:var(--gold) }
.edition-dot,.online-dot { display:inline-block; width:7px; height:7px; background:#cfab71; border-radius:50%; flex:none }
.workspace { min-width:0; display:flex; flex-direction:column }
.topbar { position:sticky; z-index:5; top:0; min-height:65px; display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px clamp(16px,3vw,39px); border-bottom:1px solid #2d2f26; background:#181915 }
.breadcrumbs,.top-actions { display:flex; align-items:center; gap:13px; min-width:0 }
.breadcrumbs { white-space:nowrap }
.top-actions { flex-shrink:0 }
.breadcrumbs a { color:var(--muted); text-decoration:none }
.crumb-divider { color:#756e5e }
#crumb { overflow:hidden; text-overflow:ellipsis }
.search-trigger,.account-trigger,.icon-btn { display:inline-flex; align-items:center; gap:9px; background:#22231d; color:var(--muted); border:1px solid var(--border); border-radius:8px; min-height:40px; padding:7px 10px }
.search-trigger:hover,.account-trigger:hover,.icon-btn:hover { color:var(--fg); border-color:#6e5a3b }
.icon-btn { justify-content:center; flex:none }
.search-trigger { min-width:222px; text-align:left; font-size:12px }
.search-icon,#account-icon { display:inline-flex; color:var(--gold) }
kbd { margin-left:auto; font-size:10px; color:#c7beab; border:1px solid #4a493e; padding:1px 4px; border-radius:4px; white-space:nowrap }
.account-trigger { max-width:200px; color:var(--fg) }
#account-label { overflow:hidden; white-space:nowrap; text-overflow:ellipsis }
.account-chevron { color:var(--dim) }
.menu-button { display:none }
html { scroll-padding-block-start:75px }
main { width:min(100%, 1560px); margin:0 auto; padding:27px clamp(16px,3vw,39px) 35px; flex:1; min-width:0 }
.site-footer { display:flex; justify-content:space-between; gap:14px; padding:15px clamp(16px,3vw,39px); border-top:1px solid #292b23; color:var(--dim); font-size:12px }
.site-footer a { color:var(--muted); text-decoration:none }
.hero {
  position:relative; isolation:isolate; display:flex; align-items:center; overflow:hidden; min-height:340px;
  border:1px solid #5c4b33; border-radius:16px; background:#29271e;
  background-image:linear-gradient(90deg,rgba(19,19,16,.98),rgba(20,20,16,.84) 28%,rgba(20,20,16,.27) 63%,rgba(20,20,16,.10)),url("./hero.jpg");
  background-size:cover; background-position:center,center 53%;
}
.hero-copy { padding:35px clamp(22px,4vw,52px); width:100% }
.hero-edition { color:#ead2a7; font-size:12px; letter-spacing:.12em; display:flex; align-items:center; gap:9px; margin-bottom:14px }
.hero h1 { font-family:"Noto Serif SC","Songti SC",SimSun,serif; font-weight:800; font-size:clamp(39px,4.15vw,67px); letter-spacing:.07em; line-height:1.12; margin:0 0 15px; color:#fff4dd; text-shadow:0 2px 15px #15120e }
.hero p { color:#ded1b9; font-size:14px; margin:0 0 20px }
.hero-actions { display:flex; flex-wrap:wrap; gap:9px }
.btn { display:inline-flex; justify-content:center; align-items:center; gap:7px; min-height:41px; padding:8px 13px; text-decoration:none; border:1px solid #504b3c; color:var(--fg); border-radius:8px; background:#292a22; font-weight:580; line-height:1.3 }
.btn:hover { border-color:#a08355; background:#393324 }
.btn.primary { color:#21170a; background:#dfb772; border-color:#dfb772; font-weight:700 }
.btn.primary:hover { background:#efc889; border-color:#efc889 }
.btn.ghost { color:#f2e2c4; border-color:#887354; background:#1b1916bd }
.btn.danger { color:var(--danger); border-color:#694541; background:#322522 }
.fill-width { width:100% }
.dashboard { display:grid; grid-template-columns:minmax(0,1fr) minmax(237px,30%); gap:19px; margin-top:24px }
.dashboard-main,.dashboard-aside { min-width:0 }
.dashboard-aside { display:grid; align-content:start; gap:15px }
.section-title { display:flex; align-items:center; justify-content:space-between; gap:9px; margin:0 0 12px; color:var(--muted) }
.section-title h2 { color:var(--fg); font-size:17px; margin:0 }
.section-title a,.subtle-link { text-decoration:none; font-size:12px }
.section-title a { display:inline-flex; align-items:center; gap:3px }
.quick-grid,.source-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px }
.tool-card { min-width:0; display:flex; align-items:center; gap:11px; min-height:83px; padding:13px; border:1px solid var(--border); background:var(--panel); border-radius:var(--radius); color:var(--fg); text-decoration:none; transition:background .15s,border-color .15s }
.tool-card:hover,.tool-card:focus-visible { background:#292b23; border-color:#8c7046 }
.tool-icon { display:grid; place-items:center; width:40px; height:40px; border-radius:9px; flex:none; background:#383023; color:#e2b675; box-shadow:inset 0 0 0 1px rgb(240 219 177 / .15) }
.tool-icon.plum { background:#352e40; color:#c6a5ed }
.tool-icon.mint { background:#273b33; color:#99d3b4 }
.tool-icon.blue { background:#283744; color:#9cc7e2 }
.tool-copy { display:grid; min-width:0; gap:4px }
.tool-copy strong { line-height:1.25 }
.tool-copy small { color:var(--muted); font-size:12px; line-height:1.45 }
.tool-arrow { margin-left:auto; color:#ada08b; display:inline-flex; flex:none; transition:transform .15s }
.tool-card:hover .tool-arrow,.tool-card:focus-visible .tool-arrow { color:var(--gold); transform:translateX(3px) }
.panel { background:var(--panel); border:1px solid var(--border); border-radius:var(--radius); padding:16px; min-width:0 }
.panel h2 { font-size:17px }
.panel h3 { font-size:15px }
.active-panel .section-title { margin-bottom:16px }
.character-line { display:flex; align-items:center; gap:11px; min-width:0 }
.character-line > div:nth-child(2) { min-width:0; overflow-wrap:anywhere }
.class-avatar { flex:none; display:grid; place-items:center; width:49px; height:49px; background:color-mix(in srgb,var(--class-color) 14%,#1c1d18); color:var(--class-color); border:1px solid color-mix(in srgb,var(--class-color) 35%,#292820); border-radius:10px }
.character-line strong { display:block; line-height:1.3; font-size:16px }
.character-line small { display:block; color:var(--muted); margin-top:4px; font-size:12px }
.active-panel .btn { margin-top:15px }
.character-tags { display:flex; gap:6px; flex-wrap:wrap; margin-top:13px }
.badge { display:inline-flex; align-items:center; gap:4px; padding:3px 8px; border-radius:6px; background:#322b20; color:#edd2a4; font-size:11px; vertical-align:middle; line-height:1.4 }
.raid-panel { background:linear-gradient(120deg,#28241b,var(--panel) 75%); border-color:#473c2a }
.raid-date { display:flex; flex-wrap:wrap; align-items:baseline; gap:9px; color:var(--fg); text-decoration:none }
.date-number { font-family:Georgia,"Songti SC",serif; color:#f1cd90; font-size:30px; line-height:1.25; letter-spacing:.02em }
.date-number span { font-family:inherit; font-size:12px; margin:0 2px }
.date-copy { font-size:12px }
.raid-panel p { color:var(--muted); font-size:12px; margin:8px 0 9px }
.progress-section { margin-top:21px }
.progress-section .section-title > span { font-size:12px }
.checklist { padding:3px 14px }
.check-row { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:44px }
.check-row + .check-row { border-top:1px solid var(--border) }
.check-row label { display:flex; align-items:center; gap:9px; flex:1; min-height:44px; cursor:pointer; padding:8px 0; color:#ddd8cc }
.check-row label:has(input:checked) span { text-decoration:line-through; color:var(--dim) }
.check-row > a { display:inline-flex; align-items:center; justify-content:center; flex:none; min-width:44px; min-height:44px; border-radius:7px; color:var(--gold) }
.check-row > a:hover { background:#322b20 }
.page-head {
  margin:0 0 18px;
  min-width:0;
  min-height:132px;
  padding:clamp(16px,2.7vw,30px);
  align-content:center;
  border:1px solid var(--heading-border,#51452e);
  border-radius:var(--radius);
  background-color:var(--heading-base,#252219);
  background-image:linear-gradient(97deg,var(--heading-base,#252219) 15%,var(--heading-middle,#252219e8) 53%,#17171238 100%),var(--heading-art,none);
  background-size:100% 100%,max(66%,470px) auto;
  background-position:center,right var(--heading-image-y,53%);
  background-repeat:no-repeat;
}
.page-head h1 { margin:0 0 6px; font-size:clamp(26px,3vw,36px); font-weight:740; letter-spacing:.025em; overflow-wrap:anywhere }
.page-head p { color:#e0d9ca; margin:0; max-width:58ch; text-shadow:0 1px 3px #111; overflow-wrap:anywhere }
.page-head .eyebrow { display:flex; align-items:center; gap:8px; color:var(--heading-accent,#efd19c); margin:0 0 9px }
.page-head .eyebrow > svg { width:28px; height:28px; flex:none; padding:5px; border:1px solid var(--heading-border,#51452e); background:#191812a6; border-radius:7px }
.page-head.gear-head,.wf-talents .page-head { display:flex; justify-content:space-between; align-items:end; flex-wrap:wrap; gap:10px 18px }
.page-head.gear-head > div:first-child,.wf-talents .page-head > div:first-child { min-width:0; flex:1 1 330px }
.page-head > .badge { max-width:100%; overflow-wrap:anywhere }
.page-head > .btn { background:#242119ec }
:is([data-page="gear"],[data-page="bis"],[data-page="items"],[data-page="stats"],[data-page="professions"]) {
  --heading-art:url("./visuals/forge.jpg");
  --heading-image-y:51%;
}
:is([data-page="talents"],[data-page="legacy"],[data-page="skills"],[data-page="macros"],[data-page="classes"]) {
  --heading-art:url("./visuals/arcana.jpg");
  --heading-base:#23212c;
  --heading-middle:#23212ce6;
  --heading-border:#53465e;
  --heading-accent:#e4caeb;
}
:is([data-page="profiles"],[data-page="dungeons"],[data-page="leveling"],[data-page="map"],[data-page="quests"],[data-page="races"],[data-page="rankings"],[data-page="sources"]) {
  --heading-art:url("./visuals/expedition.jpg");
  --heading-base:#202921;
  --heading-middle:#202921e6;
  --heading-border:#455447;
  --heading-accent:#d1dfad;
}
.eyebrow { color:var(--gold); font-size:11px; letter-spacing:.11em; margin-bottom:7px }
.grid { display:grid; gap:13px }
.muted { color:var(--muted) }
.empty { padding:23px 16px; color:var(--muted); text-align:center }
.empty h1,.empty h2 { color:var(--fg) }
.field { display:flex; flex-direction:column; gap:5px; min-width:0; color:#e0dbcf; font-size:13px }
.field input,.field select,.field textarea { width:100% }
.profile-toolbar,.profile-actions,.dialog-actions { display:flex; flex-wrap:wrap; gap:8px }
.profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px }
.profile-grid > .empty { grid-column:1/-1 }
.profile-card p { margin:11px 0 }
.profile-card .current-badge { margin-left:auto; flex:none; color:#b6d4a8; background:#303a29 }
.storage-hint { margin:12px 0 17px; font-size:12px }
.source-panel { margin-bottom:14px }
.source-panel p { color:var(--muted) }
.source-check { display:flex; flex-wrap:wrap; align-items:center; gap:9px; margin-top:12px }
dialog { width:min(100% - 26px,650px); max-height:calc(100dvh - 26px); border:1px solid #6c583b; border-radius:14px; background:#22231e; color:var(--fg); padding:18px; box-shadow:0 18px 60px #0009; overflow:auto; overscroll-behavior:contain }
dialog::backdrop { background:#0d0e0be0 }
.dialog-head { display:flex; align-items:center; justify-content:space-between; gap:9px; margin-bottom:13px }
.dialog-head h2 { margin:0; font-size:21px }
.dialog-actions { justify-content:flex-end; margin-top:16px }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px }
.span-2 { grid-column:span 2 }
.form-note { margin:11px 0 0; font-size:12px }
.form-error { color:var(--danger); margin:10px 0 0 }
.search-list { display:grid; gap:4px; margin-top:10px }
.search-list a { display:flex; gap:9px; align-items:center; min-height:44px; color:var(--fg); padding:9px; border-radius:7px; text-decoration:none; overflow-wrap:anywhere }
.search-list a:hover { background:#353025 }
.search-list svg { color:var(--gold); flex:none }
.search-list svg:last-child { margin-left:auto }
.toast { position:fixed; z-index:30; bottom:max(16px,env(safe-area-inset-bottom)); right:16px; max-width:calc(100vw - 32px); border-radius:9px; background:#3e3222; border:1px solid #937344; color:#fff0d4; padding:10px 15px; box-shadow:0 7px 23px #0008 }
.drawer-overlay { display:none }
.loading { margin:25px 0 }
@media(max-width:1115px) {
  .shell { grid-template-columns:194px minmax(0,1fr) }
  .brand { padding-left:12px; gap:8px }
  .brand strong { font-size:13px }
  .brand img { width:33px; height:33px }
  .tool-card { padding:11px; gap:8px }
  .tool-arrow { display:none }
}
@media(max-width:900px) {
  .dashboard { grid-template-columns:1fr }
  .dashboard-aside { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px }
  .hero { min-height:305px }
}
@media(min-width:761px) and (max-width:960px) {
  .search-trigger { min-width:0 }
  .search-trigger kbd { display:none }
  .account-trigger { max-width:150px }
}
@media(max-width:760px) {
  html { scroll-padding-block-start:calc(68px + env(safe-area-inset-top)) }
  .shell { display:block }
  .sidebar { position:fixed; top:0; bottom:0; left:0; width:min(284px,85vw); padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom) env(safe-area-inset-left); transform:translateX(-102%); visibility:hidden; transition:transform .18s ease,visibility .18s; z-index:12 }
  .nav-group a { min-height:44px; font-size:14px }
  .drawer-open { overflow:hidden }
  .drawer-open .sidebar { transform:none; visibility:visible }
  .drawer-overlay:not([hidden]) { display:block; position:fixed; inset:0; z-index:11; background:#000a; border:0 }
  .menu-button { display:inline-flex }
  .topbar { min-height:58px; padding:calc(7px + env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 7px max(14px,env(safe-area-inset-left)) }
  .breadcrumbs,.top-actions { gap:7px }
  .breadcrumbs a,.crumb-divider,.search-text,.search-trigger kbd,.account-chevron { display:none }
  .search-trigger,.account-trigger,.icon-btn,.btn { min-height:44px }
  .search-trigger,.menu-button,.dialog-head .icon-btn { justify-content:center; min-width:44px }
  .search-trigger { padding:8px }
  .account-trigger { max-width:clamp(110px,32vw,128px); gap:7px; padding-inline:8px }
  main { padding:14px max(14px,env(safe-area-inset-right)) 28px max(14px,env(safe-area-inset-left)) }
  .site-footer { align-items:center; padding:5px max(14px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)) }
  .site-footer a { display:inline-flex; align-items:center; min-height:44px; text-align:end }
  .hero { min-height:232px; background-position:center,61% 50% }
  .hero-copy { padding:20px }
  .hero h1 { font-size:clamp(35px,8.8vw,54px); margin-bottom:10px }
  .hero-edition { letter-spacing:.04em; margin-bottom:9px }
  .hero p { margin-bottom:14px }
  .dashboard { margin-top:15px; gap:17px }
  .page-head {
    min-height:112px;
    padding:15px;
    margin-bottom:14px;
    background-image:linear-gradient(97deg,var(--heading-base,#252219) 5%,var(--heading-middle,#252219e8) 60%,#151512b3 100%),var(--heading-art,none);
    background-size:100% 100%,max(78%,350px) auto;
  }
  .page-head h1 { font-size:clamp(24px,6.6vw,31px) }
  .page-head p:not(.eyebrow) { font-size:13px }
  .toast { inset-inline: max(14px,env(safe-area-inset-left)) max(14px,env(safe-area-inset-right)); max-width:none; bottom:max(14px,env(safe-area-inset-bottom)) }
  #profile-dialog,#search-dialog { max-height:calc(100dvh - max(12px,env(safe-area-inset-top)) - max(12px,env(safe-area-inset-bottom))); padding:14px; scroll-padding-block:68px 16px }
  #profile-dialog > .dialog-head,#search-dialog > .dialog-head { position:sticky; top:-14px; z-index:1; margin:-14px -14px 13px; padding:12px 14px; background:#22231e; border-bottom:1px solid var(--border) }
  #profile-dialog :is(input,select),#search-dialog input { min-height:44px; font-size:16px }
}
@supports(-webkit-touch-callout:none) {
  @media(max-width:760px) {
    main :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]),
    dialog :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]) { font-size:16px }
  }
}
@media(max-width:490px) {
  .dashboard-aside,.profile-grid,.source-grid { grid-template-columns:1fr }
  .quick-grid { gap:8px }
  .quick-grid .tool-card { align-items:flex-start; flex-direction:column; min-height:100px }
  .tool-icon { width:34px; height:34px }
  .tool-icon svg { width:18px; height:18px }
  .tool-copy strong { font-size:13px }
  .tool-copy small { overflow-wrap:anywhere }
  .panel { padding:13px }
  .checklist { padding-block:3px }
  .site-footer { font-size:11px }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; transition:none!important }
}
