:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-2: rgba(20, 30, 52, 0.78);
  --line: rgba(125, 211, 252, 0.18);
  --muted: #8090aa;
  --text: #e8f0fb;
  --cyan: #7dd3fc;
  --amber: #f8d85d;
  --green: #8df0bc;
  --red: #fb7185;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at 18% -10%, rgba(14, 165, 233, 0.2), transparent 34%),
    radial-gradient(circle at 82% 4%, rgba(245, 158, 11, 0.11), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: 250px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-image: linear-gradient(to bottom, rgba(2, 6, 23, 0.2), #020617 92%), url("./hero-bg.jpg");
  background-position: center;
  background-size: cover;
}

.hero-inner,
.shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-inner {
  padding: 44px 0 58px;
  text-align: center;
}

.topbar {
  position: absolute;
  inset: 18px 16px auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.pill,
.ghost-btn,
.primary-btn,
.danger-btn,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--cyan);
  padding: 8px 12px;
  line-height: 1;
  text-decoration: none;
}

.ghost-btn,
.primary-btn,
.danger-btn {
  border-radius: 8px;
  min-height: 38px;
}

.primary-btn {
  background: rgba(125, 211, 252, 0.16);
  color: #dff7ff;
}

.danger-btn {
  border-color: rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.08);
  color: #fda4af;
}

.ghost-btn:hover,
.primary-btn:hover,
.danger-btn:hover,
.chip:hover {
  border-color: rgba(125, 211, 252, 0.48);
  background: rgba(30, 41, 59, 0.94);
}

h1 {
  margin: 14px 0 8px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: 0;
}

.subtitle {
  margin: 0 auto;
  max-width: 720px;
  color: #a1acc2;
  font-size: 17px;
}

.shell {
  padding: 26px 0 42px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.ops {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.stat,
.material-card,
.rank-item,
.plan-item {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.card {
  padding: 22px;
}

.card.soft {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(6, 11, 27, 0.86));
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.title-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon {
  width: 22px;
  height: 22px;
  color: var(--cyan);
}

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

.stat {
  padding: 18px;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  margin-top: 8px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
  font-weight: 800;
}

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

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

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

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

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.62);
  color: #dff7ff;
  padding: 12px 13px;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(125, 211, 252, 0.62);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.08);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 34px;
  padding: 7px 10px;
  color: #c6d6eb;
}

.chip.active {
  border-color: rgba(125, 211, 252, 0.58);
  background: rgba(125, 211, 252, 0.16);
  color: #e6fbff;
}

.progress-shell {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.7);
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f59e0b, #7dd3fc, #34d399);
  transition: width 0.25s ease;
}

.rank-item,
.plan-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-top: 10px;
  background: rgba(15, 23, 42, 0.72);
}

.plan-item {
  border-color: rgba(125, 211, 252, 0.25);
  background: rgba(8, 47, 73, 0.35);
}

.name {
  font-weight: 700;
}

.sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.materials-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 170px 170px auto;
  gap: 10px;
  margin: 28px 0 16px;
}

.materials {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.material-card {
  padding: 16px;
  background: linear-gradient(180deg, rgba(20, 30, 52, 0.86), rgba(15, 23, 42, 0.76));
}

.material-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
}

.badge {
  height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.12);
  color: var(--cyan);
  font-size: 12px;
  white-space: nowrap;
}

.material-numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.mini {
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.38);
  padding: 9px;
}

.mini span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.mini strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.material-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.custom-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.custom-stage input {
  min-height: 36px;
  padding: 8px 10px;
}

.material-actions button,
.custom-stage button {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.82);
  color: #cbd5e1;
  min-height: 34px;
  padding: 0 10px;
}

.empty {
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.footer {
  color: #526076;
  text-align: center;
  padding: 8px 0 32px;
  font-size: 13px;
}

.hide {
  display: none !important;
}

@media (max-width: 980px) {
  .grid.stats,
  .grid.ops,
  .materials {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .materials-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .hero-inner,
  .shell {
    width: min(100% - 22px, 1220px);
  }

  .topbar {
    position: static;
    justify-content: center;
    margin-bottom: 18px;
  }

  .hero-inner {
    padding-top: 22px;
  }

  .grid.stats,
  .grid.ops,
  .grid.cols-2,
  .materials,
  .materials-toolbar {
    grid-template-columns: 1fr;
  }

  .card,
  .stat {
    padding: 16px;
  }

  .material-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
