/* ================================================================
   新华字典 · 词语大全 · 美化版全局样式
   Xinhua Dictionary — Pretty CSS
   全新设计：更现代、更美观、更精致的UI
   ================================================================ */

/* ========= 00: Theme Definitions ========= */
[data-theme="blue"]{
  --bg-primary: #f0f4ff;
  --bg-secondary: #e8f0ff;
  --bg-card: rgba(255,255,255,0.88);
  --bg-card-solid: #ffffff;
  --bg-card-hover: rgba(255,255,255,0.95);
  --bg-sidebar: linear-gradient(180deg, #f8fbff 0%, #eef3ff 100%);
  --bg-input: #ffffff;
  --bg-glass: rgba(255,255,255,0.6);
  --gold: #4a90e2;
  --gold-light: #6ba5f7;
  --gold-dark: #2a6bc5;
  --gold-glow: rgba(74,144,226,0.15);
  --gold-gradient: linear-gradient(135deg, #2a6bc5 0%, #4a90e2 50%, #6ba5f7 100%);
  --text-primary: #1a2a40;
  --text-secondary: #3d5570;
  --text-muted: #7a95b0;
  --border: rgba(74,144,226,0.15);
  --border-gold: rgba(74,144,226,0.25);
  --accent-red: #e74c3c;
  --accent-green: #27ae60;
  --accent-blue: #4a90e2;
  --accent-purple: #9b6bff;
  --theme-accent: #4a90e2;
  --theme-glow: rgba(74,144,226,0.08);
  --hero-gradient: radial-gradient(ellipse at 30% 20%, rgba(74,144,226,0.1) 0%, transparent 50%),
                  radial-gradient(ellipse at 80% 80%, rgba(107,165,247,0.06) 0%, transparent 50%);
}

[data-theme="emerald"]{
  --bg-primary: #f0faf4;
  --bg-secondary: #e6f5ed;
  --bg-card: rgba(255,255,255,0.88);
  --bg-card-solid: #ffffff;
  --bg-card-hover: rgba(255,255,255,0.95);
  --bg-sidebar: linear-gradient(180deg, #f8fdf8 0%, #eef8f0 100%);
  --bg-input: #ffffff;
  --bg-glass: rgba(255,255,255,0.6);
  --gold: #2ecc71;
  --gold-light: #54e68a;
  --gold-dark: #1e9e50;
  --gold-glow: rgba(46,204,113,0.15);
  --gold-gradient: linear-gradient(135deg, #1e9e50 0%, #2ecc71 50%, #54e68a 100%);
  --text-primary: #1a3a2a;
  --text-secondary: #3d6b52;
  --text-muted: #7aa880;
  --border: rgba(46,204,113,0.15);
  --border-gold: rgba(46,204,113,0.25);
  --accent-red: #e74c3c;
  --accent-green: #2ecc71;
  --accent-blue: #3498db;
  --accent-purple: #9b6bff;
  --theme-accent: #2ecc71;
  --theme-glow: rgba(46,204,113,0.08);
  --hero-gradient: radial-gradient(ellipse at 30% 20%, rgba(46,204,113,0.1) 0%, transparent 50%),
                  radial-gradient(ellipse at 80% 80%, rgba(84,230,138,0.06) 0%, transparent 50%);
}

[data-theme="purple"]{
  --bg-primary: #f8f4fc;
  --bg-secondary: #f0eaf6;
  --bg-card: rgba(255,255,255,0.88);
  --bg-card-solid: #ffffff;
  --bg-card-hover: rgba(255,255,255,0.95);
  --bg-sidebar: linear-gradient(180deg, #fcf8ff 0%, #f4ecff 100%);
  --bg-input: #ffffff;
  --bg-glass: rgba(255,255,255,0.6);
  --gold: #9b6bff;
  --gold-light: #b78aff;
  --gold-dark: #7a4be0;
  --gold-glow: rgba(155,107,255,0.15);
  --gold-gradient: linear-gradient(135deg, #7a4be0 0%, #9b6bff 50%, #b78aff 100%);
  --text-primary: #2a2040;
  --text-secondary: #54406a;
  --text-muted: #8870a0;
  --border: rgba(155,107,255,0.15);
  --border-gold: rgba(155,107,255,0.25);
  --accent-red: #e74c3c;
  --accent-green: #2ecc71;
  --accent-blue: #3498db;
  --accent-purple: #9b6bff;
  --theme-accent: #9b6bff;
  --theme-glow: rgba(155,107,255,0.08);
  --hero-gradient: radial-gradient(ellipse at 30% 20%, rgba(155,107,255,0.1) 0%, transparent 50%),
                  radial-gradient(ellipse at 80% 80%, rgba(183,138,255,0.06) 0%, transparent 50%);
}

[data-theme="crimson"]{
  --bg-primary: #fdf6f2;
  --bg-secondary: #f9ede6;
  --bg-card: rgba(255,255,255,0.88);
  --bg-card-solid: #ffffff;
  --bg-card-hover: rgba(255,255,255,0.95);
  --bg-sidebar: linear-gradient(180deg, #fff8f5 0%, #fff0e8 100%);
  --bg-input: #ffffff;
  --bg-glass: rgba(255,255,255,0.6);
  --gold: #e74c3c;
  --gold-light: #f56a5a;
  --gold-dark: #c0392b;
  --gold-glow: rgba(231,76,60,0.15);
  --gold-gradient: linear-gradient(135deg, #c0392b 0%, #e74c3c 50%, #f56a5a 100%);
  --text-primary: #3a2420;
  --text-secondary: #6d4a40;
  --text-muted: #a07070;
  --border: rgba(231,76,60,0.15);
  --border-gold: rgba(231,76,60,0.25);
  --accent-red: #e74c3c;
  --accent-green: #2ecc71;
  --accent-blue: #3498db;
  --accent-purple: #9b6bff;
  --theme-accent: #e74c3c;
  --theme-glow: rgba(231,76,60,0.08);
  --hero-gradient: radial-gradient(ellipse at 30% 20%, rgba(231,76,60,0.1) 0%, transparent 50%),
                  radial-gradient(ellipse at 80% 80%, rgba(245,106,90,0.06) 0%, transparent 50%);
}

[data-theme="light"]{
  --bg-primary: #faf8f0;
  --bg-secondary: #f2efe0;
  --bg-card: rgba(255,255,255,0.88);
  --bg-card-solid: #ffffff;
  --bg-card-hover: rgba(255,255,255,0.95);
  --bg-sidebar: linear-gradient(180deg, #fffdf5 0%, #fff8e0 100%);
  --bg-input: #ffffff;
  --bg-glass: rgba(255,255,255,0.58);
  --gold: #d4af37;
  --gold-light: #e8c74a;
  --gold-dark: #b8941e;
  --gold-glow: rgba(212,175,55,0.15);
  --gold-gradient: linear-gradient(135deg, #b8941e 0%, #d4af37 50%, #e8c74a 100%);
  --text-primary: #2c2418;
  --text-secondary: #5a4e3e;
  --text-muted: #8a7e6e;
  --border: rgba(180,165,140,0.25);
  --border-gold: rgba(212,175,55,0.3);
  --accent-red: #e74c3c;
  --accent-green: #27ae60;
  --accent-blue: #3498db;
  --accent-purple: #9b6bff;
  --theme-accent: #d4af37;
  --theme-glow: rgba(212,175,55,0.06);
  --hero-gradient: radial-gradient(ellipse at 30% 20%, rgba(212,175,55,0.08) 0%, transparent 50%),
                  radial-gradient(ellipse at 80% 80%, rgba(140,110,20,0.04) 0%, transparent 50%);
}

[data-theme="sakura"]{
  --bg-primary: #fdf2f8;
  --bg-secondary: #fce7f3;
  --bg-card: rgba(255,255,255,0.88);
  --bg-card-solid: #ffffff;
  --bg-card-hover: rgba(255,255,255,0.95);
  --bg-sidebar: linear-gradient(180deg, #fff8fc 0%, #ffe8f5 100%);
  --bg-input: #ffffff;
  --bg-glass: rgba(255,255,255,0.6);
  --gold: #e84393;
  --gold-light: #f06aa8;
  --gold-dark: #c0396a;
  --gold-glow: rgba(232,67,147,0.15);
  --gold-gradient: linear-gradient(135deg, #c0396a 0%, #e84393 50%, #f06aa8 100%);
  --text-primary: #3a1830;
  --text-secondary: #6d3d5a;
  --text-muted: #a0708a;
  --border: rgba(232,67,147,0.15);
  --border-gold: rgba(232,67,147,0.25);
  --accent-red: #e84393;
  --accent-green: #2ecc71;
  --accent-blue: #3498db;
  --accent-purple: #b78aff;
  --theme-accent: #e84393;
  --theme-glow: rgba(232,67,147,0.08);
  --hero-gradient: radial-gradient(ellipse at 30% 20%, rgba(232,67,147,0.1) 0%, transparent 50%),
                  radial-gradient(ellipse at 80% 80%, rgba(240,106,168,0.06) 0%, transparent 50%);
}

/* ========= 01: Root & Reset ========= */
:root{
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-main: 'Alibaba PuHuiTi 2.0', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', system-ui, sans-serif;
  --font-kai: 'LXGW WenKai', 'KaiTi', 'STKaiti', 'Kaiti SC', 'FangSong', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-display: 'Alibaba PuHuiTi 2.0', 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
  --sidebar-w: 240px;
  --toolbar-h: 48px;
  --page-pad: 24px;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.06);
  --shadow: 0 8px 32px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
  --shadow-gold: 0 8px 32px var(--gold-glow);
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;font-size:16px}

body.fs-s .main{zoom:0.85}
body.fs-m .main{zoom:1}
body.fs-l .main{zoom:1.2}

body{
  font-family:var(--font-main);
  background:var(--bg-primary);
  color:var(--text-primary);
  line-height:1.8;
  overflow-x:hidden;
  transition:background 0.5s, color 0.3s;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

[data-theme="light"]{
  background-image:url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

::-webkit-scrollbar{width:6px}
::-webkit-scrollbar-track{background:transparent;border-radius:3px}
::-webkit-scrollbar-thumb{
  background:linear-gradient(180deg, var(--gold) 0%, var(--gold-light) 100%);
  border-radius:3px;
  opacity:0.6;
  transition:opacity 0.3s;
}
::-webkit-scrollbar-thumb:hover{opacity:1}

a{color:var(--gold);text-decoration:none;transition:var(--transition)}
a:hover{color:var(--gold-light);text-decoration:none}

/* ========= 02: Floating Toolbar (吸顶导航条) ========= */
.floating-toolbar{
  position:fixed;top:0;right:0;left:var(--sidebar-w);
  height:var(--toolbar-h);
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:3px;
  padding:0 var(--page-pad);
  background:rgba(255,255,255,0.82);
  backdrop-filter:blur(24px) saturate(1.8);
  -webkit-backdrop-filter:blur(24px) saturate(1.8);
  border-bottom:1px solid var(--border);
  border-radius:0;
  box-shadow:0 2px 12px rgba(0,0,0,0.04);
  transition:left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-toolbar:hover{
  box-shadow:0 4px 20px rgba(0,0,0,0.06);
  background:rgba(255,255,255,0.92);
}

/* ========= 03: Page Layout ========= */
.page-wrap{
  display:flex;
  min-height:100vh;
}

/* ========= 04: Sidebar ========= */
.sidebar{
  position:sticky;
  top:0;
  width:var(--sidebar-w);
  height:100vh;
  flex-shrink:0;
  background:var(--bg-sidebar);
  border-right:1px solid var(--border);
  z-index:100;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  overflow-x:hidden;
  transition:all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:4px 0 24px rgba(0,0,0,0.04);
}

.sidebar::after{
  content:'';
  position:absolute;top:0;right:0;
  width:3px;height:100%;
  background:linear-gradient(180deg, var(--gold) 0%, var(--gold-light) 50%, transparent 100%);
  opacity:0.5;border-radius:2px 0 0 2px;
  transition:opacity 0.3s;
}
.sidebar:hover::after{opacity:0.8}


/* ========= Sidebar Navigation（重构版） ========= */
.sidebar-nav{padding:8px 0}

.nav-group{margin-bottom:4px}

/* 分组标题 */
.nav-head{
  display:flex;align-items:center;gap:8px;
  padding:10px 18px 6px;
  font-size:11px;font-weight:700;
  color:var(--text-muted);
  letter-spacing:1px;
  text-transform:uppercase;
  user-select:none;
}
.nav-head-ico{font-size:13px;opacity:0.7}
.nav-head-text{opacity:0.85}
.nav-head-link{
  display:inline-flex;align-items:center;gap:8px;
  text-decoration:none;color:inherit;
  transition:opacity .2s;
}
.nav-head-link:hover{opacity:1}
.nav-head-link:hover .nav-head-text{opacity:1;color:var(--theme-accent)}

/* 导航链接 */
.nav-body{padding:0 10px 4px}
.nav-link{
  display:flex;align-items:center;gap:10px;
  padding:9px 14px;
  margin:2px 0;
  border-radius:10px;
  color:var(--text-secondary);
  font-size:13.5px;
  text-decoration:none;
  transition:all 0.25s cubic-bezier(0.4,0,0.2,1);
  position:relative;
}
.nav-link .nav-ico{
  display:inline-flex;align-items:center;justify-content:center;
  width:26px;height:26px;
  border-radius:8px;
  font-size:12px;
  background:var(--bg-glass);
  border:1px solid var(--border);
  flex-shrink:0;
  transition:all 0.25s ease;
}
.nav-link:hover{
  background:var(--gold-glow);
  color:var(--gold);
}
.nav-link:hover .nav-ico{
  background:var(--gold);color:#fff;border-color:var(--gold);
  transform:scale(1.08);
}
.nav-link.active{
  background:var(--gold-glow);
  color:var(--gold);font-weight:600;
}
.nav-link.active .nav-ico{
  background:var(--gold);color:#fff;border-color:var(--gold);
}


/* ========= 05: Main Content ========= */
.main{
  flex:1;
  min-width:0;
  padding-top:var(--toolbar-h);
  min-height:100vh;
  display:flex;
  flex-direction:column;
  background:var(--bg-primary);
}

/* ========= 06: Content (fallback — 详情页用) ========= */
.content{
  width:100%;
  margin:0 auto;
  padding:32px var(--page-pad) 0;
  position:relative;
  flex:1;
}

/* Hero Section */
.hero{
  background:var(--hero-gradient);
  border-radius:var(--radius-lg);
  padding:60px 48px 52px;
  margin-bottom:40px;
  position:relative;
  overflow:hidden;
  border:1px solid var(--border);
  box-shadow:0 8px 32px rgba(0,0,0,0.04);
}

.hero::before{
  content:'';
  position:absolute;
  top:0;left:0;
  width:100%;height:100%;
  background:url("data:image/svg+xml,%3Csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='40' cy='40' r='1' fill='%234a90e2' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events:none;
}

.hero h1{
  font-size:36px;
  font-weight:900;
  color:var(--text-primary);
  margin-bottom:16px;
  letter-spacing:2px;
  position:relative;
  line-height:1.3;
}

.hero h1::after{
  display:none;
}

.hero .subtitle{
  font-size:15px;
  color:var(--text-secondary);
  line-height:1.8;
  position:relative;
  max-width:640px;
}

/* Stats Grid */
.stats-grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:20px;
  margin-bottom:40px;
}

.stat-card{
  background:var(--bg-card);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  padding:24px 20px;
  text-align:center;
  transition:all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position:relative;
  overflow:hidden;
  cursor:pointer;
}

.stat-card::before{
  content:'';
  position:absolute;
  top:0;left:0;
  width:100%;height:3px;
  background:var(--gold-gradient);
  opacity:0.5;
  transition:opacity 0.3s;
}

.stat-card:hover{
  transform:translateY(-4px);
  box-shadow:var(--shadow-gold);
  border-color:var(--border-gold);
}

.stat-card:hover::before{opacity:1}

.stat-card .stat-num{
  font-size:32px;
  font-weight:900;
  color:var(--gold);
  line-height:1.2;
  margin-bottom:8px;
  text-shadow:0 2px 8px var(--gold-glow);
}

.stat-card .stat-label{
  font-size:12px;
  color:var(--text-muted);
  letter-spacing:1px;
  opacity:0.8;
}

/* ========= 07: Card Styles ========= */
.card{
  background:var(--bg-card);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  padding:28px;
  margin-bottom:24px;
  transition:all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position:relative;
  overflow:hidden;
}

.card::before{
  content:'';
  position:absolute;
  top:0;left:0;
  width:100%;height:100%;
  background:linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events:none;
}

.card:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow);
  border-color:var(--border-gold);
}

.card h2{
  font-size:20px;
  font-weight:800;
  color:var(--text-primary);
  margin-bottom:20px;
  padding-bottom:12px;
  border-bottom:1px solid var(--border);
  position:relative;
}

.card h2::after{
  content:'';
  position:absolute;
  bottom:-1px;left:0;
  width:40px;height:2px;
  background:var(--gold-gradient);
  border-radius:1px;
}

/* ========= 08: 推荐网格 ========= */
.reco-grid{
  display:grid;
  grid-template-columns:repeat(6, 1fr);
  gap:16px;
}

.reco-item{
  background:var(--bg-card-solid);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:16px 12px;
  text-align:center;
  transition:all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor:pointer;
  position:relative;
  overflow:hidden;
}

.reco-item::before{
  content:'';
  position:absolute;
  top:0;left:0;
  width:100%;height:2px;
  background:var(--gold-gradient);
  opacity:0;
  transition:opacity 0.3s;
}

.reco-item:hover{
  transform:translateY(-3px);
  box-shadow:var(--shadow-sm);
  border-color:var(--border-gold);
}

.reco-item:hover::before{opacity:0.6}

.reco-item .reco-char{
  font-size:28px;
  font-weight:900;
  color:var(--gold);
  margin-bottom:6px;
  line-height:1.2;
  transition:transform 0.3s ease;
}

.reco-item:hover .reco-char{transform:scale(1.1)}

.reco-item .reco-label{
  font-size:11px;
  color:var(--text-muted);
  opacity:0.75;
  letter-spacing:0.5px;
}

/* ========= 09: Pinyin Index ========= */
.py-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(90px, 1fr));
  gap:12px;
}

.py-item{
  background:var(--bg-card-solid);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:14px 10px;
  text-align:center;
  transition:all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor:pointer;
  position:relative;
}

.py-item::after{
  content:'';
  position:absolute;
  bottom:0;left:50%;
  transform:translateX(-50%);
  width:0%;height:2px;
  background:var(--gold-gradient);
  border-radius:1px;
  transition:width 0.3s ease;
}

.py-item:hover{
  background:var(--theme-glow);
  border-color:var(--border-gold);
  transform:translateY(-2px);
}

.py-item:hover::after{width:80%}

.py-item .py-label{
  font-size:16px;
  font-weight:700;
  color:var(--text-primary);
  margin-bottom:4px;
}

.py-item .py-count{
  font-size:10px;
  color:var(--text-muted);
  opacity:0.7;
}

/* ========= 10: Footer ========= */
.site-footer{
  background:var(--bg-secondary);
  border-top:1px solid var(--border);
  margin-top:auto;
  padding:16px 24px;
  position:relative;
  z-index:10;
}

.site-footer::before{
  content:'';
  position:absolute;
  top:0;left:0;right:0;
  height:1px;
  background:var(--gold-gradient);
  opacity:0.3;
}

.footer-inner{
  max-width:1200px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  color:var(--text-muted);
}

.footer-line{
  text-align:center;
  line-height:1.6;
}

.footer-primary{
  font-size:13px;
  color:var(--text-secondary);
  font-weight:500;
  letter-spacing:0.5px;
}

.footer-secondary{
  font-size:11px;
  color:var(--text-muted);
  opacity:0.8;
}

.footer-copy{
  color:var(--text-secondary);
  font-weight:500;
}

.footer-sep{
  color:var(--text-muted);
  opacity:0.4;
  user-select:none;
}

.footer-inner a{
  color:var(--text-muted);
  text-decoration:none;
  transition:color 0.2s ease;
  padding:2px 0;
}

.footer-inner a:hover{
  color:var(--gold);
}

/* ========= 11: Buttons ========= */
.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 24px;
  border-radius:var(--radius-sm);
  font-size:13.5px;
  font-weight:600;
  cursor:pointer;
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border:none;
  font-family:var(--font-main);
  letter-spacing:0.5px;
}

.btn-primary{
  background:var(--gold-gradient);
  color:#fff;
  box-shadow:0 4px 16px var(--gold-glow);
}

.btn-primary:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 24px var(--gold-glow);
}

.btn-secondary{
  background:var(--bg-card-solid);
  color:var(--text-primary);
  border:1.5px solid var(--border);
}

.btn-secondary:hover{
  border-color:var(--gold);
  color:var(--gold);
  background:var(--theme-glow);
}

/* ========= 12: Responsive ========= */
@media(max-width:1100px){
  :root{--sidebar-w:200px}
  .main{padding-top:var(--toolbar-h)}
}

@media(max-width:800px){
  .sidebar{display:none}
  .floating-toolbar{left:0}
  .main{padding-top:var(--toolbar-h)}
  .content{padding:20px 16px 0}
}

@media(max-width:480px){
  .content{padding:16px 12px 0}
  .hero{padding:28px 18px 24px}
  .hero h1{font-size:24px}
  .stats-grid{grid-template-columns:1fr 1fr}
  .reco-grid{grid-template-columns:repeat(2, 1fr)}
  .py-grid{grid-template-columns:repeat(auto-fill, minmax(70px, 1fr))}
}

/* ========= 13: Animations ========= */
@keyframes fadeInUp{
  from{opacity:0;transform:translateY(20px)}
  to{opacity:1;transform:translateY(0)}
}

@keyframes fadeIn{
  from{opacity:0}
  to{opacity:1}
}

.fade-in-up{
  animation:fadeInUp 0.6s ease-out;
}

.fade-in{
  animation:fadeIn 0.4s ease-out;
}

/* 为卡片添加交错动画 */
.stat-card:nth-child(1){animation-delay:0.1s}
.stat-card:nth-child(2){animation-delay:0.2s}
.stat-card:nth-child(3){animation-delay:0.3s}
.stat-card:nth-child(4){animation-delay:0.4s}

/* ========= 14: 返回顶部按钮 ========= */
.back-to-top{
  position:fixed;
  bottom:36px;right:36px;
  width:52px;height:52px;
  border-radius:50%;
  background:var(--bg-glass),rgba(255,255,255,0.65));
  color:var(--gold);
  border:1.5px solid var(--border-gold);
  cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 4px 20px var(--gold-glow), 0 1px 3px rgba(0,0,0,0.06);
  z-index:99990;
  opacity:0;visibility:hidden;
  transform:translateY(16px) scale(0.9);
  transition:all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter:blur(12px) saturate(1.2);
  -webkit-backdrop-filter:blur(12px) saturate(1.2);
  outline:none;
}

.back-to-top.btt-visible{
  opacity:1;visibility:visible;
  transform:translateY(0) scale(1);
}

.back-to-top:hover{
  background:var(--bg-card-solid),#fff);
  border-color:var(--gold);
  box-shadow:0 8px 28px var(--gold-glow), 0 2px 6px rgba(0,0,0,0.08);
  transform:translateY(-3px) scale(1.06);
}

.back-to-top:active{
  transform:translateY(-1px) scale(0.97);
  transition-duration:0.1s;
}

.back-to-top .btt-icon{
  width:22px;height:22px;
  display:block;flex-shrink:0;
  transition:transform 0.25s ease;
}

.back-to-top:hover .btt-icon{transform:translateY(-1px)}

@media(max-width:800px){
  .back-to-top{bottom:20px;right:16px;width:44px;height:44px}
  .back-to-top .btt-icon{width:18px;height:18px}
}

@media(max-width:480px){
  .back-to-top{bottom:16px;right:12px;width:40px;height:40px}
  .back-to-top .btt-icon{width:16px;height:16px}
}

/* ========= 15: 工具栏按钮美化 ========= */
.tb-theme{
  position:relative;cursor:pointer;
  display:flex;align-items:center;gap:7px;
  padding:5px 12px 5px 6px;
  border-radius:20px;
  border:none;background:transparent;
  transition:all 0.3s cubic-bezier(0.4,0,0.2,1);
}

.tb-theme:hover{background:rgba(0,0,0,0.04)}
.tb-theme.open{background:rgba(0,0,0,0.06)}

.tb-dot{
  width:22px;height:22px;border-radius:50%;flex-shrink:0;
  border:2px solid rgba(255,255,255,0.85);
  box-shadow:0 1px 6px rgba(0,0,0,0.12);
  transition:all 0.35s cubic-bezier(0.4,0,0.2,1);
}

.tb-theme:hover .tb-dot{transform:scale(1.1)}
.tb-dot[data-t="blue"]{background:linear-gradient(135deg,#c4daf5,#4a90e2)}
.tb-dot[data-t="emerald"]{background:linear-gradient(135deg,#a8e6c3,#2ecc71)}
.tb-dot[data-t="purple"]{background:linear-gradient(135deg,#d4c5e8,#9b6bff)}
.tb-dot[data-t="crimson"]{background:linear-gradient(135deg,#f5c4a8,#e74c3c)}
.tb-dot[data-t="light"]{background:linear-gradient(135deg,#e8dfa0,#d4af37)}
.tb-dot[data-t="sakura"]{background:linear-gradient(135deg,#f8c6d8,#e84393)}

.tb-name{
  font-size:12px;font-weight:600;color:var(--text-secondary);
  white-space:nowrap;letter-spacing:0.5px;
  transition:color 0.3s;
}

.tb-theme:hover .tb-name{color:var(--gold)}

.tb-sep{width:1px;height:20px;background:rgba(0,0,0,0.08);margin:0 2px;flex-shrink:0}

/* 字号切换按钮 */
.tb-fontsize{
  display:flex;align-items:center;gap:4px;
  padding:5px 10px;border-radius:20px;
  border:1.5px solid rgba(0,0,0,0.08);cursor:pointer;
  transition:all 0.3s cubic-bezier(0.4,0,0.2,1);
  font-size:12px;font-weight:700;color:var(--text-secondary);
  user-select:none;white-space:nowrap;
}
.tb-fontsize:hover{border-color:var(--border-gold);color:var(--gold);background:var(--gold-glow)}
.tb-fs-ico{font-size:14px;font-weight:900;letter-spacing:-1px}
.tb-fs-label{font-size:11px}

/* 繁简切换按钮 */
.tb-lang{
  display:flex;align-items:center;gap:5px;
  padding:5px 12px;
  border-radius:20px;
  border:1.5px solid rgba(0,0,0,0.08);
  cursor:pointer;
  transition:all 0.3s cubic-bezier(0.4,0,0.2,1);
  font-size:12px;font-weight:700;color:var(--text-secondary);
  user-select:none;white-space:nowrap;
  letter-spacing:0.5px;
}
.tb-lang:hover{border-color:var(--border-gold);color:var(--gold);background:var(--gold-glow)}
.tb-lang.trad{color:#fff;background:var(--gold-gradient);border-color:transparent;font-weight:700}
.tb-lang-ico{font-size:13px;line-height:1}

/* 二维码按钮 */
.tb-qrcode{
  display:flex;align-items:center;gap:4px;
  padding:5px 10px;border-radius:20px;
  border:1.5px solid rgba(0,0,0,0.08);cursor:pointer;
  transition:all 0.3s cubic-bezier(0.4,0,0.2,1);
  font-size:12px;font-weight:700;color:var(--text-secondary);
  user-select:none;white-space:nowrap;
}
.tb-qrcode:hover{border-color:var(--border-gold);color:var(--gold);background:var(--gold-glow)}
.tb-qr-ico{font-size:13px;line-height:1}
.tb-qr-text{font-size:11px}

.tb-theme-dropdown{
  position:absolute;top:calc(100% + 8px);right:0;
  min-width:220px;
  background:rgba(255,255,255,0.95);
  backdrop-filter:blur(28px);-webkit-backdrop-filter:blur(28px);
  border:1px solid rgba(0,0,0,0.06);
  border-radius:16px;
  box-shadow:0 12px 48px rgba(0,0,0,0.14),0 2px 8px rgba(0,0,0,0.06);
  padding:10px;
  opacity:0;visibility:hidden;transform:translateY(-10px) scale(0.96);
  transition:all 0.28s cubic-bezier(0.4,0,0.2,1);
  z-index:99999;
}

.tb-theme.open .tb-theme-dropdown{opacity:1;visibility:visible;transform:translateY(0) scale(1)}

.tb-option{
  display:flex;align-items:center;gap:10px;
  padding:8px 12px;
  border-radius:12px;
  cursor:pointer;transition:all 0.2s ease;
  border:1.5px solid transparent;
}

.tb-option:hover{background:rgba(0,0,0,0.03);border-color:rgba(0,0,0,0.05)}
.tb-option.active{background:var(--gold-glow);border-color:var(--border-gold)}
.tb-option .opt-dot{width:24px;height:24px;border-radius:50%;flex-shrink:0;transition:var(--transition);border:2px solid rgba(255,255,255,0.7);box-shadow:0 1px 4px rgba(0,0,0,0.1)}
.tb-option.active .opt-dot{box-shadow:0 0 0 2.5px #fff,0 0 0 4.5px var(--gold)}
.tb-option .opt-info{display:flex;flex-direction:column;gap:1px}
.tb-option .opt-label{font-size:13px;color:var(--text-primary);font-weight:600}
.tb-option.active .opt-label{color:var(--gold);font-weight:700}
.tb-option .opt-preview{font-size:10px;color:var(--text-muted);opacity:0.8}

@media(max-width:800px){
  .tb-theme{padding:4px 8px 4px 4px}
  .tb-name{font-size:11px}
  .tb-dot{width:18px;height:18px}
}

/* ================================================================
   Toolbar & Sidebar（统一重构版）
   ================================================================ */

/* ---------- Toolbar ---------- */
.floating-toolbar{
  display:flex;align-items:center;gap:4px;
}
.tb-left{
  display:flex;align-items:center;gap:8px;
  flex-shrink:0;
}
.tb-center{
  flex:1;display:flex;justify-content:center;
  min-width:0;padding:0 12px;
}
.tb-center input{
  width:100%;max-width:320px;
  height:32px;border:1px solid var(--border);
  border-radius:16px;padding:0 14px;
  font-size:13px;background:var(--bg-input);
  color:var(--text-primary);outline:none;
  transition:all 0.3s;
}
.tb-center input:focus{
  border-color:var(--gold);
  box-shadow:0 0 0 3px var(--gold-glow);
}
.tb-right{
  display:flex;align-items:center;gap:4px;
  flex-shrink:0;
}
.tb-btn{
  display:inline-flex;align-items:center;justify-content:center;
  height:32px;min-width:32px;padding:0 8px;
  border:1px solid var(--border);border-radius:8px;
  background:var(--bg-card);color:var(--text-secondary);
  cursor:pointer;font-size:13px;font-weight:500;
  transition:all 0.2s;white-space:nowrap;
  font-family:var(--font-main);
}
.tb-btn:hover{
  border-color:var(--border-gold);color:var(--gold);
  background:var(--gold-glow);
}
.tb-logo{
  font-size:15px;font-weight:800;
  color:var(--gold);text-decoration:none;
  letter-spacing:1px;
}
.tb-logo:hover{color:var(--gold-light)}

/* ---------- Sidebar Header ---------- */
.sidebar-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:18px 16px 14px;
  border-bottom:1px solid var(--border);
  position:relative;z-index:1;
}
.sidebar-logo{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
}
.sidebar-logo-icon{
  font-size:26px;
  line-height:1;
  filter:drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}
.sidebar-logo-text{
  font-size:18px;font-weight:900;
  color:var(--gold);letter-spacing:3px;
  text-decoration:none;display:block;
  font-family:var(--font-kai);
}
.sidebar-logo:hover .sidebar-logo-text{opacity:0.85}
.sidebar-close{
  display:none;
  width:28px;height:28px;border:none;
  background:var(--bg-card);border-radius:8px;
  font-size:16px;cursor:pointer;color:var(--text-muted);
  align-items:center;justify-content:center;
}

/* ---------- Theme Dropdown ---------- */
.theme-wrap{position:relative;display:inline-block}
.theme-dropdown{
  position:absolute;top:calc(100% + 6px);right:0;
  z-index:2147483647;
  background:var(--bg-card);
  border:1px solid var(--border);border-radius:12px;
  padding:6px 0;min-width:150px;
  box-shadow:0 8px 32px rgba(0,0,0,0.15);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  opacity:0;transform:translateY(-4px) scale(0.96);
  transform-origin:top right;
  transition:all 0.2s cubic-bezier(0.4,0,0.2,1);
  pointer-events:none;
}
.theme-dropdown.show{
  opacity:1;transform:translateY(0) scale(1);pointer-events:auto;
}
.tb-option{
  padding:8px 14px;cursor:pointer;
  display:flex;align-items:center;gap:8px;
  font-size:13px;color:var(--text-primary);
  transition:background 0.15s;white-space:nowrap;
}
.tb-option:hover{background:var(--gold-glow)}
.tb-option.active{color:var(--gold);font-weight:600}
.tb-opt-dot{width:14px;height:14px;border-radius:50%;flex-shrink:0}

/* ---------- 搜索下拉结果 ---------- */
.search-dropdown{
  position:absolute;
  max-height:400px;
  overflow-y:auto;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  box-shadow:0 12px 48px rgba(0,0,0,0.14),0 2px 8px rgba(0,0,0,0.06);
  z-index:999999;
  padding:8px 0;
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}
.search-dropdown::-webkit-scrollbar{width:4px}
.search-dropdown::-webkit-scrollbar-thumb{background:var(--border);border-radius:2px}

.search-group{
  padding:4px 0;
  border-bottom:1px solid var(--border);
}
.search-group:last-child{border-bottom:none}

.search-group-title{
  display:flex;
  align-items:center;
  gap:6px;
  padding:6px 14px 4px;
  font-size:12px;
  font-weight:700;
  color:var(--text-muted);
  text-transform:uppercase;
  letter-spacing:0.5px;
}
.search-group-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  height:18px;
  padding:0 5px;
  background:var(--bg-glass);
  border-radius:9px;
  font-size:10px;
  font-weight:600;
  color:var(--text-secondary);
}

.search-result-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 14px;
  text-decoration:none;
  transition:background 0.15s;
  border-left:3px solid transparent;
}
.search-result-item:hover{
  background:var(--gold-glow);
  border-left-color:var(--gold);
}

.sr-char{
  font-size:20px;
  font-weight:700;
  color:var(--text-primary);
  font-family:var(--font-kai);
  min-width:32px;
  text-align:center;
  flex-shrink:0;
}

.sr-meta{
  display:flex;
  flex-direction:column;
  gap:1px;
  min-width:60px;
  flex-shrink:0;
}

.sr-pinyin{
  font-size:11px;
  color:var(--text-muted);
  font-family:var(--font-mono);
}

.sr-type{
  font-size:10px;
  font-weight:600;
  padding:1px 6px;
  border-radius:4px;
  display:inline-block;
  width:fit-content;
}
.sr-type.type-hanzi{
  background:rgba(58,123,213,0.1);
  color:#3a7bd5;
}
.sr-type.type-chengyu{
  background:rgba(139,107,191,0.1);
  color:#8b6bbf;
}

.sr-meaning{
  font-size:12px;
  color:var(--text-secondary);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  flex:1;
  min-width:0;
}

.search-empty{
  padding:20px 14px;
  text-align:center;
  font-size:13px;
  color:var(--text-muted);
}

/* ========= 下拉框内汉字网格卡片 ========= */
.sd-hanzi-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(56px,1fr));
  gap:6px;
  padding:6px 12px 10px;
}
.sd-hanzi-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  padding:8px 4px 6px;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  text-decoration:none;
  transition:all 0.15s ease;
}
.sd-hanzi-card:hover{
  background:var(--gold-glow);
  border-color:var(--gold);
  transform:translateY(-1px);
}
.sd-hz-char{
  font-size:22px;
  font-weight:700;
  color:var(--text-primary);
  font-family:var(--font-kai);
  line-height:1.2;
}
.sd-hz-py{
  font-size:10px;
  color:var(--gold);
  font-family:var(--font-mono);
}

/* ========= 下拉框内成语列表项 ========= */
.sd-cy-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 14px;
  text-decoration:none;
  transition:background 0.15s;
  border-left:3px solid transparent;
}
.sd-cy-item:hover{
  background:var(--gold-glow);
  border-left-color:var(--gold);
}
.sd-cy-text{
  font-size:16px;
  font-weight:700;
  color:var(--text-primary);
  font-family:var(--font-kai);
  min-width:72px;
  flex-shrink:0;
}
.sd-cy-py{
  font-size:11px;
  color:var(--text-muted);
  font-family:var(--font-mono);
  min-width:80px;
  flex-shrink:0;
}
.sd-cy-meaning{
  font-size:12px;
  color:var(--text-secondary);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  flex:1;
  min-width:0;
}

/* 搜索下拉 — 专题条目 */
.sd-topic-item{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 14px;
  text-decoration:none;
  transition:background 0.15s;
  border-left:3px solid transparent;
}
.sd-topic-item:hover{
  background:var(--gold-glow);
  border-left-color:var(--gold);
}
.sd-topic-icon{
  font-size:16px;
  flex-shrink:0;
}
.sd-topic-name{
  font-size:15px;
  font-weight:700;
  color:var(--text-primary);
  flex-shrink:0;
}
.sd-topic-desc{
  font-size:12px;
  color:var(--text-secondary);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  flex:1;
  min-width:0;
}

/* ========= 搜索结果页（search.html） ========= */
.search-page-content{
  padding:var(--page-pad,24px);
  max-width:960px;
  margin:0 auto;
  min-height:60vh;
}

.sp-header{
  margin-bottom:24px;
}
.sp-title{
  font-size:22px;
  font-weight:700;
  color:var(--text-primary);
  margin:0 0 8px;
}
.sp-query{
  font-size:14px;
  color:var(--text-secondary);
}
.sp-query em{
  font-style:normal;
  color:var(--gold);
  font-weight:600;
  background:var(--gold-glow);
  padding:1px 6px;
  border-radius:4px;
}
.sp-count{
  font-size:12px;
  color:var(--text-muted);
  margin-left:4px;
}

.sp-loading{
  text-align:center;
  padding:60px 20px;
  font-size:15px;
  color:var(--text-muted);
}
.sp-loading::after{
  content:'';
  display:inline-block;
  width:16px;height:16px;
  border:2px solid var(--border);
  border-top-color:var(--gold);
  border-radius:50%;
  animation:sp-spin 0.6s linear infinite;
  vertical-align:middle;
  margin-left:8px;
}
@keyframes sp-spin{
  to{transform:rotate(360deg)}
}

.sp-empty{
  text-align:center;
  padding:80px 20px;
}
.sp-empty-icon{
  font-size:48px;
  margin-bottom:16px;
  opacity:0.5;
}
.sp-empty p{
  font-size:15px;
  color:var(--text-secondary);
  margin:0 0 8px;
}
.sp-empty-hint{
  font-size:13px;
  color:var(--text-muted);
}

.sp-section{
  margin-bottom:28px;
}
.sp-section-title{
  font-size:16px;
  font-weight:700;
  color:var(--text-primary);
  padding-bottom:10px;
  margin-bottom:12px;
  border-bottom:2px solid var(--border);
  display:flex;
  align-items:center;
  gap:8px;
}
.sp-section-count{
  font-size:12px;
  font-weight:600;
  color:var(--text-muted);
  background:var(--bg-glass);
  padding:2px 8px;
  border-radius:10px;
}

/* 汉字网格卡片 */
.sp-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
  gap:12px;
}
.sp-char-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  padding:16px 10px 12px;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  text-decoration:none;
  transition:all 0.2s ease;
}
.sp-char-card:hover{
  background:var(--bg-card-hover);
  border-color:var(--gold);
  box-shadow:0 4px 16px var(--gold-glow);
  transform:translateY(-2px);
}
.sp-char-text{
  font-size:32px;
  font-weight:700;
  color:var(--text-primary);
  font-family:var(--font-kai);
  line-height:1.2;
}
.sp-char-py{
  font-size:12px;
  color:var(--gold);
  font-family:var(--font-mono);
}
.sp-char-meaning{
  font-size:11px;
  color:var(--text-muted);
  text-align:center;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:100%;
}

/* 成语列表 */
.sp-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.sp-cy-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 16px;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  text-decoration:none;
  transition:all 0.2s ease;
}
.sp-cy-item:hover{
  background:var(--bg-card-hover);
  border-color:var(--gold);
  box-shadow:0 2px 12px var(--gold-glow);
}
.sp-cy-text{
  font-size:18px;
  font-weight:700;
  color:var(--text-primary);
  font-family:var(--font-kai);
  min-width:80px;
  flex-shrink:0;
}
.sp-cy-py{
  font-size:12px;
  color:var(--gold);
  font-family:var(--font-mono);
  min-width:100px;
  flex-shrink:0;
}
.sp-cy-meaning{
  font-size:13px;
  color:var(--text-secondary);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  flex:1;
  min-width:0;
}

/* ========= 统计查阅页（stats.html） ========= */
.stats-page-content{
  padding:var(--page-pad,24px);
  max-width:1100px;
  margin:0 auto;
  min-height:60vh;
}

.st-header{margin-bottom:28px;}
.st-title{
  font-size:26px;font-weight:800;
  color:var(--text-primary);margin:0 0 6px;
  display:flex;align-items:center;gap:8px;
}
.st-sub{font-size:13px;color:var(--text-muted);margin:0;}

.st-section{
  margin-bottom:32px;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:20px 24px;
}
.st-section-title{
  font-size:17px;font-weight:700;
  color:var(--text-primary);margin:0 0 4px;
  display:flex;align-items:center;gap:6px;
}
.st-icon{font-size:18px;}
.st-desc{font-size:12px;color:var(--text-muted);margin:0 0 16px;}
.st-note{font-size:11px;color:var(--text-muted);opacity:0.7;margin-top:12px;}

/* 数据卡片网格 */
.st-card-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(130px,1fr));
  gap:12px;
}
.st-card-grid-5{
  grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
}
.st-stat-card{
  text-align:center;
  padding:16px 10px;
  background:var(--bg-glass);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  transition:transform 0.2s,box-shadow 0.2s;
}
.st-stat-card:hover{
  transform:translateY(-2px);
  box-shadow:0 4px 16px rgba(0,0,0,0.06);
}
.st-stat-val{
  font-size:24px;font-weight:800;
  color:var(--text-primary);
  font-family:var(--font-mono);
  line-height:1.3;
}
.st-stat-label{
  font-size:12px;color:var(--text-muted);
  margin-top:4px;
}
.st-accent .st-stat-val{color:#6366f1;}
.st-gold .st-stat-val{color:var(--gold);}
.st-fire .st-stat-val{color:#ef4444;}
.st-peak .st-stat-val{color:#f59e0b;}

/* 7日趋势柱状图 */
.st-chart{
  display:flex;align-items:flex-end;gap:8px;
  height:160px;padding:8px 0 0;
}
.st-chart-col{
  flex:1;display:flex;flex-direction:column;
  align-items:center;justify-content:flex-end;
  height:100%;gap:4px;
}
.st-chart-val{
  font-size:11px;font-weight:700;
  color:var(--text-secondary);
  font-family:var(--font-mono);
}
.st-chart-bar{
  width:100%;max-width:48px;
  background:var(--gold);
  border-radius:4px 4px 0 0;
  min-height:4px;
  transition:height 0.3s;
  opacity:0.75;
}
.st-chart-bar:hover{opacity:1;}
.st-chart-bar.st-bar-peak{opacity:1;background:#ef4444;}
.st-chart-label{
  font-size:10px;color:var(--text-muted);
  font-family:var(--font-mono);
}

/* 热力图 */
.st-heatmap{margin-bottom:8px;}
.st-heatmap-legend{
  display:flex;align-items:center;gap:4px;
  font-size:10px;color:var(--text-muted);
  margin-bottom:8px;
}
.st-heatmap-dot{
  width:12px;height:12px;
  border-radius:2px;
  background:var(--gold);
}
.st-heatmap-grid{
  display:flex;flex-wrap:wrap;gap:3px;
}
.st-heatmap-cell{
  width:14px;height:14px;
  border-radius:2px;
  background:var(--gold);
  cursor:default;
  transition:transform 0.1s;
}
.st-heatmap-cell:hover{transform:scale(1.5);}

/* 折叠区 */
.st-collapse-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:10px 0;cursor:pointer;
  font-size:13px;color:var(--text-secondary);
  border-top:1px solid var(--border);
  margin-top:12px;
  user-select:none;
}
.st-collapse-header:hover{color:var(--gold);}
.st-arrow{font-size:12px;transition:transform 0.2s;}
.st-collapse-body{padding:8px 0;}

/* 月历 */
.st-month{margin-bottom:16px;}
.st-month-title{
  font-size:13px;font-weight:600;
  color:var(--text-secondary);margin-bottom:6px;
}
.st-month-stat{
  font-weight:400;font-size:11px;color:var(--text-muted);margin-left:8px;
}
.st-month-grid{
  display:grid;grid-template-columns:repeat(7,1fr);gap:2px;
  max-width:320px;
}
.st-month-wd{
  text-align:center;font-size:10px;color:var(--text-muted);
  padding:2px 0;
}
.st-month-empty{padding:4px;}
.st-month-day{
  text-align:center;font-size:10px;
  padding:3px 2px;border-radius:3px;
  color:var(--text-muted);
  background:transparent;
}
.st-month-active{background:var(--gold-glow);color:var(--text-primary);font-weight:600;}
.st-month-today{
  outline:2px solid var(--gold);
  outline-offset:-1px;
}

/* 设备分析 */
.st-device-row{
  display:grid;
  grid-template-columns:repeat(3,1fr);gap:12px;
  margin-bottom:20px;
}
.st-device-item{
  text-align:center;
  padding:14px 10px;
  background:var(--bg-glass);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
}
.st-device-icon{font-size:28px;margin-bottom:4px;}
.st-device-name{font-size:12px;color:var(--text-secondary);font-weight:500;}
.st-device-val{font-size:20px;font-weight:800;color:var(--text-primary);font-family:var(--font-mono);margin:4px 0;}
.st-device-pct{font-size:13px;color:var(--text-muted);font-weight:600;margin-top:2px;}
.st-bar-wrap{
  height:6px;background:var(--bg-glass);border-radius:3px;
  margin:6px 10px 0;overflow:hidden;
}
.st-bar{height:100%;border-radius:3px;transition:width 0.4s;}
.st-sub-title{font-size:14px;font-weight:600;color:var(--text-secondary);margin:16px 0 8px;}

/* 排行列表 */
.st-rank-list{margin-bottom:12px;}
.st-rank-item{
  display:flex;align-items:center;gap:8px;
  padding:6px 0;border-bottom:1px solid var(--border);
  font-size:13px;
}
.st-rank-num{
  width:22px;text-align:center;font-weight:700;
  color:var(--text-muted);font-size:12px;
}
.st-rank-name{min-width:120px;color:var(--text-primary);font-weight:500;}
.st-rank-bar{flex:1;min-width:80px;}
.st-rank-val{
  font-size:12px;color:var(--text-muted);
  font-family:var(--font-mono);white-space:nowrap;
}
.st-rank-val em{font-style:normal;color:var(--gold);font-weight:600;}

/* 筛选行 */
.st-filter-row{
  display:flex;gap:8px;margin-bottom:12px;
}
.st-input{
  flex:1;padding:8px 12px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  background:var(--bg-glass);
  color:var(--text-primary);
  font-size:13px;
  outline:none;
  width:100%;
  box-sizing:border-box;
}
.st-input:focus{border-color:var(--gold);}
.st-select{
  padding:8px 12px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  background:var(--bg-glass);
  color:var(--text-primary);
  font-size:13px;
  outline:none;
  cursor:pointer;
}

/* 排行表格 */
.st-table-wrap{overflow-x:auto;}
.st-table{
  width:100%;border-collapse:collapse;
  font-size:13px;
}
.st-table th{
  text-align:left;padding:8px 10px;
  font-weight:600;color:var(--text-muted);
  border-bottom:2px solid var(--border);
  font-size:11px;text-transform:uppercase;letter-spacing:0.5px;
}
.st-table td{
  padding:8px 10px;
  border-bottom:1px solid var(--border);
  color:var(--text-secondary);
}
.st-table tr:hover td{background:var(--bg-glass);}
.st-rank-col{width:40px;text-align:center;}
.st-pv-col{font-weight:700;color:var(--text-primary);font-family:var(--font-mono);}
.st-date-col{font-size:11px;font-family:var(--font-mono);}
.st-page-col{max-width:300px;}
.st-page-link{
  color:var(--text-primary);text-decoration:none;
  font-weight:500;
}
.st-page-link:hover{color:var(--gold);}

.st-medal{
  display:inline-flex;align-items:center;justify-content:center;
  width:22px;height:22px;border-radius:50%;
  font-size:11px;font-weight:800;color:#fff;
}
.st-medal-1{background:#f59e0b;}
.st-medal-2{background:#94a3b8;}
.st-medal-3{background:#b45309;}

.st-type-badge{
  display:inline-block;
  padding:2px 8px;border-radius:10px;
  font-size:10px;font-weight:600;color:#fff;
  white-space:nowrap;
}

/* 操作区 */
.st-actions{
  display:flex;flex-wrap:wrap;gap:10px;align-items:center;
}
.st-btn{
  padding:10px 20px;border:none;border-radius:var(--radius-sm);
  font-size:13px;font-weight:600;cursor:pointer;
  transition:all 0.2s;
}
.st-btn-export{
  background:var(--gold);color:#fff;
}
.st-btn-export:hover{opacity:0.9;transform:translateY(-1px);}
.st-btn-clear{
  background:transparent;color:#ef4444;
  border:1px solid #ef4444;
}
.st-btn-clear:hover{background:#fef2f2;}
.st-action-note{
  font-size:11px;color:var(--text-muted);margin-left:8px;
}

/* ---------- 响应式 ---------- */
@media(max-width:768px){
  .sidebar{position:fixed;left:-280px;z-index:10000;transition:left 0.3s ease}
  .sidebar.open{left:0}
  .sidebar-close{display:flex}
  .floating-toolbar{left:0}
  .page-wrap.sidebar-open .sidebar{left:0}
  .tb-center{display:none}
}
