:root {
  --bg: #0d1117;
  --bg-soft: #151b24;
  --panel: #161d27;
  --panel-2: #1c2533;
  --border: #263041;
  --text: #e6edf3;
  --muted: #8b97a7;
  --accent: #4f9bff;
  --accent-2: #36d399;
  --warn: #f5a524;
  --danger: #f06a6a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 600px at 50% -200px, #1b2a45 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.6;
}

.wrap {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Hero */
.hero {
  padding: 54px 0 26px;
  text-align: center;
}
.badge {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  color: var(--accent-2);
  background: rgba(54, 211, 153, 0.1);
  border: 1px solid rgba(54, 211, 153, 0.3);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(28px, 6vw, 44px);
  margin: 0 0 14px;
  letter-spacing: -0.5px;
  background: linear-gradient(120deg, #fff 10%, #9fc4ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .sub {
  font-size: clamp(15px, 2.6vw, 18px);
  color: var(--muted);
  max-width: 660px;
  margin: 0 auto;
}
.hero .sub strong {
  color: var(--text);
}

/* Panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.panel h2 {
  font-size: 18px;
  margin: 0;
}
.hint {
  font-size: 13px;
  color: var(--muted);
}
code {
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12.5px;
}

textarea {
  width: 100%;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  line-height: 1.7;
  resize: vertical;
  font-family: inherit;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 155, 255, 0.18);
}

/* Examples */
.examples {
  margin: 14px 0 6px;
}
.examples-label {
  font-size: 13px;
  color: var(--muted);
  margin-right: 8px;
}
.example-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.chip {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.15s;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Buttons */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.btn {
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  padding: 11px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: 0.15s;
  font-family: inherit;
}
.btn.primary {
  background: linear-gradient(120deg, var(--accent), #6aa9ff);
  color: #06122a;
}
.btn.primary:hover {
  filter: brightness(1.08);
}
.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}
.btn.ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}
.btn.small {
  font-size: 13px;
  padding: 7px 14px;
}

/* Summary */
.summary-panel {
  border-color: rgba(79, 155, 255, 0.35);
  background: linear-gradient(180deg, rgba(79, 155, 255, 0.08), var(--panel));
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 6px 0 16px;
}
.stat {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.stat .num {
  font-size: 26px;
  font-weight: 700;
  display: block;
}
.stat .lbl {
  font-size: 12px;
  color: var(--muted);
}
.summary-panel h3 {
  font-size: 15px;
  margin: 14px 0 8px;
}
.action-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.action-list li {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 14.5px;
}
.summary-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Result cards */
.results {
  display: grid;
  gap: 14px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.card-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}
.tag {
  display: inline-block;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  margin: 4px 6px 0 0;
  color: var(--muted);
}
.score {
  text-align: center;
  flex-shrink: 0;
}
.score .ring {
  font-size: 24px;
  font-weight: 700;
  display: block;
}
.tier {
  font-size: 11.5px;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.tier.high {
  color: #06210f;
  background: var(--accent-2);
}
.tier.mid {
  color: #1d1300;
  background: var(--warn);
}
.tier.low {
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.pathways {
  margin: 14px 0 4px;
  display: grid;
  gap: 8px;
}
.pw {
  display: flex;
  gap: 10px;
  align-items: baseline;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
}
.pw .pw-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.pw .pw-dir {
  font-size: 11px;
  color: var(--accent);
  border: 1px solid rgba(79, 155, 255, 0.3);
  border-radius: 6px;
  padding: 0 6px;
  white-space: nowrap;
}
.pw .pw-reason {
  font-size: 13px;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.detail h4 {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.detail p,
.detail .users {
  font-size: 13.5px;
  margin: 0;
}
.detail .users span {
  display: inline-block;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  margin: 0 6px 6px 0;
  font-size: 12.5px;
}
.detail .chans {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.detail .chans span {
  font-size: 12.5px;
  color: var(--accent-2);
}
.detail .chans span:not(:last-child)::after {
  content: " ·";
  color: var(--muted);
}

.how ul {
  margin: 6px 0 0;
  padding-left: 20px;
}
.how li {
  margin-bottom: 8px;
  color: var(--muted);
}
.how li strong {
  color: var(--text);
}

.footer {
  text-align: center;
  padding: 30px 18px 50px;
  color: var(--muted);
  font-size: 13px;
}
.footer .muted {
  font-size: 12px;
  opacity: 0.8;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent-2);
  color: #06210f;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 50;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 620px) {
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 38px 0 18px;
  }
}
