:root {
  --bg: #07090d;
  --bg-2: #0c1017;
  --panel: rgba(18, 22, 30, 0.58);
  --panel-solid: rgba(18, 22, 30, 0.88);
  --ink: #eef3f8;
  --muted: #93a0b0;
  --line: rgba(255, 255, 255, 0.1);
  --teal: #2dd4bf;
  --teal-deep: #14b8a6;
  --teal-soft: rgba(45, 212, 191, 0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --rose: #fb7185;
  --rose-soft: rgba(251, 113, 133, 0.12);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.12);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --blur: blur(18px) saturate(140%);
  --sans: "Sora", "Noto Sans SC", "PingFang SC", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(45, 212, 191, 0.12), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(56, 189, 248, 0.08), transparent 50%),
    linear-gradient(180deg, #0a0d13, var(--bg));
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
/* 去掉 number 输入框上下箭头 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 75%);
}

.shell {
  width: min(1560px, calc(100% - 24px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  background: rgba(7, 9, 13, 0.72);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand strong { display: block; font-size: 15px; letter-spacing: -0.03em; }
.brand small { color: var(--muted); font-size: 11px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #2dd4bf, #0f766e);
  color: #041016;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a, .nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}
.nav a.active, .nav a:hover, .nav button:hover,
.nav button.active {
  color: var(--ink);
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 0 0 1px var(--line);
}

.page { padding: 14px 0 40px; }
.narrow { max-width: 820px; margin: 0 auto; }
h1 { font-size: 22px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.04em; }
h2 { margin: 0 0 8px; font-size: 15px; letter-spacing: -0.02em; }
.lead, .fine, .muted { color: var(--muted); }
.lead { margin: 0 0 12px; max-width: 720px; }
.fine { font-size: 12px; line-height: 1.55; }
.eyebrow {
  display: inline-flex;
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.summary { font-size: 14px; line-height: 1.55; margin: 6px 0; }

.panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
.panel { padding: 14px 16px; }
.card { padding: 14px; overflow: visible; }

.search, .form.inline, .hold-add {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}
.search input, .field input, .form input, .select-wrap select, .hold-add input {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
  min-width: 0;
  color: var(--ink);
}
.search input { flex: 1; min-width: 180px; }
.search input:focus, .field input:focus, .form input:focus, .select-wrap select:focus, .hold-add input:focus {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
}
.btn {
  border: 0;
  cursor: pointer;
  border-radius: 10px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #2dd4bf, #0f766e);
  color: #041016;
  font-weight: 700;
  font-size: 12px;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn.ghost {
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: rgba(255,255,255,0.08); }
.search-hint { min-height: 1.3em; margin: 8px 0 0; color: var(--amber); font-size: 12px; }

.section-head, .detail-top, .filters {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}
.filters { margin: 0 0 10px; }
.nav-user {
  color: var(--teal);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 4px 0;
}
.ghost-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 4px 0;
}
.ghost-link:hover { color: var(--ink); }
.btn.compact { padding: 6px 10px; font-size: 12px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 12px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.auth-tabs button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.auth-tabs button.active {
  background: rgba(45, 212, 191, 0.14);
  color: var(--ink);
  font-weight: 600;
}
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.pager-meta {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.pager-jump {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pager-jump label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.pager-jump input {
  width: 64px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  color: var(--ink);
  outline: none;
}
.pager-jump input:focus {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
}
.segments { display: flex; gap: 6px; flex-wrap: wrap; }
.segments button, .choice {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
}
.segments button.active {
  background: var(--teal-soft);
  border-color: rgba(45, 212, 191, 0.35);
  color: var(--teal);
}
.select-wrap { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.sort-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  z-index: 6;
}
.sort-label { flex: 0 0 auto; }
.sort-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sort-trigger:hover,
.sort-wrap.open .sort-trigger {
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.08);
}
.sort-caret {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.sort-wrap.open .sort-caret {
  border-color: var(--teal);
  transform: rotate(225deg) translateY(-1px);
}
.sort-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(14, 18, 26, 0.94);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.sort-menu li {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.sort-menu li:hover {
  background: rgba(255,255,255,0.05);
  color: var(--ink);
}
.sort-menu li.active {
  background: rgba(45, 212, 191, 0.12);
  color: var(--teal);
  font-weight: 600;
}

.rank-table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 16, 23, 0.55);
  backdrop-filter: var(--blur);
}
.rank-head, .rank-row {
  display: grid;
  grid-template-columns: 2fr .7fr .55fr .7fr .7fr .7fr .7fr .95fr;
  gap: 8px;
  align-items: center;
  min-width: 880px;
}
.rank-head {
  color: var(--muted);
  font-size: 11px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.rank-row {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 12px;
}
.rank-row:last-child { border-bottom: 0; }
.rank-row:hover { background: rgba(45, 212, 191, 0.05); }
.rank-list { display: block; }
.skeleton-row, .skeleton-block {
  height: 34px;
  border-radius: 8px;
  margin: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  background-size: 200% 100%;
  animation: shine 1.4s infinite;
}
.skeleton-block { height: 120px; }
@keyframes shine { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}
.status-HIGH_PRIORITY, .status-BUYABLE, .action-ADD { color: var(--ok); background: var(--ok-soft); }
.status-BUY_SMALL, .action-ADD_SMALL { color: var(--teal); background: var(--teal-soft); }
.status-WATCH, .status-WAIT, .status-DATA_INSUFFICIENT, .action-HOLD { color: var(--amber); background: var(--amber-soft); }
.status-NOT_RECOMMENDED, .status-NOT_AVAILABLE, .status-RISK_MISMATCH, .action-REDUCE { color: var(--rose); background: var(--rose-soft); }

.detail-top { align-items: start; margin-bottom: 12px; }
.subnav {
  position: sticky; top: 52px; z-index: 8;
  display: flex; gap: 8px; overflow: auto;
  padding: 8px 0;
  margin-bottom: 8px;
  background: rgba(7, 9, 13, 0.82);
  backdrop-filter: var(--blur);
  font-size: 12px;
}
.subnav a {
  color: var(--muted);
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 999px;
}
.subnav a:hover { color: var(--ink); background: rgba(255,255,255,0.06); }
.hero-score, .split, .stack { display: grid; gap: 12px; }
.hero-score { grid-template-columns: 96px 1fr; align-items: center; }
.split { grid-template-columns: 1fr 1fr; }
.score-orb {
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: conic-gradient(var(--teal) calc(var(--p) * 1%), rgba(255,255,255,0.08) 0);
  font-family: var(--mono);
}
.score-orb strong { font-size: 22px; line-height: 1; }
.score-orb span, .score-orb em { color: var(--muted); font-style: normal; font-size: 11px; }
.score-pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.score-pills span, .banner {
  border-radius: 999px; padding: 4px 8px; background: rgba(255,255,255,0.05); color: var(--muted); font-size: 11px;
}
.banner { display: block; border-radius: 10px; margin: 0 0 10px; }
.banner.warn { color: var(--amber); background: var(--amber-soft); }
.score-panel { margin-top: 8px; }
.break-row, .bar-row, .holding, .history-row {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.point { display: flex; gap: 10px; margin: 10px 0; }
.dot { width: 8px; height: 8px; border-radius: 99px; margin-top: 6px; background: var(--teal); }
.dot.good { background: var(--ok); }
.dot.bad { background: var(--amber); }
.risk-card { background: rgba(251, 113, 133, 0.06); }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
  align-items: stretch;
}
.metric-grid > div {
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: auto;
  min-height: 72px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  min-width: 0;
}
.metric-grid > div > span:not(.tip-box) {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.metric-grid strong {
  display: block;
  margin-top: auto;
  font-family: var(--mono);
  font-size: 14px;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.chart { height: 240px; }
.chart.short { height: 170px; }
.bar { height: 8px; background: rgba(255,255,255,0.06); border-radius: 99px; overflow: hidden; min-width: 0; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #67e8f9, var(--teal)); }
.bar-row {
  grid-template-columns: minmax(96px, 1.2fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 10px;
}
.bar-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  font-size: 12px;
}
.bar-row > b {
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
  justify-self: end;
}
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.advice { margin: 12px 0; }
.source { margin-bottom: 16px; }

.tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  z-index: 1;
}
.tip i {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 99px;
  border: 1px solid var(--line);
  font-style: normal;
  font-size: 10px;
  flex: 0 0 auto;
  cursor: help;
  color: var(--muted);
}
/* 覆盖 .metric-grid span { display:block }，否则 tip 说明会常驻盖住数值 */
.tip-box,
.metric-grid .tip-box,
.metric-grid span.tip-box {
  display: none !important;
  position: absolute;
  z-index: 60;
  left: 0;
  top: calc(100% + 8px);
  width: min(260px, 70vw);
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(12, 16, 23, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
  white-space: normal;
  line-height: 1.45;
  font-size: 11px;
  pointer-events: none;
}
.tip:hover > .tip-box,
.tip:focus-within > .tip-box,
.metric-grid .tip:hover > .tip-box,
.metric-grid .tip:focus-within > .tip-box {
  display: block !important;
}
.metric-grid > div:hover,
.metric-grid > div:focus-within { z-index: 5; }
.metric-grid > div:nth-child(n+4) .tip-box {
  left: auto;
  right: 0;
}

.form fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.form legend { margin-bottom: 8px; font-weight: 600; }
.choice { display: inline-flex; margin: 0 6px 6px 0; gap: 6px; align-items: center; }
.choice input { accent-color: var(--teal); }
.field { display: block; margin-bottom: 12px; }
.field input { display: block; width: 100%; margin-top: 6px; }
.holding { grid-template-columns: 1.5fr .8fr 1.2fr auto; align-items: center; }
.history-row { grid-template-columns: 1.5fr auto auto; }
.history-row p { grid-column: 1 / -1; color: var(--muted); margin: 0; }
.score-inline { font-family: var(--mono); font-size: 16px; }
.empty-card { text-align: left; }
.hidden { display: none !important; }
.steps { margin: 0 0 12px; padding-left: 18px; color: var(--muted); }
.steps .active { color: var(--ink); }

.ai-loading-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(45, 212, 191, 0.16), transparent 55%),
    radial-gradient(90% 70% at 100% 0%, rgba(110, 168, 255, 0.14), transparent 50%),
    var(--panel);
}
.ai-loading-card::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 60%;
  height: 80%;
  background: linear-gradient(120deg, transparent, rgba(45, 212, 191, 0.08), transparent);
  animation: aiSweep 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes aiSweep {
  0% { transform: translateX(-20%) rotate(8deg); opacity: 0.2; }
  50% { opacity: 0.7; }
  100% { transform: translateX(140%) rotate(8deg); opacity: 0.2; }
}
.ai-load-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}
.ai-orb {
  position: relative;
  width: 56px;
  height: 56px;
}
.ai-orb .ring,
.ai-orb .core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.ai-orb .ring {
  border: 1px solid rgba(45, 212, 191, 0.35);
  animation: aiSpin 4s linear infinite;
}
.ai-orb .ring:nth-child(2) {
  inset: 8px;
  border-color: rgba(110, 168, 255, 0.45);
  animation-direction: reverse;
  animation-duration: 2.6s;
}
.ai-orb .core {
  inset: 16px;
  background: radial-gradient(circle at 35% 30%, #a7f3d0, #2dd4bf 45%, #0f766e 100%);
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.45);
  animation: aiPulse 1.8s ease-in-out infinite;
}
@keyframes aiSpin { to { transform: rotate(360deg); } }
@keyframes aiPulse {
  0%, 100% { transform: scale(0.94); opacity: 0.85; }
  50% { transform: scale(1); opacity: 1; }
}
.ai-progress {
  height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  margin-bottom: 14px;
}
.ai-progress i {
  display: block;
  height: 100%;
  width: 8%;
  border-radius: inherit;
  background: linear-gradient(90deg, #67e8f9, #2dd4bf, #6ea8ff);
  background-size: 200% 100%;
  animation: shine 1.6s linear infinite;
  transition: width 0.35s ease;
}
.ai-steps {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.ai-steps li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.18);
  color: var(--muted);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.ai-steps li b { font-size: 13px; color: inherit; }
.ai-steps li span { font-size: 12px; }
.ai-steps li.run {
  color: var(--ink);
  border-color: rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.1);
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.12);
}
.ai-steps li.done {
  color: var(--ink);
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.08);
}
.ai-steps li.done b::after {
  content: " ✓";
  color: var(--ok);
  font-weight: 700;
}
.ai-stream {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  margin-bottom: 8px;
  padding-right: 2px;
}
.ai-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  font-size: 12px;
  line-height: 1.45;
}
.ai-line time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}
.ai-line.run { border-color: rgba(45, 212, 191, 0.28); }
.ai-line.ok { border-color: rgba(52, 211, 153, 0.2); }
.ai-line.err { border-color: rgba(251, 113, 133, 0.35); color: #fecdd3; }
.ai-line.sys { color: var(--muted); }
.legal {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  padding: 0 0 24px;
  width: min(1560px, calc(100% - 24px));
  margin: 0 auto;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 12px;
  margin-bottom: 14px;
}
.stat-line { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 11px;
  font-weight: 600;
}
.task-board { display: grid; gap: 8px; margin: 0 0 14px; }
.task-card header { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.task-card ol { margin: 6px 0 0; padding-left: 18px; }
.task-card li { margin: 2px 0; color: var(--muted); font-size: 12px; }
.task-card li.run { color: var(--ink); }
.task-card .task-summary { margin: 8px 0 0; }
.process { margin: 0; padding-left: 18px; }
.process li { margin: 4px 0; }
.process b { display: inline-block; min-width: 7em; }
.process span { color: var(--muted); }
.trace { margin: 8px 0; }
.trace summary { cursor: pointer; color: var(--teal); }
.trace pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
}

.hold-list { display: grid; gap: 8px; margin-top: 12px; }
.hold-card {
  display: grid;
  grid-template-columns: 1.3fr .8fr 1.4fr auto;
  gap: 10px;
  align-items: center;
}
.hold-card .action-box { display: grid; gap: 2px; }
.hold-card .action-box b { font-size: 13px; }
.hold-card .action-box span { color: var(--muted); font-size: 12px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}
.modal {
  width: min(640px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: rgba(14, 18, 26, 0.92);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
  padding: 16px;
}
.modal.wide { width: min(920px, 100%); }
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}
.modal-actions { display: flex; gap: 8px; justify-content: end; margin-top: 8px; flex-wrap: wrap; }
.task-panels {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 12px;
  min-height: 0;
}
.task-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
}
.task-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.task-panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}
.candidate-list {
  display: grid;
  gap: 8px;
  max-height: 48vh;
  overflow: auto;
  padding-right: 2px;
}
.candidate-empty {
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(255,255,255,0.12);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.candidate-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(14, 18, 26, 0.55);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.candidate-item:hover {
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.08);
}
.candidate-item .main {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.candidate-item .name {
  font-size: 13px;
  font-weight: 600;
}
.candidate-item .code {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-left: 6px;
}
.candidate-item .summary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.candidate-item .score {
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 650;
  color: var(--teal);
  white-space: nowrap;
  line-height: 1;
  padding-top: 2px;
}
.candidate-item .status { width: fit-content; }
.toast {
  position: fixed;
  right: 18px;
  bottom: 78px;
  z-index: 90;
  min-width: 220px;
  max-width: min(360px, calc(100% - 24px));
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(18, 22, 30, 0.95);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12px;
}
.toast.ok { border-color: rgba(52, 211, 153, 0.4); }
.toast.err { border-color: rgba(251, 113, 133, 0.45); }

.task-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: flex;
  gap: 8px;
  align-items: center;
}
.task-dock .dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(14, 18, 26, 0.9);
  backdrop-filter: var(--blur);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.task-dock .pulse {
  width: 8px; height: 8px; border-radius: 99px;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.6);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(45, 212, 191, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); }
}
.task-log {
  display: grid;
  gap: 6px;
  max-height: 48vh;
  overflow: auto;
  padding-right: 4px;
  align-content: start;
}
.task-log .line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
}
.task-log .line .time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  line-height: 1.55;
  white-space: nowrap;
}
.task-log .line .msg { min-width: 0; line-height: 1.55; }
.task-log .line b { color: var(--teal); }
.task-log .line.pick {
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.08);
}
.task-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

@media (max-width: 1100px) {
  .home-grid, .split, .hero-score, .hold-card { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rank-head { display: none; }
  .rank-row, .holding { grid-template-columns: 1fr 1fr; min-width: 0; }
  .task-panels { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell, .legal { width: calc(100% - 16px); }
  .topbar { flex-direction: column; align-items: flex-start; }
  .nav { width: 100%; overflow: auto; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 1fr; }
  h1 { font-size: 20px; }
  .task-dock { right: 12px; bottom: 12px; left: 12px; }
  .task-dock .dock-btn { width: 100%; justify-content: center; }
}
@media (max-width: 420px) {
  .search, .hold-add { flex-direction: column; align-items: stretch; }
  .btn, .search input, .hold-add input { width: 100%; }
}
