/**
 * XSCT Bench - Design System
 * Light + Dark Mode (follows system preference)
 * Style: Minimalist SaaS
 */

/* =====================================================
   Tailwind Base Reset (Local)
   ===================================================== */
*, ::before, ::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: currentColor;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

body {
  margin: 0;
  line-height: inherit;
}

hr {
  height: 0;
  color: inherit;
  border-top-width: 1px;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

a {
  color: inherit;
  text-decoration: inherit;
}

b, strong {
  font-weight: bolder;
}

code, kbd, samp, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1em;
}

small {
  font-size: 80%;
}

sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub { bottom: -0.25em; }
sup { top: -0.5em; }

table {
  text-indent: 0;
  border-color: inherit;
  border-collapse: collapse;
}

button, input, optgroup, select, textarea {
  font-family: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

button, select {
  text-transform: none;
}

button, [type='button'], [type='reset'], [type='submit'] {
  -webkit-appearance: button;
  background-color: transparent;
  background-image: none;
}

:-moz-focusring {
  outline: auto;
}

:-moz-ui-invalid {
  box-shadow: none;
}

progress {
  vertical-align: baseline;
}

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

[type='search'] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}

::-webkit-search-decoration {
  -webkit-appearance: none;
}

::-webkit-file-upload-button {
  -webkit-appearance: button;
  font: inherit;
}

summary {
  display: list-item;
}

blockquote, dl, dd, h1, h2, h3, h4, h5, h6, hr, figure, p, pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

ol, ul, menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

textarea {
  resize: vertical;
}

input::placeholder, textarea::placeholder {
  opacity: 1;
  color: #9ca3af;
}

button, [role="button"] {
  cursor: pointer;
}

:disabled {
  cursor: default;
}

img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  vertical-align: middle;
}

img, video {
  max-width: 100%;
  height: auto;
}

[hidden] {
  display: none;
}

/* =====================================================
   Global Scrollbar Styles - Hidden
   ===================================================== */

/* 全局隐藏滚动条，但保留滚动功能 */
::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

/* =====================================================
   Light Mode (Default)
   ===================================================== */
:root {
  /* Background */
  --bg-body: #fafafa;
  --bg-card: #ffffff;
  --bg-subtle: #f9fafb;
  --bg-muted: #f3f4f6;
  --bg-invert: #18181b;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --text-invert: #ffffff;

  /* Brand */
  --primary: #18181b;
  --primary-hover: #27272a;

  /* Borders */
  --border-light: #f3f4f6;
  --border-medium: #e5e7eb;
  --border-strong: #d1d5db;

  /* Semantic */
  --success-bg: #ecfdf5;  --success-text: #059669;
  --warning-bg: #fffbeb;  --warning-text: #d97706;
  --error-bg: #fef2f2;    --error-text: #dc2626;
  --info-bg: #eff6ff;     --info-text: #2563eb;

  /* Components */
  --code-bg: #1e1e1e;
  --code-text: #e5e7eb;
  --table-header-bg: #fafafa;
  --table-row-hover: #fcfcfc;
  --input-bg: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.8);
  --badge-bg: #f3f4f6;
  --badge-text: #374151;
  --badge-border: #e5e7eb;

  /* Misc */
  --radius: 8px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================
   Dark Mode (System Preference)
   ===================================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-body: #09090b;
    --bg-card: #18181b;
    --bg-subtle: #1c1c1f;
    --bg-muted: #27272a;
    --bg-invert: #fafafa;

    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-invert: #18181b;

    --primary: #fafafa;
    --primary-hover: #e4e4e7;

    --border-light: #27272a;
    --border-medium: #3f3f46;
    --border-strong: #52525b;

    --success-bg: #052e16;  --success-text: #4ade80;
    --warning-bg: #422006;  --warning-text: #fbbf24;
    --error-bg: #450a0a;    --error-text: #f87171;
    --info-bg: #172554;     --info-text: #60a5fa;

    --code-bg: #0a0a0a;
    --code-text: #d4d4d8;
    --table-header-bg: #1c1c1f;
    --table-row-hover: #1c1c1f;
    --input-bg: #18181b;
    --nav-bg: rgba(9, 9, 11, 0.8);
    --badge-bg: #27272a;
    --badge-text: #d4d4d8;
    --badge-border: #3f3f46;
  }
}


/* =====================================================
   Base
   ===================================================== */
body {
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

.container-wide {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 32px;
}


/* =====================================================
   Navigation Header
   ===================================================== */
.site-header {
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-medium);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0 24px;
}

.site-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: var(--transition);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text-primary);
  background-color: var(--bg-muted);
}


/* =====================================================
   Card
   ===================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  transition: var(--transition);
}


/* =====================================================
   Button
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  line-height: 1.25rem;
  user-select: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-invert);
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}
/* 深色按钮上的图标 */
/* 亮色模式：图标原色是黑的，按钮背景是黑的，需要反转为白 */
.btn-primary .icon {
  filter: invert(1);
}
/* 暗色模式：全局已经 invert(1) 把图标变白了，
   但深色按钮背景是白的（primary 反转），所以需要还原为黑 */
@media (prefers-color-scheme: dark) {
  .btn-primary .icon {
    filter: invert(0);
  }
}

.btn-secondary {
  background-color: var(--bg-card);
  border-color: var(--border-medium);
  color: var(--text-secondary);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}
.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-outline:hover:not(:disabled) {
  background-color: var(--bg-muted);
  color: var(--text-primary);
}

.btn-outline-danger {
  background: transparent;
  border-color: var(--error-text);
  color: var(--error-text);
}
.btn-outline-danger:hover:not(:disabled) {
  background-color: var(--error-bg);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}
.btn-ghost:hover:not(:disabled) {
  background-color: var(--bg-muted);
  color: var(--text-primary);
}
.btn-ghost-danger:hover:not(:disabled) {
  background-color: var(--error-bg);
  color: var(--error-text);
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }


/* =====================================================
   Icon
   img 标签加载的 SVG 无法继承 color，必须用 filter 反转
   ===================================================== */
.icon { width: 16px; height: 16px; flex-shrink: 0; }
.icon-lg { width: 20px; height: 20px; flex-shrink: 0; }
.icon-xl { width: 24px; height: 24px; flex-shrink: 0; }

/* 白色图标 - 用于深色背景按钮 */
.icon-white {
  filter: brightness(0) invert(1);
}

/* 暗色模式：反转所有图标为白色 */
@media (prefers-color-scheme: dark) {
  .icon,
  .icon-lg,
  .icon-xl {
    filter: invert(1);
  }
  
  /* 暗色模式下，.icon-white 不需要额外处理 */
  .icon-white {
    filter: none;
  }
}


/* =====================================================
   Input
   ===================================================== */
.input, textarea.input, select.input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--input-bg);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}
.input::placeholder { color: var(--text-tertiary); }
.input:hover { border-color: var(--border-strong); }
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
}
@media (prefers-color-scheme: dark) {
  .input:focus { box-shadow: 0 0 0 3px rgba(250, 250, 250, 0.1); }
}

select.input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}


/* =====================================================
   Badge
   ===================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 9999px;
  line-height: 1.5;
}
.badge-primary { background: var(--badge-bg); color: var(--badge-text); border: 1px solid var(--badge-border); }
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-error   { background: var(--error-bg);   color: var(--error-text); }
.badge-info    { background: var(--info-bg);    color: var(--info-text); }


/* =====================================================
   Table
   ===================================================== */
table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-medium);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  background-color: var(--table-header-bg);
  vertical-align: middle;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text-primary);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background-color: var(--table-row-hover); }


/* =====================================================
   Details / Summary
   ===================================================== */
details {
  border: 1px solid var(--border-medium);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
  margin-bottom: 8px;
}
summary {
  list-style: none;
  padding: 12px 16px;
  cursor: pointer;
  /* display: flex; REMOVED */
  /* align-items: center; REMOVED */
  /* justify-content: space-between; REMOVED */
  font-weight: 500;
  color: var(--text-primary);
  transition: background 0.2s;
}
summary::-webkit-details-marker { display: none; }
summary:hover { background: var(--bg-subtle); }
details[open] summary { border-bottom: 1px solid var(--border-light); background: var(--bg-subtle); }
.summary-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-icon { 
  flex-shrink: 0;
  transition: transform 0.2s;
}
details[open] .summary-icon { transform: rotate(180deg); }


/* =====================================================
   Voting Reveal
   ===================================================== */
.vote-reveal-container {
  position: relative;
  height: 200px;
  width: 100%;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  overflow: hidden;
}
.model-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 1; transition: opacity 0.5s ease;
  z-index: 2;
}
.model-revealed {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg-card);
  opacity: 0; transform: translateY(8px);
  transition: all 0.6s ease;
  z-index: 1;
}
.vote-card.revealed .model-placeholder { opacity: 0; pointer-events: none; }
.vote-card.revealed .model-revealed { opacity: 1; transform: translateY(0); z-index: 3; }


/* =====================================================
   Markdown
   ===================================================== */
.markdown-body { font-size: 14px; line-height: 1.7; color: var(--text-primary); }
.markdown-body h1 { font-size: 24px; font-weight: 700; margin: 1.5em 0 0.5em; }
.markdown-body h2 { font-size: 20px; font-weight: 600; margin: 1.5em 0 0.5em; }
.markdown-body h3 { font-size: 16px; font-weight: 600; margin: 1.2em 0 0.4em; }
.markdown-body p  { margin-bottom: 1em; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5em; margin-bottom: 1em; }
.markdown-body li { margin-bottom: 0.3em; }
.markdown-body code {
  background-color: var(--bg-muted);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 85%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.markdown-body pre {
  background-color: var(--code-bg);
  padding: 16px;
  border-radius: 6px;
  overflow: auto;
  margin-bottom: 1em;
  border: 1px solid var(--border-medium);
}
.markdown-body pre code { background: transparent; padding: 0; color: var(--code-text); }
.markdown-body blockquote {
  border-left: 3px solid var(--border-strong);
  padding-left: 16px;
  color: var(--text-secondary);
  margin: 1em 0;
}

.mermaid {
  background: var(--bg-card);
  padding: 24px;
  border-radius: 8px;
  border: 1px solid var(--border-medium);
  overflow-x: auto;
  display: flex;
  justify-content: center;
}


/* =====================================================
   Color Swatch
   ===================================================== */
.color-swatch { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.color-swatch-block { width: 64px; height: 64px; border-radius: 8px; border: 1px solid var(--border-medium); }
.color-swatch-label { font-size: 12px; color: var(--text-secondary); text-align: center; }
.color-swatch-hex { font-size: 11px; color: var(--text-tertiary); font-family: ui-monospace, monospace; }


/* =====================================================
   Hero Section (Landing Page)
   ===================================================== */
.hero {
  padding: 64px 0 32px;
  text-align: center;
}

.hero-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .hero {
    padding: 48px 0 32px;
  }
  .hero-title {
    font-size: 28px;
  }
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 16px auto 0;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .hero-subtitle {
    font-size: 14px;
  }
}

/* Stat Cards Row */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

@media (max-width: 768px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-card-label {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
}


/* =====================================================
   Spotlight Slots（首页推荐位）
   ===================================================== */
.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

@media (max-width: 960px) {
  .spotlight-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .spotlight-grid { grid-template-columns: 1fr; }
}

.spotlight-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

a.spotlight-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
  cursor: pointer;
}

.spotlight-card.no-link {
  cursor: default;
}

.spotlight-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-page, #f9fafb);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spotlight-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.spotlight-body {
  flex: 1;
  min-width: 0;
}

.spotlight-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.spotlight-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 3px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* =====================================================
   Footer Stat Bar（页脚统计数字）
   ===================================================== */
.footer-stat-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-medium);
}

.footer-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
}

.footer-stat-item:not(:last-child) {
  border-right: 1px solid var(--border-medium);
}

.footer-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.footer-stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
}

@media (max-width: 640px) {
  .footer-stat-bar {
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 16px;
  }
  .footer-stat-item {
    padding: 0 12px;
    flex: 1 1 40%;
  }
  .footer-stat-item:not(:last-child) {
    border-right: none;
  }
}


/* =====================================================
   Tab Navigation
   ===================================================== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-medium);
  margin-bottom: 24px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: var(--transition);
}

.tab:hover { color: var(--text-secondary); }
.tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}


/* =====================================================
   Admin Sidebar Layout
   ===================================================== */
.admin-layout {
  display: flex;
  height: calc(100vh - 57px);
  overflow: hidden;
}

.admin-sidebar {
  width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-medium);
  padding: 16px 0;
  flex-shrink: 0;
  overflow-y: auto;
}

.admin-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.admin-sidebar-item:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.admin-sidebar-item.active {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.admin-sidebar-section {
  padding: 20px 20px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  min-height: 0;
}

/* When using fixed layout, remove padding from admin-content */
.admin-content.has-fixed-layout {
  padding: 0;
  overflow: hidden;
}

/* Admin page fixed layout */
.admin-page-fixed-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.admin-page-header {
  flex-shrink: 0;
  padding: 32px 32px 16px 32px;
}

.admin-page-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 0 32px 32px 32px;
  min-height: 0;
}

/* Table with sticky header */
.table-sticky-header {
  width: 100%;
}

.table-sticky-header thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-card);
}

.table-sticky-header thead th {
  background: var(--bg-card);
  box-shadow: inset 0 -1px 0 var(--border-medium);
}

/* Clickable table row */
tr.clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

tr.clickable-row:hover {
  background-color: var(--bg-subtle);
}


/* =====================================================
   Footer
   ===================================================== */
.site-footer {
  border-top: 1px solid var(--border-medium);
  padding: 32px 0;
  margin-top: 64px;
  background: var(--bg-card);
}

.site-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
}


/* =====================================================
   Utilities
   ===================================================== */
.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

/* Text */
.text-xs { font-size: 12px; line-height: 1.5; }
.text-sm { font-size: 14px; line-height: 1.5; }
.text-base { font-size: 16px; line-height: 1.5; }
.text-lg { font-size: 18px; line-height: 1.5; }
.text-xl { font-size: 20px; line-height: 1.5; }
.text-2xl { font-size: 24px; line-height: 1.25; }
.text-3xl { font-size: 30px; line-height: 1.25; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.last\:border-0:last-child { border-width: 0; }
.space-x-2 > * + * { margin-left: 8px; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.whitespace-nowrap { white-space: nowrap; }

/* Colors */
.text-white { color: #fff; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-green-500 { color: #22c55e; }
.text-green-600 { color: #16a34a; }
.text-blue-500 { color: #3b82f6; }
.text-blue-600 { color: #2563eb; }
.text-yellow-500 { color: #eab308; }
.text-yellow-600 { color: #ca8a04; }
.text-gray-700 { color: #374151; }
.text-gray-900 { color: #111827; }
.text-blue-700 { color: #1d4ed8; }
.text-purple-600 { color: #9333ea; }
.text-orange-600 { color: #ea580c; }
.bg-white { background-color: #fff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-red-50 { background-color: #fef2f2; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-orange-100 { background-color: #ffedd5; }
.bg-gray-900 { background-color: #111827; }

/* Flexbox */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-span-full { grid-column: 1 / -1; }
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Gap */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

/* Spacing */
.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.py-0\.5 { padding-top: 2px; padding-bottom: 2px; }
.py-2\.5 { padding-top: 10px; padding-bottom: 10px; }
.px-2\.5 { padding-left: 10px; padding-right: 10px; }
.pt-3 { padding-top: 12px; }
.pt-4 { padding-top: 16px; }
.pb-4 { padding-bottom: 16px; }
.pl-8 { padding-left: 32px; }
.pr-3 { padding-right: 12px; }
.pr-10 { padding-right: 40px; }
.m-0 { margin: 0; }
.m-4 { margin: 16px; }
.mx-4 { margin-left: 16px; margin-right: 16px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-2 { margin-top: 8px; margin-bottom: 8px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.ml-0\.5 { margin-left: 2px; }
.ml-1 { margin-left: 4px; }
.ml-1\.5 { margin-left: 6px; }
.ml-2 { margin-left: 8px; }
.ml-3 { margin-left: 12px; }
.ml-auto { margin-left: auto; }
.mr-1\.5 { margin-right: 6px; }
.mr-2 { margin-right: 8px; }
.mr-3 { margin-right: 12px; }
.mt-1\.5 { margin-top: 6px; }
.-mt-1 { margin-top: -4px; }

/* Sizing */
.w-full { width: 100%; }
.w-1\/2 { width: 50%; }
.w-1\/3 { width: 33.333333%; }
.w-2\/3 { width: 66.666667%; }
.w-2\/5 { width: 40%; }
.w-3\/5 { width: 60%; }
.w-72 { width: 288px; }
.w-3 { width: 12px; }
.w-4 { width: 16px; }
.w-5 { width: 20px; }
.w-6 { width: 24px; }
.w-8 { width: 32px; }
.w-9 { width: 36px; }
.w-10 { width: 40px; }
.w-16 { width: 64px; }
.h-1 { height: 4px; }
.h-1\.5 { height: 6px; }
.h-2 { height: 8px; }
.h-3 { height: 12px; }
.h-4 { height: 16px; }
.h-5 { height: 20px; }
.h-6 { height: 24px; }
.h-8 { height: 32px; }
.h-9 { height: 36px; }
.h-10 { height: 40px; }
.h-48 { height: 192px; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.max-w-4xl { max-width: 896px; }
.max-w-5xl { max-width: 1024px; }
.max-w-6xl { max-width: 1152px; }
.max-w-7xl { max-width: 1280px; }
.max-w-2xl { max-width: 672px; }
.max-w-3xl { max-width: 768px; }
.max-h-48 { max-height: 192px; }
.max-h-60 { max-height: 240px; }
.max-h-full { max-height: 100%; }

/* Position */
.static { position: static; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.top-4 { top: 16px; }
.right-0 { right: 0; }
.right-4 { right: 16px; }
.right-2\.5 { right: 10px; }
.bottom-0 { bottom: 0; }
.bottom-4 { bottom: 16px; }
.left-0 { left: 0; }
.left-2\.5 { left: 10px; }
.top-1\/2 { top: 50%; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }

/* Display & Overflow */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-y-scroll { overflow-y: scroll; }

/* Border */
.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-l { border-left-width: 1px; }
.border-r { border-right-width: 1px; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-blue-100 { border-color: #dbeafe; }
.border-blue-500 { border-color: #3b82f6; }
.border-l-2 { border-left-width: 2px; }
.border-l-blue-500 { border-left-color: #3b82f6; }
.border-dashed { border-style: dashed; }
.rounded { border-radius: 4px; }
.rounded-md { border-radius: 6px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-full { border-radius: 9999px; }

/* Shadow */
.shadow { box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-90 { opacity: 0.9; }
.opacity-100 { opacity: 1; }
.bg-opacity-50 { --tw-bg-opacity: 0.5; }
.bg-opacity-75 { --tw-bg-opacity: 0.75; }
.bg-black { background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1)); }

/* Transform */
.-translate-y-1\/2 { transform: translateY(-50%); }
.-translate-x-1\/2 { transform: translateX(-50%); }
.translate-x-0 { transform: translateX(0); }
.scale-100 { transform: scale(1); }
.scale-95 { transform: scale(0.95); }

/* Cursor & Interaction */
.cursor-pointer { cursor: pointer; }
.cursor-help { cursor: help; }
.cursor-not-allowed { cursor: not-allowed; }
.select-none { user-select: none; }
.pointer-events-none { pointer-events: none; }

/* Transition */
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-shadow { transition-property: box-shadow; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-150 { transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }

/* Hover */
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-gray-800:hover { background-color: #1f2937; }
.hover\:bg-white:hover { background-color: #fff; }
.hover\:text-gray-600:hover { color: #4b5563; }
.hover\:text-gray-700:hover { color: #374151; }
.hover\:border-gray-300:hover { border-color: #d1d5db; }
.hover\:border-gray-400:hover { border-color: #9ca3af; }

/* Focus */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--ring-color, rgba(0,0,0,0.05)); }
.focus\:ring-black\/5:focus { --ring-color: rgba(0,0,0,0.05); }
.focus\:border-gray-300:focus { border-color: #d1d5db; }
.hover\:opacity-90:hover { opacity: 0.9; }
.hover\:underline:hover { text-decoration: underline; }

/* Dark Mode Utilities */
@media (prefers-color-scheme: dark) {
  .dark\:bg-gray-700 { background-color: #374151; }
  .dark\:bg-gray-800 { background-color: #1f2937; }
  .dark\:text-white { color: #fff; }
  .dark\:text-gray-300 { color: #d1d5db; }
  .dark\:text-gray-400 { color: #9ca3af; }
  .dark\:border-gray-600 { border-color: #4b5563; }
  .dark\:border-gray-700 { border-color: #374151; }
  .dark\:hover\:bg-gray-700:hover { background-color: #374151; }
  .dark\:hover\:text-gray-300:hover { color: #d1d5db; }
}

/* =====================================================
   Info Icon with Tooltip
   ===================================================== */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 9px;
  font-weight: 700;
  font-style: normal;
  color: #6b7280;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  cursor: help;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.info-icon:hover {
  color: #374151;
  background: #d1d5db;
  border-color: #9ca3af;
}

/* JS Tooltip Styles */
.tooltip-popup {
  position: fixed;
  padding: 10px 14px;
  background: var(--bg-invert);
  color: var(--text-invert);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: pre-line;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  min-width: 200px;
  max-width: 300px;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  transform: translate(-50%, -10px); /* Center horizontally, offset up */
}

.tooltip-popup.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tooltip-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--bg-invert);
}

.tooltip-popup.bottom::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--bg-invert);
}


/* =====================================================
   Additional Utilities
   ===================================================== */
/* Focus states */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1); }
.focus\:border-gray-300:focus { border-color: #d1d5db; }

/* Space utilities */
.space-y-1 > * + * { margin-top: 4px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-5 > * + * { margin-top: 20px; }
.space-y-6 > * + * { margin-top: 24px; }
.space-y-8 > * + * { margin-top: 32px; }
.space-x-2 > * + * { margin-left: 8px; }
.space-x-3 > * + * { margin-left: 12px; }
.space-x-4 > * + * { margin-left: 16px; }

/* List styles */
.list-disc { list-style-type: disc; }
.list-none { list-style-type: none; }

/* Min/max width */
.min-w-0 { min-width: 0; }
.min-h-0 { min-height: 0; }

/* Aspect ratio placeholder - use inline style instead */
/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Dropdown Menu */
.dropdown-container {
  position: relative;
  display: inline-flex;
}
.dropdown-container .btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.dropdown-trigger {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 100;
  overflow: hidden;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
.dropdown-item:hover {
  background: var(--bg-subtle);
}
.dropdown-item .icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

/* Print styles - hide certain elements when printing */
@media print {
  .no-print { display: none !important; }
}


/* =====================================================
   Mobile Navigation (Hamburger Menu)
   ===================================================== */

/* 汉堡按钮 - 移动端显示 */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border-medium);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}

.mobile-menu-btn:hover {
  background: var(--bg-muted);
}

/* 移动端抽屉菜单 - 默认隐藏 */
.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 8px 16px 12px;
  border-top: 1px solid var(--border-light);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: var(--transition);
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--text-primary);
  background: var(--bg-muted);
}

.mobile-nav-item .icon {
  width: 18px;
  height: 18px;
}

/* 仅在移动端显示汉堡按钮，隐藏桌面导航 */
@media (max-width: 768px) {
  .site-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
  }
}


/* =====================================================
   Global Mobile Responsive Utilities
   ===================================================== */

/* container 在移动端减少 padding */
@media (max-width: 768px) {
  .container,
  .container-wide {
    padding: 0 16px;
  }
}

/* 移动端隐藏/显示辅助类 */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* 移动端全宽按钮辅助 */
@media (max-width: 480px) {
  .btn-full-mobile {
    width: 100%;
    justify-content: center;
  }
}

/* 表格移动端横向滚动包裹 */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 移动端卡片内边距收缩 */
@media (max-width: 640px) {
  .card {
    padding: 16px;
  }
}

/* =====================================================
   Gallery 页 Tab / Dimension Filter 横向滚动
   ===================================================== */

/* 桌面端不变 */
.gallery-tabs {
  overflow-x: auto;
}
/* 隐藏滚动条但保留滚动功能 */
.gallery-tabs::-webkit-scrollbar,
.gallery-dims::-webkit-scrollbar {
  display: none;
}

.gallery-dims {
  overflow-x: auto;
  flex-wrap: nowrap;
}

/* 移动端：延伸到屏幕边缘 + mask-image 渐变提示可滚动 */
@media (max-width: 768px) {
  .gallery-tabs,
  .gallery-dims {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
  }
}


/* =====================================================
   Admin Mobile Layout
   ===================================================== */

/* 侧边栏切换按钮 - 仅移动端显示 */
.admin-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border-medium);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}
.admin-sidebar-toggle:hover {
  background: var(--bg-muted);
}

/* 遮罩层 */
.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 40;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.admin-sidebar-overlay.show {
  display: block;
}

@media (max-width: 768px) {
  /* 显示切换按钮 */
  .admin-sidebar-toggle {
    display: flex;
  }

  /* 侧边栏默认隐藏，变为固定层 */
  .admin-sidebar {
    position: fixed;
    top: 57px;
    left: 0;
    height: calc(100vh - 57px);
    z-index: 45;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }

  /* 展开状态 */
  .admin-sidebar.open {
    transform: translateX(0);
  }

  /* 内容区占满宽度 */
  .admin-layout {
    overflow: visible;
  }

  .admin-content {
    padding: 16px;
  }

  .admin-page-header {
    padding: 16px 16px 12px;
  }

  .admin-page-scrollable {
    padding: 0 16px 24px;
  }
}


/* =====================================================
   About Page Styles (Redesigned)
   ===================================================== */

.about-page {
  background: var(--bg-card);
  min-height: 100vh;
}

/* Hero */
.about-hero {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 72px 24px 56px;
  text-align: center;
}

.about-hero-inner {
  max-width: 600px;
  margin: 0 auto;
}

.about-hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--bg-muted);
  border: 1px solid var(--border-medium);
  border-radius: 100px;
  padding: 4px 12px;
  margin-bottom: 20px;
}

.about-hero-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 14px;
}

.about-hero-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .about-hero {
    padding: 48px 20px 40px;
  }
  .about-hero-title {
    font-size: 26px;
  }
  .about-hero-desc {
    font-size: 14px;
  }
}

/* Body container */
.about-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

@media (max-width: 640px) {
  .about-body {
    padding: 0 16px 32px;
  }
}

/* Section */
.about-section {
  margin-top: 44px;
}

.about-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.about-section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.about-section-lead {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 28px;
}

.about-section-lead strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Independence */
.about-independence {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: 12px;
}

.about-independence-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  border-radius: 8px;
}

@media (prefers-color-scheme: dark) {
  .about-independence-icon {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
  }
}

.about-independence-body {
  flex: 1;
  min-width: 0;
}

.about-independence-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.about-independence-items {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.about-independence-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.about-independence-item svg {
  flex-shrink: 0;
  color: #22c55e;
  margin-top: 2px;
}

.about-independence-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

@media (max-width: 640px) {
  .about-independence {
    flex-direction: column;
    padding: 16px;
  }
}

/* Pillars */
.about-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .about-pillars {
    grid-template-columns: 1fr;
  }
}

.about-pillar {
  padding: 20px;
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: 12px;
}

.about-pillar-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  color: var(--c);
  margin-bottom: 12px;
}

.about-pillar-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.about-pillar-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.6;
}

/* Benchmarks */
.about-benchmarks {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  overflow: hidden;
}

.about-benchmark {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s ease;
}

.about-benchmark:last-child {
  border-bottom: none;
}

.about-benchmark:hover {
  background: var(--bg-muted);
}

.about-benchmark--coming {
  opacity: 0.55;
}

.about-benchmark--coming:hover {
  background: transparent;
}

.about-benchmark-dot {
  flex-shrink: 0;
  width: 4px;
  border-radius: 4px;
  background: var(--c);
  margin-right: 16px;
  align-self: stretch;
  min-height: 20px;
}

.about-benchmark-body {
  flex: 1;
  min-width: 0;
}

.about-benchmark-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.about-benchmark-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--c);
  font-family: monospace;
}

.about-benchmark-cat {
  font-size: 13px;
  color: var(--text-tertiary);
}

.about-benchmark-soon {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--bg-muted);
  color: var(--text-tertiary);
  border-radius: 100px;
  border: 1px solid var(--border-medium);
}

.about-benchmark-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Transparency */
.about-transparency-intro {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
}

.about-notices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.about-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid;
}

.about-notice svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.about-notice--info {
  background: rgba(59, 130, 246, 0.05);
  border-color: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.about-notice--warn {
  background: rgba(234, 179, 8, 0.05);
  border-color: rgba(234, 179, 8, 0.25);
  color: #ca8a04;
}

@media (prefers-color-scheme: dark) {
  .about-notice--info {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
  }
  .about-notice--warn {
    background: rgba(234, 179, 8, 0.08);
    border-color: rgba(234, 179, 8, 0.3);
    color: #fcd34d;
  }
}

.about-notice-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.about-notice-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

.about-notice-plan {
  color: var(--text-tertiary);
}

.about-transparency-note {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.7;
}

.about-transparency-note a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Opensource */
.about-opensource {
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 24px;
}

.about-opensource-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.about-opensource-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.about-opensource-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-muted);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  padding: 5px 10px;
}

.about-opensource-tag svg {
  color: #22c55e;
}

.about-github-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-muted);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 9px 16px;
  transition: all 0.15s ease;
}

.about-github-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

/* Contact row */
.about-contact-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .about-contact-row {
    grid-template-columns: 1fr;
  }
}

.about-contact-box {
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 20px;
}

.about-contact-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.about-contact-ico {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  color: var(--c);
}

.about-contact-info {
  flex: 1;
  min-width: 0;
}

.about-contact-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.about-contact-note {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.about-contact-note strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.about-qr-wrap {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: var(--bg-muted);
  border-radius: 10px;
}

.about-qr-wrap img {
  width: 100px;
  height: 100px;
  border-radius: 6px;
  object-fit: contain;
}

/* Sponsors */
.about-sponsors-box {
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 20px 24px;
}

.about-sponsors-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.about-sponsors-empty {
  font-size: 14px;
  color: var(--text-tertiary);
}


/* =====================================================
   Methodology Page Styles
   ===================================================== */
/* 方法论页面整体两栏布局 */
.methodology-page {
  display: flex;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 0;
}

/* 左侧目录侧边栏 */
.methodology-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  height: calc(100vh - 88px);
  display: flex;
  flex-direction: column;
  padding: 48px 0 64px;
}

.sidebar-inner {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 24px;
  scrollbar-width: none;
}

.sidebar-inner::-webkit-scrollbar {
  display: none;
}

.sidebar-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
}

.sidebar-link {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-tertiary);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 5px;
  line-height: 1.5;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.sidebar-link.active {
  color: var(--text-primary);
  font-weight: 500;
}

.sidebar-link-sub {
  font-size: 0.75rem;
  padding-left: 1rem;
  color: var(--text-tertiary);
  opacity: 0.7;
}

.sidebar-link-sub:hover {
  opacity: 1;
}

.sidebar-link-sub.active {
  opacity: 1;
  font-weight: 400;
}

/* 右侧正文区域 */
.methodology-container {
  flex: 1;
  min-width: 0;
  padding: 48px 0 64px 32px;
}

.methodology-content {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  padding: 48px;
}

/* 窄屏隐藏侧边栏 */
@media (max-width: 900px) {
  .methodology-sidebar {
    display: none;
  }
  .methodology-container {
    padding: 48px 0 64px;
  }
  .methodology-page {
    padding: 0 16px;
  }
}

@media (max-width: 640px) {
  .methodology-content {
    padding: 24px;
  }
  .methodology-page {
    padding: 0 0;
  }
  .methodology-container {
    padding: 32px 16px 48px;
  }
}

.methodology-content h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.methodology-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 48px;
  margin-bottom: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.methodology-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.methodology-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 12px;
}

.methodology-content h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 24px;
  margin-bottom: 8px;
}

.methodology-content p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.methodology-content > blockquote:first-child {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-secondary);
  border-left: none;
  padding-left: 0;
  margin-bottom: 32px;
}

.methodology-content > blockquote:first-child strong {
  color: var(--text-primary);
}

.methodology-content blockquote {
  border-left: 4px solid var(--border-strong);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--text-secondary);
}

.methodology-content ul,
.methodology-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.methodology-content li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.methodology-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.methodology-content hr {
  border: none;
  border-top: 1px solid var(--border-medium);
  margin: 32px 0;
}

.methodology-content .table-wrapper {
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  overflow: hidden;
  margin: 24px 0;
}

.methodology-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 0;
}

.methodology-content th {
  background: var(--bg-subtle);
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-medium);
}

.methodology-content td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: top;
}

.methodology-content tbody tr:last-child td {
  border-bottom: none;
}

.methodology-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  background: var(--bg-muted);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-primary);
}

.methodology-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
}

.methodology-content pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--code-text);
}

.methodology-content a {
  color: #6366f1;
  text-decoration: none;
}

.methodology-content a:hover {
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  .methodology-content a {
    color: #a5b4fc;
  }
}

/* KaTeX 数学公式样式 */
.methodology-content .katex-display {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--bg-subtle);
  border-radius: 8px;
  overflow-x: auto;
}

.methodology-content .katex {
  font-size: 1.1em;
  color: var(--text-primary);
}

.methodology-content .katex-display > .katex {
  font-size: 1.15em;
}

/* cases 环境（分段函数）特殊处理 */
.methodology-content .katex .mord.text {
  font-family: inherit;
}

/* 方法论文档目录块 */
.methodology-content .toc-block {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-medium, #e5e7eb);
  border-left: 3px solid var(--text-primary, #111827);
  border-radius: 0 10px 10px 0;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0 2.5rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.methodology-content .toc-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-primary, #111827);
  padding-top: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.5;
}

.methodology-content .toc-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.methodology-content .toc-nav > a {
  display: block;
  font-size: 0.845rem;
  font-weight: 500;
  color: var(--text-primary, #111827);
  text-decoration: none;
  padding: 0.28rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
  line-height: 1.5;
}

.methodology-content .toc-nav > a:hover {
  background: var(--bg-subtle, #f9fafb);
  color: var(--text-primary, #111827);
}

.methodology-content .toc-sub {
  display: flex;
  flex-direction: column;
  padding-left: 0.875rem;
  margin: 0.1rem 0 0.1rem 0.25rem;
}

.methodology-content .toc-sub a {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-tertiary, #9ca3af);
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
  line-height: 1.5;
}

.methodology-content .toc-sub a:hover {
  background: var(--bg-subtle, #f9fafb);
  color: var(--text-secondary, #4b5563);
}

@media (prefers-color-scheme: dark) {
  .methodology-content .toc-block {
    border-left-color: var(--text-primary, #fafafa);
  }
}

@media (max-width: 640px) {
  .methodology-content .toc-block {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem;
  }
}

/* 方法论文档内 heading 滚动偏移：防止被固定导航栏遮住 */
.methodology-content h1,
.methodology-content h2,
.methodology-content h3,
.methodology-content h4,
.methodology-content h5,
.methodology-content h6 {
  scroll-margin-top: 72px;
}

/* 方法论文档内图片样式 */
.methodology-content img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border-light, #e5e7eb);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin: 1.5rem auto 0.5rem;
}

/* 图片下方的说明文字：图片和 em 在同一个 p 内（markdown 渲染结构） */
.methodology-content p > img + em {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-tertiary, #9ca3af);
  margin-top: 0.5rem;
  font-style: italic;
}

.methodology-content p:has(> img) {
  margin-bottom: 0.25rem;
}

/* 页脚信息行 */
.methodology-content .methodology-footer {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  text-align: center;
}

/* 强调蓝色文字 */
.methodology-content strong.highlight {
  color: #2563eb !important;
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  .methodology-content strong.highlight {
    color: #60a5fa !important;
  }
}

/* 正文内引用角标 [1] */
.methodology-content .ref-link {
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
  color: var(--text-tertiary);
  text-decoration: none;
  font-weight: 500;
  padding: 0 1px;
  transition: color 0.15s;
}

.methodology-content .ref-link:hover {
  color: var(--text-primary);
}

/* 表格控制按钮 */
.table-ctrl-btn {
  cursor: pointer;
  user-select: none;
}

.table-ctrl-btn:hover {
  background: var(--bg-subtle) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-medium) !important;
}

.table-ctrl-btn:active {
  transform: scale(0.97);
}

.table-ctrl-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* 表格视图模式切换按钮 */
.table-view-btn {
  cursor: pointer;
  user-select: none;
}.table-view-btn:hover {
  background: var(--bg-subtle) !important;
}

/* =====================================================
   懒加载样式
   ===================================================== */
img[data-src],
[data-bg-src] {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

img.lazy-loading,
.lazy-loading {
  opacity: 0.5;
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-secondary) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: lazy-shimmer 1.5s infinite;
}

@keyframes lazy-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

img.lazy-loaded,
.lazy-loaded {
  opacity: 1;
}
