:root {
  color-scheme: light;
  --ink: #10251f;
  --muted: #60736c;
  --paper: #f5f3ea;
  --panel: rgba(255, 255, 255, 0.78);
  --line: #d9ddd5;
  --green: #176b52;
  --green-dark: #0d4636;
  --amber: #d59b39;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 5%, rgba(213, 155, 57, .18), transparent 30rem),
    linear-gradient(135deg, #f8f6ef, var(--paper));
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
}
main { width: min(1440px, 94vw); margin: 0 auto; padding: 3rem 0 5rem; }
.hero { display: flex; justify-content: space-between; gap: 2rem; align-items: flex-end; margin-bottom: 2rem; }
.hero-actions { display: flex; align-items: center; gap: .65rem; }
.language-toggle { min-height: 38px; padding: .45rem .8rem; color: var(--green); background: transparent; }
.language-toggle:hover { color: white; }
.eyebrow { color: var(--green); font-size: .76rem; font-weight: 800; letter-spacing: .18em; }
h1 { margin: .25rem 0; font-family: Georgia, "STSong", serif; font-size: clamp(2.3rem, 5vw, 4.8rem); font-weight: 500; }
.subtitle { color: var(--muted); margin: 0; font-size: 1.05rem; }
.status { padding: .55rem .85rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); white-space: nowrap; }
.status.online { color: var(--green); border-color: #96c5b5; background: #eaf6f1; }
.status.error, .error { color: #9b302c; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.stats article { display: flex; flex-direction: column; padding: 1.25rem; background: rgba(255,255,255,.75); }
.stats strong { font-family: Georgia, serif; font-size: 1.9rem; font-weight: 500; }
.stats span { color: var(--muted); font-size: .82rem; }
.panel { margin-top: 1.25rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); backdrop-filter: blur(10px); }
form { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: .8rem; align-items: end; }
label { display: flex; flex-direction: column; gap: .4rem; color: var(--muted); font-size: .78rem; font-weight: 700; }
input, select, button { min-height: 42px; border: 1px solid #cbd3cd; border-radius: 8px; padding: .6rem .7rem; color: var(--ink); background: white; font: inherit; }
input:focus, select:focus { outline: 2px solid #9bc9b9; border-color: var(--green); }
.actions { display: flex; gap: .5rem; }
button { cursor: pointer; border-color: var(--green); color: white; background: var(--green); font-weight: 700; }
button:hover { background: var(--green-dark); }
button.secondary { color: var(--green); background: transparent; }
button.secondary:hover { background: #e8f0ec; }
button:disabled { cursor: not-allowed; opacity: .45; }
.results-head { display: flex; justify-content: space-between; margin: 1.6rem .2rem .6rem; color: var(--muted); font-size: .86rem; }
#result-count, #selected-count { color: var(--ink); font-weight: 800; }
.batch-bar { display: flex; align-items: center; gap: .75rem; margin-bottom: .7rem; }
.batch-bar > span { color: var(--muted); font-size: .76rem; }
.batch-bar button { min-height: 36px; }
.check-label { flex-direction: row; align-items: center; gap: .4rem; cursor: pointer; }
.check-label input, .select-cell input { min-height: auto; accent-color: var(--green); }
.select-cell { width: 34px; text-align: center !important; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.72); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: .82rem .9rem; border-bottom: 1px solid #e4e7e2; text-align: right; white-space: nowrap; }
th { color: var(--muted); background: #eef0eb; font-size: .72rem; letter-spacing: .04em; }
th:nth-child(3), td:nth-child(3) { text-align: left; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7fbf8; }
.strong { color: var(--green-dark); font-weight: 800; }
.download { color: var(--green); font-weight: 800; text-decoration: none; }
.download:hover { text-decoration: underline; }
.empty { padding: 3rem; text-align: center !important; color: var(--muted); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; }
.pagination button { min-height: 36px; }
.pagination span { color: var(--muted); font-size: .85rem; }

@media (max-width: 1050px) {
  form { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  main { width: 94vw; padding-top: 1.5rem; }
  .hero { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  form { grid-template-columns: 1fr; }
  .actions button { flex: 1; }
}
