:root {
  --bg: #f4f6fb;            
  --bg-card: #ffffff;       
  --bg-card-hover: #eef2f9;
  --bg-input: #ffffff;
  --bg-sidebar: #eef2f8;
  --primary: #2563eb;       
  --primary-strong: #1d4ed8;
  --primary-light: #3b82f6; 
  --primary-dim: rgba(37, 99, 235, 0.10);
  --primary-glow: rgba(37, 99, 235, 0.22);
  --accent: #0891b2;        
  --accent-dim: rgba(8, 145, 178, 0.10);
  --success: #059669;
  --danger: #dc2626;
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: rgba(15, 23, 42, 0.08);
  --border-light: rgba(15, 23, 42, 0.14);
  --surface: rgba(15, 23, 42, 0.03); 
  --grad-primary: linear-gradient(135deg, var(--primary-light), var(--primary));
  --grad-primary-strong: linear-gradient(135deg, var(--primary), var(--primary-strong));
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --container-padding: 1rem;
  --container-max: 480px;
}
[data-theme="dark"] {
  --bg: #0e131a;
  --bg-card: #182029;
  --bg-card-hover: #212c38;
  --bg-input: #182029;
  --bg-sidebar: #141b23;
  --primary: #4c8dff;
  --primary-strong: #2f6fe0;
  --primary-light: #7fb0ff;
  --primary-dim: rgba(76, 141, 255, 0.16);
  --primary-glow: rgba(76, 141, 255, 0.35);
  --accent: #2dd4bf;
  --accent-dim: rgba(45, 212, 191, 0.14);
  --success: #34d399;
  --danger: #f87171;
  --text: #e7eef6;
  --text-secondary: #aebccb;
  --text-muted: #6f8194;
  --border: rgba(255, 255, 255, 0.10);
  --border-light: rgba(255, 255, 255, 0.16);
  --surface: rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);
}
[data-theme="dark"] .top-nav { background: rgba(14, 19, 26, 0.82); border-bottom-color: var(--border); }
[data-theme="dark"] .side-card.daily { background: linear-gradient(160deg, #241318, #1a1622); border-color: rgba(244, 63, 94, 0.22); }
[data-theme="dark"] .daily-row { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .daily-row:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(244, 63, 94, 0.35); }
[data-theme="dark"] .hc-arrow:hover { background: var(--bg-card-hover); color: var(--primary); }
[data-theme="dark"] .hc-dot { background: rgba(255, 255, 255, 0.35); }
[data-theme="dark"] .hc-dot.active { background: var(--primary-light); }
[data-theme="dark"] .hs-history { background: var(--bg-card); box-shadow: var(--shadow-card); }
[data-theme="dark"] .hs-history-item:hover { background: var(--bg-card-hover); }
[data-theme="dark"] #daily-popup .daily-modal,
[data-theme="dark"] .share-modal { background: var(--bg-card); color: var(--text); }
[data-theme="dark"] .modal-btn.secondary { background: var(--surface); }
[data-theme="dark"] .nav-btn { color: var(--text-secondary); }
[data-theme="dark"] .nav-btn:hover { background: var(--bg-card-hover); color: var(--text); }
[data-theme="dark"] .card-img-wrap { background: var(--bg-card); }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
::-webkit-scrollbar { width: 0; height: 0; display: none; }
:focus-visible{outline:2px solid var(--primary);outline-offset:2px;border-radius:2px}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; font-weight: 700; color: var(--text);
}
.section-title::before {
  content: ''; width: 3px; height: 14px; border-radius: 2px;
  background: var(--grad-primary);
  box-shadow: 0 0 8px var(--primary-glow);
}
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--primary-dim);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-img, .skeleton-text {
  background: linear-gradient(100deg, var(--surface) 30%, var(--bg-card-hover) 50%, var(--surface) 70%);
  background-size: 200% 100%;
  animation: sk 1.2s infinite;
  border-radius: 12px;
}
.skeleton-img { width: 100%; aspect-ratio: 2/3; }
.skeleton-text { height: 12px; margin: 0 3px; }
.sk-card { display: flex; flex-direction: column; gap: 8px; }
.nav-page-title {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--primary-dim); color: var(--primary-strong);
  font-size: 13px; font-weight: 700;
  border: 1px solid var(--primary-glow);
  white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 768px) { .nav-page-title { display: none; } }
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 150;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:active { transform: scale(0.92); }
@media (max-width: 420px) {
  .back-to-top { right: 12px; bottom: 18px; width: 40px; height: 40px; font-size: 16px; }
}
.nav-btn.active {
  background: var(--primary-dim);
  color: var(--primary-strong);
  cursor: default;
}
.nav-btn.active:hover { background: var(--primary-dim); color: var(--primary-strong); }
[data-theme="dark"] .nav-btn.active { color: var(--primary-light); }
.nav-history-panel {
  position: fixed; top: 64px; right: 14px; z-index: 120;
  width: 320px; max-width: calc(100vw - 28px);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.98);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.nav-history-panel.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.nhp-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.nhp-head .nhp-title { font-size: 14.5px; font-weight: 700; color: var(--text); }
.nhp-head .nhp-count { font-size: 12px; color: var(--text-muted); }
.nhp-head .nhp-clear {
  margin-left: auto; border: none; background: transparent; cursor: pointer;
  color: var(--text-muted); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 6px; border-radius: 8px; transition: all var(--transition);
}
.nhp-head .nhp-clear:hover { background: rgba(239, 68, 68, 0.12); color: var(--err); }
.nhp-list { max-height: 360px; overflow-y: auto; padding: 6px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.nhp-list::-webkit-scrollbar { width: 6px; }
.nhp-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.nhp-item {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius);
  cursor: pointer; transition: background var(--transition); position: relative;
}
.nhp-item:hover { background: var(--bg-card-hover); }
.nhp-item img { width: 46px; height: 62px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; background: var(--bg-card-hover); }
.nhp-item .nhp-noimg { width: 46px; height: 62px; border-radius: 8px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: var(--bg-card-hover); color: var(--text-muted); font-size: 20px; }
.nhp-info { flex: 1; min-width: 0; }
.nhp-name { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nhp-ep { font-size: 12px; color: var(--primary-light); margin-top: 3px; }
.nhp-del {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all var(--transition);
}
.nhp-del:hover { background: rgba(239, 68, 68, 0.14); color: var(--err); border-color: rgba(239, 68, 68, 0.3); }
.nhp-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 36px 0; }
.nhp-empty i { display: block; font-size: 30px; margin-bottom: 8px; opacity: 0.5; }
@media (max-width: 768px) {
  .nav-history-panel { top: 58px; right: 10px; left: 10px; width: auto; }
}
