:root {
  --bg: #e8f1f7;
  --bg-strong: #d6e7f2;
  --surface: rgba(244, 250, 255, 0.84);
  --surface-strong: rgba(244, 250, 255, 0.96);
  --line: rgba(21, 64, 91, 0.16);
  --text: #102231;
  --muted: #4c677d;
  --accent: #2e78a6;
  --accent-deep: #174d75;
  --accent-soft: rgba(46, 120, 166, 0.1);
  --shadow: 0 18px 60px rgba(29, 73, 107, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(74, 158, 214, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(125, 191, 214, 0.22), transparent 24%),
    linear-gradient(180deg, #eef6fb 0%, #dce9f2 100%);
  font-family: "Manrope", "Noto Sans KR", sans-serif;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.hero,
.section-grid,
.meta-card,
.news-card,
.featured-cloud,
.cloud-item,
.hero-panel {
  backdrop-filter: blur(12px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(300px, 0.72fr);
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-copy {
  min-width: 0;
}

.eyebrow,
.section-kicker,
.panel-label,
.meta-label,
.stat-label {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.hero h1,
.section-header h2,
.hero-panel h2 {
  margin: 0;
  font-family: "Manrope", "Noto Sans KR", sans-serif;
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.hero h1 {
  max-width: 14ch;
  font-size: clamp(2.8rem, 4vw, 5rem);
}

.hero-text,
.section-note,
#range-text,
.panel-text,
.news-content,
.news-journalist,
.news-time,
.news-office,
#featured-caption {
  color: var(--muted);
}

.hero-text {
  max-width: 58ch;
  margin: 18px 0 0;
  font-size: 1.02rem;
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.hero-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.stat-card,
.meta-card,
.insight-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 251, 245, 0.76);
}

.stat-value {
  display: block;
  font-size: 1.2rem;
}

.insight-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.insight-value {
  display: block;
  font-size: 1.08rem;
  line-height: 1.4;
}

.insight-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.hero-keywords-empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 16px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(18, 67, 104, 0.98), rgba(54, 128, 173, 0.9)),
    #174d75;
  color: #f2f9ff;
}

.hero-trend {
  grid-column: 1 / -1;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
}

.hero-trend-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
}

.hero-trend-header h2 {
  font-size: clamp(1.3rem, 2vw, 1.8rem);
}

.trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.trend-summary-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(247, 251, 255, 0.82);
}

.trend-summary-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.trend-summary-value {
  display: block;
  font-size: 1.02rem;
  line-height: 1.4;
}

.trend-summary-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.hero-panel .panel-label,
.hero-panel .panel-text {
  color: rgba(242, 249, 255, 0.82);
}

.hero-panel h2 {
  margin-top: 12px;
  font-size: clamp(1.5rem, 2.2vw, 2.15rem);
}

.panel-image {
  width: 100%;
  aspect-ratio: 10 / 6.2;
  margin-top: 6px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.18);
}

.hero-panel .panel-text {
  margin: 10px 0 0;
  line-height: 1.55;
}

.panel-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 18px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(242, 249, 255, 0.14);
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease;
}

.panel-link:hover {
  transform: translateY(-1px);
  background: rgba(242, 249, 255, 0.2);
}

.section-grid {
  margin-top: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

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

.search-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.section-header h2 {
  font-size: clamp(1.8rem, 2.6vw, 3rem);
}

.wordcloud-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
  gap: 20px;
}

.featured-cloud {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.56);
}

.featured-cloud img {
  width: 100%;
  aspect-ratio: 10 / 7;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fafdff, #ddebf5);
}

.featured-cloud figcaption {
  margin-top: 12px;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.cloud-rail {
  display: grid;
  gap: 12px;
  max-height: 700px;
  overflow: auto;
  padding-right: 4px;
}

.cloud-item {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: rgba(255, 252, 247, 0.76);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.cloud-item:hover,
.cloud-item.is-active {
  transform: translateY(-1px);
  border-color: rgba(46, 120, 166, 0.42);
  background: rgba(240, 248, 255, 0.98);
}

.cloud-item img {
  width: 100%;
  aspect-ratio: 10 / 7;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #fff;
}

.cloud-item span {
  font-weight: 600;
  line-height: 1.45;
}

.search-box input {
  width: min(460px, 52vw);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.reset-button {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.reset-button:hover {
  transform: translateY(-1px);
  border-color: rgba(46, 120, 166, 0.35);
  background: rgba(220, 238, 250, 0.92);
}

.news-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  padding: 7px 10px;
  border-radius: 999px;
  border: 0;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease;
}

.tag:hover,
.tag.is-active {
  transform: translateY(-1px);
  background: rgba(46, 120, 166, 0.18);
}

.trend-table {
  display: grid;
  gap: 10px;
}

.trend-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) minmax(220px, 0.9fr);
  align-items: center;
  gap: 16px;
}

.trend-row-head {
  padding: 0 14px 2px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.trend-row-item {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 252, 247, 0.76);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.trend-row-item:hover {
  transform: translateY(-1px);
  border-color: rgba(46, 120, 166, 0.35);
  background: rgba(240, 248, 255, 0.98);
}

.trend-rank {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--accent-deep);
}

.trend-word {
  font-size: 1.02rem;
  font-weight: 700;
}

.trend-word-wrap {
  display: grid;
  gap: 4px;
}

.trend-subtext {
  color: var(--muted);
  font-size: 0.9rem;
}

.trend-metrics {
  display: grid;
  gap: 8px;
  justify-items: stretch;
  align-self: stretch;
}

.trend-count {
  display: block;
  width: 100%;
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.trend-bar {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(46, 120, 166, 0.12);
}

.trend-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #74b7de, #2e78a6);
}

.trend-history {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.trend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(46, 120, 166, 0.16);
  border: 1px solid rgba(46, 120, 166, 0.2);
}

.trend-dot.is-active {
  background: #2e78a6;
  border-color: rgba(23, 77, 117, 0.65);
  box-shadow: 0 0 0 4px rgba(46, 120, 166, 0.08);
}

.trend-history-label {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.news-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.news-card-header {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
}

.news-office {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.news-title {
  margin: 14px 0 10px;
  font-size: 1.15rem;
  line-height: 1.45;
}

.news-journalist,
.news-content {
  margin: 0 0 12px;
  line-height: 1.65;
}

.news-content {
  flex: 1;
}

.news-link {
  width: fit-content;
  margin-top: 8px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 22px;
}

.page-button {
  min-width: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.page-button:hover,
.page-button.is-active {
  transform: translateY(-1px);
  border-color: rgba(46, 120, 166, 0.35);
  background: rgba(220, 238, 250, 0.92);
}

.page-control {
  min-width: 44px;
}

.page-control:first-child,
.page-control:last-child {
  min-width: 84px;
}

.page-button:disabled {
  cursor: default;
  opacity: 0.45;
  transform: none;
}

.empty-state {
  margin: 24px 0 0;
  color: var(--muted);
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1040px) {
  .hero,
  .wordcloud-layout,
  .news-list {
    grid-template-columns: 1fr;
  }

  .hero-stats,
  .hero-insights,
  .trend-summary,
  .news-meta {
    grid-template-columns: 1fr;
  }

  .cloud-rail {
    max-height: none;
  }

  .hero-trend-header,
  .trend-row {
    grid-template-columns: 1fr;
  }

  .hero-trend-header {
    align-items: start;
  }

  .trend-row-head {
    display: none;
  }

  .trend-count {
    justify-self: start;
  }

  .trend-metrics {
    justify-items: stretch;
  }

  .trend-count,
  .trend-history-label {
    text-align: left;
  }

  .trend-history {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 20px;
  }

  .hero,
  .section-grid {
    padding: 20px;
  }

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

  .search-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .search-box,
  .search-box input {
    width: 100%;
  }

  .cloud-item {
    grid-template-columns: 92px 1fr;
  }
}
