:root {
  --bg: #0e1417;
  --bg-soft: #111b1f;
  --panel: rgba(246, 244, 237, 0.9);
  --panel-2: rgba(255, 255, 255, 0.08);
  --panel-dark: rgba(9, 16, 20, 0.78);
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(39, 62, 71, 0.12);
  --text: #112027;
  --text-light: #f5f2ea;
  --muted: #6a7c83;
  --accent: #ff6b35;
  --accent-2: #ffd166;
  --moss: #91c483;
  --ink: #2f6fed;
  --night: #13313d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text-light);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 107, 53, 0.22), transparent 20%),
    radial-gradient(circle at 85% 12%, rgba(47, 111, 237, 0.16), transparent 24%),
    linear-gradient(180deg, #0c1114 0%, #132026 100%);
}

.ambient {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.55;
  pointer-events: none;
}

.ambient-a {
  top: 18%;
  left: -3%;
  width: 220px;
  height: 220px;
  background: rgba(255, 123, 0, 0.22);
}

.ambient-b {
  right: 4%;
  bottom: 12%;
  width: 280px;
  height: 280px;
  background: rgba(54, 156, 255, 0.14);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1540px;
  margin: 0 auto;
  padding: 34px 22px 72px;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 24px;
  align-items: stretch;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 209, 102, 0.88);
  font-size: 11px;
  font-weight: 800;
}

h1 {
  margin: 0;
  max-width: 920px;
  font-size: clamp(38px, 5.8vw, 74px);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 760px;
  margin: 16px 0 0;
  color: rgba(245, 242, 234, 0.7);
  font-size: 16px;
  line-height: 1.7;
}

.signal-card,
.workflow-ribbon,
.panel {
  backdrop-filter: blur(18px);
}

.signal-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.signal-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.signal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 8px rgba(255, 209, 102, 0.1);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-badge.ok {
  background: rgba(145, 196, 131, 0.14);
  color: #d5f5cd;
}

.status-badge.error {
  background: rgba(255, 107, 53, 0.16);
  color: #ffd7c7;
}

.status-badge.neutral {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(245, 242, 234, 0.75);
}

.signal-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.signal-metrics div {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-label {
  display: block;
  color: rgba(245, 242, 234, 0.62);
  font-size: 12px;
  margin-bottom: 8px;
}

.signal-metrics strong {
  font-size: 28px;
  line-height: 1;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.workflow-ribbon {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.ribbon-step {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: 18px;
  color: rgba(245, 242, 234, 0.72);
  background: rgba(255, 255, 255, 0.03);
}

.ribbon-step span {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ribbon-step strong {
  font-size: 15px;
}

.ribbon-step.active {
  color: #fff5e7;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.24), rgba(255, 209, 102, 0.12));
  box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.16);
}

.workspace {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 420px;
  gap: 22px;
}

.left-rail,
.right-rail {
  display: grid;
  gap: 22px;
}

.panel {
  border-radius: 28px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
  color: var(--text);
}

.glass-dark {
  background: var(--panel-dark);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-light);
}

.mini {
  padding-bottom: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-head h2,
.action-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.hero-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 244, 237, 0.92)),
    linear-gradient(135deg, rgba(255, 107, 53, 0.08), transparent);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.action-grid.single-column {
  grid-template-columns: 1fr;
}

.action-card {
  position: relative;
  padding: 18px;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.action-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -45% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  opacity: 0.22;
  filter: blur(26px);
}

.accent-fire::after {
  background: rgba(255, 107, 53, 0.55);
}

.accent-ink::after {
  background: rgba(47, 111, 237, 0.55);
}

.accent-moss::after {
  background: rgba(145, 196, 131, 0.55);
}

.accent-night::after {
  background: rgba(19, 49, 61, 0.55);
}

.card-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(17, 32, 39, 0.08);
  color: #304852;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.action-card p {
  margin: 10px 0 14px;
  color: #4c626a;
  font-size: 14px;
  line-height: 1.6;
}

.stack {
  display: grid;
  gap: 12px;
}

.compact {
  gap: 10px;
}

.dense {
  gap: 10px;
}

.dual,
.triple {
  display: grid;
  gap: 10px;
}

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

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

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(11, 27, 35, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

input:focus,
textarea:focus {
  border-color: rgba(47, 111, 237, 0.35);
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.08);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 800;
  color: #fff8ef;
  background: linear-gradient(135deg, #ff6b35 0%, #df4e18 100%);
  box-shadow: 0 12px 30px rgba(223, 78, 24, 0.24);
  transition: transform 160ms ease, filter 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

button.secondary {
  background: linear-gradient(135deg, #29424b 0%, #18313a 100%);
  box-shadow: 0 12px 30px rgba(24, 49, 58, 0.24);
}

.import-zone {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.file-box {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(17, 32, 39, 0.04);
  border: 1px dashed rgba(17, 32, 39, 0.16);
}

.file-box span {
  font-size: 14px;
  font-weight: 700;
  color: #2c454d;
}

.file-box input[type="file"] {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.output {
  margin: 0;
  min-height: 420px;
  padding: 18px;
  overflow: auto;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.28);
  color: #f7f4ec;
  font-size: 13px;
  line-height: 1.55;
}

.sku-stack,
.record-list {
  display: grid;
  gap: 12px;
}

.sku-empty {
  padding: 18px;
  border-radius: 18px;
  background: rgba(17, 32, 39, 0.05);
  color: var(--muted);
}

.sku-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(17, 32, 39, 0.05);
  border: 1px solid rgba(17, 32, 39, 0.06);
}

.sku-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.sku-top strong {
  font-size: 16px;
}

.sku-name {
  color: #4b6168;
  font-size: 14px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(17, 32, 39, 0.08);
  color: #39515a;
  font-size: 11px;
  font-weight: 800;
}

.pill.ready {
  background: rgba(145, 196, 131, 0.22);
  color: #275a29;
}

.pill.ai {
  background: rgba(47, 111, 237, 0.14);
  color: #2350af;
}

.pill.editing {
  background: rgba(255, 209, 102, 0.24);
  color: #865d00;
}

.pill.warn {
  background: rgba(255, 107, 53, 0.16);
  color: #9f3f1c;
}

.record-card {
  display: grid;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(17, 32, 39, 0.07);
  background: rgba(17, 32, 39, 0.05);
  color: var(--text);
  box-shadow: none;
}

.record-card.static {
  cursor: default;
}

.record-card.selected {
  outline: 2px solid rgba(47, 111, 237, 0.26);
  background: rgba(47, 111, 237, 0.08);
}

.record-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.record-line {
  font-size: 14px;
  color: #304852;
  line-height: 1.6;
  word-break: break-word;
}

.record-line.subtle {
  color: var(--muted);
}

.memory-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

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

.memory-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(17, 32, 39, 0.05);
}

.memory-item span {
  font-size: 13px;
  color: var(--muted);
}

.memory-item strong {
  font-size: 16px;
}

@media (max-width: 1220px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .right-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .glass-dark {
    grid-column: 1 / -1;
  }

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

@media (max-width: 980px) {
  .masthead,
  .action-grid,
  .workflow-ribbon,
  .import-zone,
  .dual,
  .triple,
  .right-rail {
    grid-template-columns: 1fr;
  }

  .panel,
  .signal-card {
    border-radius: 24px;
  }

  h1 {
    font-size: clamp(34px, 11vw, 54px);
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }
}
