:root {
  color-scheme: dark;
  --bg: #0d1117;
  --surface: #21262d;
  --panel: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --button: #1f6feb;
  --hover: #388bfd;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
}
html[data-theme="light"] { color-scheme: light; --bg: #f9f9f9; --surface: #fff; --panel: #f6f8fa; --border: #d1d9e0; --text: #1f2328; --muted: #59636e; --accent: #0969da; --button: #0969da; --hover: #0860ca; }
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--text); margin: 0; padding-top: 64px; }
button, input, select { font: inherit; }
button, select, input { color: var(--text); border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
button { cursor: pointer; padding: 8px 15px; font-size: 13px; transition: background .15s, border-color .15s; }
button:hover { background: var(--panel); border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--button); color: #fff; }
button.primary:hover { background: var(--hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); text-underline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#info { font-size: 12px; color: var(--muted); }
#versionInfo { margin: 4px 0 10px !important; }
main { max-width: 1800px; margin: auto; padding: 0 24px; }
.page-intro { text-align: center; padding: 22px 0 18px; }
.eyebrow { margin: 0 0 4px; font-size: 11px; color: var(--accent); letter-spacing: .12em; }
h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: 0; }
.search-row { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 0 auto 20px; }
.search-field { display: block; flex: 0 1 280px; min-width: 100px; }
.category-field { display: flex; align-items: center; }
.search-field input { width: 100%; height: 36px; padding: 0 14px; font-size: 14px; }
.filter-row { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 13px 0 20px; }
.filter-row label { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
select { min-height: 34px; padding: 4px 26px 4px 10px; font-size: 12px; }
#result-count { color: var(--muted); font-size: 12px; }
.catalog-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 20px; }
.mark-card { width: 329px; max-width: 100%; aspect-ratio: 329 / 137; flex-shrink: 0; position: relative; margin-top: 6px; box-shadow: none; user-select: none; }
.mark-card:hover { z-index: 2; }
.card-visual { width: 100%; height: 100%; position: relative; display: flex; align-items: center; justify-content: center; background: transparent center / 100% 100% no-repeat; border-radius: 8px; }
.card-name { position: absolute; top: 3px; left: 8px; right: 55px; font-size: 12px; font-family: "方正兰亭黑", "PingFang SC", "Microsoft YaHei", sans-serif; color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 2px 2px 4px #000e; z-index: 3; }
.card-icon { width: 176px; height: 74px; max-width: 100%; object-fit: contain; pointer-events: none; z-index: 1; }
.card-placeholder { position: absolute; inset: 40% 0 0; color: #b4b0b8; font-size: 12px; text-align: center; }
.card-preview { position: absolute; right: 10px; bottom: 8px; width: 43px; height: 23px; border: 0; border-radius: 0; background: transparent center / 100% 100% no-repeat; padding: 0; z-index: 4; }
.card-preview:hover { background-color: transparent; }
#paginationControls.pagination-wrapper { padding: 20px 0 4px; color: var(--text); }
#paginationControls .btn-link { background: var(--surface); border-color: var(--border); color: var(--accent) !important; }
#paginationControls .btn-link:hover:not(:disabled) { background: var(--panel); }
#paginationControls .btn-link:disabled { background: var(--panel); color: var(--muted) !important; }
#paginationControls .btn-link.active-page { background: var(--button) !important; color: #fff !important; border-color: var(--button) !important; opacity: 1; }
#paginationControls .page-input { background: var(--surface); color: var(--text); border-color: var(--border); }
#paginationControls :is(.section-label, .total-count, .page-total-label) { color: var(--muted); }
#paginationControls :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.status-message { border: 1px solid var(--border); padding: 32px 16px; text-align: center; border-radius: 10px; color: var(--muted); }
.status-message button { margin-left: 12px; }
dialog { color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 22px; width: min(1110px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow-y: auto; overscroll-behavior: contain; box-shadow: none; }
dialog::backdrop { background: rgba(1, 4, 9, .48); backdrop-filter: none; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.dialog-toolbar h2 { margin: 0; font-size: 20px; }
#preview-meta { margin: 5px 0 0; font-size: 11px; color: var(--muted); }
#close-preview { flex-shrink: 0; }
.player-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 20px 0 16px; }
.check-label { font-size: 12px; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
input[type="checkbox"], input[type="range"] { accent-color: var(--accent); }
.view-tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.view-tabs button { border: 0; border-radius: 0; color: var(--muted); background: none; border-bottom: 2px solid transparent; }
.view-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.native-wrap { position: relative; margin: auto; width: 100%; max-width: 1000px; overflow: hidden; }
.native-popup { position: relative; width: 1000px; height: 607px; transform-origin: top left; color: #d2d2d2; background: transparent; }
.native-layer, .native-label, .native-button { position: absolute; }
.native-layer { pointer-events: none; }
.native-title { font-weight: 700; font-size: 14px; color: #ffd146; text-align: center; line-height: 21px; margin: 0; }
.native-button { background: transparent center / 100% 100% no-repeat; padding: 0; border: 0; border-radius: 0; color: #e4e0e8; font-size: 11px; font-weight: 600; line-height: 1; }
.native-button:hover { background-color: transparent; }
.native-label { font-size: 9px; text-align: center; line-height: 18px; }
.preview-slot { position: absolute; width: 309px; height: 129px; overflow: visible; }
.preview-slot-bg { position: absolute; inset: 0; width: 309px; height: 129px; }
.slot-title { position: absolute; left: 7px; top: 5px; width: 260px; height: 16px; color: #d2d2d2; font-size: 10px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; line-height: 16px; z-index: 3; }
.slot-asset { position: absolute; object-fit: fill; transform-origin: center; pointer-events: none; opacity: 1; z-index: 2; }
.slot-sprite { position: absolute; pointer-events: none; z-index: 1; isolation: isolate; }
.sprite-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; mix-blend-mode: plus-lighter; }
.overlay-sprite { transform-origin: center; mix-blend-mode: normal; filter: none; opacity: 1; }
.slot-play { position: absolute; left: 261px; top: 99px; width: 43px; height: 23px; border: 0; background-color: transparent; background-size: 100% 100%; padding: 0; border-radius: 0; z-index: 4; }
.slot-play:hover { background-color: transparent; }
.slot-play-fx { position: absolute; left: 262px; top: 99px; width: 41px; height: 23px; pointer-events: none; background-size: 164px 92px; z-index: 5; }
.slot-missing { position: absolute; inset: 46px 0 auto; text-align: center; color: #ada8b4; font-size: 11px; z-index: 3; }
.slot-fallback { position: absolute; left: 7px; bottom: 8px; font-size: 9px; color: #a5a1ac; z-index: 3; }
.event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 9px; }
.event-cell { width: 100%; position: relative; aspect-ratio: 309 / 129; overflow: hidden; background: transparent; border-radius: 6px; }
.event-cell .preview-slot { top: 0; left: 0; transform-origin: top left; }
.preview-status { margin: 10px 0; color: var(--muted); font-size: 11px; }
@media (max-width: 860px) {
  body { padding-top: 56px; }
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-bar { gap: 10px; }
}
@media (max-width: 540px) {
  main { padding-left: 14px; padding-right: 14px; }
  .page-intro { padding: 20px 0 15px; }
  h1 { font-size: 20px; }
  .search-field input { font-size: 16px; }
  .filter-row { gap: 10px; padding: 14px 0 20px; }
  #result-count { width: 100%; margin: 0; }
  .filter-row label { gap: 6px; }
  .catalog-grid { gap: 10px; }
  .card-icon { width: min(208px, 58vw); height: auto; max-height: 64%; }
  dialog { padding: 12px; width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .dialog-toolbar h2 { font-size: 17px; }
  .player-bar button { min-height: 38px; }
  .event-grid { grid-template-columns: 1fr; }
  .native-popup { background: transparent; }
  .native-popup > .native-layer, .native-popup > .native-title, .native-popup > .native-button, .native-popup > .native-label { display: none; }
  .native-popup { width: 100%; height: auto; transform: none !important; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; justify-items: center; }
  .native-popup > .preview-slot { position: relative; left: auto !important; top: auto !important; margin: 0; }
  .native-wrap { height: auto !important; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 768px) {
  .search-row { margin-bottom: 12px; }
  #paginationControls.pagination-wrapper { padding: 0 0 14px; }
}

/* Shared site scripts own the top navigation, theme, controls and mobile state. */
.page-title-source, #changelog-button { display: none !important; }
body.mark-page #changelog-button { display: none !important; }
main { padding-bottom: 24px; }
.mark-page .page-intro { padding: 14px 0 12px; }
#catalog-grid .card-icon { width: 176px !important; height: 74px !important; max-width: 100% !important; }
#catalog-grid .mark-card-base .card-icon { width: 202px !important; height: 86px !important; }
#catalog-grid .card-preview { width: 43px !important; height: 23px !important; min-width: 43px !important; min-height: 23px !important; background-color: transparent !important; border: 0 !important; }
#preview-dialog { background: var(--bg) !important; color: var(--text) !important; }
#preview-dialog, #preview-dialog::backdrop { box-shadow: none !important; }
#preview-dialog .native-button, #preview-dialog .slot-play { background-color: transparent !important; border: none !important; box-shadow: none !important; }
#preview-dialog .slot-play { width: 43px !important; height: 23px !important; min-height: 0 !important; padding: 0 !important; z-index: 6; }
#preview-dialog .slot-play-fx { z-index: 7; }
#preview-dialog .slot-title, #preview-dialog .slot-fallback, #preview-dialog .slot-missing { z-index: 5; }
#preview-dialog img { max-width: none !important; }
#preview-dialog .sprite-frame { width: 100% !important; height: 100% !important; }
#preview-dialog .preview-slot-bg { width: 309px !important; height: 129px !important; }
#preview-dialog .slot-extra { position: absolute; pointer-events: none; object-fit: fill; z-index: 3; transform-origin: center; }
#preview-dialog .weapon-effects .overlay-sprite { z-index: 3; }
#preview-dialog .weapon-effects .slot-asset { z-index: 2; }
#preview-dialog .player-bar button { background: var(--surface) !important; color: var(--text) !important; }
#preview-dialog .player-bar .primary { background: var(--button) !important; color: white !important; }
#preview-dialog .view-tabs button { background: transparent !important; color: var(--muted) !important; }
#preview-dialog .view-tabs button[aria-selected='true'] { color: var(--accent) !important; }
#badge-control { font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 540px) {
  .search-row { flex-wrap: wrap; }
  .search-field { flex: 1 1 160px; }
  .category-field { width: 100%; justify-content: center; }
  #catalog-grid .card-icon { width: min(176px, 52vw) !important; height: 74px !important; max-height: 64% !important; }
  #catalog-grid .mark-card-base .card-icon { width: min(202px, 58vw) !important; height: 86px !important; }
  #preview-dialog .player-bar button { min-height: 38px; }
}
