:root {
  --bg: #eef3f7;
  --bg-soft: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f7f4;
  --ink: #111827;
  --ink-soft: #243041;
  --muted: #64748b;
  --line: #dbe3ea;
  --line-strong: #c7d2df;
  --accent: #087f5b;
  --accent-dark: #066045;
  --accent-soft: #dcfce7;
  --blue: #2563eb;
  --amber: #b45309;
  --danger: #b42318;
  --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 22px 60px rgba(15, 23, 42, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f8fafc 0, #eef3f7 420px, #eef3f7 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 58px);
  border-bottom: 1px solid rgba(219, 227, 234, 0.86);
  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
}

.brand img {
  display: block;
  height: 40px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(219, 227, 234, 0.8);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.nav a {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.nav a:hover,
.nav a.active {
  background: var(--ink);
  color: #fff;
}

#app {
  width: min(1680px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: 18px;
  align-items: stretch;
}

.home-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.home-main {
  min-width: 0;
}

.hero-panel,
.hero-banner,
.detail-hero,
.detail-box,
.result-card,
.category-card,
.guide-card,
.offer {
  border: 1px solid rgba(219, 227, 234, 0.95);
  border-radius: var(--radius);
  background: var(--surface);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  box-shadow: var(--shadow-md);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--amber));
}

.kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(8, 127, 91, 0.16);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  line-height: 1.08;
}

h1 {
  max-width: 760px;
  margin-top: 16px;
  font-size: 56px;
}

h2 {
  font-size: 30px;
}

.lead {
  max-width: 690px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.62;
}

.searchbox {
  display: grid;
  grid-template-columns: 1fr 178px;
  gap: 10px;
  margin-top: 30px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.searchbox input,
.searchbox select {
  min-height: 52px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 15px;
  outline: none;
}

.searchbox input:focus,
.searchbox select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(8, 127, 91, 0.12);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-stats span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
}

.hero-banner {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  background:
    linear-gradient(120deg, rgba(17, 24, 39, 0.82), rgba(8, 127, 91, 0.25)),
    url("assets/banner-pattern.svg") center / cover no-repeat;
  box-shadow: var(--shadow-sm);
}

.diagnostic-card {
  position: absolute;
  right: 22px;
  bottom: 22px;
  left: 22px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  padding: 18px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(14px);
}

.code-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.code-chip,
.code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.code-chip {
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  padding: 8px 10px;
  font-size: 14px;
}

.code {
  font-size: 18px;
  font-weight: 950;
}

.status {
  color: var(--danger);
  font-size: 13px;
  font-weight: 850;
}

.meter {
  height: 8px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e9ee;
}

.meter span {
  display: block;
  width: 68%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.section {
  margin-top: 32px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.result-card,
.category-card,
.guide-card {
  position: relative;
  min-height: 154px;
  padding: 17px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.result-card::before,
.category-card::before,
.guide-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 160ms ease;
}

.result-card:hover,
.category-card:hover,
.guide-card:hover {
  transform: translateY(-2px);
  border-color: rgba(8, 127, 91, 0.38);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.09);
}

.result-card:hover::before,
.category-card:hover::before,
.guide-card:hover::before {
  opacity: 1;
}

.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-dark);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.result-card h3,
.category-card h3,
.guide-card h3 {
  margin-top: 14px;
  font-size: 17px;
  line-height: 1.22;
}

.result-card p,
.category-card p,
.guide-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.ad-box {
  display: block;
  min-height: 0;
  margin: 22px 0;
}

.ad-placeholder {
  display: none;
}

.ad-live {
  min-height: 0;
  overflow: hidden;
}

.ad-live ins {
  width: 100%;
}

.native-ad {
  display: block;
  min-height: 0;
  margin: 22px 0;
  overflow: hidden;
}

.native-ad:empty {
  display: none;
}

.layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 318px;
  gap: 24px;
  align-items: start;
}

.left-ad {
  position: sticky;
  top: 84px;
  min-width: 0;
  max-width: 170px;
}

.left-ad .native-ad {
  margin: 0;
}

.left-ad iframe,
.left-ad img,
.left-ad div {
  max-width: 100%;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 42px);
  box-shadow: var(--shadow-md);
}

.detail-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--amber));
}

.detail-hero h1 {
  font-size: 50px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
}

.detail-box {
  margin-top: 14px;
  padding: 21px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.detail-box h2 {
  font-size: 23px;
}

.detail-box ul,
.detail-box ol {
  margin: 14px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.72;
}

.detail-box li + li {
  margin-top: 6px;
}

.content-block p {
  margin: 13px 0 0;
  color: var(--muted);
  line-height: 1.72;
}

.content-block p:first-of-type {
  margin-top: 14px;
}

.faq {
  display: grid;
  gap: 10px;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px 16px;
}

.faq summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 850;
}

.faq p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.sidebar {
  position: sticky;
  top: 84px;
}

.offer {
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.offer h2 {
  font-size: 19px;
}

.offer p {
  margin: 12px 0 16px;
  color: var(--muted);
  line-height: 1.54;
}

.offer a,
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  padding: 0 15px;
  font-weight: 850;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.offer a:hover,
.button:hover {
  transform: translateY(-1px);
  background: var(--accent-dark);
  box-shadow: 0 10px 22px rgba(8, 127, 91, 0.22);
}

.button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.button.secondary:hover {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
}

.empty {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.footer {
  width: min(1680px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer p {
  margin: 5px 0;
}

.muted {
  color: var(--muted);
}

@media (max-width: 980px) {
  .home-layout {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .left-ad {
    position: static;
    grid-column: 1 / -1;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (min-width: 1400px) {
  .home-layout {
    grid-template-columns: 170px minmax(0, 1fr);
  }

  .layout {
    grid-template-columns: 170px minmax(0, 1fr) 360px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  }
}

@media (max-width: 880px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .hero-banner {
    min-height: 260px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .left-ad,
  .sidebar {
    position: static;
  }
}

@media (max-width: 620px) {
  #app {
    width: calc(100% - 22px);
    padding-top: 16px;
  }

  .topbar {
    padding: 11px;
  }

  .brand img {
    height: 38px;
  }

  .nav a {
    padding: 8px 10px;
  }

  .hero-panel {
    padding: 24px 20px;
  }

  h1,
  .detail-hero h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 25px;
  }

  .lead {
    font-size: 16px;
  }

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

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .code-line {
    align-items: flex-start;
    flex-direction: column;
  }
}
