:root {
  color-scheme: dark;
  --bg: #050708;
  --panel: rgba(10, 14, 18, 0.82);
  --line: rgba(169, 226, 255, 0.14);
  --line-strong: rgba(169, 226, 255, 0.3);
  --text: #f1f7fb;
  --muted: #8fa0aa;
  --soft: #c8d6de;
  --blue: #9fdcff;
  --green: #9effc9;
  --gold: #ffd166;
  --red: #ff7a7a;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 8%, rgba(159, 220, 255, 0.18), transparent 28vw),
    radial-gradient(circle at 78% 18%, rgba(158, 255, 201, 0.1), transparent 30vw),
    linear-gradient(145deg, #050708 0%, #081018 50%, #070b0d 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.ambient,
.grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient {
  z-index: -3;
  background:
    linear-gradient(115deg, transparent 0 32%, rgba(159, 220, 255, 0.055) 33%, transparent 48%),
    radial-gradient(ellipse at 50% 100%, rgba(158, 255, 201, 0.07), transparent 48%);
}

.grid {
  z-index: -2;
  background-image:
    linear-gradient(rgba(169, 226, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169, 226, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82), transparent 86%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(169, 226, 255, 0.1);
  background: rgba(5, 8, 10, 0.78);
  backdrop-filter: blur(18px);
}

.brand,
.nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-size: 15px;
  font-weight: 760;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(169, 226, 255, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.brand-mark img {
  width: 24px;
  height: 24px;
}

.nav {
  gap: 8px;
}

.nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.nav a:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(169, 226, 255, 0.06);
}

.shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 60px 0 72px;
}

.hero {
  max-width: 960px;
  margin-bottom: 42px;
}

.kicker,
.panel-head p {
  margin: 0 0 16px;
  color: var(--blue);
  font-family: "SFMono-Regular", "Cascadia Code", Menlo, monospace;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.18em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 0.98;
  font-weight: 790;
}

.summary {
  max-width: 760px;
  margin: 26px 0 0;
  color: var(--soft);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.75;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(0, 1.18fr);
  gap: 20px;
  align-items: start;
}

.input-panel,
.result-panel,
.logic-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 34px 100px rgba(0, 0, 0, 0.3);
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1;
}

.sample-button,
.ghost {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: var(--soft);
  font-size: 13px;
  font-weight: 720;
}

.sample-button:hover,
.ghost:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(169, 226, 255, 0.06);
}

textarea {
  width: 100%;
  min-height: 340px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  outline: none;
  background: rgba(0, 0, 0, 0.26);
  color: var(--text);
  font-family: "SFMono-Regular", "Cascadia Code", Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
}

textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(169, 226, 255, 0.06);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.primary {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--blue), #eaf8ff);
  color: #061018;
  font-weight: 820;
}

.hint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

.score-strip article,
.matrix-card,
.json-panel,
.logic-grid article {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.score-strip article {
  min-height: 112px;
  padding: 18px;
}

.score-strip span,
.table-head,
.notice-head span,
.logic-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-strip strong {
  display: block;
  margin-top: 18px;
  font-size: 28px;
}

.schedule-table {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.4fr;
  gap: 14px;
  align-items: center;
}

.table-head {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
}

.table-row {
  min-height: 72px;
  padding: 16px;
  border-top: 1px solid var(--line);
  color: var(--soft);
}

.table-row strong {
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--blue);
  font-weight: 780;
}

.matrix-card {
  margin-top: 16px;
  padding: 18px;
}

.notice-head {
  margin-bottom: 12px;
}

.score-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.score-list article {
  border: 1px solid rgba(169, 226, 255, 0.1);
  border-radius: 16px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.score-list strong {
  display: block;
  color: var(--text);
}

.score-list span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.json-panel {
  margin-top: 16px;
  padding: 16px 18px;
}

.json-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 760;
}

pre {
  margin: 14px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--soft);
  font-family: "SFMono-Regular", "Cascadia Code", Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
}

.logic-panel {
  margin-top: 20px;
}

.logic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.logic-grid article {
  min-height: 132px;
  padding: 18px;
}

.logic-grid p {
  margin: 18px 0 0;
  color: var(--soft);
  line-height: 1.7;
}

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

  .score-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .topbar {
    min-height: 68px;
    padding: 0 16px;
  }

  .nav {
    display: none;
  }

  .shell {
    width: min(100% - 28px, 1240px);
    padding: 38px 0 48px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .summary {
    font-size: 16px;
  }

  .input-panel,
  .result-panel,
  .logic-panel {
    border-radius: 22px;
    padding: 18px;
  }

  .panel-head {
    display: grid;
  }

  textarea {
    min-height: 280px;
  }

  .actions,
  .score-strip {
    grid-template-columns: 1fr;
    display: grid;
  }

  .table-head {
    display: none;
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
