:root {
  --bg: #0b0f1a;
  --bg2: #111726;
  --panel: #151c2e;
  --panel2: #1b2440;
  --line: #26314f;
  --txt: #e7ecf6;
  --mut: #93a0bd;
  --accent: #6ea8fe;
  --accent2: #7ef0c8;
  --warn: #ffcf6b;
  --bad: #ff8a8a;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--txt);
  background: radial-gradient(1200px 600px at 80% -10%, #16223f, transparent), radial-gradient(1000px 500px at 0% 0%, #16203a, transparent), var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { width: min(1080px, 92vw); margin: 0 auto; }

/* topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 15, 26, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.logo { font-size: 20px; }
.ghost-btn {
  color: var(--txt); text-decoration: none; font-size: 14px;
  border: 1px solid var(--line); padding: 7px 13px; border-radius: 10px;
  transition: border-color .15s, background .15s;
}
.ghost-btn:hover { border-color: var(--accent); background: var(--panel2); }

/* hero */
.hero { padding: 44px 0 20px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); margin: 0 0 12px; line-height: 1.15; background: linear-gradient(120deg, #fff, #9fc2ff 60%, #7ef0c8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero .sub { color: var(--mut); font-size: 17px; max-width: 760px; margin: 0; }
.hero .sub strong { color: var(--txt); font-weight: 600; }

/* panel */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-top: 8px;
}
.picker { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.span2 { grid-column: 1 / -1; }
.field.inline { flex-direction: row; align-items: center; }
.field label { font-size: 13px; font-weight: 600; color: var(--mut); letter-spacing: .3px; }
.field select {
  appearance: none; background: var(--panel2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2393a0bd' d='M6 8L0 0h12z'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--txt); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 34px 11px 13px; font-size: 15px; cursor: pointer;
}
.field select:focus { outline: none; border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--txt); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  border: 1px solid var(--line); background: var(--panel2); color: var(--txt);
  padding: 8px 14px; border-radius: 999px; font-size: 14px; cursor: pointer;
  transition: all .14s; user-select: none;
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: linear-gradient(120deg, var(--accent), #4f83e0); border-color: transparent; color: #06122a; font-weight: 600; }
.hint { color: var(--mut); font-size: 13px; margin: 4px 0 0; }
.hint.mini { margin-top: 14px; font-size: 12.5px; }
.hint code, code { background: #0e1526; border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }

/* result */
.result { margin: 22px 0 8px; display: grid; gap: 16px; }
.rec-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.rec-head h2 { margin: 0; font-size: 20px; }
.rec-head .muted { color: var(--mut); font-size: 14px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px; position: relative;
}
.card.primary { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow); }
.card.fallback { border-color: #3a4a2e; }
.card .role {
  position: absolute; top: -10px; left: 14px; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; letter-spacing: .5px;
}
.card.primary .role { background: var(--accent); color: #06122a; }
.card.fallback .role { background: var(--accent2); color: #06251a; }
.card .name { font-size: 17px; font-weight: 700; margin-top: 4px; }
.card .vendor { font-size: 12px; color: var(--mut); margin-top: -6px; }
.score-row { display: flex; align-items: center; gap: 10px; }
.score-bar { flex: 1; height: 8px; background: #0e1526; border-radius: 999px; overflow: hidden; }
.score-fill { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 999px; }
.score-num { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; min-width: 30px; text-align: right; }
.reasons { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
.reasons li { font-size: 13px; color: var(--txt); padding-left: 18px; position: relative; }
.reasons li::before { content: "✓"; position: absolute; left: 0; color: var(--accent2); }
.reasons li.warn { color: var(--warn); }
.reasons li.warn::before { content: "!"; color: var(--warn); font-weight: 700; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); color: var(--mut); }
.tag.stack { background: #14301f; border-color: #1f5a37; color: var(--accent2); }
.tag.mod { background: #1a2440; border-color: #2b3a63; color: #a9c2ff; }
.note { font-size: 12.5px; color: var(--mut); border-top: 1px dashed var(--line); padding-top: 8px; }

/* sample block */
.sample {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px;
  display: grid; gap: 12px;
}
.sample h3 { margin: 0; font-size: 16px; }
.sample .prompt { background: #0e1526; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14px; color: #d6e2ff; white-space: pre-wrap; }
.sample .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--line); background: var(--panel2); color: var(--txt);
  padding: 9px 16px; border-radius: 10px; font-size: 14px; cursor: pointer; transition: all .14s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(120deg, var(--accent), #4f83e0); border: none; color: #06122a; font-weight: 600; }
.eval { display: grid; gap: 6px; }
.eval label { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--txt); }
.eval input { margin-top: 3px; accent-color: var(--accent2); }
.copied { color: var(--accent2); font-size: 13px; }

/* catalog */
.catalog-section { padding: 40px 0 20px; }
.catalog-section h2 { font-size: 24px; margin: 0 0 6px; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 16px; }
.cat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.cat-card .cat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cat-card .cat-name { font-weight: 700; font-size: 15px; }
.cat-card .cat-vendor { font-size: 12px; color: var(--mut); }
.cat-card .cat-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.cat-card .cat-note { font-size: 12.5px; color: var(--mut); }

/* footer */
.footer { padding: 34px 0 48px; color: var(--mut); font-size: 13px; text-align: center; border-top: 1px solid var(--line); margin-top: 30px; }
.footer .mini { font-size: 12px; opacity: .8; }
.mini { font-size: 12px; }

/* empty */
.empty { color: var(--mut); text-align: center; padding: 30px; border: 1px dashed var(--line); border-radius: 12px; }

@media (max-width: 640px) {
  .picker { grid-template-columns: 1fr; }
  .hero { padding: 30px 0 14px; }
  .cards { grid-template-columns: 1fr; }
}
