:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --soft: #f8fafb;
  --text: #18242d;
  --muted: #687986;
  --line: #dce5ea;
  --ink: #101820;
  --blue: #2369b3;
  --green: #168060;
  --gold: #a46d17;
  --red: #b64343;
  --shadow: 0 18px 48px rgba(24, 36, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
}

button.secondary {
  background: #eaf0f4;
  color: var(--text);
}

.purchase-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.topbar,
.status-band,
.workspace,
.panel-title,
.button-row,
.payment-item,
.split-form {
  display: grid;
  gap: 12px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 16px;
}

.topbar p,
.panel-title span,
.status-band span,
.deal-grid span,
.proof-state span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
h3,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

nav {
  display: flex;
  gap: 8px;
}

nav a,
.locale-select {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  text-decoration: none;
}

.locale-select {
  display: block;
  background: #eef3f6;
}

.status-band {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 16px;
}

.status-band > div,
.panel,
.timeline-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-band > div {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.status-band strong {
  font-size: 22px;
}

.workspace {
  grid-template-columns: 290px minmax(420px, 1fr) 360px;
  align-items: start;
}

.panel,
.timeline-panel {
  padding: 18px;
}

.main-panel {
  min-width: 0;
}

.panel-title {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 16px;
}

.panel-title.compact {
  margin-bottom: 8px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

textarea {
  min-height: 108px;
  padding: 10px 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #95bce8;
  box-shadow: 0 0 0 3px rgba(35, 105, 179, 0.12);
}

.button-row {
  grid-template-columns: 1fr 1fr;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.service-note {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  border: 1px solid #d8e6ec;
  border-radius: 8px;
  background: #f4f8fa;
  padding: 12px;
}

.service-note strong {
  font-size: 13px;
}

.service-note p,
.proof-state small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.deal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.deal-grid > div {
  display: grid;
  gap: 7px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}

.deal-grid strong {
  align-self: end;
  font-size: 20px;
  line-height: 1.2;
  word-break: break-word;
}

.proof-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
}

.proof-state {
  display: grid;
  gap: 10px;
  align-content: center;
  border: 1px solid #cfe4dc;
  border-radius: 8px;
  background: #f0faf6;
  padding: 14px;
}

.proof-state strong {
  color: var(--green);
  line-height: 1.35;
}

.message-box {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}

pre {
  min-height: 118px;
  margin: 0;
  overflow: auto;
  border-radius: 8px;
  background: #111827;
  color: #edf5f8;
  padding: 12px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.payment-list {
  display: grid;
  gap: 10px;
}

.payment-item {
  grid-template-columns: 18px 1fr auto;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px;
}

.payment-item input {
  width: 16px;
  min-height: 16px;
  margin-top: 3px;
  accent-color: var(--green);
}

.payment-item strong {
  display: block;
  margin-bottom: 4px;
}

.payment-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.payment-item button {
  min-height: 32px;
  background: #f3e9e9;
  color: var(--red);
}

.split-form {
  grid-template-columns: 1fr 120px auto;
  margin-top: 12px;
}

.timeline-panel {
  margin-top: 16px;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-item span {
  color: var(--muted);
  font-size: 13px;
}

.timeline-item b {
  color: var(--blue);
}

.timeline-item em {
  color: var(--gold);
  font-style: normal;
  font-weight: 700;
}

@media (max-width: 1160px) {
  .workspace,
  .deal-grid,
  .proof-row {
    grid-template-columns: 1fr;
  }

  .status-band {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .purchase-shell {
    padding: 16px;
  }

  .topbar,
  .panel-title,
  .button-row,
  .action-grid,
  .status-band,
  .split-form,
  .payment-item,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }
}
