:root {
  --bg: #0f1722;
  --panel: #16212e;
  --panel-2: #1d2a3a;
  --line: #28384b;
  --text: #e8eef5;
  --muted: #8aa0b6;
  --accent: #4fd1c5;
  --cold: #3b82f6;
  --warm: #f59e0b;
  --hot: #ef4444;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #1b2c3f 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { font-size: 34px; line-height: 1; }
.topbar h1 { margin: 0; font-size: 20px; letter-spacing: 0.3px; }
.tag { margin: 4px 0 0; color: var(--muted); font-size: 13px; max-width: 560px; }
.topbar-actions { display: flex; gap: 10px; }

/* layout */
.layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}
.panel { display: flex; flex-direction: column; gap: 20px; }

.block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.block-head h2 { margin: 0; font-size: 16px; }
.hint { color: var(--muted); font-size: 12px; text-align: right; }

/* holdings table */
.table-head, .holding-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.7fr 0.7fr 32px;
  gap: 8px;
  align-items: center;
}
.table-head { color: var(--muted); font-size: 12px; padding: 0 4px 8px; }
.holding-row { margin-bottom: 8px; }
.holding-row input, .holding-row select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 13px;
  outline: none;
}
.holding-row input:focus, .holding-row select:focus { border-color: var(--accent); }
.holding-row .del {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.holding-row .del:hover { color: var(--hot); }

.btn.add {
  margin-top: 6px;
  width: 100%;
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--muted);
}
.btn.add:hover { border-color: var(--accent); color: var(--accent); }

.weight-status {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.weight-status strong { color: var(--text); font-size: 15px; }
.flag { font-size: 12px; }
.flag.ok { color: var(--accent); }
.flag.warn { color: var(--warm); }

/* factors */
.factors { display: flex; flex-direction: column; gap: 8px; }
.factor {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.factor:hover { border-color: var(--accent); }
.factor.on { border-color: var(--warm); background: #20283010; }
.factor input { margin-top: 3px; accent-color: var(--warm); }
.factor .f-text { display: flex; flex-direction: column; gap: 2px; }
.factor .f-label { font-size: 13.5px; }
.factor .f-sub { font-size: 11.5px; color: var(--muted); }
.factor .f-pts { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* gauge */
.gauge-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 20px;
  align-items: center;
}
.thermo { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.thermo-track {
  position: relative;
  width: 18px; height: 200px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.thermo-fill {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 0%;
  background: linear-gradient(to top, var(--cold), var(--accent) 45%, var(--warm) 72%, var(--hot));
  transition: height 0.5s cubic-bezier(.2,.8,.2,1);
}
.thermo-scale { display: none; }

.score-readout { text-align: left; }
.score-num { font-size: 64px; font-weight: 700; line-height: 1; }
.score-band {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.score-line { color: var(--muted); font-size: 13px; margin: 12px 0 0; line-height: 1.6; }

/* breakdown + actions */
.breakdown, .actions-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.breakdown h3, .actions-card h3 { margin: 0 0 12px; font-size: 15px; }
.breakdown-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.breakdown-list li {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 7px 0; border-bottom: 1px dashed var(--line);
}
.breakdown-list li:last-child { border-bottom: none; }
.breakdown-list .b-pts { font-variant-numeric: tabular-nums; color: var(--warm); font-weight: 600; }
.breakdown-list .b-pts.cool { color: var(--accent); }

.action-list { margin: 0 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; }
.action-list li { font-size: 13.5px; line-height: 1.55; }
.action-list li::marker { color: var(--accent); font-weight: 700; }

.muted { color: var(--muted); }

/* buttons */
.btn {
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  transition: all 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--accent); color: #06231f; border-color: var(--accent); font-weight: 600; width: 100%; }
.copy-ok { display: inline-block; margin-left: 10px; color: var(--accent); font-size: 12px; }

/* footer */
.foot {
  max-width: 1180px;
  margin: 10px auto 40px;
  padding: 0 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.foot a { color: var(--accent); text-decoration: none; }
.foot .meta { margin-top: 6px; opacity: 0.7; }

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .gauge-card { grid-template-columns: 60px 1fr; }
  .score-num { font-size: 52px; }
  .hint { display: none; }
}
