:root {
  color-scheme: dark;
  --bg: #08090a;
  --surface: #111315;
  --surface-raised: #181b1e;
  --surface-input: #0c0e10;
  --line: #303438;
  --line-soft: #24272a;
  --text: #f4f5f2;
  --muted: #a5aaad;
  --muted-strong: #c4c8ca;
  --red: #d71920;
  --red-hover: #f12c32;
  --gold: #d7ad52;
  --cyan: #44c8c6;
  --green: #4bd29c;
  font-family: Inter, "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.content-width, .header-inner { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { border-bottom: 1px solid var(--line-soft); background: rgba(8, 9, 10, .96); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { min-width: 0; display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-icon { width: 46px; height: 46px; flex: 0 0 46px; object-fit: contain; border-radius: 50%; }
.brand > span:last-child { min-width: 0; display: grid; gap: 2px; }
.brand strong { font-size: 16px; }
.brand small { color: var(--muted); font-size: 10px; font-weight: 800; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.language-control { position: relative; width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border: 1px solid #4a5054; border-radius: 50%; background: #171a1d; color: var(--muted-strong); cursor: pointer; overflow: hidden; }
.language-control:hover, .language-control:focus-within { border-color: #858c91; background: #23272a; color: #fff; outline: 0; }
.language-control svg { width: 19px; height: 19px; pointer-events: none; }
.language-control select { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; cursor: pointer; }
.theme-toggle, .motion-toggle { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid #4a5054; border-radius: 50%; background: #171a1d; color: var(--muted-strong); cursor: pointer; }
.theme-toggle:hover, .theme-toggle:focus-visible, .motion-toggle:hover, .motion-toggle:focus-visible { border-color: #858c91; background: #23272a; color: #fff; outline: 0; }
.theme-toggle svg, .motion-toggle svg { width: 19px; height: 19px; }
.motion-toggle[aria-checked='true'] { border-color: #b8944b; background: #2b2417; color: #f1cf83; }
.submission-help { position: relative; }
.submission-help-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid #4a5054; border-radius: 50%; background: #171a1d; color: var(--muted-strong); cursor: help; }
.submission-help-button:hover, .submission-help-button:focus-visible { border-color: #858c91; background: #23272a; color: #fff; outline: 0; }
.submission-help-button svg { width: 19px; height: 19px; }
.submission-help-tooltip { position: absolute; top: calc(100% + 12px); right: 0; z-index: 30; width: min(390px, calc(100vw - 28px)); display: grid; gap: 9px; padding: 15px 16px; border: 1px solid #565d62; border-radius: 5px; background: #171b1e; color: var(--muted-strong); box-shadow: 0 18px 48px rgba(0,0,0,.6); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease, visibility .15s ease; pointer-events: none; }
.submission-help-tooltip::before { content: ''; position: absolute; top: -6px; right: 13px; width: 10px; height: 10px; border-top: 1px solid #565d62; border-left: 1px solid #565d62; background: #171b1e; transform: rotate(45deg); }
.submission-help:hover .submission-help-tooltip, .submission-help:focus-within .submission-help-tooltip { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.submission-help-tooltip strong { color: #fff; font-size: 15px; }
.submission-help-tooltip p { margin: 0; font-size: 13px; line-height: 1.7; }
.submission-help-tooltip code, .submission-help-tooltip b { color: #f2d18b; font-weight: 850; }
.submission-button { min-width: 112px; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid #f2383e; border-radius: 4px; background: var(--red); color: #fff; font-size: 13px; font-weight: 900; text-decoration: none; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.submission-button:hover { border-color: #ff5a60; background: var(--red-hover); }
.submission-button:active { transform: translateY(1px); }
.submission-button:focus-visible { outline: 2px solid rgba(255, 255, 255, .78); outline-offset: 2px; }
.submission-button.is-copied { border-color: #63d7aa; background: #238760; }
.submission-button svg { width: 17px; height: 17px; flex: 0 0 17px; }

.search-band { position: relative; min-height: 408px; padding: 46px 0 30px; border-bottom: 1px solid var(--line); background: #080a0b; overflow: hidden; isolation: isolate; }
.search-band::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(7, 9, 10, .58); }
.search-band::after { content: ''; position: absolute; left: 0; bottom: 0; width: 34%; height: 3px; background: var(--red); }
.search-band > .content-width { position: relative; z-index: 1; min-height: 332px; display: flex; flex-direction: column; }
.hero-spine-layer { position: absolute; inset: 0; z-index: -2; background: #0c0e0f url('assets/community-bg.jpg') center 42% / cover no-repeat; opacity: .78; transition: opacity .3s ease; pointer-events: none; }
.hero-spine-layer.is-ready { background: #080a0b; opacity: .92; }
#heroSpine { position: absolute; inset: -94% 0 -128%; }
#heroSpine .spine-player, #heroSpine canvas { width: 100% !important; height: 100% !important; }
#heroSpine .spine-player { background: transparent !important; }
#heroSpine .spine-player-controls, #heroSpine .spine-player-progress { display: none !important; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 0; }
.eyebrow { margin: 0 0 7px; color: var(--red-hover); font-size: 11px; font-weight: 950; }
h1 { margin: 0; font-size: 34px; line-height: 1.18; letter-spacing: 0; }
.index-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(215, 173, 82, .12); }
.index-status.ready .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(75, 210, 156, .12); }
.index-status.error .status-dot { background: var(--red-hover); box-shadow: 0 0 0 4px rgba(241, 44, 50, .12); }

.search-controls { display: grid; grid-template-columns: minmax(260px, 1fr) 210px 260px; gap: 10px; margin-top: auto; }
.search-field, .select-field, .character-picker-trigger { min-width: 0; min-height: 48px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-input); }
.search-field { display: grid; grid-template-columns: 20px minmax(0, 1fr) 34px; align-items: center; gap: 8px; padding: 0 8px 0 14px; }
.search-field:focus-within, .select-field:focus-within, .character-picker-trigger:focus-visible { border-color: #858b90; box-shadow: 0 0 0 2px rgba(255,255,255,.06); outline: 0; }
.search-field > svg { width: 19px; color: var(--muted); }
.search-field input { width: 100%; min-width: 0; height: 46px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-field input::placeholder { color: #73797d; }
.clear-search { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--muted); cursor: pointer; visibility: hidden; }
.clear-search.visible { visibility: visible; }
.clear-search:hover { color: var(--text); background: var(--surface-raised); }
.clear-search svg { width: 17px; height: 17px; }
.select-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding-left: 14px; }
.select-field span { color: var(--muted); font-size: 12px; font-weight: 800; }
.select-field select { min-width: 0; height: 46px; padding: 0 34px 0 0; border: 0; outline: 0; background: transparent; color: var(--text); font-weight: 800; cursor: pointer; }
.select-field option { background: var(--surface); color: var(--text); }
.character-picker-trigger { display: grid; grid-template-columns: auto minmax(0, 1fr) 18px; align-items: center; gap: 10px; padding: 0 13px; color: var(--text); cursor: pointer; text-align: left; }
.character-picker-trigger:hover { border-color: #70757a; }
.character-picker-trigger .field-label { color: var(--muted); font-size: 12px; font-weight: 800; }
.character-picker-trigger > svg { width: 17px; height: 17px; color: var(--muted); }
.character-trigger-value { min-width: 0; display: flex; align-items: center; gap: 8px; }
.character-trigger-value strong { min-width: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.selected-avatar-stack { display: flex; align-items: center; padding-left: 5px; }
.selected-avatar-stack:empty { display: none; }
.selected-avatar-stack .mini-avatar { margin-left: -5px; border-color: #676c70; }
.mini-avatar { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #272b2f; color: var(--muted-strong); font-size: 10px; font-weight: 900; object-fit: cover; }

.tag-filter { min-width: 0; display: flex; align-items: center; gap: 10px; }
.tag-filter > span { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 800; }
.tag-list { min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.tag-button { min-height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: var(--muted-strong); font-size: 12px; font-weight: 800; cursor: pointer; }
.tag-button:hover { border-color: #70757a; color: var(--text); }
.tag-button.active { border-color: #f05a5f; background: var(--red); color: #fff; }

.results-band { padding: 30px 0 64px; }
.results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 14px; }
.results-head h2 { margin: 0; font-size: 20px; }
.results-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.results-tools { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.reset-button, .empty-state button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted-strong); font-size: 12px; font-weight: 800; cursor: pointer; }
.reset-button:hover, .empty-state button:hover { border-color: #70757a; color: var(--text); background: var(--surface-raised); }
.reset-button svg { width: 15px; height: 15px; }

.combo-list { display: grid; gap: 9px; }
.combo-card { position: relative; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 420px); border: 1px solid var(--line-soft); border-radius: 5px; background: var(--surface); overflow: hidden; }
.combo-card:hover { border-color: #4b5054; background: #141719; }
.combo-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, var(--red)); }
.combo-main { min-width: 0; padding: 18px 18px 16px 21px; }
.combo-title-row { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.combo-title-row > div:first-child { min-width: 0; }
.combo-card h3 { margin: 0; color: var(--text); font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
.characters { margin: 5px 0 0; color: var(--cyan); font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.combo-tags { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.combo-tag { padding: 4px 9px; border: 1px solid #5d6368; border-radius: 3px; background: rgba(255,255,255,.035); color: #d8dcde; font-size: 12px; font-weight: 850; line-height: 1.2; }
.combo-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 15px 0 0; }
.combo-meta > div { display: flex; align-items: baseline; gap: 7px; }
.combo-meta dt { color: #7f8589; font-size: 10px; font-weight: 800; }
.combo-meta dd { margin: 0; color: var(--muted-strong); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.combo-actions { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) 98px; align-items: center; gap: 14px; padding: 16px; border-left: 1px solid var(--line-soft); background: rgba(0,0,0,.14); }
.card-characters { min-width: 38px; display: flex; align-items: center; }
.card-character-avatar { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; margin-left: -14px; border: 2px solid #24282b; border-radius: 50%; background: #30363a; color: var(--muted-strong); font-size: 13px; font-weight: 900; object-fit: cover; box-shadow: 0 2px 7px rgba(0,0,0,.42); }
.card-character-avatar:first-child { margin-left: 0; }
.unknown-avatar { object-fit: contain !important; background: #f4f1ed !important; }
.card-submitter { min-width: 0; display: grid; gap: 2px; }
.card-submitter > span { color: #777d81; font-size: 9px; font-weight: 850; }
.card-submitter strong, .card-submitter small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-submitter strong { color: var(--muted-strong); font-size: 12px; }
.card-submitter small { color: #858b8f; font-size: 10px; }
.detail-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 1px solid #ff5960; border-radius: 4px; background: var(--red); color: #fff; font-size: 12px; font-weight: 900; cursor: pointer; }
.detail-button:hover { background: var(--red-hover); }
.detail-button svg { width: 16px; height: 16px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,.78); backdrop-filter: blur(5px); }
.modal-backdrop[hidden] { display: none; }
.character-picker-dialog, .detail-dialog { width: min(1080px, 100%); max-height: min(860px, calc(100vh - 48px)); display: grid; border: 1px solid #454b50; border-radius: 6px; background: #11161a; box-shadow: 0 28px 90px rgba(0,0,0,.72); overflow: hidden; }
.character-picker-dialog { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.modal-header { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 24px; }
.modal-header p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.icon-button { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: #24282c; color: var(--text); cursor: pointer; }
.icon-button:hover { border-color: #7b8186; background: #30353a; }
.icon-button svg { width: 19px; height: 19px; }
.picker-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 22px; border-bottom: 1px solid var(--line-soft); background: #0e1215; }
.picker-toolbar > strong { color: var(--muted-strong); font-size: 12px; }
.picker-search { min-height: 38px; display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-input); }
.picker-search:focus-within { border-color: #858b90; }
.picker-search svg { width: 17px; height: 17px; color: var(--muted); }
.picker-search input { min-width: 0; height: 36px; border: 0; outline: 0; background: transparent; color: var(--text); }
.character-grid { min-height: 220px; display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); align-content: start; gap: 10px; padding: 18px 22px; overflow: auto; }
.character-option { position: relative; min-width: 0; min-height: 148px; display: grid; place-items: center; align-content: center; gap: 10px; padding: 12px 8px; border: 1px solid #3b4145; border-radius: 4px; background: #1c2125; color: var(--text); cursor: pointer; }
.character-option:hover { border-color: #7a8084; background: #242a2e; }
.character-option.selected { border-color: #ff5a60; background: #3a181a; box-shadow: inset 0 0 0 1px rgba(255,90,96,.4); }
.character-option img, .character-option .avatar-fallback { width: 86px; height: 86px; display: grid; place-items: center; border: 3px solid #5b6063; border-radius: 50%; background: #303538; object-fit: cover; font-size: 28px; font-weight: 950; }
.character-option.selected img, .character-option.selected .avatar-fallback { border-color: #ff6a70; }
.character-option strong { max-width: 100%; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.character-option .selected-check { position: absolute; top: 8px; right: 8px; width: 23px; height: 23px; display: none; place-items: center; border-radius: 50%; background: var(--red); color: #fff; }
.character-option.selected .selected-check { display: grid; }
.character-option .selected-check svg { width: 15px; height: 15px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 13px 22px; border-top: 1px solid var(--line); background: #0e1215; }
.modal-footer button, .primary-button, .secondary-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 1px solid var(--line); border-radius: 4px; background: #24282c; color: var(--text); font-size: 12px; font-weight: 900; text-decoration: none; cursor: pointer; }
.primary-button { border-color: #ff5960; background: var(--red); color: #fff; }
.primary-button:hover { background: var(--red-hover); }
.secondary-button:hover, .modal-footer button:hover { border-color: #777d81; background: #30353a; }
.primary-button svg, .secondary-button svg { width: 16px; height: 16px; }

.detail-backdrop { z-index: 110; }
.detail-dialog { width: min(1420px, 100%); height: min(860px, calc(100vh - 48px)); grid-template-rows: auto minmax(0, 1fr); }
.detail-header { align-items: center; padding: 17px 20px; }
.detail-header h2 { max-width: 980px; overflow: hidden; font-size: 22px; text-overflow: ellipsis; white-space: nowrap; }
.detail-header .eyebrow { margin-bottom: 4px; }
.detail-layout { min-height: 0; display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); }
.detail-info { min-height: 0; display: grid; align-content: start; gap: 16px; padding: 20px; border-right: 1px solid var(--line); overflow: auto; }
.detail-characters { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-character { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px 5px 5px; border: 1px solid var(--line); border-radius: 3px; background: #1a1f23; font-size: 11px; font-weight: 850; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-tags:empty { display: none; }
.detail-tag { padding: 4px 8px; border: 1px solid #565c60; border-radius: 3px; color: var(--muted-strong); font-size: 10px; font-weight: 850; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; border: 1px solid var(--line); background: var(--line); }
.detail-meta > div { min-width: 0; padding: 10px; background: #151a1e; }
.detail-meta > div:last-child { grid-column: 1 / -1; }
.detail-meta dt { color: #858b8f; font-size: 9px; font-weight: 850; }
.detail-meta dd { margin: 3px 0 0; color: var(--text); font-size: 12px; font-weight: 850; overflow-wrap: anywhere; }
.detail-section { display: grid; gap: 6px; }
.detail-section[hidden] { display: none; }
.detail-section h3 { margin: 0; color: #858b8f; font-size: 10px; }
.detail-section p { margin: 0; color: var(--muted-strong); font-size: 12px; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.detail-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.axis-preview-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); background: #090b0d; }
.axis-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 17px; border-bottom: 1px solid var(--line); background: #121619; }
.axis-preview-head h3 { margin: 0; font-size: 15px; }
.axis-preview-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.axis-preview-options { display: flex; align-items: center; gap: 8px; }
.axis-zoom-control { height: 28px; display: grid; grid-template-columns: 15px minmax(72px, 110px) 38px; align-items: center; gap: 6px; padding: 0 7px; border: 1px solid #42494d; border-radius: 4px; background: #0b0e10; color: #aeb4b7; }
.axis-zoom-control svg { width: 14px; height: 14px; }
.axis-zoom-control input { width: 100%; accent-color: var(--red-hover); cursor: pointer; }
.axis-zoom-control output { color: var(--muted-strong); font-size: 9px; font-weight: 900; font-variant-numeric: tabular-nums; text-align: right; }
.axis-icon-set { height: 26px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 2px; border: 1px solid #42494d; border-radius: 4px; background: #0b0e10; }
.axis-icon-set button { min-width: 42px; height: 20px; padding: 0 7px; border: 0; border-radius: 2px; background: transparent; color: #7f878b; font-size: 9px; font-weight: 900; }
.axis-icon-set button:hover { color: #d8dcde; }
.axis-icon-set button.active { background: #343a3e; color: #fff; }
.axis-icon-set button:focus-visible { outline: 2px solid #f1cb75; outline-offset: 1px; }
.experimental-badge { padding: 4px 7px; border: 1px solid #856322; border-radius: 3px; color: #f1cb75; font-size: 9px; font-weight: 900; }
.axis-preview { width: 100%; min-width: 0; min-height: 0; display: grid; align-content: start; gap: 18px; padding: 18px; overflow-x: hidden; overflow-y: auto; background-color: #0d1012; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 24px 24px; }
.axis-group { min-width: 0; display: grid; gap: calc(9px * var(--axis-scale, 1)); }
.axis-group-head { display: flex; align-items: center; gap: 8px; }
.axis-group-head strong { color: #f1cf83; font-size: calc(12px * var(--axis-scale, 1)); }
.axis-group-head span { color: #737a7f; font-size: calc(9px * var(--axis-scale, 1)); }
.axis-flow { width: 100%; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: calc(10px * var(--axis-scale, 1)) calc(19px * var(--axis-scale, 1)); padding: calc(14px * var(--axis-scale, 1)); border: 1px solid #30363a; border-left: 3px solid var(--axis-color, var(--gold)); border-radius: 4px; background: rgba(18,22,25,.94); }
.axis-step { position: relative; max-width: 100%; min-width: calc(70px * var(--axis-scale, 1)); min-height: calc(50px * var(--axis-scale, 1)); display: grid; grid-template-columns: calc(34px * var(--axis-scale, 1)) minmax(0, auto); align-items: center; gap: calc(8px * var(--axis-scale, 1)); padding: calc(7px * var(--axis-scale, 1)) calc(10px * var(--axis-scale, 1)) calc(7px * var(--axis-scale, 1)) calc(7px * var(--axis-scale, 1)); border: 1px solid color-mix(in srgb, var(--role-color), #fff 25%); border-radius: 4px; background: color-mix(in srgb, var(--role-color), #101315 80%); }
.axis-move-continuation { min-width: calc(42px * var(--axis-scale, 1)); grid-template-columns: minmax(0, auto); padding-left: calc(10px * var(--axis-scale, 1)); }
.axis-step:not(:last-child)::after { content: ''; position: absolute; left: calc(100% + 6px); top: 50%; width: 7px; height: 7px; border-top: 1px solid #686e72; border-right: 1px solid #686e72; transform: translateY(-50%) rotate(45deg); }
.axis-step .mini-avatar { width: calc(34px * var(--axis-scale, 1)); height: calc(34px * var(--axis-scale, 1)); flex-basis: calc(34px * var(--axis-scale, 1)); border: 0; }
.axis-move-content { min-width: 0; display: flex; align-items: center; flex-wrap: nowrap; gap: calc(5px * var(--axis-scale, 1)); overflow: hidden; }
.axis-action { min-width: calc(20px * var(--axis-scale, 1)); min-height: calc(31px * var(--axis-scale, 1)); display: inline-flex; align-items: center; justify-content: center; gap: calc(2px * var(--axis-scale, 1)); color: #f0f2ef; font-size: calc(12px * var(--axis-scale, 1)); font-weight: 900; line-height: 1; white-space: nowrap; }
.axis-action > span { max-width: calc(180px * var(--axis-scale, 1)); overflow: hidden; text-overflow: ellipsis; }
.axis-action-icon { width: calc(31px * var(--axis-scale, 1)); height: calc(31px * var(--axis-scale, 1)); display: block; object-fit: contain; }
.axis-action-icon.is-wide { width: calc(49px * var(--axis-scale, 1)); }
.axis-empty, .axis-error { min-height: 240px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); font-size: 12px; text-align: center; }
.axis-error { color: #ff9b9f; }
.axis-loading { min-height: 260px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.axis-loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--red-hover); animation: axis-pulse .9s infinite alternate; }
.axis-loading span:nth-child(2) { animation-delay: .15s; }
.axis-loading span:nth-child(3) { animation-delay: .3s; }
@keyframes axis-pulse { to { opacity: .25; transform: translateY(-5px); } }

.empty-state { min-height: 320px; display: grid; place-items: center; align-content: center; gap: 9px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state > svg { width: 38px; height: 38px; margin-bottom: 5px; color: #6f7579; }
.empty-state strong { color: var(--text); font-size: 16px; }
.empty-state span { font-size: 12px; }
.empty-state button { margin-top: 7px; }
.error-state > svg { color: var(--red-hover); }

@media (max-width: 780px) {
  .content-width, .header-inner { width: min(100% - 28px, 1180px); }
  .search-band { min-height: 390px; padding-top: 32px; }
  .search-band > .content-width { min-height: 326px; }
  #heroSpine { inset: -70% -12% -100%; }
  .title-row { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 28px; }
  .search-controls { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .results-head { align-items: flex-start; }
  .results-tools { max-width: 62%; align-items: flex-start; }
  .tag-filter { align-items: flex-start; }
  .tag-list { justify-content: flex-end; }
  .combo-card { grid-template-columns: 1fr; }
  .combo-actions { border-left: 0; border-top: 1px solid var(--line-soft); }
  .detail-layout { grid-template-columns: 1fr; overflow: auto; }
  .detail-info { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .axis-preview-panel { min-height: 520px; }
  .axis-preview-head { align-items: flex-start; }
  .axis-preview-options { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 520px) {
  .header-inner { gap: 6px; }
  .header-actions { gap: 4px; }
  .brand { gap: 6px; }
  .brand-icon { width: 38px; height: 38px; flex-basis: 38px; }
  .brand strong { font-size: 13px; }
  .brand small { display: none; }
  .theme-toggle, .motion-toggle, .submission-help-button, .language-control { width: 34px; height: 34px; flex-basis: 34px; }
  .submission-button { width: 36px; min-width: 36px; height: 36px; padding: 0; }
  .submission-button span { display: none; }
  .submission-help-tooltip { position: fixed; top: 66px; right: 14px; left: 14px; width: auto; }
  .search-controls { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .select-field { min-height: 44px; }
  .select-field select { height: 42px; }
  .hero-spine-layer { opacity: .6; }
  .hero-spine-layer.is-ready { opacity: .72; }
  #heroSpine { inset: -42% -70% -32%; }
  .results-head { align-items: stretch; flex-direction: column; }
  .results-tools { width: 100%; max-width: none; justify-content: space-between; }
  .tag-list { justify-content: flex-start; }
  .reset-button { width: 38px; min-width: 38px; padding: 0; }
  .reset-button:not(:hover) { font-size: 0; gap: 0; }
  .reset-button svg { width: 17px; height: 17px; }
  .combo-title-row { flex-direction: column; gap: 9px; }
  .combo-tags { justify-content: flex-start; }
  .combo-main { padding: 16px 15px 15px 18px; }
  .combo-actions { grid-template-columns: auto minmax(0, 1fr) 92px; gap: 10px; padding: 12px 14px; }
  .card-characters { min-width: 32px; }
  .card-character-avatar { width: 34px; height: 34px; flex-basis: 34px; margin-left: -11px; font-size: 11px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .character-picker-dialog, .detail-dialog { width: 100%; max-height: 94vh; border-radius: 6px 6px 0 0; }
  .modal-header { padding: 16px; }
  .picker-toolbar { grid-template-columns: 1fr; padding: 10px 16px; }
  .character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 16px; }
  .character-option { min-height: 132px; }
  .character-option img, .character-option .avatar-fallback { width: 72px; height: 72px; }
  .modal-footer { padding: 12px 16px; }
  .detail-dialog { height: 94vh; }
  .detail-header h2 { font-size: 18px; }
  .detail-info { padding: 16px; }
  .detail-links { grid-template-columns: 1fr; }
  .axis-preview { padding: 12px; }
  .axis-preview-head { display: grid; }
  .axis-preview-options { justify-content: flex-start; }
  .axis-zoom-control { grid-template-columns: 15px minmax(70px, 1fr) 38px; }
}

html[data-theme='day'] {
  color-scheme: light;
  --bg: #edf3f4;
  --surface: #ffffff;
  --surface-raised: #e7eff1;
  --surface-input: rgba(255, 255, 255, .92);
  --line: #aab9bd;
  --line-soft: #d5e0e3;
  --text: #17282d;
  --muted: #62777e;
  --muted-strong: #354b52;
  --red: #c93740;
  --red-hover: #df4650;
  --gold: #9d7428;
  --cyan: #177f83;
  --green: #22845f;
  background: var(--bg);
  color: var(--text);
}

html[data-theme='day'] body { background: var(--bg); color: var(--text); }
html[data-theme='day'] .site-header { border-color: #cedadd; background: rgba(248, 251, 252, .96); }
html[data-theme='day'] .brand { color: #17282d; }
html[data-theme='day'] .brand small { color: #65787f; }
html[data-theme='day'] .theme-toggle,
html[data-theme='day'] .motion-toggle,
html[data-theme='day'] .language-control,
html[data-theme='day'] .submission-help-button { border-color: #a8b8bd; background: #f7fafb; color: #425b63; }
html[data-theme='day'] .theme-toggle:hover,
html[data-theme='day'] .theme-toggle:focus-visible,
html[data-theme='day'] .motion-toggle:hover,
html[data-theme='day'] .motion-toggle:focus-visible,
html[data-theme='day'] .language-control:hover,
html[data-theme='day'] .language-control:focus-within,
html[data-theme='day'] .submission-help-button:hover,
html[data-theme='day'] .submission-help-button:focus-visible { border-color: #698087; background: #e7eff1; color: #15272d; }
html[data-theme='day'] .motion-toggle[aria-checked='true'] { border-color: #9b722c; background: #fff4d8; color: #7f5714; }
html[data-theme='day'] .submission-help-tooltip { border-color: #9dafb4; background: #ffffff; color: #40565d; box-shadow: 0 18px 48px rgba(45, 69, 76, .24); }
html[data-theme='day'] .submission-help-tooltip::before { border-color: #9dafb4; background: #ffffff; }
html[data-theme='day'] .submission-help-tooltip strong { color: #17282d; }
html[data-theme='day'] .submission-help-tooltip code,
html[data-theme='day'] .submission-help-tooltip b { color: #8b5e14; }

html[data-theme='day'] .search-band { border-color: #aebfc4; background: #dce8eb; }
html[data-theme='day'] .search-band::before { background: rgba(238, 246, 247, .28); }
html[data-theme='day'] .hero-spine-layer,
html[data-theme='day'] .hero-spine-layer.is-ready { background: #dce8eb url('assets/day-hero.webp') center 46% / min(900px, 82vw) auto no-repeat; opacity: .9; }
html[data-theme='day'] #heroSpine { inset: -86% -4% -114%; transform: translateY(-4%); }
html[data-theme='day'] h1 { color: #142a31; text-shadow: 0 1px 5px rgba(255,255,255,.95); }
html[data-theme='day'] .eyebrow { color: #b52d37; }
html[data-theme='day'] .index-status { color: #40575f; text-shadow: 0 1px 4px rgba(255,255,255,.9); }
html[data-theme='day'] .status-dot { box-shadow: 0 0 0 4px rgba(157, 116, 40, .17); }
html[data-theme='day'] .search-field,
html[data-theme='day'] .select-field,
html[data-theme='day'] .character-picker-trigger { border-color: #91a6ac; background: rgba(255,255,255,.94); box-shadow: 0 5px 18px rgba(51, 78, 87, .12); color: #17282d; }
html[data-theme='day'] .search-field input { color: #17282d; }
html[data-theme='day'] .search-field input::placeholder { color: #6d8188; }
html[data-theme='day'] .select-field select { color: #17282d; }
html[data-theme='day'] .select-field option { background: #ffffff; color: #17282d; }
html[data-theme='day'] .clear-search:hover { background: #e6eef0; color: #17282d; }

html[data-theme='day'] .results-band { background: #edf3f4; }
html[data-theme='day'] .tag-button,
html[data-theme='day'] .reset-button,
html[data-theme='day'] .empty-state button { border-color: #b2c0c4; background: #ffffff; color: #40555c; }
html[data-theme='day'] .tag-button:hover,
html[data-theme='day'] .reset-button:hover,
html[data-theme='day'] .empty-state button:hover { border-color: #71868d; background: #e8f0f2; color: #17282d; }
html[data-theme='day'] .tag-button.active { border-color: #c93740; background: #c93740; color: #ffffff; }
html[data-theme='day'] .combo-card { border-color: #d0dcdf; background: #ffffff; box-shadow: 0 6px 18px rgba(51, 75, 82, .06); }
html[data-theme='day'] .combo-card:hover { border-color: #9daeb3; background: #fbfdfd; }
html[data-theme='day'] .combo-card h3 { color: #17282d; }
html[data-theme='day'] .characters { color: #137a80; }
html[data-theme='day'] .combo-tag { border-color: #9dafb4; background: #edf4f5; color: #314950; }
html[data-theme='day'] .combo-meta dt,
html[data-theme='day'] .card-submitter > span { color: #708289; }
html[data-theme='day'] .combo-meta dd,
html[data-theme='day'] .card-submitter strong { color: #354b52; }
html[data-theme='day'] .card-submitter small { color: #6a7e85; }
html[data-theme='day'] .combo-actions { border-color: #d8e2e4; background: #f5f9fa; }
html[data-theme='day'] .card-character-avatar { border-color: #f5f9fa; background: #dde8ea; box-shadow: 0 2px 7px rgba(44, 68, 75, .2); }

html[data-theme='day'] .modal-backdrop { background: rgba(40, 59, 65, .48); }
html[data-theme='day'] .character-picker-dialog,
html[data-theme='day'] .detail-dialog { border-color: #91a5ab; background: #ffffff; box-shadow: 0 28px 90px rgba(29, 49, 55, .34); }
html[data-theme='day'] .modal-header { border-color: #cdd9dc; }
html[data-theme='day'] .icon-button { border-color: #aebdc1; background: #edf3f4; color: #22373e; }
html[data-theme='day'] .icon-button:hover { border-color: #75898f; background: #dfe9eb; }
html[data-theme='day'] .picker-toolbar,
html[data-theme='day'] .modal-footer { border-color: #d4dfe2; background: #f2f7f8; }
html[data-theme='day'] .picker-search { border-color: #adbdc1; background: #ffffff; }
html[data-theme='day'] .picker-search input { color: #17282d; }
html[data-theme='day'] .character-option { border-color: #bcc9cd; background: #f4f8f9; color: #17282d; }
html[data-theme='day'] .character-option:hover { border-color: #7b9096; background: #e8f0f2; }
html[data-theme='day'] .character-option.selected { border-color: #cc3c45; background: #fdeced; box-shadow: inset 0 0 0 1px rgba(204,60,69,.24); }
html[data-theme='day'] .character-option img,
html[data-theme='day'] .character-option .avatar-fallback { border-color: #a9b9bd; background: #dfe8ea; }
html[data-theme='day'] .modal-footer button,
html[data-theme='day'] .secondary-button { border-color: #afbec2; background: #edf3f4; color: #243a41; }
html[data-theme='day'] .secondary-button:hover,
html[data-theme='day'] .modal-footer button:hover { border-color: #758a90; background: #dfe9eb; }
html[data-theme='day'] .primary-button { border-color: #d64a53; background: #c93740; color: #ffffff; }

html[data-theme='day'] .detail-info { border-color: #d4dfe1; background: #ffffff; }
html[data-theme='day'] .detail-character { border-color: #bdcacc; background: #eef4f5; }
html[data-theme='day'] .detail-tag { border-color: #9dafb4; color: #40575f; }
html[data-theme='day'] .detail-meta { border-color: #cbd7da; background: #cbd7da; }
html[data-theme='day'] .detail-meta > div { background: #f5f8f9; }
html[data-theme='day'] .detail-meta dt,
html[data-theme='day'] .detail-section h3 { color: #6a7e84; }
html[data-theme='day'] .detail-meta dd { color: #17282d; }
html[data-theme='day'] .detail-section p { color: #40565d; }

html[data-theme='day'] .axis-preview-panel { background: #e7eff1; }
html[data-theme='day'] .axis-preview-head { border-color: #c8d5d8; background: #f8fbfb; }
html[data-theme='day'] .axis-preview-head p { color: #667a81; }
html[data-theme='day'] .axis-zoom-control,
html[data-theme='day'] .axis-icon-set { border-color: #a9b8bc; background: #eef4f5; color: #40575f; }
html[data-theme='day'] .axis-icon-set button { color: #657980; }
html[data-theme='day'] .axis-icon-set button:hover { color: #17282d; }
html[data-theme='day'] .axis-icon-set button.active { background: #577078; color: #ffffff; }
html[data-theme='day'] .experimental-badge { border-color: #b58a3b; color: #835e17; background: #fff7e5; }
html[data-theme='day'] .axis-preview { background-color: #edf3f4; background-image: linear-gradient(rgba(53,78,86,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(53,78,86,.08) 1px, transparent 1px); }
html[data-theme='day'] .axis-flow { border-color: #b7c6ca; background: rgba(255,255,255,.92); }
html[data-theme='day'] .axis-step { border-color: color-mix(in srgb, var(--role-color), #455d65 24%); background: color-mix(in srgb, var(--role-color), #ffffff 84%); }
html[data-theme='day'] .axis-action { color: #17282d; }
html[data-theme='day'] .axis-group-head span { color: #687c83; }
html[data-theme='day'] .axis-empty { color: #60757c; }
html[data-theme='day'] .empty-state { border-color: #aebec2; color: #63777e; }

@media (max-width: 520px) {
  html[data-theme='day'] #heroSpine { inset: -40% -72% -34%; transform: translateY(-3%); }
  html[data-theme='day'] .hero-spine-layer,
  html[data-theme='day'] .hero-spine-layer.is-ready { background-size: 150% auto; opacity: .82; }
}
