:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-ink: #1d4ed8;
  --do-now: #16a34a;
  --big-bet: #2563eb;
  --fill-in: #d97706;
  --cut: #dc2626;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1140px, 92vw); margin: 0 auto; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { color: var(--brand); transform: rotate(0deg); font-size: 14px; }
.brand-name { font-size: 17px; letter-spacing: .2px; }
.topbar-actions { display: flex; gap: 8px; }

button { font-family: inherit; cursor: pointer; }
.primary-btn {
  background: var(--brand); color: #fff; border: none;
  padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  transition: background .15s ease, transform .05s ease;
}
.primary-btn:hover { background: var(--brand-ink); }
.primary-btn:active { transform: translateY(1px); }
.primary-btn.block { width: 100%; padding: 12px; font-size: 15px; }
.ghost-btn {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 10px; font-size: 14px; font-weight: 500;
  transition: border-color .15s ease, background .15s ease;
}
.ghost-btn:hover { border-color: #cbd5e1; background: #f8fafc; }

/* Hero */
.hero { padding: 40px 0 8px; }
.hero h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.25; margin: 0 0 14px; letter-spacing: -.5px; }
.hero-sub { font-size: 16px; color: var(--muted); max-width: 760px; margin: 0; }
.hero-sub strong { color: var(--ink); }

/* Layout */
.layout { display: grid; grid-template-columns: 360px 1fr; gap: 22px; margin: 28px 0 36px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.panel-title { font-size: 15px; font-weight: 700; margin: 0 0 16px; text-transform: none; }

/* Form */
.field { display: block; margin-bottom: 18px; }
.field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field input[type="text"] {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; color: var(--ink); background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
.field input[type="text"]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }

.sliders { display: grid; gap: 16px; }
.slider-row { display: grid; gap: 4px; }
.slider-head { display: flex; align-items: baseline; justify-content: space-between; }
.slider-name { font-size: 13px; font-weight: 600; }
.slider-val { font-size: 15px; font-weight: 700; color: var(--brand); min-width: 18px; text-align: right; }
.slider-hint { font-size: 11.5px; color: var(--muted); }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, #93c5fd, #2563eb); outline: none; margin: 2px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); cursor: pointer;
}

.form-actions { margin-top: 20px; }

/* Weights */
.weights { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.weights-toggle { background: none; border: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 0; display: flex; align-items: center; gap: 6px; }
.weights-toggle .chev { transition: transform .2s ease; }
.weights-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.weights-note { font-size: 12px; color: var(--muted); margin: 10px 0; }
.weight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.weight-grid label { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.weight-grid input { padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.weight-grid input:focus { outline: none; border-color: var(--brand); }

/* Result */
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.result-head .panel-title { margin: 0; }
.result-stats { font-size: 12.5px; color: var(--muted); }
.result-stats b { color: var(--ink); }

.tabs { display: inline-flex; gap: 4px; background: #f1f5f9; padding: 4px; border-radius: 10px; margin-bottom: 18px; }
.tab { background: none; border: none; padding: 7px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15,23,42,.08); }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { text-align: left; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; font-size: 12.5px; }
tbody td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #f8fafc; }
.rank { font-weight: 700; color: var(--muted); width: 28px; }
.feat-name { font-weight: 600; }
.score-pill { display: inline-block; min-width: 42px; text-align: center; font-weight: 700; padding: 3px 8px; border-radius: 999px; color: #fff; font-size: 12.5px; }
.tier-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tier-do-now { background: rgba(22,163,74,.12); color: var(--do-now); }
.tier-big-bet { background: rgba(37,99,235,.12); color: var(--big-bet); }
.tier-fill-in { background: rgba(217,119,6,.12); color: var(--fill-in); }
.tier-cut { background: rgba(220,38,38,.12); color: var(--cut); }
.mini-dims { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.del-btn { background: none; border: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 4px; border-radius: 6px; }
.del-btn:hover { color: var(--cut); background: rgba(220,38,38,.08); }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; font-size: 14px; }
.empty button { margin-top: 12px; }

/* Matrix */
.matrix-wrap { display: grid; gap: 16px; }
.matrix {
  position: relative; width: 100%; aspect-ratio: 1 / 1; max-width: 460px; margin: 0 auto;
  background:
    linear-gradient(rgba(226,232,240,.6), rgba(226,232,240,.6)) center/1px 100% no-repeat,
    linear-gradient(rgba(226,232,240,.6), rgba(226,232,240,.6)) center/100% 1px no-repeat;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.q-label { position: absolute; font-size: 11px; font-weight: 600; color: var(--muted); opacity: .9; }
.q-label.tl { top: 8px; left: 10px; }
.q-label.tr { top: 8px; right: 10px; }
.q-label.bl { bottom: 8px; left: 10px; }
.q-label.br { bottom: 8px; right: 10px; }
.axis-label { position: absolute; font-size: 11px; color: var(--muted); }
.axis-label.x { bottom: -22px; left: 50%; transform: translateX(-50%); }
.axis-label.y { top: 50%; left: -10px; transform: translateY(-50%) rotate(-90deg); transform-origin: left center; }
.bubble {
  position: absolute; transform: translate(-50%, 50%);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700; cursor: default;
  box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .1s ease;
}
.bubble:hover { transform: translate(-50%, 50%) scale(1.12); z-index: 5; }
.matrix-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.matrix-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.do-now { background: var(--do-now); }
.dot.big-bet { background: var(--big-bet); }
.dot.fill-in { background: var(--fill-in); }
.dot.cut { background: var(--cut); }

/* Roadmap */
.roadmap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lane { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.lane h3 { margin: 0 0 4px; font-size: 14px; }
.lane .lane-sub { font-size: 11.5px; color: var(--muted); margin: 0 0 12px; }
.lane-item { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; margin-bottom: 8px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lane-item .li-score { font-size: 11.5px; font-weight: 700; color: var(--brand); }
.lane-empty { font-size: 12.5px; color: var(--muted); padding: 8px 0; }
.lane.now { border-top: 3px solid var(--do-now); }
.lane.next { border-top: 3px solid var(--big-bet); }
.lane.later { border-top: 3px solid var(--fill-in); }

/* Method */
.method { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); margin-bottom: 40px; }
.method h2 { font-size: 17px; margin: 0 0 12px; }
.method ol { margin: 0; padding-left: 20px; color: var(--muted); }
.method li { margin-bottom: 8px; }
.method strong { color: var(--ink); }

/* Footer */
.footer { border-top: 1px solid var(--line); background: #fff; padding: 22px 0 32px; }
.footer .wrap { display: flex; flex-direction: column; gap: 4px; }
.footer span { font-size: 13px; color: var(--muted); }
.footer-sub { font-size: 12px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .roadmap { grid-template-columns: 1fr; }
  .hero { padding: 28px 0 4px; }
  .brand-name { font-size: 16px; }
  .topbar-actions .ghost-btn { padding: 8px 10px; }
}
