:root {
  color-scheme: light;
  --bg: #f5f2ec;
  --panel: #fffdf8;
  --ink: #23211e;
  --muted: #6d6860;
  --line: #ddd6c9;
  --accent: #5f432c;
  --accent-strong: #3d2a1d;
  --ok: #1f7a4d;
  --warn: #a15d00;
  --bad: #b42318;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(95, 67, 44, 0.08) 0 1px, transparent 1px 100%),
    var(--bg);
  background-size: 18px 100%;
  color: var(--ink);
}

.shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  max-width: 1180px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.brand {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 6px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
  line-height: 1.35;
}

.section-hint {
  color: var(--warn);
  font-size: 13px;
  font-weight: 700;
  margin-top: 5px;
}

.status-pill,
.invoice-type {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff8ed;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(61, 42, 29, 0.06);
}

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

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  outline: none;
  padding: 10px 11px;
}

textarea:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(95, 67, 44, 0.12);
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  min-height: 42px;
  padding: 0 18px;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.secondary {
  background: #ebe2d5;
  color: var(--accent-strong);
}

button.secondary:hover {
  background: #dfd2c0;
}

.notice {
  color: var(--muted);
  font-size: 14px;
  min-height: 22px;
  padding: 8px 0 2px;
}

.notice.ok {
  color: var(--ok);
}

.notice.warn {
  color: var(--warn);
}

.notice.bad {
  color: var(--bad);
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 940px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #f1eadf;
  color: #4e443a;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.select-cell {
  text-align: center;
  width: 54px;
}

.select-cell input {
  height: 18px;
  margin: 0;
  padding: 0;
  width: 18px;
}

.order-summary {
  background: #f7f0e5;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  margin-top: 12px;
  padding: 10px 12px;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.ok {
  background: #e7f5ee;
  color: var(--ok);
}

.badge.bad {
  background: #fde8e6;
  color: var(--bad);
}

.badge.warn {
  background: #fff3dd;
  color: var(--warn);
}

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

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

label span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.wide {
  grid-column: 1 / -1;
}

.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.summary {
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .shell {
    padding: 14px;
  }

  .topbar,
  .section-title,
  .submit-row {
    align-items: stretch;
    flex-direction: column;
  }

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

  h1 {
    font-size: 24px;
  }

  button {
    width: 100%;
  }
}
