:root {
  --ink: #182332;
  --text: #34465b;
  --muted: #687789;
  --line: #d9e1e8;
  --soft: #eef3f7;
  --canvas: #f7f5ef;
  --card: #ffffff;
  --navy: #17324d;
  --teal: #087f7a;
  --coral: #e36a3f;
  --gold: #b5852d;
  --shadow: 0 18px 48px rgba(20, 36, 54, .11);
  --max: 1480px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.58;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--coral); }
button, input, select { font: inherit; }
.skip { position: absolute; left: -999px; top: 10px; }
.skip:focus { left: 12px; z-index: 80; background: var(--navy); color: #fff; padding: 8px 12px; border-radius: 6px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(217, 225, 232, .92);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 210px; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  font-weight: 900;
}
.brand strong, .brand small { display: block; white-space: nowrap; }
.brand small { color: var(--muted); font-size: 12px; }
.nav { display: flex; align-items: center; justify-content: center; gap: 2px; flex-wrap: wrap; }
.nav a, .command-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 780;
}
.command-button {
  min-width: 74px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.directory-shell, .detail-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  align-items: stretch;
  gap: 18px;
  padding: 22px 0 16px;
}
.hero-copy, .plain-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 26px;
}
.plain-hero { margin: 10px 0 16px; }
.eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 880;
  text-transform: uppercase;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
.hero h1, .plain-hero h1 {
  margin: 0;
  font-size: clamp(38px, 5.8vw, 76px);
  line-height: 1;
  letter-spacing: 0;
}
.hero p, .plain-hero p {
  max-width: 850px;
  margin: 14px 0 0;
  color: var(--text);
  font-size: 17px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}
.button.primary {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}
.hero-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.hero-board div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}
.hero-board strong {
  display: block;
  color: var(--navy);
  font-size: 30px;
  line-height: 1.05;
}
.hero-board span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 12px;
  margin-bottom: 14px;
}
.rank-panel, .intent-panel, .control-panel, .seo-brief, .content-card, .related-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.rank-panel, .intent-panel, .seo-brief { padding: 14px; }
.panel-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel-head h2, .section-head h2 { margin: 0; font-size: 24px; line-height: 1.15; }
.rank-list {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
}
.rank-list a {
  min-height: 70px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 9px;
}
.rank-list span {
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--coral);
  font-weight: 900;
}
.rank-list strong, .rank-list small, .intent-grid strong, .intent-grid small, .mini-grid strong, .mini-grid small {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-list small, .intent-grid small, .mini-grid small { color: var(--muted); font-size: 12px; }
.intent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.intent-grid a, .mini-grid a {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.control-panel {
  position: sticky;
  top: 55px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(260px, 440px) 138px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(14px);
}
.search-box {
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 5px 10px;
}
.search-box span { color: var(--muted); font-size: 13px; font-weight: 800; }
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}
.control-panel select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  padding: 6px 12px;
  font-weight: 820;
  cursor: pointer;
}
.filter-chip.active, .filter-chip:hover {
  border-color: rgba(8, 127, 122, .38);
  background: #e9f6f4;
  color: var(--teal);
}

.directory-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.side-rail {
  position: sticky;
  top: 128px;
  display: grid;
  gap: 8px;
}
.side-rail a {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}
.side-rail span {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--navy);
  font-weight: 900;
}
.side-rail strong, .side-rail small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-rail small { color: var(--muted); font-size: 12px; }
.directory-section {
  margin: 0 0 24px;
  scroll-margin-top: 125px;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.section-head p { margin: 3px 0 0; color: var(--muted); }
.section-head span, .section-head a { color: var(--muted); font-size: 13px; font-weight: 780; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.directory-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.directory-card:hover {
  border-color: rgba(8, 127, 122, .42);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.card-top {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
}
.site-icon {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #edf5ff, #eef7f1);
  color: var(--navy);
  font-weight: 900;
}
.card-top h3 { margin: 0; font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-top small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
meter {
  width: 100%;
  height: 8px;
  accent-color: var(--teal);
}
.directory-card p {
  display: -webkit-box;
  margin: 11px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.48;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.tag-row span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  padding: 2px 7px;
  color: var(--text);
  font-size: 12px;
}
.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
}
.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  color: var(--muted);
}

.seo-brief { margin-top: 10px; }
.brief-grid, .tool-grid, .content-grid, .mini-grid {
  display: grid;
  gap: 10px;
}
.brief-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.brief-grid article, .tool-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}
.brief-grid h3 { margin: 0 0 6px; font-size: 17px; }
.brief-grid p { margin: 0; color: var(--text); }
.tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-card {
  display: grid;
  gap: 6px;
  background: #fff;
}
.tool-card strong { font-size: 18px; }
.tool-card span { color: var(--text); }
.tool-card small { color: var(--muted); }

.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  box-shadow: var(--shadow);
}
.detail-hero h1 { margin: 0 0 10px; font-size: clamp(34px, 5vw, 60px); line-height: 1; }
.detail-hero p { margin: 0; max-width: 900px; color: var(--text); font-size: 17px; }
.jump-card {
  display: grid;
  align-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 16px;
}
.score-label { color: var(--muted); font-size: 12px; font-weight: 830; text-transform: uppercase; }
.jump-card strong { color: var(--navy); font-size: 42px; line-height: 1; }
.fact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.fact-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}
.fact-grid span { display: block; color: var(--muted); font-size: 12px; font-weight: 780; }
.fact-grid strong { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.content-card, .related-block { padding: 16px; }
.content-card h2 { margin: 0 0 8px; font-size: 22px; }
.content-card p { margin: 0 0 10px; color: var(--text); }
.check-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.check-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px 12px;
  color: var(--text);
}
.related-block { margin-top: 14px; }
.mini-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.site-footer {
  margin-top: 18px;
  background: var(--navy);
  color: #fff;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .6fr);
  gap: 24px;
  padding: 28px 18px;
}
.footer-inner p, .footer-inner a { color: #d5dde5; }
.footer-inner a { display: block; margin: 5px 0; }

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: start center;
  padding-top: 12vh;
  background: rgba(15, 24, 38, .38);
  backdrop-filter: blur(10px);
}
.search-dialog {
  position: relative;
  width: min(680px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow);
}
.search-dialog button {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}
.search-dialog input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: 0;
}
.global-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 54vh;
  overflow: auto;
}
.global-results a {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.global-results small { color: var(--muted); }
[hidden] { display: none !important; }

@media (max-width: 1160px) {
  .hero { grid-template-columns: 1fr; }
  .hero-board { max-width: 760px; }
}

@media (max-width: 1280px) {
  .rank-list, .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brief-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .header-inner { align-items: flex-start; flex-direction: column; }
  .control-panel, .directory-layout, .editorial-grid, .detail-hero, .content-grid { grid-template-columns: 1fr; }
  .control-panel { position: static; }
  .side-rail {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .card-grid, .tool-grid, .fact-grid, .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  body { font-size: 14px; }
  .directory-shell, .detail-shell { padding: 12px; }
  .hero-copy, .plain-hero, .detail-hero { padding: 16px; }
  .hero h1, .plain-hero h1, .detail-hero h1 { font-size: 38px; }
  .hero-board, .rank-list, .intent-grid, .side-rail, .card-grid, .brief-grid, .tool-grid, .fact-grid, .mini-grid, .footer-inner { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .card-top { grid-template-columns: 44px minmax(0, 1fr); }
  .card-top meter { grid-column: 1 / -1; }
}
