:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
}
.top-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--muted);
}
.top-nav a:hover, .top-nav a.active { color: var(--primary); }
.top-nav .nav-cta {
  background: var(--primary);
  color: #fff;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s;
}
.top-nav .nav-cta:hover { background: var(--primary-hover); color: #fff; }

/* Layout with Left Sidebar (ai-bot style) */
.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: 84px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  box-shadow: var(--shadow-sm);
}
.sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 4px 12px 10px;
}
.side-links { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.side-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  color: #334155;
  transition: all 0.15s;
}
.side-links a:hover, .side-links a.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.side-count {
  font-size: 0.78rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 999px;
}
.sidebar-box {
  margin-top: 16px;
  padding: 14px 12px;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  border-radius: 12px;
  font-size: 0.85rem;
  color: #312e81;
}
.sidebar-box strong { display: block; margin-bottom: 4px; }
.sidebar-box a {
  display: inline-block;
  margin-top: 8px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

/* Hero & Search */
.hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 55%, #4f46e5 100%);
  color: #fff;
  border-radius: 18px;
  padding: 36px 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
}
.hero-kicker {
  display: inline-block;
  background: rgba(255,255,255,0.16);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.hero h1 {
  font-size: 2rem;
  line-height: 1.25;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.hero p {
  color: #e0e7ff;
  max-width: 680px;
  font-size: 1rem;
  margin-bottom: 22px;
}
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 680px;
}
.search-bar input {
  flex: 1 1 280px;
  height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  border: 2px solid transparent;
  font-size: 0.96rem;
  outline: none;
  color: var(--text);
}
.search-bar input:focus { border-color: #a5b4fc; }
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.filter-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { background: rgba(255, 255, 255, 0.24); }
.filter-btn.active {
  background: #fff;
  color: #312e81;
  font-weight: 700;
}

/* Category Section & Cards */
.cat-section {
  margin-bottom: 38px;
  scroll-margin-top: 84px;
}
.cat-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.cat-header h2 {
  font-size: 1.32rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-sub {
  font-size: 0.88rem;
  color: var(--muted);
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  box-shadow: var(--shadow-sm);
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #c7d2fe;
}
.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-weight: 800;
  color: var(--primary);
  font-size: 1.1rem;
}
.tool-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.card-title-wrap { min-width: 0; flex: 1; }
.card-title {
  font-size: 1.03rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-domain {
  font-size: 0.78rem;
  color: #64748b;
  display: block;
}
.card-desc {
  font-size: 0.88rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.8rem;
}
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-free { background: #dcfce7; color: #166534; }
.badge-freemium { background: #e0e7ff; color: #3730a3; }
.badge-trial { background: #fef3c7; color: #92400e; }
.card-more {
  color: var(--primary);
  font-weight: 600;
}

/* Guides Preview Strip */
.guides-strip {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}
.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.16s, box-shadow 0.16s;
}
.guide-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.guide-meta { font-size: 0.78rem; color: var(--primary); font-weight: 600; }
.guide-card h3 { font-size: 1.05rem; line-height: 1.38; }
.guide-card p { font-size: 0.88rem; color: var(--muted); flex: 1; }
.read-link { font-size: 0.86rem; font-weight: 600; color: var(--primary); }

/* Detail & Article Containers */
.page-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}
.breadcrumb {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
.detail-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.detail-head-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1 1 360px;
}
.detail-icon {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}
.detail-icon img { width: 42px; height: 42px; object-fit: contain; }
.detail-head-left h1 { font-size: 1.8rem; line-height: 1.2; margin-bottom: 6px; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 0.86rem; color: var(--muted); }
.btn-visit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 13px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.96rem;
  transition: background 0.15s;
}
.btn-visit:hover { background: var(--primary-hover); }

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
}
.detail-card h2 {
  font-size: 1.24rem;
  margin: 22px 0 10px;
  color: var(--text);
}
.detail-card h2:first-child { margin-top: 0; }
.detail-card p { color: #334155; margin-bottom: 12px; }
.detail-card ul, .detail-card ol { padding-left: 20px; color: #334155; margin-bottom: 14px; }
.detail-card li { margin-bottom: 6px; }
.detail-card a { color: var(--primary); text-decoration: underline; }

.pros-cons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.pc-box {
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.pc-pros { background: #f0fdf4; border-color: #bbf7d0; }
.pc-cons { background: #fff7ed; border-color: #fed7aa; }
.pc-box h3 { font-size: 0.98rem; margin-bottom: 8px; }

.table-wrap { overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
th { background: #f1f5f9; font-weight: 700; }

.empty-state {
  display: none;
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 48px 20px 28px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid #1e293b;
}
.site-footer .brand-text { color: #fff; }
.footer-desc { font-size: 0.88rem; color: #94a3b8; max-width: 300px; }
.footer-col h4 { color: #fff; font-size: 0.92rem; margin-bottom: 12px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 0.86rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  max-width: 1280px;
  margin: 20px auto 0;
  font-size: 0.82rem;
  color: #64748b;
  text-align: center;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .tool-grid, .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .side-links { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .side-links a { white-space: nowrap; }
  .sidebar-box { display: none; }
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .tool-grid, .guide-grid, .pros-cons { grid-template-columns: 1fr; }
  .hero { padding: 26px 20px; }
  .hero h1 { font-size: 1.55rem; }
  .top-nav { gap: 12px; font-size: 0.86rem; }
  .footer-inner { grid-template-columns: 1fr; }
}
