:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #e6eaf2;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --green: #079455;
  --red: #d92d20;
  --orange: #f79009;
  --soft-blue: #eaf1ff;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at top left, #dbeafe 0, transparent 30rem), var(--bg);
}
button, input, select { font: inherit; }

.hero {
  color: white;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 52%, #2563eb 100%);
  padding: 24px clamp(18px, 4vw, 56px) 56px;
}
.topbar, .hero-body, .container { max-width: 1280px; margin: 0 auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px;
  display: inline-grid; place-items: center;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22);
  font-weight: 900;
}
.brand small { display: block; color: rgba(255,255,255,.68); margin-top: 2px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ghost {
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.1);
  color: white;
  border-radius: 999px;
  padding: 10px 15px;
  cursor: pointer;
}
.ghost:hover { background: rgba(255,255,255,.18); }
.hero-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: end; padding-top: 56px; }
h1 { font-size: clamp(32px, 5vw, 58px); line-height: 1.04; margin: 8px 0 18px; letter-spacing: -1.8px; }
.lead { max-width: 760px; color: rgba(255,255,255,.78); font-size: 18px; line-height: 1.8; margin: 0; }
.eyebrow { margin: 0; color: #60a5fa; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
.hero-card {
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  box-shadow: var(--shadow); border-radius: 28px; padding: 28px;
  backdrop-filter: blur(14px);
}
.hero-card span, .hero-card small { color: rgba(255,255,255,.7); }
.hero-card strong { display: block; font-size: 42px; margin: 8px 0; }

.container { padding: 34px clamp(16px, 4vw, 48px) 56px; }
.section { margin-bottom: 28px; }
.section-title, .panel-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; margin-bottom: 16px; }
.section-title h2, .panel-head h2 { margin: 4px 0 0; font-size: 26px; }
.section-title p, .panel-head p { color: var(--muted); margin: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card, .panel {
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(230,234,242,.95);
  box-shadow: var(--shadow);
  border-radius: 24px;
}
.metric-card { padding: 20px; }
.metric-card small { color: var(--muted); display: block; margin-bottom: 10px; }
.metric-card strong { font-size: clamp(22px, 3vw, 32px); letter-spacing: -.8px; }
.metric-card em { display: block; color: var(--muted); font-style: normal; margin-top: 8px; font-size: 13px; }
.positive { color: var(--red) !important; }
.negative { color: var(--green) !important; }
.warning { color: var(--orange) !important; }

.grid-two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr); gap: 18px; align-items: start; }
.panel { padding: 22px; }
.sticky { position: sticky; top: 18px; }
.tag { background: #fff7ed; color: #b45309; border: 1px solid #fed7aa; padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; }
.field > span { font-weight: 700; font-size: 13px; color: #344054; }
.input-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  background: #fbfcff;
  border-radius: 14px;
  overflow: hidden;
}
.field input, .field select {
  width: 100%; border: 0; background: transparent;
  padding: 11px 12px; outline: none;
}
.field input::placeholder { color: #98a2b3; }
.input-unit.readonly { background: #eef2f7; }
.input-unit.readonly input { color: #667085; cursor: not-allowed; }
.unit {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  background: #f1f5f9;
  border-left: 1px solid var(--line);
  font-size: 13px;
  white-space: nowrap;
}
.field:focus-within .input-unit { border-color: #93c5fd; box-shadow: 0 0 0 4px #dbeafe; }
.field select { border: 1px solid var(--line); background: #fbfcff; border-radius: 14px; }
.field small { color: var(--muted); min-height: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.roi-field { margin-top: -2px; }
.roi-line { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 14px; align-items: start; }
.inline-actions { display: grid; gap: 10px; min-width: 160px; }
.inline-action {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}
.inline-action.primary { background: var(--soft-blue); color: var(--primary-dark); border-color: #bfdbfe; }
.inline-action.primary:hover { background: #dbeafe; }
.inline-action.danger { background: #fff1f2; color: #be123c; border-color: #fecaca; }
.inline-action.danger:hover { background: #ffe4e6; }
.full { grid-column: 1 / -1; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row.compact { align-items: center; }
.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: #344054;
  border-radius: 999px;
  padding: 9px 13px;
  cursor: pointer;
  user-select: none;
}
.radio-pill input { width: auto; margin: 0; accent-color: var(--primary); }
.radio-pill.checked { border-color: var(--primary); background: var(--soft-blue); color: var(--primary-dark); font-weight: 800; }
.optional-card {
  border: 1px dashed #bfd0ea;
  background: #f8fbff;
  border-radius: 18px;
  padding: 12px 14px;
}
.optional-card summary { cursor: pointer; font-weight: 800; color: #344054; }
.optional-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.result-list { display: grid; gap: 10px; }
.result-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.result-row span { color: var(--muted); }
.result-row strong { text-align: right; }
.notice { margin-top: 18px; background: #f8fafc; border: 1px solid var(--line); border-radius: 18px; padding: 14px; color: var(--muted); line-height: 1.7; }
.notice p { margin: 6px 0 0; }
.empty-state { color: var(--muted); background: #f8fafc; border: 1px dashed var(--line); border-radius: 16px; padding: 18px; line-height: 1.7; }
.muted-card strong { color: #98a2b3; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: #475467; background: #f8fafc; font-size: 13px; }
td input { width: 90px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.tabs { display: flex; gap: 8px; margin: 12px 0 16px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: #fff; color: #344054; padding: 9px 14px; border-radius: 999px; cursor: pointer; }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.sensitivity-controls { margin-bottom: 14px; }
.range-control { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #f8fafc; border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.range-control > span { font-weight: 800; color: #344054; }
.range-control small { color: var(--muted); }
.custom-step {
  display: inline-grid;
  grid-template-columns: auto 86px auto;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  color: #344054;
}
.custom-step.checked { border-color: var(--primary); background: var(--soft-blue); color: var(--primary-dark); font-weight: 800; }
.custom-step input { width: 86px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px; outline: none; background: #fff; }
.custom-step em { font-style: normal; color: var(--muted); }
.current-row { background: #fff7ed; animation: pulse-row 1.5s ease-in-out infinite; }
.current-row td:first-child { font-weight: 900; color: #c2410c; }
@keyframes pulse-row { 0%, 100% { box-shadow: inset 4px 0 0 #f97316; } 50% { box-shadow: inset 8px 0 0 #fb923c; } }
.saved-toolbar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.saved-toolbar button { border: 0; background: var(--soft-blue); color: var(--primary-dark); border-radius: 999px; padding: 9px 13px; cursor: pointer; font-weight: 800; }
.saved-toolbar button:last-of-type { background: #ecfdf3; color: #067647; }
.saved-hint { color: var(--muted); margin: -6px 0 14px; }
.saved-plans { display: grid; gap: 10px; }
.saved-plans.empty { color: var(--muted); }
.plan-card { display: flex; justify-content: space-between; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fbfcff; }
.plan-main { display: grid; gap: 6px; min-width: 220px; }
.plan-name-input { border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; font-weight: 900; color: var(--text); background: #fff; max-width: 260px; }
.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.plan-card button { border: 0; background: var(--soft-blue); color: var(--primary-dark); border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.plan-card button.danger { background: #fef2f2; color: #b42318; }
.plan-card button.danger:hover { background: #fee4e2; }
.combo-page { border-color: #bfdbfe; }
.combo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.combo-name-field { margin-bottom: 14px; max-width: 520px; }
.combo-summary { background: #f8fafc; border: 1px solid var(--line); border-radius: 20px; padding: 18px; position: sticky; top: 18px; }
.combo-summary h3 { margin: 0 0 12px; }
.combo-sku-name { min-width: 150px; }
.combo-share, .combo-money { width: 82px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.warning-text { color: #b45309; background: #fffbeb; border-color: #fed7aa; }
.mini-danger { border: 0; background: #fef2f2; color: #b42318; border-radius: 999px; padding: 7px 10px; cursor: pointer; }
.footer { text-align: center; color: var(--muted); padding: 24px; }
.wrap { flex-wrap: wrap; }

@media (max-width: 960px) {
  .hero-body, .grid-two, .combo-layout { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sticky { position: static; }
}
@media (max-width: 640px) {
  .topbar, .section-title, .panel-head { align-items: flex-start; flex-direction: column; }
  .hero { padding-bottom: 34px; }
  .hero-body { padding-top: 36px; }
  .metric-grid, .form-grid, .optional-grid, .roi-line { grid-template-columns: 1fr; }
  .panel { padding: 16px; border-radius: 20px; }
  h1 { letter-spacing: -1px; }
}
