:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #fbfcfe;
  --ink: #111827;
  --muted: #4b5563;
  --line: #dde5ef;
  --line-strong: #cfd8e3;
  --accent: #1d4ed8;
  --accent-rgb: 29, 78, 216;
  --accent-soft: #dbeafe;
  --page-tint-rgb: 233, 242, 255;
  --header-bg: rgba(255, 255, 255, 0.84);
  --header-line: rgba(230, 235, 242, 0.9);
  --brand-start: #1d4ed8;
  --brand-end: #3b82f6;
  --theme-menu-bg: rgba(255, 255, 255, 0.96);
  --success: #16a34a;
  --shadow: 0 18px 45px rgba(24, 39, 75, 0.06);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max: 1320px;
  --ui: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

body[data-theme="cream"] {
  --bg: #faf5ee;
  --panel: #fffdf8;
  --panel-soft: #fffbf3;
  --ink: #2f2417;
  --muted: #6d5c45;
  --line: #eadfca;
  --line-strong: #ddceb2;
  --accent: #b7791f;
  --accent-rgb: 183, 121, 31;
  --accent-soft: #f9ebcb;
  --page-tint-rgb: 250, 234, 201;
  --header-bg: rgba(255, 250, 242, 0.9);
  --header-line: rgba(234, 223, 202, 0.92);
  --brand-start: #c78828;
  --brand-end: #e7b454;
  --theme-menu-bg: rgba(255, 252, 246, 0.97);
}

body[data-theme="mint"] {
  --bg: #f3f8f6;
  --panel: #fbfffd;
  --panel-soft: #f6fcf8;
  --ink: #17332f;
  --muted: #4a6660;
  --line: #d6e5dd;
  --line-strong: #bfd4ca;
  --accent: #0f766e;
  --accent-rgb: 15, 118, 110;
  --accent-soft: #d8f0ea;
  --page-tint-rgb: 214, 240, 229;
  --header-bg: rgba(248, 255, 252, 0.88);
  --header-line: rgba(214, 229, 221, 0.92);
  --brand-start: #148076;
  --brand-end: #2fb9a9;
  --theme-menu-bg: rgba(249, 255, 252, 0.97);
}

body[data-theme="sakura"] {
  --bg: #fbf4f7;
  --panel: #fffdfd;
  --panel-soft: #fff8fa;
  --ink: #3a1d2a;
  --muted: #735160;
  --line: #ecd8e1;
  --line-strong: #ddc1cf;
  --accent: #c2417a;
  --accent-rgb: 194, 65, 122;
  --accent-soft: #f8dbe8;
  --page-tint-rgb: 248, 220, 233;
  --header-bg: rgba(255, 250, 252, 0.9);
  --header-line: rgba(236, 216, 225, 0.92);
  --brand-start: #c8528a;
  --brand-end: #f28fb6;
  --theme-menu-bg: rgba(255, 250, 252, 0.97);
}

body[data-theme="slate"] {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --ink: #1f2937;
  --muted: #556171;
  --line: #d8e0ea;
  --line-strong: #c3cedb;
  --accent: #475569;
  --accent-rgb: 71, 85, 105;
  --accent-soft: #e2e8f0;
  --page-tint-rgb: 220, 228, 239;
  --header-bg: rgba(250, 252, 255, 0.88);
  --header-line: rgba(216, 224, 234, 0.92);
  --brand-start: #516175;
  --brand-end: #94a3b8;
  --theme-menu-bg: rgba(251, 252, 255, 0.97);
}

body[data-theme="xuan"] {
  --bg: #0f1216;
  --panel: #171c22;
  --panel-soft: #1d232b;
  --ink: #edf2f7;
  --muted: #97a3b0;
  --line: #2a313a;
  --line-strong: #36404c;
  --accent: #8aa0b7;
  --accent-rgb: 138, 160, 183;
  --accent-soft: #24303d;
  --page-tint-rgb: 28, 34, 41;
  --header-bg: rgba(10, 13, 17, 0.88);
  --header-line: rgba(48, 56, 66, 0.94);
  --brand-start: #20262d;
  --brand-end: #566372;
  --theme-menu-bg: rgba(17, 21, 27, 0.98);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

body[data-theme="qinghui"] {
  --bg: #f2f5f4;
  --panel: #fbfdfc;
  --panel-soft: #f5f8f7;
  --ink: #203234;
  --muted: #5b6e71;
  --line: #d8e2e0;
  --line-strong: #c1d0cc;
  --accent: #5f7d83;
  --accent-rgb: 95, 125, 131;
  --accent-soft: #deeceb;
  --page-tint-rgb: 220, 230, 228;
  --header-bg: rgba(249, 252, 251, 0.9);
  --header-line: rgba(216, 226, 224, 0.94);
  --brand-start: #5f7d83;
  --brand-end: #8ea4a7;
  --theme-menu-bg: rgba(250, 253, 252, 0.98);
}

body[data-theme="yuebai"] {
  --bg: #f7f9fb;
  --panel: #ffffff;
  --panel-soft: #fbfdff;
  --ink: #213547;
  --muted: #637283;
  --line: #dbe4ec;
  --line-strong: #c7d3df;
  --accent: #7d9ab8;
  --accent-rgb: 125, 154, 184;
  --accent-soft: #e7f0f8;
  --page-tint-rgb: 229, 238, 247;
  --header-bg: rgba(252, 254, 255, 0.92);
  --header-line: rgba(219, 228, 236, 0.94);
  --brand-start: #88a7c6;
  --brand-end: #b5cce2;
  --theme-menu-bg: rgba(252, 254, 255, 0.98);
}

body[data-theme="dailan"] {
  --bg: #eef2f7;
  --panel: #fbfcfe;
  --panel-soft: #f6f8fb;
  --ink: #1c2940;
  --muted: #54647f;
  --line: #d5dde8;
  --line-strong: #becadb;
  --accent: #425678;
  --accent-rgb: 66, 86, 120;
  --accent-soft: #dde5f2;
  --page-tint-rgb: 214, 223, 238;
  --header-bg: rgba(249, 251, 254, 0.9);
  --header-line: rgba(213, 221, 232, 0.94);
  --brand-start: #405373;
  --brand-end: #7188a8;
  --theme-menu-bg: rgba(251, 252, 255, 0.98);
}

body[data-theme="chijin"] {
  --bg: #fbf5ef;
  --panel: #fffdf9;
  --panel-soft: #fff8f1;
  --ink: #3b241a;
  --muted: #7b5948;
  --line: #ecdacb;
  --line-strong: #dec0a8;
  --accent: #bd7f36;
  --accent-rgb: 189, 127, 54;
  --accent-soft: #f5e3c8;
  --page-tint-rgb: 246, 224, 197;
  --header-bg: rgba(255, 250, 245, 0.92);
  --header-line: rgba(236, 218, 203, 0.94);
  --brand-start: #b56735;
  --brand-end: #e0b261;
  --theme-menu-bg: rgba(255, 251, 247, 0.98);
}

body[data-theme="zhusha"] {
  --bg: #faf2f1;
  --panel: #fffdfc;
  --panel-soft: #fff7f6;
  --ink: #3f2323;
  --muted: #7d5652;
  --line: #ecd8d4;
  --line-strong: #dbbcb5;
  --accent: #b84139;
  --accent-rgb: 184, 65, 57;
  --accent-soft: #f6ddd9;
  --page-tint-rgb: 243, 220, 216;
  --header-bg: rgba(255, 250, 249, 0.92);
  --header-line: rgba(236, 216, 212, 0.94);
  --brand-start: #b53d36;
  --brand-end: #de7a66;
  --theme-menu-bg: rgba(255, 250, 249, 0.98);
}

body[data-theme="qinghuaci"] {
  --bg: #f4f8fb;
  --panel: #fcfeff;
  --panel-soft: #f7fbfe;
  --ink: #21384d;
  --muted: #5f7590;
  --line: #d9e4ee;
  --line-strong: #c4d3e1;
  --accent: #3f6f9c;
  --accent-rgb: 63, 111, 156;
  --accent-soft: #ddebfa;
  --page-tint-rgb: 220, 234, 246;
  --header-bg: rgba(251, 254, 255, 0.92);
  --header-line: rgba(217, 228, 238, 0.94);
  --brand-start: #36658f;
  --brand-end: #7eacd5;
  --theme-menu-bg: rgba(252, 255, 255, 0.98);
}

body[data-theme="shilv"] {
  --bg: #f1f7f3;
  --panel: #fbfefc;
  --panel-soft: #f5fbf7;
  --ink: #1f352d;
  --muted: #547066;
  --line: #d8e5dc;
  --line-strong: #bfd2c4;
  --accent: #4f8a6b;
  --accent-rgb: 79, 138, 107;
  --accent-soft: #ddefe3;
  --page-tint-rgb: 218, 236, 224;
  --header-bg: rgba(249, 253, 250, 0.92);
  --header-line: rgba(216, 229, 220, 0.94);
  --brand-start: #4b8a69;
  --brand-end: #89bc9f;
  --theme-menu-bg: rgba(250, 254, 251, 0.98);
}

body[data-theme="liujin"] {
  --bg: #fbf7ee;
  --panel: #fffdf9;
  --panel-soft: #fffaf2;
  --ink: #362816;
  --muted: #766349;
  --line: #ecdfc7;
  --line-strong: #dbc7a0;
  --accent: #c49a45;
  --accent-rgb: 196, 154, 69;
  --accent-soft: #f7ebc9;
  --page-tint-rgb: 246, 233, 199;
  --header-bg: rgba(255, 252, 246, 0.94);
  --header-line: rgba(236, 223, 199, 0.94);
  --brand-start: #b88934;
  --brand-end: #e2c479;
  --theme-menu-bg: rgba(255, 253, 248, 0.99);
}

body[data-theme="zheshi"] {
  --bg: #f8f2ec;
  --panel: #fffdfa;
  --panel-soft: #fff8f3;
  --ink: #3d2d21;
  --muted: #72584a;
  --line: #e8d9cb;
  --line-strong: #d7bea9;
  --accent: #9e6540;
  --accent-rgb: 158, 101, 64;
  --accent-soft: #f2e0d1;
  --page-tint-rgb: 239, 222, 206;
  --header-bg: rgba(255, 251, 247, 0.93);
  --header-line: rgba(232, 217, 203, 0.94);
  --brand-start: #9e6540;
  --brand-end: #c49167;
  --theme-menu-bg: rgba(255, 252, 248, 0.99);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}
body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(var(--page-tint-rgb), 0.72), rgba(var(--page-tint-rgb), 0) 180px),
    var(--bg);
  color: var(--ink);
  font: 16px/1.75 var(--ui);
}

body[data-theme="xuan"] {
  color-scheme: dark;
}

body[data-theme="xuan"] .theme-trigger,
body[data-theme="xuan"] .section-toggle,
body[data-theme="xuan"] #clear-search,
body[data-theme="xuan"] .keyword-chip,
body[data-theme="xuan"] .recent-toggle,
body[data-theme="xuan"] .recent-item,
body[data-theme="xuan"] .symbol-card,
body[data-theme="xuan"] .toolbar-search input {
  background: #1a2027;
  color: var(--ink);
  border-color: #313a45;
}

body[data-theme="xuan"] .theme-trigger {
  background: rgba(21, 26, 32, 0.94);
}

body[data-theme="xuan"] .theme-trigger-caret,
body[data-theme="xuan"] .toolbar-search input::placeholder {
  color: #7f8b99;
}

body[data-theme="xuan"] .theme-menu {
  background:
    linear-gradient(180deg, rgba(20, 24, 30, 0.98), rgba(14, 18, 23, 0.98));
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

body[data-theme="xuan"] .theme-option-swatch {
  border-color: rgba(19, 24, 30, 0.94);
  box-shadow:
    0 0 0 1px rgba(118, 130, 145, 0.24),
    0 4px 10px rgba(0, 0, 0, 0.18);
}

body[data-theme="xuan"] .sidebar-origin-head {
  background:
    linear-gradient(180deg, rgba(25, 31, 38, 0.98), rgba(20, 25, 31, 0.96));
}

body[data-theme="xuan"] .sidebar-origin-rail {
  background:
    linear-gradient(180deg, rgba(34, 41, 50, 0.98), rgba(24, 29, 36, 0.98)),
    linear-gradient(180deg, rgba(138, 160, 183, 0.08), rgba(138, 160, 183, 0));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28);
}

body[data-theme="xuan"] .sidebar-origin-rail::before {
  background: linear-gradient(180deg, #475363 0%, #313b47 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.04),
    inset 0 -1px 1px rgba(0, 0, 0, 0.36);
}

body[data-theme="xuan"] .sidebar-origin-thumb {
  border-color: rgba(96, 110, 126, 0.92);
  background:
    linear-gradient(180deg, rgba(68, 79, 92, 0.98), rgba(41, 49, 58, 0.98));
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.24),
    0 2px 6px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body[data-theme="xuan"] .sidebar-origin-thumb::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
}

body[data-theme="xuan"] .sidebar-origin-thumb.dragging,
body[data-theme="xuan"] .sidebar-origin-rail:hover .sidebar-origin-thumb {
  border-color: rgba(118, 135, 154, 0.96);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.28),
    0 3px 8px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body[data-theme="xuan"] .sidebar-origin-link {
  color: #d8e0ea;
}

body[data-theme="xuan"] .sidebar-origin-icon {
  border-color: rgba(73, 84, 98, 0.88);
  background:
    linear-gradient(180deg, rgba(39, 47, 57, 0.98), rgba(28, 34, 42, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 3px 8px rgba(0, 0, 0, 0.16);
}

body[data-theme="xuan"] .sidebar-origin-link:hover .sidebar-origin-icon,
body[data-theme="xuan"] .sidebar-origin-link:focus-visible .sidebar-origin-icon,
body[data-theme="xuan"] .sidebar-origin-link.active .sidebar-origin-icon {
  background:
    linear-gradient(180deg, rgba(58, 69, 81, 1), rgba(35, 43, 51, 1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 16px rgba(0, 0, 0, 0.18);
}

body[data-theme="xuan"] .sidebar-origin-link + .sidebar-origin-link {
  border-top-color: rgba(51, 59, 69, 0.88);
}

body[data-theme="xuan"] .site-footer {
  background: rgba(13, 16, 21, 0.82);
  border-top-color: rgba(49, 57, 67, 0.94);
}
a { color: inherit; text-decoration: none; }

.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;
}
button, input { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid rgba(var(--accent-rgb), 0.22);
  outline-offset: 2px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-line);
}

.header-inner,
.footer-inner {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-start) 0%, var(--brand-end) 100%);
  color: #fff;
  font-weight: 700;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-copy strong { font-size: 17px; }
.brand-copy small { font-size: 14px; }
.brand-copy small,
.breadcrumb,
.sidebar-desc,
.toolbar-meta p,
.recent-desc,
.category-header p,
.seo-copy p,
.faq-card p,
.footer-inner p {
  color: var(--muted);
}

.breadcrumb {
  font-size: 14px;
}

.toolbar-meta p,
.recent-desc,
.category-header p,
.seo-copy p,
.faq-card p,
.footer-inner p {
  font-size: 15px;
  line-height: 1.75;
}

.theme-switcher {
  position: relative;
}

.theme-trigger,
.section-toggle,
#clear-search,
.keyword-chip {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.18s ease;
}

.theme-trigger {
  min-width: 0;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.94);
}

.theme-trigger-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  white-space: nowrap;
}

.theme-trigger-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.theme-trigger-copy strong {
  font-size: 14px;
  color: var(--ink);
}

.theme-trigger-caret {
  font-size: 14px;
  color: #8b96a8;
  transition: transform 180ms ease, color 180ms ease;
}

.theme-trigger[aria-expanded="true"] .theme-trigger-caret {
  transform: rotate(180deg);
  color: var(--accent);
}

.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(250px, calc(100vw - 32px));
  max-height: min(72vh, 620px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--theme-menu-bg);
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  backdrop-filter: blur(16px);
  overflow: auto;
  scrollbar-width: thin;
  z-index: 60;
}

.theme-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}

.theme-option:hover,
.theme-option:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.18);
  background: rgba(var(--accent-rgb), 0.06);
  outline: none;
}

.theme-option.active {
  border-color: rgba(var(--accent-rgb), 0.22);
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.03));
}

.theme-option-swatch {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 0 1px rgba(167, 178, 194, 0.36),
    0 4px 10px rgba(24, 39, 75, 0.08);
}

.swatch-sky {
  background: linear-gradient(135deg, #1d4ed8 0%, #60a5fa 100%);
}

.swatch-cream {
  background: linear-gradient(135deg, #b7791f 0%, #f0c36c 100%);
}

.swatch-mint {
  background: linear-gradient(135deg, #0f766e 0%, #5fd3b7 100%);
}

.swatch-sakura {
  background: linear-gradient(135deg, #c2417a 0%, #f39cbc 100%);
}

.swatch-slate {
  background: linear-gradient(135deg, #475569 0%, #a7b4c5 100%);
}

.swatch-xuan {
  background: linear-gradient(135deg, #252d36 0%, #5b6977 100%);
}

.swatch-qinghui {
  background: linear-gradient(135deg, #5f7d83 0%, #a8bbb9 100%);
}

.swatch-yuebai {
  background: linear-gradient(135deg, #8ca8c4 0%, #e7f2fb 100%);
}

.swatch-dailan {
  background: linear-gradient(135deg, #405373 0%, #8ca0bf 100%);
}

.swatch-chijin {
  background: linear-gradient(135deg, #b45a33 0%, #e1bb6d 100%);
}

.swatch-zhusha {
  background: linear-gradient(135deg, #b73f37 0%, #e1957e 100%);
}

.swatch-qinghuaci {
  background: linear-gradient(135deg, #3c6e9b 0%, #d8edf9 100%);
}

.swatch-shilv {
  background: linear-gradient(135deg, #4f8a6b 0%, #a7d3ba 100%);
}

.swatch-liujin {
  background: linear-gradient(135deg, #b88934 0%, #f1dc97 100%);
}

.swatch-zheshi {
  background: linear-gradient(135deg, #9e6540 0%, #d5a07a 100%);
}

.theme-option-copy {
  display: block;
}

.theme-option-copy strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.theme-trigger:hover,
.section-toggle:hover,
#clear-search:hover,
.keyword-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-shell {
  width: min(calc(100% - 32px), var(--max));
  margin: 20px auto 0;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  z-index: 40;
  overflow: visible;
}

.sidebar-card,
.panel-card,
.category-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.sidebar-card {
  position: relative;
  z-index: 40;
  padding: 20px 18px;
  overflow: visible;
}

.sidebar-card + .sidebar-card {
  margin-top: 14px;
}

.sidebar-card-nav {
  padding: 0;
  overflow: hidden;
  transform:
    perspective(1200px)
    rotateX(var(--sidebar-card-rotate-x, 0deg))
    rotateY(var(--sidebar-card-rotate-y, 0deg))
    translate3d(var(--sidebar-card-shift-x, 0px), var(--sidebar-card-shift-y, 0px), 0);
  transform-origin: center center;
  transform-style: preserve-3d;
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms ease,
    border-color 220ms ease;
  will-change: transform;
}

.sidebar-card-nav::before {
  content: "";
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(circle at var(--sidebar-card-glow-x, 50%) var(--sidebar-card-glow-y, 12%),
    rgba(var(--accent-rgb), 0.18),
    rgba(var(--accent-rgb), 0.06) 20%,
    transparent 48%);
  opacity: var(--sidebar-card-glow-opacity, 0);
  transition: opacity 220ms ease;
  pointer-events: none;
}

.sidebar-card-nav > * {
  position: relative;
  z-index: 1;
}

.sidebar-card-nav.is-pointer-active {
  border-color: rgba(var(--accent-rgb), 0.16);
  box-shadow:
    0 24px 52px rgba(24, 39, 75, 0.08),
    0 10px 24px rgba(var(--accent-rgb), 0.1);
}

.sidebar-card h2,
.intro-heading h1,
.category-header h2,
.panel-card h2 {
  margin: 0;
  line-height: 1.2;
}

.sidebar-kicker,
.category-index {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.category-index {
  display: none;
}

.sidebar-origin-head {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.96));
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.sidebar-origin-head h2 {
  font-size: 20px;
  font-weight: 700;
}

.sidebar-origin-nav {
  padding: 10px 10px 12px 0;
}

.sidebar-origin-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: stretch;
}

.sidebar-origin-scroll {
  max-height: min(74vh, 960px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-origin-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar-origin-list {
  display: grid;
  padding-left: 0;
}

.sidebar-origin-scrollbar {
  display: flex;
  justify-content: center;
}

.sidebar-origin-rail {
  position: relative;
  width: 100%;
  min-height: 100%;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 246, 252, 0.96)),
    linear-gradient(180deg, rgba(185, 202, 232, 0.14), rgba(185, 202, 232, 0.04));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(211, 222, 238, 0.42);
  overflow: hidden;
}

.sidebar-origin-rail::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: 6px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, #ccd8ee 0%, #bccae5 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    inset 0 -1px 1px rgba(142, 161, 198, 0.24);
}

.sidebar-origin-thumb {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 0;
  height: var(--sidebar-origin-thumb-height, 72px);
  transform: translateY(var(--sidebar-origin-thumb-top, 0));
  border-radius: 14px;
  border: 1px solid rgba(202, 212, 228, 0.96);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 252, 0.96));
  box-shadow:
    0 10px 24px rgba(148, 166, 199, 0.2),
    0 2px 6px rgba(196, 207, 223, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  cursor: grab;
  transition:
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    height 180ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms ease,
    border-color 180ms ease;
  touch-action: none;
  user-select: none;
}

.sidebar-origin-thumb::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 7px;
  height: 38%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0));
}

.sidebar-origin-thumb.dragging,
.sidebar-origin-rail:hover .sidebar-origin-thumb {
  border-color: rgba(168, 184, 208, 0.96);
  box-shadow:
    0 14px 30px rgba(148, 166, 199, 0.24),
    0 3px 8px rgba(196, 207, 223, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.sidebar-origin-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 11px 20px 11px 22px;
  border-left: 3px solid transparent;
  color: #374151;
  background: transparent;
  font-size: 16px;
  line-height: 1.55;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.sidebar-origin-link::before {
  display: none;
}

.sidebar-origin-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(191, 204, 224, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 252, 0.94));
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 3px 8px rgba(148, 166, 199, 0.12);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.sidebar-origin-text {
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar-origin-link:hover,
.sidebar-origin-link:focus-visible {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  outline: none;
}

.sidebar-origin-link:hover .sidebar-origin-icon,
.sidebar-origin-link:focus-visible .sidebar-origin-icon {
  transform: translateY(-1px) scale(1.04);
  border-color: rgba(var(--accent-rgb), 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(231, 241, 255, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 8px 16px rgba(var(--accent-rgb), 0.14);
}

.sidebar-origin-link.active {
  color: var(--accent);
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.14), rgba(var(--accent-rgb), 0.04));
  border-left-color: var(--accent);
  font-weight: 700;
}

.sidebar-origin-link.active .sidebar-origin-icon {
  border-color: rgba(var(--accent-rgb), 0.3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(224, 236, 255, 1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 10px 18px rgba(var(--accent-rgb), 0.18);
}

.sidebar-origin-link + .sidebar-origin-link {
  border-top: 1px solid rgba(230, 235, 242, 0.88);
}

.nav-glider {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 0;
  height: var(--nav-glider-height);
  transform: translateY(var(--nav-glider-top));
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(58, 132, 255, 0.18), rgba(118, 169, 255, 0.1)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 248, 255, 0.9));
  border: 1px solid rgba(58, 132, 255, 0.16);
  box-shadow:
    0 14px 28px rgba(58, 132, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    height 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease;
  pointer-events: none;
  z-index: 0;
}

.nav-glider::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3a84ff 0%, #89b7ff 100%);
  box-shadow: 0 0 18px rgba(58, 132, 255, 0.32);
}

.nav-glider::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 15px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), transparent 35%);
  opacity: 0.8;
}

.nav-tree .nav-item {
  position: relative;
  z-index: 0;
  overflow: visible;
}

.nav-tree .nav-item:hover,
.nav-tree .nav-item.active,
.nav-tree .nav-item:focus-within {
  z-index: 80;
}

.nav-trigger {
  width: 100%;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(230, 235, 242, 0.96);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 12px 18px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.nav-trigger::after {
  content: "›";
  color: #9aa4b2;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.18s ease, color 0.18s ease;
}

.nav-tree .nav-item:hover .nav-trigger,
.nav-tree .nav-item.active .nav-trigger,
.nav-tree .nav-item:focus-within .nav-trigger {
  color: var(--accent);
  border-color: rgba(58, 132, 255, 0.18);
  background: rgba(255, 255, 255, 0.68);
}

.nav-tree .nav-item:hover .nav-trigger::after,
.nav-tree .nav-item.active .nav-trigger::after,
.nav-tree .nav-item:focus-within .nav-trigger::after {
  color: var(--accent);
  transform: translateX(2px);
}

.nav-sublist {
  padding: 14px;
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 90;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(24, 39, 75, 0.12);
}

.nav-sublist a {
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--muted);
}

.nav-sublist a:hover,
.nav-sublist a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
}

.panel-card,
.category-section {
  padding: 24px;
}

.panel-card,
.category-section,
.subgroup {
  scroll-margin-top: 90px;
}

.intro-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.intro-heading h1 {
  font-size: clamp(32px, 4vw, 40px);
  margin-bottom: 8px;
}

.intro-heading p {
  font-size: 16px;
}

.intro-stats {
  min-width: 124px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--accent-soft);
  text-align: center;
}

.intro-stats strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  color: var(--accent);
}

.toolbar {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.intro-card .toolbar:first-child {
  margin-top: 0;
}

.toolbar-search {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.toolbar-search span {
  font-size: 15px;
}

.toolbar-search input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

.toolbar-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.14);
}

.toolbar-search input::placeholder {
  color: var(--muted);
  opacity: 1;
}

#clear-search {
  align-self: end;
  height: 50px;
  cursor: pointer;
}

.toolbar-meta {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.keyword-row,
.category-actions,
.symbol-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.keyword-chip {
  cursor: pointer;
  background: var(--panel-soft);
}

.recent-panel {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  background: var(--panel-soft);
  display: grid;
  gap: 14px;
}

.recent-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.recent-title { margin: 0; font-weight: 700; }
.recent-title { font-size: 16px; }

.recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  overflow: hidden;
  transition: max-height 220ms ease;
}

.recent-toggle {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s ease;
}

.recent-toggle:hover,
.recent-toggle:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.recent-item {
  min-width: 46px;
  height: 46px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 20px;
}

.recent-item.is-label-card,
.symbol-card.is-label-card {
  min-width: 88px;
  height: auto;
  min-height: 46px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  word-break: break-word;
}

.category-section {
  display: grid;
  gap: 14px;
}

.category-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 6px;
}

.category-header h2 {
  margin-bottom: 6px;
  font-size: 28px;
}

.category-header p {
  font-size: 15px;
}

.category-actions {
  display: none;
}

.section-toggle {
  cursor: pointer;
  background: var(--panel-soft);
}

.category-symbol-shell {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
  padding: 18px;
}

.category-symbol-grid {
  padding: 0;
}

#cat-common .category-symbol-shell {
  display: block;
}

#cat-common .common-priority-groups {
  display: grid;
  gap: 16px;
}

#cat-common .common-priority-group {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 252, 0.92));
  padding: 16px;
}

#cat-common .common-priority-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#cat-common .common-priority-kicker,
#cat-common .common-priority-desc {
  margin: 0;
}

#cat-common .common-priority-kicker {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);
}

#cat-common .common-priority-desc {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

#cat-common .common-priority-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

#cat-common .common-priority-grid {
  display: grid;
  grid-template-columns: repeat(10, 56px);
  grid-auto-rows: 46px;
  gap: 10px;
  justify-content: center;
}

#cat-common .common-priority-grid .symbol-card {
  min-width: 56px;
  width: 56px;
  padding: 0;
}

.subgroup {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
  overflow: hidden;
}

.subgroup summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.subgroup summary::-webkit-details-marker { display: none; }

.subgroup summary span {
  font-weight: 700;
  font-size: 17px;
}

.subgroup summary small {
  color: var(--muted);
  font-size: 14px;
}

.symbol-grid {
  padding: 0 18px 18px;
}

.symbol-card {
  min-width: 52px;
  height: 46px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 20px;
  color: var(--ink);
  transition: 0.16s ease;
}

#supp-supersub .symbol-card {
  font-size: 22px;
}

.symbol-card:hover,
.symbol-card:focus-visible,
.recent-item:hover,
.recent-item:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
  outline: none;
}

.symbol-card.copied {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.3);
}

.faq-card details {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.faq-card details:first-of-type { border-top: 0; }
.faq-card summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  list-style: none;
}
.faq-card summary::-webkit-details-marker { display: none; }
.faq-card p { margin: 10px 0 0; }

.supplement-card {
  display: grid;
  gap: 16px;
}

.supplement-heading h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.supplement-heading p {
  margin: 0;
  color: var(--muted);
}

.supplement-index {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.full-nav-list {
  margin-top: 0;
  max-height: min(52vh, 560px);
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 6px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.full-nav-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.full-nav-list a {
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  transition: 0.18s ease;
}

.full-nav-list a:hover,
.full-nav-list a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.sidebar-scroll-control {
  position: relative;
  min-height: 160px;
  height: 100%;
}

.sidebar-scroll-nudge {
  position: absolute;
  left: 50%;
  z-index: 3;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(235, 243, 255, 0.92)),
    linear-gradient(180deg, rgba(58, 132, 255, 0.12), rgba(58, 132, 255, 0.04));
  color: #4f6fa6;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 1px solid rgba(58, 132, 255, 0.14);
  box-shadow:
    0 10px 18px rgba(58, 132, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition:
    transform 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

#sidebar-scroll-up {
  top: -6px;
  transform: translateX(-50%);
}

#sidebar-scroll-down {
  bottom: -6px;
  transform: translateX(-50%);
}

.sidebar-scroll-nudge:hover,
.sidebar-scroll-nudge:focus-visible {
  color: var(--accent);
  border-color: rgba(58, 132, 255, 0.28);
  box-shadow:
    0 14px 22px rgba(58, 132, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  outline: none;
}

#sidebar-scroll-up:hover,
#sidebar-scroll-up:focus-visible {
  transform: translate(-50%, -1px);
}

#sidebar-scroll-down:hover,
#sidebar-scroll-down:focus-visible {
  transform: translate(-50%, 1px);
}

.sidebar-scroll-nudge:disabled {
  opacity: 0.42;
  box-shadow:
    0 6px 12px rgba(58, 132, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  cursor: default;
}

#sidebar-scroll-up:disabled,
#sidebar-scroll-down:disabled {
  transform: translateX(-50%);
}

.sidebar-scroll-rail {
  position: relative;
  min-height: 100%;
  height: 100%;
  border-radius: 999px;
  border: 1px solid rgba(58, 132, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(233, 242, 255, 0.88), rgba(255, 255, 255, 0.92)),
    linear-gradient(180deg, rgba(58, 132, 255, 0.06), rgba(58, 132, 255, 0));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 12px 22px rgba(58, 132, 255, 0.08);
  overflow: hidden;
  touch-action: none;
}

.sidebar-scroll-rail::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(58, 132, 255, 0.08), rgba(58, 132, 255, 0.22), rgba(58, 132, 255, 0.08));
}

.sidebar-scroll-rail::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  pointer-events: none;
}

.sidebar-scroll-thumb {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 0;
  height: var(--sidebar-scroll-thumb-height, 56px);
  transform: translateY(var(--sidebar-scroll-thumb-top, 0));
  border-radius: 999px;
  background:
    linear-gradient(180deg, #8fc1ff 0%, #4e91ff 48%, #2c73f6 100%);
  box-shadow:
    0 12px 20px rgba(58, 132, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    inset 0 -8px 12px rgba(32, 88, 198, 0.22);
  transition:
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    height 180ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms ease,
    filter 180ms ease;
  cursor: grab;
  pointer-events: auto;
}

.sidebar-scroll-thumb::before {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 7px;
  height: 32%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
}

.sidebar-scroll-thumb::after {
  content: "⋮";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  letter-spacing: -1px;
  text-shadow: 0 1px 2px rgba(15, 53, 129, 0.2);
}

.sidebar-scroll-rail:hover .sidebar-scroll-thumb,
.sidebar-scroll-thumb.dragging {
  filter: saturate(1.05);
  box-shadow:
    0 16px 26px rgba(58, 132, 255, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -8px 12px rgba(32, 88, 198, 0.28);
}

body.is-sidebar-dragging,
body.is-sidebar-dragging * {
  cursor: grabbing !important;
  user-select: none;
}

.supplement-link {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  transition: 0.18s ease;
}

.supplement-link:hover,
.supplement-link:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

#supplement-categories {
  display: grid;
  gap: 18px;
}

.compact-category .category-header h2 {
  font-size: 24px;
}

.compact-category .category-symbol-shell {
  padding: 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 20px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.92);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.floating-top-button {
  position: fixed;
  right: 24px;
  bottom: 26px;
  z-index: 70;
  min-height: 52px;
  padding: 10px 16px 10px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 255, 0.94));
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow:
    0 18px 34px rgba(24, 39, 75, 0.12),
    0 8px 18px rgba(var(--accent-rgb), 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition:
    opacity 200ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.floating-top-button.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.floating-top-button:hover,
.floating-top-button:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.32);
  box-shadow:
    0 22px 38px rgba(24, 39, 75, 0.14),
    0 10px 24px rgba(var(--accent-rgb), 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
  transform: translateY(-2px) scale(1.01);
  outline: none;
}

.floating-top-button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.42), transparent 38%);
  opacity: 0.85;
  pointer-events: none;
}

.floating-top-button > * {
  position: relative;
  z-index: 1;
}

.floating-top-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.floating-top-text {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

body[data-theme="xuan"] .floating-top-button {
  background:
    linear-gradient(180deg, rgba(30, 37, 46, 0.96), rgba(20, 25, 31, 0.94));
  border-color: rgba(118, 135, 154, 0.28);
  color: var(--ink);
  box-shadow:
    0 22px 38px rgba(0, 0, 0, 0.32),
    0 10px 24px rgba(138, 160, 183, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-theme="xuan"] .floating-top-button::before {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 38%);
}

body[data-theme="xuan"] .floating-top-button:hover,
body[data-theme="xuan"] .floating-top-button:focus-visible {
  border-color: rgba(138, 160, 183, 0.4);
  box-shadow:
    0 24px 40px rgba(0, 0, 0, 0.36),
    0 12px 28px rgba(138, 160, 183, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body[data-theme="xuan"] .floating-top-icon {
  background: rgba(138, 160, 183, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-footer {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.footer-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-inner a {
  color: var(--accent);
  font-weight: 700;
}

[hidden] { display: none !important; }

@media (min-width: 1041px) {
  .nav-tree .nav-item {
    min-height: 46px;
  }

  .nav-sublist {
    position: absolute;
    top: -1px;
    left: calc(100% + 12px);
    width: 220px;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 30;
  }

  .nav-tree .nav-item:hover .nav-sublist,
  .nav-tree .nav-item.active .nav-sublist,
  .nav-tree .nav-item:focus-within .nav-sublist {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

@media (max-width: 1040px) {
  .nav-glider {
    opacity: 0;
  }

  .page-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }

  .sidebar-card-nav {
    transform: none !important;
  }

  .sidebar-card-nav::before {
    opacity: 0 !important;
  }

  .nav-sublist {
    display: none;
    margin: 0 10px 10px;
    padding: 12px;
  }

  .nav-tree .nav-item.active .nav-sublist {
    display: grid;
  }

  .sidebar-origin-scroll {
    max-height: min(56vh, 520px);
  }

  #cat-common .common-priority-grid {
    grid-template-columns: repeat(8, 56px);
  }
}

@media (max-width: 760px) {
  .header-inner,
  .footer-inner,
  .page-shell {
    width: min(calc(100% - 20px), var(--max));
  }
  .header-inner,
  .intro-heading,
  .toolbar,
  .toolbar-meta,
  .recent-panel,
  .recent-meta,
  .category-header,
  .footer-inner {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }
  .toolbar {
    display: flex;
  }

  .theme-switcher {
    width: 100%;
  }

  .theme-trigger {
    width: 100%;
  }

  .theme-menu {
    left: 0;
    right: 0;
    width: 100%;
  }

  .floating-top-button {
    right: 16px;
    bottom: 18px;
    min-height: 46px;
    padding: 9px 12px 9px 10px;
    gap: 8px;
  }

  .floating-top-icon {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    font-size: 14px;
  }

  .floating-top-text {
    font-size: 13px;
  }

  .intro-stats {
    width: 100%;
    text-align: left;
  }

  .sidebar-origin-head {
    padding: 14px 16px 12px;
  }

  .sidebar-origin-nav {
    padding: 8px 8px 10px 0;
  }

  .sidebar-origin-shell {
    grid-template-columns: minmax(0, 1fr) 28px;
    gap: 8px;
  }

  .sidebar-origin-scroll {
    max-height: min(48vh, 420px);
  }

  .sidebar-origin-link {
    min-height: 44px;
    padding: 10px 16px 10px 18px;
    font-size: 15px;
  }

  .sidebar-origin-icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
    font-size: 13px;
    border-radius: 7px;
  }

  .sidebar-origin-rail::before {
    top: 10px;
    bottom: 10px;
    width: 5px;
  }

  .sidebar-origin-thumb {
    left: 1px;
    right: 1px;
    border-radius: 13px;
  }

  #clear-search {
    width: 100%;
  }
  .subgroup summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-trigger::after {
    transform: rotate(90deg);
  }

  .nav-tree .nav-item.active .nav-trigger::after,
  .nav-tree .nav-item:focus-within .nav-trigger::after {
    transform: rotate(270deg);
  }

  .symbol-grid {
    gap: 8px;
  }

  .category-symbol-shell {
    padding: 14px;
  }

  .symbol-card {
    min-width: 44px;
    height: 40px;
  }

  .recent-item.is-label-card,
  .symbol-card.is-label-card {
    min-width: 74px;
    min-height: 40px;
    padding: 6px 8px;
    font-size: 11px;
  }

  #cat-common .common-priority-group {
    padding: 14px;
  }

  #cat-common .common-priority-header {
    flex-direction: column;
    align-items: stretch;
  }

  #cat-common .common-priority-count {
    align-self: flex-start;
  }

  #cat-common .common-priority-grid {
    grid-template-columns: repeat(6, 44px);
    grid-auto-rows: 44px;
    gap: 8px;
  }

  #cat-common .common-priority-grid .symbol-card {
    min-width: 44px;
    width: 44px;
    height: 44px;
  }
}
