/* ===== tool.uzu.net 主样式 ===== */

/* 字体方案 */
:root {
  --font-base: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

/* 亮色模式变量 */
:root {
  --bg-body: #eef1f5;
  --bg-gradient: linear-gradient(135deg, #eef1f5 0%, #d5dce6 100%);
  --card-bg: #ffffff;
  --card-border: #d0d7de;
  --text-primary: #1a1a2e;
  --text-secondary: #495057;
  --text-muted: #868e96;
  --primary: #0d6efd;
  --primary-light: #e8f0fe;
  --primary-gradient: linear-gradient(135deg, #0d6efd 0%, #7c3aed 100%);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 25px rgba(13,110,253,0.15);
  --border: #dee2e6;
  --border-light: #e9ecef;
  --radius: 16px;
  --radius-sm: 12px;
  --footer-bg: #ffffff;
  --hero-text: #ffffff;
  --input-bg: #fcfcfd;
  --input-border: #cbd5e1;
  --output-bg: #f0f4ff;
  --breadcrumb-bg: transparent;
  --ad-bg: #f0f2f5;
  --scrollbar: #cbd5e1;
  --badge-bg: rgba(13,110,253,0.1);
  --tool-icon-gradient: linear-gradient(135deg, #e8f0fe 0%, #d0e1fd 100%);
  --tool-icon-color: #0d6efd;
  --tool-header-bg: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
  --tool-header-border: rgba(79,110,247,0.2);
  --card-header-bg: #f8fafc;
}

/* 深色模式变量 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-body: #0f172a;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --card-bg: #1e293b;
    --card-border: #334155;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary: #60a5fa;
    --primary-light: rgba(96,165,250,0.12);
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --shadow-sm: 0 2px 12px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 25px rgba(96,165,250,0.2);
    --border: #334155;
    --border-light: #334155;
    --footer-bg: #1e293b;
    --hero-text: #ffffff;
    --input-bg: #1a1f2e;
    --input-border: #475569;
    --output-bg: #0d1b2a;
    --breadcrumb-bg: transparent;
    --ad-bg: #1e293b;
    --scrollbar: #475569;
    --badge-bg: rgba(96,165,250,0.15);
    --tool-icon-gradient: linear-gradient(135deg, rgba(96,165,250,0.2) 0%, rgba(124,58,237,0.15) 100%);
    --tool-icon-color: #60a5fa;
    --tool-header-bg: linear-gradient(135deg, rgba(30,41,59,1) 0%, rgba(15,23,42,1) 100%);
    --tool-header-border: rgba(96,165,250,0.1);
    --card-header-bg: #1a2744;
  }
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-base);
  background: var(--bg-gradient);
  min-height: 100vh;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 等宽字体 */
.font-monospace, textarea, code, pre, .code-font {
  font-family: var(--font-mono) !important;
}

/* ===== 导航栏 ===== */
.navbar {
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  background: #4f6ef7 !important;
  background-image: linear-gradient(135deg, #4f6ef7 0%, #6c5ce7 100%) !important;
  border-bottom: 2px solid rgba(255,255,255,0.08);
}
.navbar .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
}
@media (prefers-color-scheme: dark) {
  .navbar {
    background: #3b5bdb !important;
    background-image: linear-gradient(135deg, #3b5bdb 0%, #5a4bd1 100%) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border-bottom: 2px solid rgba(255,255,255,0.05);
  }
  .navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.85) !important;
  }
  .navbar-dark .navbar-nav .nav-link:hover,
  .navbar-dark .navbar-nav .nav-link.active {
    color: #60a5fa !important;
  }
  .navbar-dark .navbar-brand { color: #60a5fa !important; }
  .dropdown-menu {
    background-color: #1e293b !important;
    border-color: #334155 !important;
  }
  .dropdown-item { color: #e2e8f0 !important; }
  .dropdown-item:hover {
    background-color: #334155 !important;
    color: #60a5fa !important;
  }
  .dropdown-item .text-primary { color: #60a5fa !important; }
  .navbar-toggler-icon { filter: brightness(1.5); }
}

/* ===== 首页 ===== */
.section-block {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid var(--card-border);
  margin-bottom: 12px;
}
.section-block:hover { box-shadow: var(--shadow-md); }

@media (prefers-color-scheme: light) {
  .section-block {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  }
  .section-block:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  }
}

.section-title {
  font-size: 1rem; font-weight: 700;
  color: var(--text-primary);
  border-left: 4px solid var(--primary);
  padding-left: 14px;
  margin-bottom: 0.5rem !important;
}

.tool-card { transition: all 0.25s ease; display: block; }
.tool-card .card {
  transition: all 0.25s ease;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border) !important;
  background: var(--card-bg);
}
.tool-card:hover .card {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg) !important;
  border-color: var(--primary) !important;
}
.tool-icon {
  width: 48px; height: 48px;
  background: var(--tool-icon-gradient);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
}
.tool-icon i { font-size: 1.4rem; color: var(--tool-icon-color); }
.card-title { font-size: 0.92rem; font-weight: 600; color: var(--text-primary); }

/* ===== Hero section - 搜索框右侧 ===== */
.hero-section {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-radius: var(--radius);
  padding: 20px 28px;
  color: #ffffff;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(37,99,235,0.25);
  text-align: center;
}
.hero-section h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 2px; }
.hero-section p { opacity: 0.85; font-size: 0.88rem; margin: 2px auto 0; max-width: 600px; }
.hero-stats span { color: rgba(255,255,255,0.85); font-size: 0.82rem; }

/* ===== 导航栏搜索框 ===== */
.nav-search-form {
  min-width: 200px;
  max-width: 260px;
}
.nav-search-input {
  background: rgba(255,255,255,0.12) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  color: #fff !important;
  font-size: 0.82rem !important;
  padding: 4px 10px !important;
  border-radius: 6px 0 0 6px !important;
}
.nav-search-input::placeholder {
  color: rgba(255,255,255,0.5) !important;
  font-size: 0.82rem !important;
}
.nav-search-input:focus {
  background: rgba(255,255,255,0.2) !important;
  border-color: rgba(255,255,255,0.3) !important;
  box-shadow: none !important;
}
.nav-search-btn {
  background: rgba(255,255,255,0.15) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-left: none !important;
  color: rgba(255,255,255,0.8) !important;
  padding: 4px 10px !important;
  border-radius: 0 6px 6px 0 !important;
  font-size: 0.78rem;
}
.nav-search-btn:hover {
  background: rgba(255,255,255,0.25) !important;
  color: #fff !important;
}

@media (max-width: 991px) {
  .nav-search-form {
    max-width: 100%;
    margin: 8px 0 4px 0;
  }
}

/* ===== 工具详情页 ===== */
.tool-main textarea,
textarea.form-control {
  font-family: var(--font-mono) !important;
  font-size: 0.85rem;
  border: 1.5px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  padding: 8px 12px;
  line-height: 1.6;
}
.tool-main textarea:focus,
textarea.form-control:focus {
  box-shadow: 0 0 0 3px rgba(96,165,250,0.15);
  border-color: var(--primary);
  outline: none;
}
.tool-main textarea::placeholder,
textarea.form-control::placeholder {
  color: var(--text-muted);
}

.tool-page-header {
  background: var(--tool-header-bg);
  border-radius: var(--radius-sm); 
  padding: 1rem 1.25rem; 
  margin-bottom: 0.75rem;
  border: 1px solid var(--tool-header-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.tool-page-header h2 { 
  font-weight: 700; 
  font-size: 1.2rem; 
  color: var(--text-primary);
}
.tool-page-header p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.tool-main .card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--card-bg) !important;
  overflow: hidden;
}
.tool-main .card-body {
  padding: 1rem;
  background: var(--card-bg);
}
.tool-main .card-header {
  background: var(--card-header-bg) !important;
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.tool-main .btn-primary {
  background: #4f6ef7 !important;
  background-image: linear-gradient(135deg, #4f6ef7, #7c3aed) !important;
  color: #fff !important;
  border: none;
  border-radius: 8px;
  padding: 0.35rem 1rem;
  font-weight: 600;
  transition: all 0.2s;
  font-family: var(--font-base);
  font-size: 0.85rem;
}
.tool-main .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,110,247,0.3); }

.tool-main .btn-outline-secondary,
.tool-main .btn-outline-primary {
  border: 1px solid var(--border); 
  color: var(--text-secondary); 
  border-radius: 8px; 
  transition: all 0.2s;
  background: transparent;
  font-family: var(--font-base);
  font-size: 0.82rem;
  padding: 0.35rem 0.8rem;
}
.tool-main .btn-outline-secondary:hover,
.tool-main .btn-outline-primary:hover {
  background: var(--primary-light); 
  border-color: var(--primary); 
  color: var(--primary);
}
.tool-main .form-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-base);
}
#tool-output {
  background: var(--output-bg) !important;
}

/* ===== 信息卡片 ===== */
/* ===== 使用说明/示例框 ===== */
.tool-usage-box {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(13,110,253,0.04);
  border: 1px solid var(--tool-header-border);
  border-radius: 10px;
}
@media (prefers-color-scheme: dark) {
  .tool-usage-box {
    background: rgba(96,165,250,0.06);
  }
}
.usage-section {
  flex: 1;
  min-width: 0;
}
.usage-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: 4px;
}
.usage-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}
.usage-example {
  font-family: var(--font-mono) !important;
  font-size: 0.78rem;
  background: rgba(0,0,0,0.04);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-secondary);
  line-height: 1.5;
  border: 1px solid var(--border-light);
  max-height: 100px;
  overflow-y: auto;
}
@media (prefers-color-scheme: dark) {
  .usage-example {
    background: rgba(0,0,0,0.2);
    border-color: var(--border);
  }
}
@media (max-width: 576px) {
  .tool-usage-box {
    flex-direction: column;
    gap: 8px;
  }
}

/* ===== 信息卡片 ===== */
.info-card { 
  border: 1px solid var(--border); 
  border-radius: var(--radius-sm); 
  overflow: hidden; 
  background: var(--card-bg);
}
.info-card .card-header { 
  background: var(--card-header-bg); 
  border-bottom: 1px solid var(--border); 
  font-weight: 600; 
  font-size: 0.85rem; 
  padding: 0.75rem 1rem; 
  color: var(--text-primary);
}
.info-card .card-body { padding: 0.5rem 0.75rem; }
.info-card table tr td { padding: 4px 0 !important; vertical-align: middle; font-size: 0.82rem; }
.info-card .text-muted { color: var(--text-muted) !important; }

/* ===== 面包屑 ===== */
.breadcrumb { 
  background: var(--breadcrumb-bg); 
  padding: 0; 
  margin-bottom: 1rem; 
  font-size: 0.85rem; 
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--text-muted); }

/* ===== Footer ===== */
footer { 
  border-top: 1px solid var(--border-light); 
  background: var(--footer-bg) !important; 
}
footer a { color: var(--text-secondary); text-decoration: none; }
footer a:hover { color: var(--primary); text-decoration: underline; }
footer p { color: var(--text-muted) !important; }


/* ===== Footer v2 (Redesigned) ===== */
.site-footer {
  background: var(--footer-bg) !important;
  border-top: 1px solid var(--border-light);
}
.footer-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.footer-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0;
  opacity: 0.85;
}
.footer-social { display: flex; gap: 8px; }
.footer-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary) !important;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.footer-icon-link:hover {
  background: var(--primary);
  color: #fff !important;
  transform: translateY(-2px);
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links li { margin-bottom: 6px; }
.footer-links a {
  font-size: 0.8rem;
  color: var(--text-secondary) !important;
  text-decoration: none;
  transition: all 0.2s;
  padding: 2px 0;
  display: inline-block;
  position: relative;
}
.footer-links a::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width 0.25s;
}
.footer-links a:hover {
  color: var(--primary) !important;
  padding-left: 4px;
}
.footer-links a:hover::before { width: 100%; }
.footer-tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.82rem;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary) !important;
  text-decoration: none !important;
  border: 1px solid transparent;
  transition: all 0.2s;
  letter-spacing: 0.01em;
}
.footer-tag span { opacity: 0.5; margin-right: 2px; }
.footer-tag:hover {
  background: transparent;
  border-color: var(--primary);
  transform: translateY(-1px);
}
.footer-page-link {
  font-size: 0.9rem;
  color: var(--text-secondary) !important;
  text-decoration: none;
  padding: 4px 14px;
  border-radius: 6px;
  background: var(--primary-light);
  transition: all 0.2s;
  display: inline-block;
}
.footer-page-link:hover {
  color: #fff !important;
  background: var(--primary);
  transform: translateY(-2px);
}
.footer-divider {
  margin: 0 0 12px 0;
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-light), transparent);
  opacity: 0.4;
}
.footer-bottom {
  text-align: center;
}
.footer-bottom .footer-page-link {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 6px;
  font-size: 1rem;
  color: var(--text-secondary) !important;
  text-decoration: none;
  transition: all 0.2s;
}
.footer-bottom .footer-page-link:hover {
  color: var(--primary) !important;
  background: var(--primary-light);
}
.footer-copyright {
  font-size: 0.9rem;
  color: var(--text-muted);
  opacity: 0.7;
}
.footer-icp { font-size: 0.9rem; }
.footer-icp a {
  color: var(--text-muted) !important;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.footer-icp a:hover { opacity: 1; color: var(--primary) !important; }



/* ===== 广告位（无内容时隐藏） ===== */
.ad-banner-header:empty,
.ad-banner-footer:empty,
.ad-tool-top:empty,
.ad-tool-bottom:empty,
.ad-banner:empty {
  display: none !important;
}
.ad-banner-header,
.ad-banner-footer,
.ad-tool-top,
.ad-tool-bottom,
.ad-banner {
  background: var(--ad-bg);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  min-height: 60px;
  border: 1px dashed var(--border-light);
  overflow: hidden;
}
.ad-banner-header { min-height: 90px; }
.ad-banner-footer { min-height: 90px; }

/* ===== 同分类工具 ===== */
.same-cat-btn {
  border: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-family: var(--font-base);
  transition: all 0.2s;
  background: transparent;
}
.same-cat-btn:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background: var(--primary-light) !important;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }

/* ===== Badge ===== */
.badge.bg-primary.bg-opacity-10 {
  background: var(--badge-bg) !important;
  color: var(--primary) !important;
  font-weight: 500;
}

/* ===== 响应式 ===== */
@media (max-width: 991px) {
  .tool-page-header { padding: 1.25rem; }
}

@media (max-width: 768px) {
  .hero-section { 
    padding: 1.5rem 1rem; 
    margin: -1rem -1rem 1.5rem -1rem; 
    border-radius: 0; 
  }
  .hero-section h1 { font-size: 1.5rem; }
  .section-block { padding: 1rem; }
  .tool-page-header { padding: 1rem; }
  .tool-page-header h2 { font-size: 1.25rem; }
  .tool-main .card-body { padding: 1rem !important; }
  .info-card .card-body { padding: 0.5rem 0.75rem; }
}

@media (max-width: 576px) {
  .tool-card .card-body { padding: 10px 8px !important; }
  .tool-icon { width: 40px; height: 40px; }
  .tool-icon i { font-size: 1.1rem; }
  .card-title { font-size: 0.82rem; }
}

/* ===== 侧栏广告位 ===== */
.ad-sidebar {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.ad-inner {
  width: 260px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ad-inner img,
.ad-inner iframe,
.ad-inner a {
  max-width: 100%;
}

/* Card hover enhancements */
.tool-card:hover .card {
  border-color: var(--primary);
  box-shadow: 0 8px 25px rgba(79, 110, 247, 0.15);
}
.tool-card:hover .tool-icon {
  transform: scale(1.15);
  color: var(--primary) !important;
}
.tool-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--text-light);
  transition: all 0.3s ease;
}
.navbar-brand i { transition: transform 0.3s ease; }
.navbar-brand:hover i { transform: rotate(15deg) scale(1.2); }

/* Back to top button */
#backToTop { transition: opacity 0.3s ease; }

/* Mobile improvements */
@media (max-width: 576px) {
  .tool-card .card-body { padding: 8px 6px !important; }
  .tool-card .card-title { font-size: 0.78rem; }
  .tool-card small { font-size: 0.68rem; }
  .hero-section h1 { font-size: 1.4rem; }
  .hero-section p { font-size: 0.78rem; }
  .tool-main .card-body { padding: 0.75rem !important; }
}

/* ===== 返回顶部按钮 ===== */
#backToTop {
  transform: scale(1);
}
#backToTop:hover {
  transform: scale(1.1);
  opacity: 1 !important;
  box-shadow: 0 6px 20px rgba(79,110,247,0.6);
}
#backToTop:active {
  transform: scale(0.95);
}
@media (max-width: 768px) {
  #backToTop {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
    bottom: 20px !important;
    right: 15px !important;
  }
}


/* ===== 深色模式完善 ===== */
@media (prefers-color-scheme: dark) {
  /* 分享弹窗 */
  #shareModal > div {
    background: #1e293b !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
  }
  #shareModal > div > div:first-child > div:first-child {
    color: #e2e8f0 !important;
  }
  #shareModal > div > div:first-child > div:last-child {
    color: #94a3b8 !important;
  }
  #shareModal [onclick*="shareWechat"],
  #shareModal [onclick*="shareMoment"] {
    background: rgba(7,193,96,0.1) !important;
  }
  #shareModal [onclick*="shareWechat"]:hover,
  #shareModal [onclick*="shareMoment"]:hover {
    background: rgba(7,193,96,0.2) !important;
  }
  #shareModal [onclick*="copyLink"] {
    background: rgba(79,110,247,0.1) !important;
  }
  #shareModal [onclick*="copyLink"]:hover {
    background: rgba(79,110,247,0.2) !important;
  }
  #shareModal [onclick*="bookmark"] {
    background: rgba(245,158,11,0.1) !important;
  }
  #shareModal [onclick*="bookmark"]:hover {
    background: rgba(245,158,11,0.2) !important;
  }
  #shareModal [onclick*="shareWechat"] > div:last-child,
  #shareModal [onclick*="shareMoment"] > div:last-child,
  #shareModal [onclick*="copyLink"] > div:last-child,
  #shareModal [onclick*="bookmark"] > div:last-child {
    color: #e2e8f0 !important;
  }
  /* 主背景强化 */
  body {
    background: #0f172a !important;
  }
  /* 所有卡片 */
  .card, .section-block {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  /* 卡片文字 */
  .card-title, .card-body, .card-text {
    color: #e2e8f0 !important;
  }
  .text-muted {
    color: #94a3b8 !important;
  }
  /* 输入框美化 */
  .form-control, .form-select {
    background-color: #1a1f2e !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
  }
  .form-control:focus, .form-select:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 2px rgba(96,165,250,0.2) !important;
  }
  .form-control::placeholder {
    color: #64748b !important;
  }
  /* 输出框 */
  #tool-output {
    background: #0d1b2a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
  }
  /* 秒表 */
  #sw-display {
    background: rgba(96,165,250,0.08) !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
  }
  /* 颜文字 */
  #kao-list span {
    background: rgba(96,165,250,0.12) !important;
  }
  #kao-list span:hover {
    background: rgba(96,165,250,0.25) !important;
  }
  /* 预览框 */
  #shadow-preview, #gb-preview, #contrast-preview, #kao-list {
    border-color: #475569 !important;
  }
  /* 导航搜索框 */
  .nav-search-input {
    background: rgba(255,255,255,0.1) !important;
    border-color: rgba(255,255,255,0.2) !important;
    color: #fff !important;
  }
  .nav-search-input::placeholder {
    color: rgba(255,255,255,0.5) !important;
  }
  .nav-search-btn {
    background: rgba(255,255,255,0.15) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,0.2) !important;
  }
  .nav-search-btn:hover {
    background: rgba(255,255,255,0.25) !important;
  }
  /* 按钮 */
  .btn-outline-primary, .btn-outline-secondary {
    border-color: #475569 !important;
    color: #94a3b8 !important;
  }
  .btn-outline-primary:hover, .btn-outline-secondary:hover {
    background: rgba(96,165,250,0.12) !important;
    border-color: #60a5fa !important;
    color: #60a5fa !important;
  }
  .btn-check:checked + .btn-outline-primary {
    background: rgba(96,165,250,0.2) !important;
    border-color: #60a5fa !important;
    color: #60a5fa !important;
  }
  /* 下拉选项 */
  select.form-select option {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
  }
  /* 颜色选择器 */
  input[type="color"] {
    background-color: #1e293b !important;
    border-color: #475569 !important;
  }
  /* 工具header */
  .tool-page-header {
    background: linear-gradient(135deg, #1a2744 0%, #0f172a 100%) !important;
    border-bottom: 1px solid rgba(96,165,250,0.1) !important;
  }
  /* 使用说明 */
  .tool-usage-box {
    background: rgba(96,165,250,0.06) !important;
  }
  .usage-example {
    background: rgba(0,0,0,0.2) !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
  }
  /* 卡片header */
  .card-header {
    background: #1a2744 !important;
    border-bottom: 1px solid rgba(96,165,250,0.1) !important;
    color: #e2e8f0 !important;
  }
  /* Hero */
  .hero-section {
    background: linear-gradient(135deg, #1a2744 0%, #1e293b 50%, #2d1b69 100%) !important;
  }
  .hero-section h1, .hero-section p {
    color: #f1f5f9 !important;
  }
  /* Footer */
  footer, .container-fluid + footer, .mt-5 + footer {
    background: #1e293b !important;
    border-top-color: #334155 !important;
  }
  footer p, footer small {
    color: #94a3b8 !important;
  }
  /* 同分类 */
  .same-cat-btn {
    border-color: #475569 !important;
    color: #94a3b8 !important;
  }
  .same-cat-btn:hover {
    border-color: #60a5fa !important;
    color: #60a5fa !important;
    background: rgba(96,165,250,0.12) !important;
  }
  /* 面包屑 */
  .breadcrumb a {
    color: #93c5fd !important;
  }
  .breadcrumb-item.active {
    color: #64748b !important;
  }
  /* 提示消息文字 */
  #shareMsg {
    color: #94a3b8 !important;
  }
}


/* ===== 手动深色模式切换 (html.dark-mode) ===== */
/* === 隐私提示 === */
.tool-privacy-notice {
  padding: 8px 14px;
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: #059669;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tool-privacy-notice i {
  font-size: 0.875rem;
}
html.dark-mode .tool-privacy-notice {
  background: rgba(52,211,153,0.06) !important;
  border-color: rgba(52,211,153,0.15) !important;
  color: #6ee7b7 !important;
}

html.dark-mode {
  --bg-body: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --card-bg: #1e293b;
  --card-border: #334155;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --primary: #60a5fa;
  --primary-light: rgba(96,165,250,0.12);
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 25px rgba(96,165,250,0.2);
  --border: #334155;
  --border-light: #334155;
  --footer-bg: #1e293b;
  --hero-text: #ffffff;
  --input-bg: #1a1f2e;
  --input-border: #475569;
  --output-bg: #0d1b2a;
  --breadcrumb-bg: transparent;
  --ad-bg: #1e293b;
  --scrollbar: #475569;
  --badge-bg: rgba(96,165,250,0.15);
  --tool-icon-gradient: linear-gradient(135deg, rgba(96,165,250,0.2) 0%, rgba(124,58,237,0.15) 100%);
  --tool-icon-color: #60a5fa;
  --tool-header-bg: linear-gradient(135deg, rgba(30,41,59,1) 0%, rgba(15,23,42,1) 100%);
  --tool-header-border: rgba(96,165,250,0.1);
  --card-header-bg: #1a2744;
}
html.dark-mode body {
  background: #0f172a !important;
}
html.dark-mode .card,
html.dark-mode .section-block {
  background: #1e293b !important;
  border-color: #334155 !important;
}
html.dark-mode .text-muted {
  color: #94a3b8 !important;
}
html.dark-mode .form-control,
html.dark-mode .form-select {
  background-color: #1a1f2e !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html.dark-mode #tool-output {
  background: #0d1b2a !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html.dark-mode .tool-page-header {
  background: linear-gradient(135deg, #1a2744 0%, #0f172a 100%) !important;
}
html.dark-mode .card-header {
  background: #1a2744 !important;
  border-bottom: 1px solid rgba(96,165,250,0.1) !important;
  color: #e2e8f0 !important;
}
html.dark-mode .hero-section {
  background: linear-gradient(135deg, #1a2744 0%, #1e293b 50%, #2d1b69 100%) !important;
}
html.dark-mode .hero-section h1,
html.dark-mode .hero-section p {
  color: #f1f5f9 !important;
}
html.dark-mode footer {
  background: #1e293b !important;
  border-top-color: #334155 !important;
}
html.dark-mode .tool-usage-box {
  background: rgba(96,165,250,0.06) !important;
}
html.dark-mode .usage-example {
  background: rgba(0,0,0,0.2) !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}
html.dark-mode .breadcrumb a {
  color: #93c5fd !important;
}
html.dark-mode .btn-outline-primary,
html.dark-mode .btn-outline-secondary {
  border-color: #475569 !important;
  color: #94a3b8 !important;
}
html.dark-mode .btn-outline-primary:hover,
html.dark-mode .btn-outline-secondary:hover {
  background: rgba(96,165,250,0.12) !important;
  border-color: #60a5fa !important;
  color: #60a5fa !important;
}
html.dark-mode select.form-select option {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
}
html.dark-mode .nav-search-input {
  background: rgba(255,255,255,0.1) !important;
  border-color: rgba(255,255,255,0.2) !important;
  color: #fff !important;
}
html.dark-mode .nav-search-btn {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
}
html.dark-mode .same-cat-btn {
  border-color: #475569 !important;
  color: #94a3b8 !important;
}
html.dark-mode .same-cat-btn:hover {
  border-color: #60a5fa !important;
  color: #60a5fa !important;
  background: rgba(96,165,250,0.12) !important;
}


/* ===== 移动端广告自适应 ===== */
@media (max-width: 768px) {
  .ad-banner-header,
  .ad-banner-footer,
  .ad-tool-top,
  .ad-tool-bottom,
  .ad-banner {
    min-height: 50px !important;
    padding: 10px !important;
    border-radius: 8px !important;
    margin-left: -4px !important;
    margin-right: -4px !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  .ad-banner-header { min-height: 60px !important; }
  .ad-banner-footer { min-height: 60px !important; }
  /* 广告内嵌内容自适应 */
  .ad-banner-header img,
  .ad-banner-footer img,
  .ad-tool-top img,
  .ad-tool-bottom img,
  .ad-banner img,
  .ad-inner img {
    max-width: 100% !important;
    height: auto !important;
  }
  .ad-banner-header iframe,
  .ad-banner-footer iframe,
  .ad-tool-top iframe,
  .ad-tool-bottom iframe,
  .ad-banner iframe,
  .ad-inner iframe {
    max-width: 100% !important;
  }
  /* 右侧栏广告 → 移动端全宽 */
  .ad-sidebar {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
  }
  .ad-inner {
    width: 100% !important;
    min-height: 100px !important;
  }
}

/* 极小屏优化 */
@media (max-width: 480px) {
  .ad-banner-header,
  .ad-banner-footer,
  .ad-tool-top,
  .ad-tool-bottom {
    padding: 8px !important;
    min-height: 40px !important;
  }
}


/* ===== 设备专属广告显示 ===== */
.ad-show-desktop { display: block; }
.ad-show-mobile { display: none; }
@media (max-width: 768px) {
  .ad-show-desktop { display: none !important; }
  .ad-show-mobile { display: block !important; }
}

/* === 右侧栏宽度固定300px（桌面端）=== */
@media (min-width: 992px) {
  .tool-page .tool-main-col { flex: 1; max-width: 100%; }
  .tool-page .tool-sidebar-col { width: 300px; flex: 0 0 300px; }
}
@media (max-width: 991.98px) {
  .tool-page .tool-sidebar-col { width: 100%; }
}

/* 侧栏广告 */
.tool-sidebar-col .ad-sidebar {
  width: 100%;
  overflow: hidden;
}
.tool-sidebar-col .ad-sidebar > * {
  max-width: 100%;
}

/* 侧栏广告：撑满整列（抵消 Bootstrap 列内边距） */
.tool-sidebar-col .ad-sidebar {
  margin-left: -12px;
  margin-right: -12px;
  width: 300px;
  max-width: none;
  overflow: hidden;
}
.tool-sidebar-col .ad-sidebar > * {
  max-width: 100%;
}

/* ===== 暗色切换按钮 ===== */
.dark-toggle-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
.dark-toggle-btn:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ===== Toast 提示 ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999999;
  pointer-events: none;
}
.toast-msg {
  background: #1e293b;
  color: #e2e8f0;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: toast-in 0.3s ease;
  pointer-events: auto;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.toast-msg i { font-size: 1rem; }

/* ===== 字数统计小标签 ===== */
.char-count-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  padding: 2px 4px;
  border-radius: 4px;
  margin-top: 2px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.char-count-badge span {
  background: var(--badge-bg);
  padding: 1px 8px;
  border-radius: 4px;
}
/* ===== 文本对比工具 (text-diff) ===== */
.diff-output {
  background: var(--output-bg, #f0f4ff);
  border: 1px solid var(--border, #dee2e6);
  border-radius: var(--radius-sm, 12px);
  padding: 8px 0;
  font-family: var(--font-mono, "SF Mono", "Fira Code", monospace);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
}
.diff-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted, #868e96);
  font-size: 14px;
}
.diff-summary-bar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border, #dee2e6);
  margin-bottom: 4px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.diff-stat {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 10px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #dee2e6);
  white-space: nowrap;
}
.diff-stat-same { border-color: #10b981; color: #059669; }
.diff-stat-ins { border-color: #22c55e; color: #16a34a; }
.diff-stat-del { border-color: #ef4444; color: #dc2626; }
.diff-stat-mod { border-color: #f59e0b; color: #d97706; }
.diff-line {
  display: flex;
  align-items: stretch;
  min-height: 26px;
  padding: 0;
  transition: background 0.15s;
}
.diff-line:hover { filter: brightness(1.05); }
.diff-same { background: transparent; }
.diff-del { background: rgba(239, 68, 68, 0.1); }
.diff-ins { background: rgba(34, 197, 94, 0.1); }
.diff-modified { background: rgba(245, 158, 11, 0.08); }
.diff-gutter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  font-size: 11px;
  color: var(--text-muted, #868e96);
  user-select: none;
  padding: 0 2px;
}
.diff-gutter-same { color: var(--text-muted, #868e96); }
.diff-gutter-del { color: #ef4444; }
.diff-gutter-ins { color: #22c55e; }
.diff-sign {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-width: 20px;
  font-weight: 700;
  user-select: none;
  font-size: 12px;
}
.diff-sign-same { color: transparent; }
.diff-sign-del { color: #ef4444; }
.diff-sign-ins { color: #22c55e; }
.diff-sign-mod { color: #f59e0b; }
.diff-text {
  flex: 1;
  padding: 0 8px;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: break-word;
}
.diff-word-del {
  background: rgba(239, 68, 68, 0.25);
  text-decoration: line-through;
  border-radius: 3px;
  padding: 0 2px;
}
.diff-word-ins {
  background: rgba(34, 197, 94, 0.25);
  border-radius: 3px;
  padding: 0 2px;
}
/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .diff-del { background: rgba(239, 68, 68, 0.15); }
  .diff-ins { background: rgba(34, 197, 94, 0.15); }
  .diff-modified { background: rgba(245, 158, 11, 0.12); }
  .diff-word-del { background: rgba(239, 68, 68, 0.3); }
  .diff-word-ins { background: rgba(34, 197, 94, 0.3); }
  .diff-stat { background: var(--card-bg, #1e293b); }
}
/* 移动端适配 */
@media (max-width: 768px) {
  .diff-output { font-size: 12px; }
  .diff-gutter { width: 28px; min-width: 28px; font-size: 10px; }
  .diff-sign { width: 16px; min-width: 16px; }
  .diff-summary-bar { gap: 6px; }
  .diff-stat { font-size: 11px; padding: 1px 8px; }
}

/* ===== 字数统计 ===== */
.char-counter {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 11px;
  color: rgba(108,117,125,0.8);
  background: rgba(255,255,255,0.75);
  padding: 0 6px;
  border-radius: 4px;
  line-height: 1.6;
  pointer-events: none;
  transition: color 0.2s, background 0.2s;
  z-index: 2;
}
.char-counter.warning {
  color: #d97706;
  background: rgba(255,245,220,0.85);
}
.char-counter.danger {
  color: #dc2626;
  font-weight: 600;
  background: rgba(254,226,226,0.85);
}
.char-counter.limit-hit {
  color: #dc2626;
  font-weight: 700;
  background: rgba(254,202,202,0.9);
}
@media (prefers-color-scheme: dark) {
  .char-counter { background: rgba(30,41,59,0.75); color: rgba(148,163,184,0.8); }
  .char-counter.warning { background: rgba(180,120,40,0.35); }
  .char-counter.danger { background: rgba(180,40,40,0.35); }
  .char-counter.limit-hit { background: rgba(200,50,50,0.4); }
}

/* ===== 提词器 v2 (Teleprompter) ===== */
.tp-wrap { margin-top: 8px; }
.tp-viewport {
  position: relative;
  height: 420px;
  overflow: hidden;
  border: 1px solid var(--border, #dee2e6);
  border-radius: 12px 12px 0 0;
  background: var(--card-bg, #fff);
}
.tp-content {
  position: absolute;
  left: 0; right: 0; top: 0;
  padding: 32px 48px;
  line-height: 1.8;
  text-align: center;
  font-size: 32px;
  font-family: var(--font-sans, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif);
  will-change: transform;
}
.tp-line {
  padding: 8px 0;
  opacity: 0.4;
  transition: opacity 0.25s;
}
.tp-line.tp-active {
  opacity: 1;
  font-weight: 700;
  color: var(--primary, #2563eb);
}
.tp-marker {
  position: absolute;
  left: 10%; right: 10%;
  top: 50%;
  height: 48px;
  margin-top: -24px;
  border-top: 2px solid rgba(37,99,235,0.25);
  border-bottom: 2px solid rgba(37,99,235,0.25);
  pointer-events: none;
  z-index: 1;
}
.tp-bar {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #dee2e6);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 8px 12px;
}
.tp-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tp-btn {
  font-size: 13px !important;
  border-radius: 8px !important;
  padding: 4px 14px !important;
  background: var(--card-bg, #f8f9fa) !important;
  border: 1px solid var(--border, #dee2e6) !important;
  color: var(--text, #333) !important;
  cursor: pointer;
  transition: all 0.2s;
}
.tp-btn:hover { background: var(--primary, #2563eb) !important; color: #fff !important; border-color: var(--primary) !important; }
.tp-btn-close:hover { background: #dc3545 !important; border-color: #dc3545 !important; }
.tp-divider { width: 1px; height: 20px; background: var(--border, #dee2e6); flex-shrink: 0; }
.tp-label { font-size: 12px; color: var(--text-muted, #6b7280); white-space: nowrap; }
.tp-value { font-size: 12px; color: var(--text, #333); min-width: 28px; text-align: center; }
.tp-range { width: 70px; height: 4px; cursor: pointer; accent-color: var(--primary, #2563eb); }
.tp-toggle { font-size: 12px; color: var(--text, #333); cursor: pointer; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.tp-toggle input { width: 14px; height: 14px; cursor: pointer; accent-color: var(--primary); }

/* Fullscreen */
.tp-wrap.tp-fullscreen {
  position: fixed !important;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: #fff;
  margin: 0 !important;
  display: flex; flex-direction: column;
}
.tp-wrap.tp-fullscreen .tp-viewport {
  flex: 1;
  height: auto !important;
  border: none; border-radius: 0;
}
.tp-wrap.tp-fullscreen .tp-bar {
  border: none; border-top: 1px solid var(--border, #dee2e6);
  border-radius: 0;
  padding: 10px 16px;
}
.tp-wrap.tp-fullscreen .tp-content {
  padding: 40px 60px;
}
@media (prefers-color-scheme: dark) {
  .tp-wrap { background: var(--card-bg, #1e293b); }
  .tp-bar { background: var(--card-bg, #1e293b); border-color: rgba(255,255,255,0.1); }
  .tp-viewport { background: var(--card-bg, #1e293b); }
  .tp-btn { background: rgba(30,41,59,0.85) !important; border-color: rgba(255,255,255,0.12) !important; color: #e2e8f0 !important; }
  .tp-btn:hover { background: var(--primary, #3b82f6) !important; }
  .tp-toggle { color: #e2e8f0; }
  .tp-value { color: #e2e8f0; }
  .tp-marker { border-color: rgba(59,130,246,0.35); }
  .tp-wrap.tp-fullscreen { background: #0f172a; }
}
@media (max-width: 768px) {
  .tp-content { padding: 20px 16px; font-size: 24px !important; }
  .tp-bar-inner { gap: 4px; }
  .tp-range { width: 50px; }
  .tp-label { font-size: 11px; }
  .tp-btn { font-size: 12px !important; padding: 3px 10px !important; }
}
/* ===== Teleprompter v4 Pro ===== */
#tp-bar .tp-btn:hover {
  transform: scale(1.12) !important;
  box-shadow: 0 0 12px rgba(255,255,255,0.15) !important;
}
#tp-bar .tp-btn {
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1) !important;
}
#tp-bar .tp-lbl {
  font-size: 11px !important;
  letter-spacing: 0.5px !important;
}
#tp-bar input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 4px;
  background: rgba(255,255,255,0.15);
  outline: none;
}
#tp-bar input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(37,99,235,0.5);
}
#tp-bar input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
  border: none;
}
#tp-guide-colors > div:hover {
  transform: scale(1.25) !important;
  opacity: 1 !important;
}
#tp-content { scrollbar-width: none; -ms-overflow-style: none; }
#tp-content::-webkit-scrollbar { display: none; }
@media (max-width: 768px) {
  #tp-bar { padding: 10px 8px !important; gap: 6px !important; }
  #tp-bar input[type="range"] { width: 60px !important; }
  #tp-content { padding: 0 24px !important; }
  #tp-guide-colors > div { width: 14px !important; height: 14px !important; }
}

/* ===== v5: 首页sidebar（防止flash + 桌面端定位） ===== */
#catSidebarOverlay, .cat-fab {
  display: none;
}
html { overflow-y: scroll; }
.cat-sidebar-inner {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 10px 8px;
  background: var(--card-bg,#fff);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.cat-mobile-toggle {
  display:none;width:30px;height:30px;
  border:none;background:var(--hover-bg,#f3f4f6);
  border-radius:6px;cursor:pointer;
  font-size:13px;color:var(--text-muted,#6b7280);
  align-items:center;justify-content:center;
  transition:transform 0.2s;
}
.cat-mobile-toggle.open { transform:rotate(180deg); }
.cat-sidebar-inner::-webkit-scrollbar { width: 4px; }
.cat-sidebar-inner::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
.cat-sidebar-item {
.list-group-item { font-size: 13px; }
  display:flex;align-items:center;padding:5px 8px;
  border-radius:8px;cursor:pointer;transition:all 0.15s;gap:6px;
}
.cat-sidebar-item:hover { background: var(--hover-bg,#f3f4f6); }
.cat-name { flex:0 1 auto; font-size:13px; color:var(--text-primary,#1f2937); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cat-count { font-size:11px; color:var(--text-muted,#9ca3af); background:var(--bg-body,#f9fafb); padding:0 6px; border-radius:8px; }
.cat-toggle { width:20px; height:20px; font-size:10px; color:var(--text-muted,#6b7280); border-radius:4px; cursor:pointer; flex-shrink:0; display:flex; align-items:center; justify-content:center; }
.cat-toggle:hover { background: var(--hover-bg,#e5e7eb); }
.cat-section-hidden .row { display:none !important; }
.cat-section-hidden .section-title { opacity:0.5; }
#catSidebarList { max-height:none !important; overflow:visible !important; }
