:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --ink: #1f2937;
  --muted: #64748b;
  --line: #d9d2c5;
  --panel: #fffdf8;
  --panel-strong: #ffffff;
  --accent: #2f8f83;
  --accent-dark: #1f6f66;
  --gold: #f2b84b;
  --danger: #b54646;
  --shadow: 0 18px 50px rgba(31, 41, 55, 0.12);
  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;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(247, 244, 238, 0.92), rgba(240, 246, 244, 0.96)),
    #f7f4ee;
  color: var(--ink);
}

button,
textarea {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.workbench {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

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

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(47, 143, 131, 0.35);
  color: var(--accent-dark);
  background: rgba(47, 143, 131, 0.08);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.composer {
  padding: 24px 28px;
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.composer label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 128px;
  resize: vertical;
  border: 1px solid #c8c0b2;
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 143, 131, 0.18);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  min-height: 42px;
  cursor: pointer;
  font-weight: 750;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.secondary:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.result {
  padding: 0;
}

.empty {
  padding: 28px;
  color: var(--muted);
}

.empty strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 18px;
}

.empty p {
  margin: 0;
}

.parser-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
}

.parser-note strong {
  font-size: 13px;
  white-space: nowrap;
}

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

.parser-note.ok {
  background: rgba(47, 143, 131, 0.08);
}

.parser-note.ok strong {
  color: var(--accent-dark);
}

.parser-note.warn {
  background: rgba(242, 184, 75, 0.14);
}

.parser-note.warn strong {
  color: #725318;
}

.fx-panel {
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
}

.fx-panel h2 {
  margin-bottom: 12px;
}

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

.fx-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(47, 143, 131, 0.22);
  border-radius: 8px;
  background: #fff;
}

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

.fx-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.25;
}

.fx-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.fx-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.fx-card a {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent-dark);
  font-weight: 750;
  text-decoration: none;
}

.fx-card a:hover {
  text-decoration: underline;
}

.primary-rate {
  border-color: rgba(47, 143, 131, 0.38);
  background: rgba(47, 143, 131, 0.06);
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.metric {
  padding: 22px 28px;
  background: var(--panel-strong);
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: none;
}

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

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.metric.employee strong {
  color: var(--danger);
}

.metric.company strong {
  color: var(--accent-dark);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 0;
}

.main-panel,
.side-panel {
  padding: 24px 28px;
}

.side-panel {
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}

h2 {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.data-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.data-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(217, 210, 197, 0.7);
}

.data-row dt {
  color: var(--muted);
  font-size: 14px;
}

.data-row dd {
  margin: 0;
  text-align: right;
  font-weight: 750;
  overflow-wrap: anywhere;
}

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

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #ece6dc;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

th {
  color: var(--muted);
  background: #faf7f0;
  font-size: 13px;
}

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

.notice-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.notice-list li {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(242, 184, 75, 0.14);
  border: 1px solid rgba(242, 184, 75, 0.32);
  color: #66501c;
  line-height: 1.5;
}

.question-box {
  margin: 24px 28px;
  padding: 18px;
  border: 1px solid rgba(181, 70, 70, 0.26);
  background: rgba(181, 70, 70, 0.06);
  border-radius: 8px;
}

.question-box h2 {
  color: var(--danger);
}

.question-box ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.7;
}

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

@media (max-width: 820px) {
  .shell {
    width: 100%;
    padding: 0;
  }

  .workbench {
    min-height: 100vh;
    border: none;
    border-radius: 0;
  }

  .topbar {
    align-items: flex-start;
    padding: 22px 18px 18px;
  }

  .top-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .composer,
  .main-panel,
  .side-panel {
    padding: 18px;
  }

  .parser-note {
    grid-template-columns: 1fr;
    padding: 12px 18px;
  }

  .fx-panel {
    padding: 16px 18px;
  }

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

  .summary-band {
    grid-template-columns: 1fr;
  }

  .metric {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 18px;
  }

  .metric:last-child {
    border-bottom: none;
  }

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

  .side-panel {
    border-left: none;
    border-top: 1px solid var(--line);
  }

  table {
    min-width: 680px;
  }
}
