:root {
  --bg: #0f1320;
  --bg-soft: #161b2e;
  --panel: #1a2138;
  --panel-2: #222b47;
  --line: #2c3654;
  --text: #eef2ff;
  --muted: #9aa6cc;
  --accent: #6ea8ff;
  --accent-2: #8b7bff;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 700px at 80% -10%, #1d2748 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: 0.2px; }
b { color: var(--text); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 26px;
  max-width: 1180px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  font-size: 30px;
  filter: drop-shadow(0 4px 12px rgba(110, 168, 255, 0.5));
}
.topbar h1 { font-size: 19px; }
.tag { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 22px;
  max-width: 1180px;
  margin: 8px auto 0;
  padding: 0 26px;
  align-items: start;
}

.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel-head h2 { font-size: 16px; }
.panel-head.spaced { margin-top: 22px; }
.muted { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

.capacity {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 16px;
  margin-top: 14px;
}
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--muted); }
.field span b { color: var(--accent); }

input[type="number"], input[type="text"], select, textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 168, 255, 0.18);
}
input[type="range"] { width: 100%; accent-color: var(--accent); }
textarea { resize: vertical; min-height: 38px; }

.lines { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }

.line-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  position: relative;
}
.line-card .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.line-card .full { grid-column: 1 / -1; }
.line-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.del-line {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
}
.del-line:hover { color: var(--bad); background: rgba(248, 113, 113, 0.12); }

.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

button { cursor: pointer; font-family: inherit; }
.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  text-decoration: none;
  transition: 0.15s;
}
.ghost:hover { color: var(--text); border-color: var(--accent); }
.ghost.danger:hover { color: var(--bad); border-color: var(--bad); }

.primary {
  margin-top: 18px;
  width: 100%;
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  border: none;
  color: #0b1020;
  font-weight: 700;
  font-size: 15px;
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(110, 168, 255, 0.35);
  transition: transform 0.1s, box-shadow 0.15s;
}
.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(110, 168, 255, 0.45); }
.primary:active { transform: translateY(0); }
.hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; text-align: center; }

.output-panel { min-height: 420px; position: sticky; top: 16px; }
.empty { text-align: center; padding: 48px 18px; color: var(--muted); }
.empty-icon { font-size: 46px; margin-bottom: 10px; }
.empty h2 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.empty p { font-size: 14px; max-width: 360px; margin: 0 auto; }

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.metric {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.metric .num { font-size: 22px; font-weight: 700; }
.metric .lab { font-size: 11px; color: var(--muted); margin-top: 2px; }
.metric.warn .num { color: var(--warn); }
.metric.good .num { color: var(--good); }

.headline {
  background: linear-gradient(120deg, rgba(110,168,255,0.16), rgba(139,123,255,0.16));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.headline .k { font-size: 12px; color: var(--muted); }
.headline .v { font-size: 18px; font-weight: 700; margin-top: 2px; }
.headline .v small { font-size: 12px; color: var(--muted); font-weight: 400; }

.block-title { font-size: 13px; color: var(--muted); margin: 18px 0 8px; text-transform: none; }

.alloc-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 11px;
}
.alloc-card.good { border-left-color: var(--good); }
.alloc-card.warn { border-left-color: var(--warn); }
.alloc-card.bad { border-left-color: var(--bad); opacity: 0.92; }
.alloc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.alloc-name { font-size: 15px; font-weight: 700; }
.alloc-hours { font-size: 15px; font-weight: 700; white-space: nowrap; }
.alloc-hours small { font-size: 11px; color: var(--muted); font-weight: 400; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge.status-good { color: var(--good); border-color: rgba(52,211,153,0.4); }
.badge.status-warn { color: var(--warn); border-color: rgba(251,191,36,0.4); }
.badge.status-bad { color: var(--bad); border-color: rgba(248,113,113,0.4); }
.blocks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chip {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(110,168,255,0.12);
  border: 1px solid rgba(110,168,255,0.25);
  color: var(--accent);
}
.mindone { font-size: 12px; color: var(--muted); margin-top: 9px; }
.mindone b { color: var(--text); }

.tradeoffs { list-style: none; padding: 0; margin: 8px 0 0; }
.tradeoffs li {
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  margin-bottom: 7px;
}

.deliverables { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 15px; }
.deliverables ul { margin: 6px 0 0; padding-left: 18px; }
.deliverables li { font-size: 13px; margin-bottom: 5px; }
.deliverables li small { color: var(--muted); }

.export-row { display: flex; gap: 10px; margin-top: 16px; }
.export-row button { flex: 1; }
.copied { color: var(--good) !important; border-color: var(--good) !important; }

.how {
  max-width: 1180px;
  margin: 30px auto 0;
  padding: 24px 26px;
}
.how h2 { font-size: 17px; margin-bottom: 12px; }
.how ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.how li { margin-bottom: 8px; }
.how li b { color: var(--text); }
.loop-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.foot {
  max-width: 1180px;
  margin: 24px auto;
  padding: 0 26px 24px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.foot .dot { opacity: 0.5; }

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .output-panel { position: static; }
  .capacity { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; }
}
