/* ---------- Reset & Tokens ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #1a1f2b;
  background: #f6f7f9;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e5e8ee;
  --text: #1a1f2b;
  --muted: #5a6473;
  --brand: #1f4fd8;
  --brand-600: #1a43bb;
  --brand-50: #eef2fd;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow-md: 0 4px 14px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.10);
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--brand-50);
  color: var(--brand);
}
.logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.logo-text strong { color: var(--brand); font-weight: 800; }

.search-form {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f3f7;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 4px 4px 14px;
  max-width: 560px;
  transition: border-color .15s, background .15s;
}
.search-form:focus-within {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(31,79,216,.10);
}
.search-form .search-icon { color: var(--muted); flex-shrink: 0; }
.search-form input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  min-width: 0;
  padding: 8px 0;
}
.search-form input::placeholder { color: #8a93a3; }
.search-form button {
  border: 0;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: 999px;
  transition: background .15s;
}
.search-form button:hover { background: var(--brand-600); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------- Category nav ---------- */
.cat-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.cat-nav-inner {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  background: #f1f3f7;
  border: 1px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.chip:hover { color: var(--brand); background: var(--brand-50); }
.chip.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ---------- Page head ---------- */
.page-head {
  padding: 32px 20px 20px;
}
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { margin: 0 4px; }
.page-head h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--text);
}
.page-sub { color: var(--muted); margin: 0; font-size: 14.5px; }

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 8px 0 32px;
}

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  position: relative;
}
.card:hover {
  border-color: #cdd3de;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.card-cat {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--brand);
  background: var(--brand-50);
  padding: 4px 9px;
  border-radius: 6px;
}
.card-brand {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.card-title a {
  color: var(--text);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .2s;
}
.card-title a:hover { color: var(--brand); background-size: 100% 1px; }
.card-desc {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}
.card-domain { color: #8a93a3; }
.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  font-weight: 600;
  transition: gap .15s;
}
.card-cta:hover { gap: 7px; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 12px 0 8px;
}
.page-btn, .page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all .15s;
}
.page-btn:hover, .page-num:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-50);
}
.page-num.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.page-btn.is-disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}
.page-ellipsis {
  padding: 0 4px;
  color: var(--muted);
  user-select: none;
}
.page-meta {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 40px;
}

/* ---------- Detail ---------- */
.detail { padding: 8px 20px 40px; }
.detail-head {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.detail-head h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 12px 0 8px;
  line-height: 1.2;
}
.detail-brand { color: var(--muted); font-size: 14px; margin: 0; }
.detail-brand a { color: var(--brand); font-weight: 500; }
.detail-brand a:hover { text-decoration: underline; }

.detail-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}
.detail-lead {
  font-size: 17px;
  line-height: 1.65;
  color: #2b3140;
  font-weight: 500;
  margin: 0 0 24px;
  padding-left: 16px;
  border-left: 3px solid var(--brand);
}
.detail-desc p {
  color: #39404f;
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.75;
}
.detail-side { position: sticky; top: 84px; }
.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}
.side-card h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin: 0 0 12px;
}
.side-card dl { margin: 0; }
.side-card dt {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2px;
}
.side-card dd {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 12px;
}
.side-card dd:last-child { margin-bottom: 0; }
.side-card a { color: var(--brand); }
.side-card a:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid var(--brand);
  transition: background .15s;
  text-align: center;
}
.btn:hover { background: var(--brand-600); }
.btn-ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: #f1f3f7; color: var(--text); }
.btn-block { display: flex; width: 100%; margin-bottom: 8px; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state svg { margin: 0 auto 12px; color: #b6bdc9; }
.empty-state h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  color: var(--text);
  margin: 0 0 8px;
}
.empty-state p { margin: 0 0 20px; }
.empty-state h1 { font-size: 60px; margin: 0; color: var(--brand); }

/* ---------- Related ---------- */
.related { padding-top: 32px; padding-bottom: 40px; border-top: 1px solid var(--border); margin-top: 20px; }
.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #111726;
  color: #b8bfcd;
  margin-top: 40px;
  padding-top: 48px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 32px;
}
.footer-brand .logo-text { color: #fff; font-size: 18px; }
.footer-brand p { margin: 12px 0 0; font-size: 14px; max-width: 360px; }
.site-footer h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 14px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { font-size: 14px; color: #b8bfcd; transition: color .15s; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 18px 20px;
  font-size: 13px;
  text-align: center;
  color: #8a93a3;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .detail-body { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 20px; gap: 12px; }
  .search-form { order: 3; width: 100%; max-width: 100%; }
  .nav-toggle { display: flex; }
  .cat-nav-inner { padding: 10px 16px; }
  .page-head { padding: 24px 20px 12px; }
  .grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .page-btn, .page-num { min-width: 34px; height: 34px; padding: 0 9px; font-size: 13px; }
}