:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #66768a;
  --line: #d9e0ea;
  --red: #d62828;
  --blue: #1d4ed8;
  --accent: #0f766e;
  --accent-hover: #0b5f59;
  --ok-bg: #e8f6ef;
  --ok-text: #166534;
  --err-bg: #fdecec;
  --err-text: #b42318;
  --shadow: 0 10px 30px rgba(28, 36, 48, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 40%),
    linear-gradient(180deg, #eef3f8 0%, var(--bg) 48%, #e8edf4 100%);
  min-height: 100vh;
}

.page {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: 0.02em;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.sync-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.sync-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sync-all-form {
  align-items: center;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.btn-secondary {
  background: #1f3a56;
}

.btn-secondary:hover {
  background: #162b40;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.25rem;
}

.pager-pages {
  display: inline-flex;
  gap: 0.35rem;
}

.pager-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  background: #fbfcfe;
  font-size: 0.9rem;
}

.pager-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pager-link.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pager-link.disabled {
  pointer-events: none;
  opacity: 0.4;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.85rem;
  color: var(--muted);
}

.field input {
  width: 8rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fbfcfe;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

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

.alert {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.alert-ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.alert-err {
  background: var(--err-bg);
  color: var(--err-text);
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.85rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.85rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.code {
  font-weight: 700;
}

.balls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ball {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.ball-red {
  background: var(--red);
}

.ball-blue {
  background: var(--blue);
}

.money,
.content {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 18rem;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

@media (max-width: 720px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .field input {
    width: 100%;
  }

  .sync-form {
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}
