:root {
  color-scheme: light;
  --bg: #f5f7f2;
  --panel: #ffffff;
  --ink: #1e2528;
  --muted: #66706a;
  --line: #dce3da;
  --accent: #0f766e;
  --accent-dark: #0b4d49;
  --gold: #b7791f;
  --soft: #eaf4f0;
  --warn: #fff7e6;
  --shadow: 0 18px 45px rgba(31, 41, 35, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), transparent 38%),
    linear-gradient(225deg, rgba(183, 121, 31, 0.09), transparent 34%),
    var(--bg);
}

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

.panel,
.metric {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.input-panel {
  padding: 28px;
}

.title-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  line-height: 1.25;
}

.badge {
  padding: 8px 12px;
  border: 1px solid #b7d7cf;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--soft);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

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

label {
  display: grid;
  gap: 8px;
}

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

input {
  width: 100%;
  height: 46px;
  border: 1px solid #cdd8d2;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  background: #fbfcfa;
  font: inherit;
  font-size: 17px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, 1fr);
  gap: 16px;
  margin: 18px 0;
}

.metric {
  min-height: 132px;
  padding: 20px;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.metric.primary {
  background: linear-gradient(135deg, #0f766e, #184e49);
  color: #ffffff;
}

.metric span,
.metric small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric.primary span,
.metric.primary small {
  color: rgba(255, 255, 255, 0.78);
}

.metric strong {
  display: block;
  font-size: 26px;
  line-height: 1.15;
}

.results-panel,
.detail-panel,
.notice-panel {
  padding: 24px;
  margin-top: 18px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 16px;
}

.section-heading p {
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  background: #ffffff;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-size: 14px;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: #526059;
  background: #f1f5f2;
  font-weight: 800;
}

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

tbody tr.best {
  background: var(--soft);
}

tbody tr.current {
  background: var(--warn);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: #dcefeb;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
  margin-left: 6px;
}

.detail-grid,
.notice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.detail-grid div,
.notice-grid div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

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

.detail-grid strong {
  font-size: 20px;
}

.notice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.notice-grid strong {
  display: block;
  color: var(--accent-dark);
  font-size: 15px;
  margin-bottom: 7px;
}

.notice-grid p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.site-footer {
  padding: 0 20px 32px;
  text-align: center;
}

.filing-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
}

.site-footer a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.input-help {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.input-help a { color: var(--accent-dark); }
.input-error { margin-top: 14px; color: #b42318; line-height: 1.6; }
input[aria-invalid="true"] { border-color: #b42318; }
.input-warning { margin-top: 14px; color: #854d0e; line-height: 1.6; }

.public-security-record {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.public-security-record img {
  width: 18px;
  height: 20px;
  flex: 0 0 auto;
  object-fit: contain;
}

@media (max-width: 900px) {
  .form-grid,
  .summary-grid,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric.primary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .app {
    width: min(100vw - 20px, 1180px);
    padding: 16px 0 20px;
  }

  .input-panel,
  .results-panel,
  .detail-panel,
  .notice-panel {
    padding: 18px;
  }

  .title-row,
  .section-heading {
    display: grid;
    align-items: start;
  }

  .section-heading p {
    text-align: left;
  }

  h1 {
    font-size: 28px;
  }

  .form-grid,
  .summary-grid,
  .detail-grid,
  .notice-grid {
    grid-template-columns: 1fr;
  }
}
