:root {
  color-scheme: light;
  --navy: #0b2440;
  --blue: #1769aa;
  --orange: #f6a623;
  --page: #f2f5f8;
  --border: #d8e0e8;
  --muted: #64748b;
  --text: #0f172a;
  --danger: #b42318;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  color: #fff;
  background: var(--navy);
  border-bottom: 1px solid #263f59;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 768px);
  margin: 0 auto;
  padding: 15px 16px 16px;
}

.brand {
  margin: 0;
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

h1 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.tool-badge {
  flex: none;
  padding: 5px 9px;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.page-shell {
  width: min(100%, 768px);
  margin: 0 auto;
  padding: 20px 16px 8px;
}

.input-card,
.table-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07);
}

.input-card {
  padding: 17px 16px;
}

h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}

.input-grid {
  display: grid;
  gap: 15px;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

select,
input {
  width: 100%;
  height: 44px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
}

select {
  padding: 0 38px 0 12px;
  appearance: none;
}

input {
  padding: 0 12px;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

select:focus,
input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.15);
}

input:disabled {
  color: #94a3b8;
  background: #f1f5f9;
  cursor: not-allowed;
}

input::placeholder {
  color: #94a3b8;
  font-size: 15px;
  font-weight: 400;
}

input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1);
}

.reference-hint,
.input-error {
  margin: 11px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

.reference-hint {
  color: var(--muted);
}

.reference-hint strong {
  margin-left: 4px;
  color: #0b5592;
}

.input-error {
  color: var(--danger);
  font-weight: 600;
}

.result-section {
  margin-top: 20px;
}

.result-section > h2 {
  margin-bottom: 11px;
}

.empty-result {
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
}

.table-card {
  overflow: hidden;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: #e8f0f7;
}

th {
  height: 44px;
  padding: 0 8px;
  color: #1e293b;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

td {
  height: 49px;
  padding: 0 8px;
  border-bottom: 1px solid #e5eaf0;
}

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

tbody tr.reference-row {
  background: #fffbeb;
}

.name-column {
  width: 42%;
  padding-left: 12px;
}

.number-column {
  width: 20%;
  text-align: center;
}

.check-column {
  width: 18%;
  padding-right: 4px;
  padding-left: 4px;
  text-align: center;
}

td.hoop-name {
  overflow: hidden;
  padding-left: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td.center-number {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

td.check-cell {
  padding: 0;
  text-align: center;
}

.check-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  cursor: pointer;
}

.check-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.check-box {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #fff;
  background: #fff;
  border: 2px solid #94a3b8;
  border-radius: 5px;
}

.check-label input:checked + .check-box {
  background: var(--blue);
  border-color: var(--blue);
}

.check-label input:checked + .check-box::after {
  width: 6px;
  height: 11px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: translateY(-1px) rotate(45deg);
}

.check-label input:focus-visible + .check-box {
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.2);
}

.privacy-note {
  margin: 0;
  padding: 18px 4px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (min-width: 640px) {
  .header-inner {
    padding-right: 24px;
    padding-left: 24px;
  }

  .page-shell {
    padding: 28px 24px 10px;
  }

  .input-card {
    padding: 22px 24px;
  }

  .input-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  th {
    font-size: 14px;
  }
}

@media (hover: hover) {
  tbody tr:not(.reference-row):hover {
    background: #f8fafc;
  }
}
