/* ============================================================
   AI Tools Directory — ThinkCMF 8.0 Theme
   Minimalist monochrome design · Flat cards · Small radii
   ============================================================ */

/* ----- 1. CSS Custom Properties (Light Mode Default) ----- */
:root {
  /* Surfaces */
  --bg-primary:       #ffffff;
  --bg-secondary:     #fafafa;
  --bg-tertiary:      #f5f5f5;
  --bg-inverse:       #171717;

  /* Text */
  --text-primary:     #171717;
  --text-secondary:   #525252;
  --text-tertiary:    #737373;
  --text-placeholder: #a3a3a3;
  --text-inverse:     #ededed;

  /* Borders */
  --border-primary:   #e5e5e5;
  --border-secondary: #d4d4d4;
  --border-hover:     #a3a3a3;
  --border-focus:     #737373;

  /* Accent (monochrome) */
  --accent:           #171717;
  --accent-hover:     #262626;
  --accent-text:      #ffffff;

  /* Badge */
  --badge-hot-bg:     #171717;
  --badge-hot-text:   #ffffff;
  --badge-pick-bg:    #ffffff;
  --badge-pick-text:  #171717;
  --badge-pick-border:#d4d4d4;

  /* Tags */
  --tag-bg:           #f5f5f5;
  --tag-text:         #525252;
  --tag-border:       #e5e5e5;

  /* Misc */
  --radius-sm:        4px;
  --radius-md:        8px;
  --radius-lg:        12px;
  --transition-fast:  0.15s ease;
  --header-height:    64px;
  --nav-height:       44px;
  --sidebar-width:    232px;

  /* Font stack */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Microsoft YaHei', 'Noto Sans SC', 'Helvetica Neue', Arial,
               sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono',
               'Courier New', monospace;
}

/* ----- 2. Dark Mode Custom Properties ----- */
[data-theme="dark"] {
  --bg-primary:       #0a0a0a;
  --bg-secondary:     #111111;
  --bg-tertiary:      #1a1a1a;
  --bg-inverse:       #ededed;

  --text-primary:     #ededed;
  --text-secondary:   #a3a3a3;
  --text-tertiary:    #737373;
  --text-placeholder: #525252;
  --text-inverse:     #171717;

  --border-primary:   #262626;
  --border-secondary: #333333;
  --border-hover:     #525252;
  --border-focus:     #737373;

  --accent:           #ededed;
  --accent-hover:     #d4d4d4;
  --accent-text:      #0a0a0a;

  --badge-hot-bg:     #ededed;
  --badge-hot-text:   #0a0a0a;
  --badge-pick-bg:    #1a1a1a;
  --badge-pick-text:  #ededed;
  --badge-pick-border:#333333;

  --tag-bg:           #1a1a1a;
  --tag-text:         #a3a3a3;
  --tag-border:       #262626;
}

/* ----- 3. Reset & Base ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 0.9375rem;           /* 15px */
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-fast),
              color var(--transition-fast);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font: inherit;
  color: inherit;
}

/* ----- 4. Selection & Focus ----- */
::selection {
  background: var(--accent);
  color: var(--accent-text);
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ----- 5. Scrollbar (Webkit) ----- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ============================================================
   HEADER
   ============================================================ */

/* ----- 6. Site Header ----- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-primary);
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast);
}

.header-inner {
  max-width: 100%;
  margin: 0 auto;
}

/* ----- 7. Header Top Bar ----- */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 24px;
  gap: 20px;
}

/* Logo */
.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-area .logo-icon {
  width: 28px;
  height: 28px;
}

.logo-area .logo-text {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo-area .logo-divider {
  width: 1px;
  height: 18px;
  background: var(--border-primary);
  margin: 0 2px;
}

.logo-area .logo-subtitle {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

/* Search */
.search-container {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-container .search-form {
  position: relative;
}

.search-container .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-placeholder);
  pointer-events: none;
}

.search-container .search-input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: border-color var(--transition-fast),
              background-color var(--transition-fast);
}

.search-container .search-input::placeholder {
  color: var(--text-placeholder);
}

.search-container .search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-primary);
}

.search-container .search-shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  color: var(--text-placeholder);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  line-height: 1.4;
  pointer-events: none;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-actions .action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast);
  white-space: nowrap;
  gap: 6px;
}

.header-actions .action-btn.btn-ghost {
  color: var(--text-secondary);
}

.header-actions .action-btn.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.header-actions .action-btn.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.header-actions .action-btn.btn-primary:hover {
  background: var(--accent-hover);
}

.header-actions .action-btn.btn-outline {
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
}

.header-actions .action-btn.btn-outline:hover {
  border-color: var(--border-hover);
  background: var(--bg-secondary);
}

/* Theme Toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: background-color var(--transition-fast),
              color var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  width: 18px;
  height: 18px;
}

/* Show sun icon in dark mode, moon in light mode */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: background-color var(--transition-fast);
}

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

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

/* ----- 8. Main Navigation ----- */
.main-nav {
  display: flex;
  align-items: center;
  height: var(--nav-height);
  padding: 0 24px;
  border-top: 1px solid var(--border-primary);
  gap: 2px;
  overflow-x: auto;
}

.main-nav .nav-item {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast),
              border-color var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.main-nav .nav-item:hover {
  color: var(--text-primary);
}

.main-nav .nav-item.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.main-nav .nav-item .nav-badge {
  margin-left: 6px;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background: var(--badge-hot-bg);
  color: var(--badge-hot-text);
  line-height: 1.4;
}

/* ============================================================
   APP LAYOUT (Sidebar + Main)
   ============================================================ */

/* ----- 9. Layout Container ----- */
.app-layout {
  display: flex;
  min-height: 100vh;
  padding-top: calc(var(--header-height) + var(--nav-height));
}

/* ----- 10. Sidebar ----- */
.sidebar {
  position: fixed;
  top: calc(var(--header-height) + var(--nav-height));
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  padding: 20px 12px;
  overflow-y: auto;
  border-right: 1px solid var(--border-primary);
  background: var(--bg-primary);
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast);
  z-index: 100;
}

.sidebar .sidebar-section {
  margin-bottom: 24px;
}

.sidebar .sidebar-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 0 12px;
  margin-bottom: 6px;
}

.sidebar .sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar .sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast),
              color var(--transition-fast);
  cursor: pointer;
}

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

.sidebar .sidebar-item.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 500;
}

.sidebar .sidebar-item .item-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}

.sidebar .sidebar-item .item-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-placeholder);
  font-variant-numeric: tabular-nums;
}

/* ----- 11. Main Content ----- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  padding: 0;
}

/* ============================================================
   HERO BANNER
   ============================================================ */

/* ----- 12. Hero Banner ----- */
.hero-banner {
  background: var(--bg-inverse);
  color: var(--text-inverse);
  padding: 48px 32px;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,255,255,0.04), transparent);
  pointer-events: none;
}

[data-theme="dark"] .hero-banner::before {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,255,255,0.06), transparent);
}

.hero-banner .hero-inner {
  position: relative;
  max-width: 640px;
}

.hero-banner .hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  opacity: 0.7;
}

.hero-banner .hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 12px;
}

.hero-banner .hero-description {
  font-size: 0.9375rem;
  line-height: 1.65;
  opacity: 0.65;
  max-width: 520px;
}

.hero-banner .hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 24px;
}

.hero-banner .stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-banner .stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hero-banner .stat-label {
  font-size: 0.75rem;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================
   CATEGORY SECTIONS & TOOL CARDS
   ============================================================ */

/* ----- 13. Category Section ----- */
.category-section {
  padding: 32px 32px 8px;
}

.category-section + .category-section {
  border-top: 1px solid var(--border-primary);
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.category-header .category-title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-header .category-title .cat-icon {
  width: 18px;
  height: 18px;
  opacity: 0.5;
}

.category-header .category-count {
  font-size: 0.75rem;
  color: var(--text-placeholder);
  font-weight: 400;
}

.category-header .category-more {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-fast);
}

.category-header .category-more:hover {
  color: var(--text-primary);
}

.category-header .category-more svg {
  width: 14px;
  height: 14px;
}

/* ----- 14. Tools Grid ----- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
}

/* ----- 15. Tool Card ----- */
.tool-card {
  display: flex;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  transition: border-color var(--transition-fast),
              background-color var(--transition-fast);
  position: relative;
}

.tool-card:hover {
  border-color: var(--border-hover);
}

.tool-card .card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.tool-card:hover .card-icon {
  border-color: var(--border-hover);
}

.tool-card .card-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

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

.tool-card .card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.tool-card .card-name {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-card .card-name a {
  color: inherit;
}

.tool-card .card-name a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
  vertical-align: middle;
  flex-shrink: 0;
}

.badge-hot {
  background: var(--badge-hot-bg);
  color: var(--badge-hot-text);
}

.badge-pick {
  background: var(--badge-pick-bg);
  color: var(--badge-pick-text);
  border: 1px solid var(--badge-pick-border);
}

.badge-new {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

.tool-card .card-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.tool-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Tags */
.tool-card .card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--tag-border);
  line-height: 1.5;
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast);
  white-space: nowrap;
}

.tag:hover {
  border-color: var(--border-hover);
}

.tool-card .card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-placeholder);
  flex-shrink: 0;
}

.tool-card .card-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.tool-card .card-meta svg {
  width: 12px;
  height: 12px;
}

/* ============================================================
   RESULT COUNT
   ============================================================ */

/* ----- 16. Search Result Count ----- */
.result-count {
  padding: 12px 32px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  display: none;
}

.result-count.visible {
  display: block;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

/* ----- 17. Empty State ----- */
.empty-state {
  padding: 64px 32px;
  text-align: center;
  display: none;
}

.empty-state.visible {
  display: block;
}

.empty-state .empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--text-placeholder);
  opacity: 0.5;
}

.empty-state .empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state .empty-desc {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* ============================================================
   FOOTER
   ============================================================ */

/* ----- 18. Site Footer ----- */
.site-footer {
  margin-left: var(--sidebar-width);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast);
}

.footer-inner {
  padding: 40px 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.footer-grid .footer-col .col-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

.footer-grid .footer-col .col-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-grid .footer-col .col-links a {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-grid .footer-col .col-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border-primary);
  font-size: 0.75rem;
  color: var(--text-placeholder);
  gap: 12px;
}

.footer-bottom .footer-links {
  display: flex;
  gap: 16px;
}

.footer-bottom .footer-links a {
  color: var(--text-tertiary);
}

.footer-bottom .footer-links a:hover {
  color: var(--text-primary);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

/* ----- 19. Utilities ----- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }

.hidden   { display: none !important; }
.no-scroll { overflow: hidden; }

/* Category hidden by search filter */
.category-section.is-hidden {
  display: none;
}

/* Tool card hidden by search filter */
.tool-card.is-hidden {
  display: none;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ----- 20. Tablet (<= 1024px): Hide Sidebar ----- */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 900;
    box-shadow: none;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
  }

  .main-content {
    margin-left: 0;
  }

  .site-footer {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .hero-banner {
    padding: 36px 24px;
  }

  .category-section {
    padding: 28px 24px 8px;
  }

  .result-count {
    padding: 12px 24px;
  }

  .footer-inner {
    padding: 32px 24px;
  }
}

/* ----- 21. Mobile (<= 768px): Single Column Cards ----- */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
    --nav-height: 0px;
  }

  .main-nav {
    display: none;
    border-top: none;
    flex-direction: column;
    height: auto;
    padding: 8px 16px;
    gap: 0;
  }

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

  .main-nav .nav-item {
    height: 40px;
    padding: 0 12px;
    border-bottom: none;
    border-radius: var(--radius-sm);
  }

  .main-nav .nav-item.active {
    background: var(--bg-tertiary);
    border-bottom: none;
  }

  .header-top {
    padding: 0 16px;
  }

  .search-container {
    display: none;
  }

  .search-container.is-open {
    display: block;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    padding: 8px 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    max-width: 100%;
    z-index: 10;
  }

  .header-actions .action-btn span {
    display: none;
  }

  .hero-banner {
    padding: 28px 16px;
  }

  .hero-banner .hero-title {
    font-size: 1.375rem;
  }

  .hero-banner .hero-stats {
    gap: 20px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .category-section {
    padding: 24px 16px 8px;
  }

  .category-header {
    margin-bottom: 14px;
  }

  .result-count {
    padding: 10px 16px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .footer-inner {
    padding: 28px 16px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ----- 22. Small Mobile (<= 480px) ----- */
@media (max-width: 480px) {
  .hero-banner .hero-stats {
    flex-direction: column;
    gap: 12px;
  }

  .tool-card {
    padding: 14px;
    gap: 12px;
  }

  .tool-card .card-icon {
    width: 38px;
    height: 38px;
  }

  .tool-card .card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ----- 23. Print Styles ----- */
@media print {
  .site-header,
  .sidebar,
  .mobile-menu-btn,
  .theme-toggle,
  .search-container {
    display: none !important;
  }

  .app-layout {
    padding-top: 0;
  }

  .main-content {
    margin-left: 0;
  }

  .site-footer {
    margin-left: 0;
  }

  .tool-card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

/* ----- 24. Keyframes ----- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tool-card {
  animation: fadeIn 0.3s ease both;
}

.tools-grid .tool-card:nth-child(1)  { animation-delay: 0.00s; }
.tools-grid .tool-card:nth-child(2)  { animation-delay: 0.03s; }
.tools-grid .tool-card:nth-child(3)  { animation-delay: 0.06s; }
.tools-grid .tool-card:nth-child(4)  { animation-delay: 0.09s; }
.tools-grid .tool-card:nth-child(5)  { animation-delay: 0.12s; }
.tools-grid .tool-card:nth-child(6)  { animation-delay: 0.15s; }
.tools-grid .tool-card:nth-child(7)  { animation-delay: 0.18s; }
.tools-grid .tool-card:nth-child(8)  { animation-delay: 0.21s; }
.tools-grid .tool-card:nth-child(9)  { animation-delay: 0.24s; }
.tools-grid .tool-card:nth-child(10) { animation-delay: 0.27s; }
.tools-grid .tool-card:nth-child(11) { animation-delay: 0.30s; }
.tools-grid .tool-card:nth-child(12) { animation-delay: 0.33s; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0, 0, 0, 0.3);
}

.sidebar-overlay.is-open {
  display: block;
}

/* ============================================================
   SUBMIT / CTA SECTION
   ============================================================ */

/* ----- 25. Submit CTA ----- */
.submit-cta {
  padding: 32px;
  margin: 0 32px 32px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  text-align: center;
  transition: border-color var(--transition-fast);
}

.submit-cta:hover {
  border-color: var(--border-hover);
}

.submit-cta .cta-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.submit-cta .cta-desc {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.submit-cta .cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.submit-cta .cta-btn:hover {
  background: var(--accent-hover);
}

/* ============================================================
   PAGINATION
   ============================================================ */

/* ----- 26. Pagination ----- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px 32px 40px;
}

.pagination .page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  transition: border-color var(--transition-fast),
              color var(--transition-fast),
              background-color var(--transition-fast);
}

.pagination .page-item:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.pagination .page-item.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.pagination .page-item.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.pagination .page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 0.8125rem;
  color: var(--text-placeholder);
}
