:root {
  --ink: #1c2418;
  --muted: #5c6754;
  --paper: #f3eee4;
  --panel: #fffdf8;
  --line: #d9d0c0;
  --accent: #3d6b4f;
  --accent-deep: #244233;
  --gold: #b0893c;
  --heat: #3d6b4f;
  --empty: #9aa392;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(circle at top right, rgba(176, 137, 60, 0.08), transparent 32%),
    linear-gradient(180deg, #efe8d9 0%, var(--paper) 220px);
}

.site-header, main, footer {
  width: min(1180px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.userbar button, .login-card button {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.userbar button {
  background: transparent;
  color: var(--accent-deep);
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, calc(100% - 32px));
  margin: 40px auto;
}

.login-card form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.login-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
}

.login-card button {
  margin-top: 4px;
  padding: 12px;
}

.error {
  margin: 0;
  color: #a33;
  font-size: 14px;
}

.site-header {
  padding: 36px 0 8px;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  text-transform: none;
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
}

h1, h2 {
  font-family: "Noto Serif TC", "Noto Sans TC", serif;
  font-weight: 700;
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0.04em;
}

.lede, .sub, .hint, footer p {
  color: var(--muted);
  line-height: 1.7;
}

.lede {
  max-width: 42em;
  margin: 12px 0 0;
}

main {
  display: grid;
  gap: 20px;
  padding: 24px 0 48px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(36, 66, 51, 0.05);
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.filters .hint {
  grid-column: 1 / -1;
  margin: 4px 0 0;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-deep);
}

label.inline {
  grid-auto-flow: column;
  align-items: center;
  gap: 10px;
}

select {
  appearance: none;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23244233' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center;
  font: inherit;
  color: var(--ink);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

h2 {
  font-size: 22px;
}

.sub {
  margin: 6px 0 0;
  font-size: 14px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

thead th {
  background: #eef4ef;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 700;
  position: sticky;
  top: 0;
}

thead tr:nth-child(2) th {
  top: 41px;
}

.num, td.num, th.num {
  text-align: right;
}

.col-name, td.name {
  min-width: 180px;
}

tbody tr:hover {
  background: #f7f3ea;
}

.rank {
  color: var(--gold);
  font-weight: 700;
}

.empty {
  margin: 16px 0 0;
  color: var(--empty);
}

footer {
  padding-bottom: 40px;
  font-size: 13px;
}

.heat {
  font-weight: 700;
}

@media (max-width: 800px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .section-head, .header-row {
    flex-direction: column;
    align-items: stretch;
  }
}
