:root {
  color-scheme: light;
  --bg: #eef7fb;
  --bg-2: #f8fbff;
  --panel: #ffffff;
  --panel-soft: #f5fbff;
  --text: #22313d;
  --muted: #687984;
  --line: #d5e8f0;
  --accent: #5aaed0;
  --accent-2: #92d6c8;
  --accent-3: #c9c6f2;
  --danger: #c06884;
  --shadow: 0 12px 30px rgba(58, 102, 125, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(238, 247, 251, 0.95), rgba(248, 251, 255, 0.98) 38%, #ffffff 100%),
    radial-gradient(circle at 10% 0%, rgba(146, 214, 200, 0.22), transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(201, 198, 242, 0.28), transparent 30%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 10px 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
}

.nav-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.nav-tabs a {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.nav-tabs a.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(72, 123, 146, 0.12);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 22px;
  align-items: stretch;
  padding: 22px 0 16px;
}

.hero-main {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
}

.lead {
  max-width: 680px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.hero-side,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-side {
  overflow: hidden;
}

.hero-side img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--panel-soft);
}

.hero-side-body {
  padding: 14px;
}

.hero-side h2,
.panel h2,
.section-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.hero-side p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.search,
.select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
}

.search {
  flex: 1 1 260px;
}

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

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(72, 123, 146, 0.09);
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--panel-soft);
}

.image-link {
  display: block;
  line-height: 0;
  background: var(--panel-soft);
}

.image-credit {
  padding: 6px 10px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.card.image-missing img,
.card.image-missing .image-credit {
  display: none;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 13px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e7f4fa;
  color: #317d9c;
  font-size: 12px;
  font-weight: 650;
}

.badge.hot {
  background: #f1edff;
  color: #6a62a8;
}

.badge.buy {
  background: #e7f7f0;
  color: #398871;
}

.card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.meta,
.mini {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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

.metric {
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.metric strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #71c5df);
  color: #fff;
  font-weight: 700;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
  padding-bottom: 40px;
}

.article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.article h1 {
  font-size: clamp(26px, 3.4vw, 42px);
}

.article-cover {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  margin: 18px 0;
  border-radius: 8px;
  background: var(--panel-soft);
}

.article-body {
  display: grid;
  gap: 16px;
}

.article-body h2 {
  margin: 10px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 24px;
}

.article-body h3 {
  margin: 8px 0 0;
  font-size: 19px;
}

.article-body p {
  margin: 0;
  line-height: 1.9;
}

.article-body figure {
  margin: 4px 0;
}

.article-body figure img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--panel-soft);
}

.article-body figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.dialogue {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.speaker {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #dff2fa;
  color: #317d9c;
  font-weight: 800;
}

.dialogue.dera .speaker {
  background: #eeeaff;
  color: #6a62a8;
}

.bubble {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  line-height: 1.75;
  white-space: pre-wrap;
}

.side-panel {
  position: sticky;
  top: 86px;
  padding: 14px;
}

.side-panel h2 {
  margin-bottom: 10px;
}

.kv {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.kv div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

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

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.empty,
.loading {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.notice {
  margin: 24px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

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

  .nav-tabs {
    width: 100%;
  }

  .nav-tabs a {
    flex: 1;
    text-align: center;
  }

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

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

  .side-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 18px, 1180px);
  }

  .hero-main,
  .article {
    padding: 16px;
  }

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

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