:root {
  color-scheme: light;
  --accent: #ffa436;
  --accent-hover: #e6922a;
  --bg: color-mix(in srgb, var(--accent) 4%, #fffaf4);
  --panel: color-mix(in srgb, var(--accent) 4%, #ffffff);
  --panel-muted: color-mix(in srgb, var(--accent) 12%, #ffffff);
  --border: color-mix(in srgb, var(--accent) 26%, #d7dee8);
  --text: #152033;
  --muted: #66758c;
  --ok: #147d54;
  --warn: #ad5f00;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: color-mix(in srgb, var(--accent) 5%, #090d17);
  --panel: color-mix(in srgb, var(--accent) 7%, #0d1320);
  --panel-muted: color-mix(in srgb, var(--accent) 13%, #111827);
  --border: color-mix(in srgb, var(--accent) 35%, #23314a);
  --text: #f8fbff;
  --muted: #a9b7cc;
  --ok: #4fd18f;
  --warn: #ffb454;
  --shadow: 0 18px 44px rgba(2, 6, 23, 0.38);
}

:root[data-accent="rose"] { --accent: #f5276c; --accent-hover: #ff5a8f; }
:root[data-accent="orange"] { --accent: #f54927; --accent-hover: #ff6d4f; }
:root[data-accent="maple"] { --accent: #ffa436; --accent-hover: #ffb85f; }
:root[data-accent="sprout"] { --accent: #d3f527; --accent-hover: #e1ff5a; }
:root[data-accent="cyan"] { --accent: #27f5b0; --accent-hover: #63ffd0; }
:root[data-accent="blue"] { --accent: #276cf5; --accent-hover: #5d92ff; }
:root[data-accent="purple"] { --accent: #b027f5; --accent-hover: #c45dff; }

* { box-sizing: border-box; }
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 70%, var(--muted)) var(--panel-muted);
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--panel-muted); border-radius: 8px; }
*::-webkit-scrollbar-thumb {
  border: 2px solid var(--panel-muted);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 70%, var(--muted));
}
*::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, p { margin-top: 0; }
table { width: 100%; border-collapse: collapse; background: transparent; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

.site-header {
  position: fixed;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
.site-header__left, .theme-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}
.site-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}
.site-nav, .theme-tools { display: flex; gap: 4px; align-items: center; }
.site-nav a, .icon-button {
  min-width: 38px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.site-nav a {
  padding: 0 12px;
  font-size: 14px;
}
.icon-button {
  width: 36px;
  padding: 0;
}
.site-nav a:hover, .icon-button:hover { background: var(--panel-muted); color: var(--text); }
.page-download .site-nav a[href="/"],
.page-stats .site-nav a[href="/stats"],
.page-about .site-nav a[href="/about"],
.page-api-docs .site-nav a[href="/api-docs"] {
  background: var(--panel-muted);
  color: var(--text);
}
.site-nav svg, .icon-button svg { width: 18px; height: 18px; color: currentColor; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.site-nav svg *, .icon-button svg * { fill: none; stroke: currentColor; }
.page-loading-bar {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  width: 0;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 80%, transparent);
  opacity: 0;
  transition: width .22s ease, opacity .18s ease;
}
.page-loading-bar.is-loading { width: 82%; opacity: 1; }
.theme-tools { position: relative; }
.palette-menu {
  position: absolute;
  right: 0;
  top: 46px;
  display: grid;
  gap: 6px;
  min-width: 148px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.palette-menu[hidden] { display: none; }
.palette-choice { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--text); padding: 8px; border-radius: 8px; cursor: pointer; font: inherit; }
.palette-choice:hover { background: var(--panel-muted); }
.palette-choice.is-active {
  background: var(--panel-muted);
  outline: 2px solid color-mix(in srgb, var(--accent) 78%, transparent);
  outline-offset: 1px;
}
.palette-choice span { width: 18px; height: 18px; border-radius: 999px; border: 1px solid color-mix(in srgb, #000 18%, transparent); }
.palette-choice b { font-size: 13px; font-weight: 600; }

.site-main { flex: 1; width: min(90vw, 1480px); margin: 0 auto; padding: 82px 0 44px; }
.page-title-row { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title-row h1 { margin-bottom: 0; font-size: 34px; line-height: 1.15; }
.page-subtitle { margin-bottom: 0; color: var(--muted); font-size: 16px; }
.theme-toggle, .download-button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #140f08;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
.download-button:disabled { opacity: .6; cursor: not-allowed; }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.sub { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.status { margin: 0 0 20px; padding: 14px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); box-shadow: var(--shadow); }
.status[hidden] { display: none; }
.page-intro { max-width: 760px; color: var(--muted); }
.panel-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.site-footer {
  width: min(90vw, 1480px);
  margin: 0 auto 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer div, .site-footer a { display: inline-flex; align-items: center; gap: 6px; }
.site-footer svg { width: 15px; height: 15px; color: var(--accent); fill: currentColor; }
@media (max-width: 760px) {
  .site-header {
    position: sticky;
    inset: auto;
    top: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 8px;
    background: var(--bg);
    pointer-events: auto;
  }
  .site-header__left {
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
    padding: 7px;
  }
  .theme-tools {
    flex: 0 0 auto;
    gap: 4px;
    padding: 7px;
  }
  .site-brand { gap: 7px; }
  .site-brand span { max-width: 74px; overflow: hidden; text-overflow: ellipsis; }
  .site-nav { flex: 0 1 auto; min-width: 0; }
  .site-nav a { min-width: 32px; width: 32px; height: 32px; padding: 0; }
  .icon-button { width: 32px; height: 32px; }
  .site-nav span { display: none; }
  .site-main { padding-top: 20px; }
  .site-footer { align-items: flex-start; flex-direction: column; margin-top: 0; }
}
