:root {
  --ink: #16141f;
  --muted: #5c5668;
  --line: #e6e1d8;
  --paper: #fffdf8;
  --bg: #f4efe6;
  --rose: #c81e4a;
  --navy: #1b2742;
  --gold: #c4a35a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Pretendard, "Apple SD Gothic Neo", sans-serif;
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(200, 30, 74, 0.08), transparent 50%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

a { color: inherit; }
.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.top {
  background: var(--navy);
  color: #f7f1e6;
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.nav {
  display: flex;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.nav a {
  color: #d7cbb3;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.nav a:hover,
.nav a.is-on {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.nav a.is-on {
  background: var(--rose);
}
.brand strong { display: block; font-size: 20px; letter-spacing: -0.03em; }
.brand small { color: var(--gold); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.mark {
  width: 14px;
  height: 28px;
  background: linear-gradient(180deg, var(--rose), #7a102c);
  border-radius: 2px 8px 2px 8px;
}
.live {
  margin: 0;
  font-size: 13px;
  color: #d7cbb3;
}

.hero { padding: 28px 0 10px; }
.hero-inner {
  padding: 28px 0 8px;
  max-width: 920px;
}
.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 0 rgba(200, 30, 74, 0.55);
  animation: pulse 1.6s ease-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 30, 74, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(200, 30, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 30, 74, 0); }
}
.eyebrow {
  margin: 0;
  color: var(--rose);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 5.4vw, 58px);
  letter-spacing: -0.055em;
  line-height: 1.12;
  max-width: 12.5em;
}
.lead {
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.7;
  font-size: 18px;
  max-width: 38em;
}
.meta { color: var(--muted); margin: 0; line-height: 1.6; font-weight: 600; }

body[data-view="home"] .hero {
  padding: 48px 0 22px;
}
body[data-view="home"] .hero-inner {
  padding: 8px 0 12px;
}
body[data-view="home"] .grid {
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.15fr) 280px;
}
body[data-view="home"] .section-issues {
  box-shadow: 0 18px 40px rgba(27, 39, 66, 0.1);
  border-color: rgba(200, 30, 74, 0.18);
}

.grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  gap: 18px;
  padding: 12px 0 28px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(27, 39, 66, 0.05);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head span { color: var(--muted); font-size: 12px; }

.rank, .wiki, .posts, .news { list-style: none; margin: 0; padding: 0; }
.wiki li, .posts li, .news article {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.rank-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: start;
  position: relative;
  cursor: default;
  border-radius: 12px;
  padding: 12px 8px;
  margin: 0 -8px;
  border-bottom: 1px solid var(--line);
}
.rank-item:hover,
.rank-item:focus-within,
.rank-item.is-open {
  background: #fff8ef;
}
.rank-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #f3ece3;
  color: var(--navy);
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}
.rank-1 .rank-num {
  background: linear-gradient(180deg, var(--rose), #9a1538);
  color: #fff;
  font-size: 24px;
  box-shadow: 0 8px 16px rgba(200, 30, 74, 0.28);
}
.rank-2 .rank-num {
  background: linear-gradient(180deg, #3a4d72, var(--navy));
  color: #fff;
  font-size: 22px;
}
.rank-3 .rank-num {
  background: linear-gradient(180deg, #d8b56d, #a07b2e);
  color: #fff;
}
.keyword-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.keyword-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.rank .keyword {
  font-weight: 800;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.03em;
}
.keyword-orig {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}
.trend {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.trend-up { color: #c81e4a; background: #fde8ee; }
.trend-down { color: #1a73e8; background: #e8f0fe; }
.trend-new { color: #9a6b12; background: #f8e7bf; }
.trend-same { color: var(--muted); background: #f0ebe3; }
.kw-preview {
  display: none;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(27, 39, 66, 0.08);
}
.rank-item:hover .kw-preview,
.rank-item:focus-within .kw-preview,
.rank-item.is-open .kw-preview {
  display: block;
}
.kw-preview .kw-summary {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 600;
}
.kw-preview a,
.kw-preview p {
  display: block;
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  text-decoration: none;
}
.kw-preview a:hover { color: var(--rose); }
.kw-preview span {
  display: block;
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}
.kw-wiki { margin: 4px 0 0 !important; font-weight: 600; }
.search-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-self: center;
  gap: 4px;
}
.s-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.s-naver { color: #03c75a; border-color: #b6ebcd; }
.s-google { color: #1a73e8; border-color: #c6d8f5; }
.s-youtube { color: #c4302b; border-color: #f0c4c2; }
.s-btn:hover { background: #f7f4ee; }
.wiki li { font-size: 13px; color: var(--muted); }
.wiki a { color: var(--ink); text-decoration: none; }

.news article a { text-decoration: none; display: block; }
.news h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.45; }
.news p { margin: 0; color: var(--muted); font-size: 13px; }
.news .src { color: var(--gold); font-weight: 700; margin-right: 8px; }

.composer { display: grid; gap: 8px; margin-bottom: 12px; }
.composer input, .composer textarea, .composer button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 10px 12px;
}
.composer button {
  background: var(--navy);
  color: #fff;
  border: 0;
  cursor: pointer;
}
.form-msg { color: var(--rose); font-size: 13px; }
.posts li strong { display: block; font-size: 13px; }
.posts li span { color: var(--muted); font-size: 12px; }
.posts li p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; }

.country-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}
.country-tabs a {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.country-tabs a.is-on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.dummy-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
}
.tab.is-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.overseas-list article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.overseas-list a { text-decoration: none; }
.overseas-list h3 { margin: 0 0 6px; font-size: 16px; }
.overseas-list .orig { color: var(--muted); font-size: 13px; margin: 0; }

.foot {
  border-top: 1px solid var(--line);
  padding: 24px 0 36px;
  color: var(--muted);
  font-size: 13px;
}
.foot a { color: var(--navy); }

.empty { color: var(--muted); padding: 18px 0; }

body[data-view="issues"] .grid,
body[data-view="news"] .grid,
body[data-view="community"] .grid {
  grid-template-columns: 1fr;
}
body[data-view="issues"] .section-news,
body[data-view="issues"] .section-community,
body[data-view="issues"] .section-overseas,
body[data-view="news"] .section-issues,
body[data-view="news"] .section-community,
body[data-view="news"] .section-overseas,
body[data-view="community"] .section-issues,
body[data-view="community"] .section-news,
body[data-view="community"] .section-overseas,
body[data-view="overseas"] .grid {
  display: none;
}

@media (max-width: 980px) {
  .grid,
  body[data-view="home"] .grid { grid-template-columns: 1fr; }
  .top-inner { flex-wrap: wrap; padding: 8px 0; }
  .nav { order: 3; flex-basis: 100%; justify-content: flex-start; }
  body[data-view="home"] .hero { padding: 32px 0 14px; }
  .hero h1 { font-size: clamp(28px, 8.4vw, 42px); }
  .lead { font-size: 16px; }
  .rank-item {
    grid-template-columns: 48px 1fr;
  }
  .search-links {
    grid-column: 2;
    justify-content: flex-start;
  }
}
