/* =============================================
   NaviFlow Theme - Modern AI Navigation
   ============================================= */

:root {
  /* Dark Theme (default) */
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --text-primary: #f0f0f5;
  --text-secondary: #888899;
  --text-muted: #555566;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --orb-1: rgba(99, 102, 241, 0.15);
  --orb-2: rgba(139, 92, 246, 0.1);
  --orb-3: rgba(236, 72, 153, 0.08);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.6);
  --header-bg: rgba(10, 10, 15, 0.85);
  --radius: 14px;
  --radius-sm: 8px;
  --font-sans: 'Plus Jakarta Sans', 'Noto Sans SC', system-ui, sans-serif;
}

[data-theme="light"] {
  --bg-primary: #f5f5fa;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --border: rgba(0, 0, 0, 0.07);
  --border-hover: rgba(99, 102, 241, 0.3);
  --text-primary: #111118;
  --text-secondary: #555566;
  --text-muted: #aaaaaa;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --orb-1: rgba(99, 102, 241, 0.08);
  --orb-2: rgba(139, 92, 246, 0.06);
  --orb-3: rgba(236, 72, 153, 0.05);
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 32px rgba(99, 102, 241, 0.15);
  --header-bg: rgba(245, 245, 250, 0.9);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

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

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

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

/* ── Background Decoration ────────────────── */
.bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb-1 {
  width: 600px;
  height: 600px;
  background: var(--orb-1);
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.bg-orb-2 {
  width: 500px;
  height: 500px;
  background: var(--orb-2);
  top: 40%;
  right: -150px;
  animation-delay: -7s;
}

.bg-orb-3 {
  width: 400px;
  height: 400px;
  background: var(--orb-3);
  bottom: -100px;
  left: 30%;
  animation-delay: -14s;
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -40px) scale(1.05);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

/* ── Container ────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ───────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s;
}

.site-header.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  width: 32px;
  height: 32px;
  display: block;
}

.logo-icon img.custom-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
}

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

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

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

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

[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: block;
}

.mobile-menu-btn {
  display: none;
}

/* ── Hero / Search ────────────────────────── */
.hero {
  position: relative;
  z-index: 1;
  padding: 64px 0 40px;
}

.hero-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0 20px;
  height: 56px;
  gap: 12px;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
  cursor: text;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-card-hover);
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-primary);
}

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

.search-kbd {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-family: var(--font-sans);
  flex-shrink: 0;
}

/* ── Category Tabs ────────────────────────── */
.category-tabs-wrap {
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
}

.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.tab-btn {
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.tab-btn.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* ── Sub-Category Tabs ────────────────────── */
.sub-category-tabs-wrap {
  margin-top: 12px;
  margin-bottom: 28px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

.sub-category-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.sub-category-tabs::-webkit-scrollbar {
  display: none;
}

.sub-tab-btn {
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  transition: all 0.18s;
  white-space: nowrap;
  scroll-snap-align: start;
  flex-shrink: 0;
}

.sub-tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.sub-tab-btn.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-color: var(--accent);
}

/* ── Sub-Category Group ───────────────────── */
.sub-category-group {
  margin-bottom: 32px;
  animation: fadeInUp 0.4s ease both;
}

.sub-category-header {
  margin-bottom: 12px;
}

.sub-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding-left: 2px;
}

/* ── Tools Section ────────────────────────── */
.tools-section {
  position: relative;
  z-index: 1;
  padding-bottom: 80px;
}

.category-group {
  margin-bottom: 48px;
  animation: fadeInUp 0.5s ease both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-group:nth-child(1) {
  animation-delay: 0.05s;
}

.category-group:nth-child(2) {
  animation-delay: 0.10s;
}

.category-group:nth-child(3) {
  animation-delay: 0.15s;
}

.category-group:nth-child(4) {
  animation-delay: 0.20s;
}

.category-group:nth-child(5) {
  animation-delay: 0.25s;
}

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

.category-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.cat-icon {
  font-size: 18px;
  line-height: 1;
}

.cat-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 2px 9px;
}

/* ── Tool Cards ───────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.22s;
}

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

.tool-card:hover::before {
  opacity: 0.04;
}

.tool-card:hover .tool-arrow {
  opacity: 1;
  transform: translate(0, 0);
}

.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.tool-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.icon-placeholder {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.tool-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.tool-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.tool-desc {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

.tool-arrow {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: all 0.2s;
  position: relative;
  z-index: 1;
}

.tool-arrow svg {
  width: 16px;
  height: 16px;
}

/* ── No Results ───────────────────────────── */
.no-results {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.no-results-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.no-results h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ── Post Single ──────────────────────────── */
.post-single {
  max-width: 800px;
  margin: 48px auto 80px;
  padding: 0 24px;
}

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

/* Post header */
.post-header {
  margin-bottom: 32px;
}

.post-header h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 12px;
}

.post-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.post-meta-top {
  margin-top: 10px;
  margin-bottom: 24px;
}

/* Logo + title row */
.post-detail-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.post-detail-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.post-detail-meta-wrap {
  flex: 1;
  min-width: 0;
}

.post-detail-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  word-break: break-word;
}

/* Visit button */
.post-visit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 28px;
  box-shadow: 0 4px 16px var(--accent-glow);
  transition: opacity 0.2s, transform 0.2s;
}

.post-visit-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* Post body — rich typography */
.post-body {
  line-height: 1.85;
  color: var(--text-secondary);
  font-size: 15px;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
  margin: 28px 0 12px;
}

.post-body h1 {
  font-size: 24px;
}

.post-body h2 {
  font-size: 20px;
}

.post-body h3 {
  font-size: 17px;
}

.post-body h4 {
  font-size: 15px;
}

.post-body p {
  margin-bottom: 16px;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-body a:hover {
  opacity: 0.8;
}

.post-body img {
  border-radius: var(--radius-sm);
  margin: 16px auto;
  max-width: 100%;
  display: block;
}

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

.post-body li {
  margin-bottom: 6px;
}

.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 20px 0;
  background: var(--bg-card-hover);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.post-body blockquote p {
  margin: 0;
}

.post-body pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
}

.post-body code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.88em;
  background: var(--bg-card-hover);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: var(--accent-2);
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: inherit;
}

.post-body table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}

.post-body table th,
.post-body table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.post-body table th {
  background: var(--bg-card-hover);
  font-weight: 600;
  color: var(--text-primary);
}

.post-body table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* Related tools */
.related-tools {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.related-tools-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

/* ── Footer ───────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-logo {
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.footer-copy {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-copy a {
  color: var(--text-secondary);
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.footer-copy a:hover {
  color: var(--accent);
}

.footer-copy strong {
  color: var(--text-secondary);
}

/* ── Back to Top ──────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.3s;
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
}

/* ── Search Modal ─────────────────────────── */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.search-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.search-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.search-modal-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  padding: 0 24px;
}

.search-modal-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  padding: 0 20px;
  height: 60px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.search-modal-box svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-modal-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-primary);
}

.search-modal-box input::placeholder {
  color: var(--text-muted);
}

.search-modal-close {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-family: var(--font-sans);
}

.search-results {
  margin-top: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--bg-card-hover);
}

.search-result-item .tool-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.search-result-item .r-name {
  font-size: 14px;
  font-weight: 500;
}

.search-result-item .r-cat {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Hidden (search/filter) ───────────────── */
.category-group.hidden {
  display: none;
}

.tool-card.hidden {
  display: none;
}

/* ── Scrollbar ────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

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

/* ══ COMMENT SECTION ══════════════════════════════════════════════ */
.comment-section {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.comment-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--text-primary);
}

/* Comment list */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

.comment-item {
  display: flex;
  gap: 14px;
  animation: fadeInUp 0.3s ease both;
}

.comment-child {
  margin-left: 40px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

.comment-avatar {
  flex-shrink: 0;
}

.comment-avatar img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  display: block;
}

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

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.comment-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-author a {
  color: var(--accent);
  text-decoration: none;
}

.comment-author a:hover {
  text-decoration: underline;
}

.comment-badge-author {
  font-size: 10px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  padding: 2px 7px;
  border-radius: 10px;
}

.comment-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.comment-text {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
  word-break: break-word;
}

.comment-text p {
  margin-bottom: 8px;
}

.comment-text p:last-child {
  margin-bottom: 0;
}

.comment-text code {
  font-size: 0.85em;
  background: var(--bg-card-hover);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--accent-2);
}

.comment-actions {
  margin-top: 8px;
}

.comment-reply-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
  padding: 3px 0;
}

.comment-reply-link:hover {
  color: var(--accent);
}

/* Empty state */
.comment-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.comment-empty p {
  font-size: 14px;
}

/* Pagination */
.comment-pagination {
  margin: 24px 0;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

/* Typecho page-navigator (archive & comment pagination) */
.page-navigator {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.page-navigator li {
  display: inline-flex;
}

.page-navigator li a,
.page-navigator li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  line-height: 1;
}

.page-navigator li a:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* Current / active page */
.page-navigator li.current a,
.page-navigator li.current span,
.page-navigator li a.current {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px var(--accent-glow);
  pointer-events: none;
}

/* Prev / Next links */
.page-navigator li.prev a,
.page-navigator li.next a {
  padding: 0 16px;
  font-weight: 600;
  gap: 4px;
}

.page-navigator li.prev a:hover,
.page-navigator li.next a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* Ellipsis / dots */
.page-navigator li.split span {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: default;
  min-width: auto;
  padding: 0 4px;
  letter-spacing: 2px;
}

/* Comment form */
.comment-form-wrap {
  margin-top: 40px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.comment-form-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.reply-notice {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 16px;
}

.reply-notice a {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

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

.comment-logged-in {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.comment-logged-in a {
  color: var(--accent);
}

.comment-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.comment-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.comment-form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.comment-form-group .required {
  color: var(--accent-2);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
  color: var(--text-muted);
}

.comment-form textarea {
  min-height: 120px;
}

.comment-form-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.comment-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border: none;
  border-radius: 50px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.comment-submit-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.comment-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Responsive ───────────────────────────── */
/* ── Mobile Sidebar ────────────────────────── */
.mobile-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-sidebar {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: var(--bg-primary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  border-left: 1px solid var(--border);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.mobile-sidebar.open {
  right: 0;
}

.sidebar-header {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.sidebar-close svg {
  width: 20px;
  height: 20px;
}

.sidebar-nav {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.sidebar-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.sidebar-link.active,
.sidebar-link:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
}

@media (max-width: 768px) {
  .site-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    width: 36px;
  }

  .mobile-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.2s;
  }

  .hero {
    padding: 40px 0 24px;
  }

  .search-kbd {
    display: none;
  }

  .category-tabs {
    display: none !important;
  }

  .sub-category-tabs-wrap {
    padding: 8px 10px;
  }

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

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

  .tool-icon {
    width: 36px;
    height: 36px;
  }

  .tool-name {
    font-size: 13px;
  }

  .tool-arrow {
    display: none !important;
  }

  /* Post detail — mobile */
  .post-content {
    padding: 24px 16px;
    border-radius: 14px;
  }

  .post-detail-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .post-detail-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
  }

  .post-detail-title {
    font-size: 20px;
  }

  .post-visit-btn {
    width: 100%;
    justify-content: center;
  }

  .post-body {
    font-size: 14px;
  }

  .post-body pre {
    padding: 12px 14px;
    font-size: 12.5px;
  }

  /* Comments — mobile */
  .comment-child {
    margin-left: 20px;
  }

  .comment-avatar img {
    width: 36px;
    height: 36px;
  }

  .comment-form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .comment-form-wrap {
    padding: 20px 16px;
  }

  .comment-form-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .comment-submit-btn {
    width: 100%;
    justify-content: center;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
  }

  .search-modal {
    padding-top: 60px;
  }
}

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

  .post-single {
    padding: 0 12px;
  }
}

/* 隐藏在 PC 端不该出现的移动端菜单/侧边栏文字 */
@media (min-width: 769px) {

  .mobile-sidebar,
  .mobile-sidebar-overlay,
  .mobile-menu-btn {
    display: none !important;
  }
}