:root {
  --bg: #edf3f8;
  --panel: rgba(249, 252, 255, 0.94);
  --line: rgba(33, 53, 71, 0.12);
  --ink: #1e2f3d;
  --muted: #5f6f7d;
  --accent: #166272;
  --accent-soft: #d9edf2;
  --blue: #274c77;
  --blue-soft: #d9e4f2;
  --shadow: 0 24px 60px rgba(38, 48, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "SUIT Variable", "Pretendard Variable", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(39, 76, 119, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(22, 98, 114, 0.14), transparent 30%),
    linear-gradient(180deg, #f5f9fc 0%, #e7eef5 100%);
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 20px 60px;
}

.hero {
  padding: 8px 0 28px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1000px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.s1forum-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0;
  color: inherit;
  text-decoration: none;
}

.s1forum-link img {
  display: block;
  width: 116px;
  height: auto;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
}

h1,
h2,
h3,
strong {
  margin: 0;
  font-family: "Avenir Next", "SUIT Variable", sans-serif;
}

h1 {
  font-size: clamp(32px, 4.4vw, 54px);
  line-height: 1.08;
  max-width: 1000px;
  word-break: keep-all;
}

.hero-copy {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.section-head p,
.matches-head p,
.status,
.result-copy,
.result-description {
  color: var(--muted);
}

.section-head {
  margin-bottom: 20px;
}

.section-head h2,
.matches-head h3 {
  font-size: 24px;
}

.section-head p,
.matches-head p {
  margin: 8px 0 0;
  line-height: 1.6;
}

.series-switch {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.series-switch button,
.match-card {
  border: 0;
  cursor: pointer;
}

.series-switch button {
  flex: 1;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.series-switch button.active {
  background: var(--blue);
  color: #fff;
  transform: translateY(-1px);
}

label {
  display: block;
  margin: 16px 0 8px;
  font-size: 14px;
  font-weight: 700;
}

select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: 15px;
}

select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px dashed var(--line);
  line-height: 1.6;
}

.equation {
  margin-top: 6px;
  padding: 18px 20px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--line);
}

.equation-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.equation-part,
.equation-result {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: #f4f8fb;
  border: 1px solid var(--line);
}

.equation-thumb {
  width: 100%;
  max-width: 140px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 10px;
  background: #eef3f8;
}

.equation-part strong,
.equation-result strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.equation-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.equation-operator {
  font-size: 24px;
  font-weight: 800;
  color: var(--muted);
}

.equation-operator.equals {
  color: var(--accent);
}

.match-series {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.result-card {
  margin-top: 22px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f1f6fb 100%);
  border: 1px solid var(--line);
}

.result-card.empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
  border-style: dashed;
}

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

.result-top > div:not(.result-visual):not(.price-badge) {
  min-width: 0;
  flex: 1 1 auto;
}

.result-visual {
  width: min(260px, 34vw);
  flex-shrink: 0;
}

.result-visual img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 22px;
  background: #eef3f8;
  border: 1px solid var(--line);
}

.result-series {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.result-top h3 {
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.price-badge {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.result-meta span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(39, 76, 119, 0.08);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.result-description {
  margin: 18px 0 0;
  line-height: 1.7;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

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

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

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.metric.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.result-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.result-links a {
  display: inline-flex;
  align-items: center;
  padding: 11px 14px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.latest-posts {
  margin-top: 28px;
}

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

.latest-head h2 {
  margin-top: 6px;
  font-size: 24px;
}

.latest-head a {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

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

.latest-loading,
.latest-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 36px rgba(38, 48, 58, 0.08);
}

.latest-loading {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

.latest-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
  padding: 12px;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.latest-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  object-fit: cover;
  background: #dfeaf2;
}

.latest-thumb-empty {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(39, 76, 119, 0.18), rgba(22, 98, 114, 0.2)),
    #edf3f8;
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
}

.latest-card:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 98, 114, 0.28);
  background: #fff;
}

.latest-card > span:not(.latest-thumb) {
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.latest-card strong {
  display: -webkit-box;
  overflow: hidden;
  padding: 0 4px 4px;
  line-height: 1.45;
  font-size: 16px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.latest-card-wide {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .page {
    padding-top: 28px;
  }

  .hero-brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .brand-divider {
    display: none;
  }

  .s1forum-link {
    width: auto;
  }

  .panel {
    padding: 20px;
    border-radius: 22px;
  }

  .result-top {
    flex-direction: column;
  }

  .result-visual {
    width: 100%;
  }

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

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