:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2563eb;
  --brand2: #7c3aed;
  --danger: #dc2626;
  --success: #16a34a;
  --warn: #d97706;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}
.page {
  width: min(980px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0 40px;
}
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  margin-bottom: 20px;
  color: #fff;
  border-radius: 20px;
  background: linear-gradient(135deg, #111827, #1e3a8a 55%, #5b21b6);
  box-shadow: 0 18px 50px rgba(17, 24, 39, .18);
}
.eyebrow {
  margin: 0 0 8px;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .16em;
}
h1, h2 { margin: 0; }
h1 { font-size: clamp(30px, 5vw, 52px); letter-spacing: -.04em; }
.hero p:last-child { margin: 12px 0 0; max-width: 720px; color: #dbeafe; line-height: 1.8; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
}
.main-card, .submit-card { padding: 22px; }
.submit-card { margin-top: 20px; }
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
#pageInfo { display: inline-block; margin-top: 8px; color: var(--muted); }
code {
  color: var(--brand);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 3px 7px;
  border-radius: 8px;
}
.number-list {
  min-height: 330px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.pgx-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #fff, #f9fafb);
}
.pgx-item:hover { border-color: #bfdbfe; }
.pgx-index { color: var(--muted); font-size: 13px; }
.pgx-value {
  color: var(--brand);
  font-size: 24px;
  font-weight: 900;
  font-family: Consolas, monospace;
}
.empty {
  grid-column: 1 / -1;
  color: var(--muted);
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed var(--line);
  border-radius: 14px;
}
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.pages { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
button, .pgx-page {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  font-weight: 800;
  cursor: pointer;
}
button.secondary {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.35);
}
button:disabled, .pgx-page:disabled { opacity: .45; cursor: not-allowed; }
.pgx-page {
  min-width: 40px;
  color: var(--text);
  background: #f3f4f6;
  border: 1px solid var(--line);
}
.pgx-page.is-active { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand2)); }
.session {
  margin-top: 14px;
  padding: 12px;
  color: var(--muted);
  background: #f9fafb;
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-size: 13px;
  word-break: break-all;
}
.submit-card p { color: var(--muted); line-height: 1.8; }
.submit-row { display: flex; gap: 12px; margin-top: 16px; }
input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
}
input:focus { border-color: #93c5fd; box-shadow: 0 0 0 4px #dbeafe; }
.result {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: #f9fafb;
  color: var(--muted);
  border: 1px solid var(--line);
}
.result.success { color: var(--success); background: #f0fdf4; border-color: #bbf7d0; }
.result.error { color: var(--danger); background: #fef2f2; border-color: #fecaca; }
.result.warn { color: var(--warn); background: #fffbeb; border-color: #fed7aa; }
@media (max-width: 760px) {
  .hero { display: grid; }
  .number-list { grid-template-columns: 1fr; }
  .submit-row { flex-direction: column; }
}
