:root {
  --blue: #0968ff;
  --blue-deep: #0047d8;
  --blue-soft: #eaf3ff;
  --ink: #071b44;
  --body: #3c4a63;
  --muted: #7c8aa2;
  --line: #dce6f6;
  --panel: #ffffff;
  --page: #f7fbff;
  --shadow: 0 18px 48px rgba(20, 92, 255, 0.14);
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--body);
  background: #fff;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.hero {
  position: relative;
  overflow: hidden;
  background: #005bef;
}

.hero-banner {
  display: block;
  width: 100%;
  height: auto;
}

.selection-layout {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 30%);
  align-items: stretch;
  gap: 24px;
  max-width: 1440px;
  margin: 12px auto 0;
  padding: 0 20px;
}

.search-wrap {
  min-width: 0;
}

.search-panel {
  position: sticky;
  top: 88px;
  padding: 0 18px 20px;
  background: #fff;
  border: 1px solid #e8eef8;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--line);
}

.search-tab {
  height: 50px;
  color: var(--blue);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: inset 0 -3px 0 var(--blue);
  font-weight: 500;
  cursor: default;
}

.search-tab:hover {
  box-shadow: inset 0 -3px 0 var(--blue);
  transform: none;
}

.search-line {
  display: grid;
  grid-template-columns: 40px 58px minmax(0, 1fr);
  gap: 0;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.search-icon {
  display: grid;
  place-items: center;
  color: var(--blue);
  background: #fff;
}

.search-icon svg {
  width: 20px;
  height: 20px;
}

.fixed-prefix,
.search-line button {
  height: 44px;
  border: 0;
  border-radius: 0;
}

.fixed-prefix {
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #fff;
  border-left: 1px solid var(--line);
  font-size: 17px;
  font-weight: 600;
}

.digits {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid var(--line);
}

.digits input {
  width: 100%;
  height: 44px;
  border: 0;
  border-right: 1px solid #edf3fb;
  color: var(--blue);
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  outline: 0;
}

.search-line button {
  grid-column: 1 / -1;
  font-size: 16px;
}

.digits input:focus {
  background: var(--blue-soft);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: var(--blue);
  font-weight: 500;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(9, 104, 255, 0.22);
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: none;
}

.hot-searches {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 18px;
  color: #6f7d94;
  font-size: 14px;
}

.hot-searches button,
.collapse-button {
  min-height: auto;
  padding: 0;
  color: #246ff4;
  background: transparent;
  font-weight: 500;
}

.section-toggle {
  display: none;
  color: #6a778d;
  font-size: 13px;
}

.hot-searches button svg {
  width: 15px;
  height: 15px;
  margin-left: 4px;
  vertical-align: -2px;
}

.hot-searches button:hover,
.collapse-button:hover {
  box-shadow: none;
}

.rules,
.segment-rules,
.contains-rules {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.rules-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
  list-style: none;
}

.rules-head::-webkit-details-marker {
  display: none;
}

.rules-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.rules-title {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.segment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.segment-grid label {
  display: grid;
  place-items: center;
  min-height: 34px;
  color: #243957;
  background: #f8fbff;
  border: 1px solid #dbe7f8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.segment-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment-grid label:has(input:checked) {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.contains-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.contains-toggle {
  display: flex;
  gap: 14px;
  align-items: center;
  white-space: nowrap;
}

.contains-toggle label {
  color: #606a7d;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.contains-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.contains-toggle label:has(input:checked) {
  color: var(--blue);
}

.contains-search {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.contains-search input {
  min-height: 40px;
  width: 100%;
  padding: 0 12px;
  color: var(--ink);
  border: 0;
  outline: 0;
  font-size: 14px;
}

.contains-search input::placeholder {
  color: #b7c0cf;
}

.rule-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}

.rule-tab {
  min-height: 42px;
  color: #1f2f4d;
  background: #fff;
  border-radius: 0;
  border-right: 1px solid var(--line);
  font-size: 16px;
}

.rule-tab:last-child {
  border-right: 0;
}

.rule-tab.is-active {
  color: var(--blue);
  box-shadow: inset 0 -3px 0 var(--blue);
}

.rule-tab:hover {
  box-shadow: none;
}

.rule-panel {
  padding: 14px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0 0 7px 7px;
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 4px;
}

.rules label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  color: #5c6473;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.rules input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rules label:has(input:checked) {
  color: var(--blue);
}

.process-section,
.advantage-section {
  max-width: 1100px;
  margin: 44px auto 0;
  padding: 0 20px;
}

.results-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 8px;
}

.section-title h2,
.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
}

.section-heading {
  margin-bottom: 28px;
  text-align: center;
}

.section-heading p,
#status {
  margin: 8px 0 0;
  color: var(--muted);
}

.more-link {
  color: #6f7d94;
  font-size: 14px;
}

.status-pill {
  margin-bottom: 14px;
}

.recommend-layout {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.number-card {
  position: relative;
  overflow: hidden;
  min-height: 56px;
  padding: 9px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
  animation: cardRise 360ms ease both;
}

.number-card:hover,
.number-card:focus-visible {
  transform: translateY(-2px);
  background: #f8fbff;
  border-color: #b8d4ff;
  box-shadow: var(--shadow);
  outline: none;
}

.card-signal {
  position: absolute;
  inset: 0 0 auto auto;
  width: 46px;
  height: 40px;
  background: radial-gradient(circle at top right, rgba(9, 104, 255, 0.1), transparent 70%);
}

.number-card strong {
  display: block;
  margin-top: 1px;
  color: #071b44;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
}

.reservation-tip {
  position: absolute;
  left: 50%;
  bottom: 6px;
  z-index: 1;
  min-width: max-content;
  padding: 4px 9px;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  background: var(--blue);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(9, 104, 255, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.number-card:hover .reservation-tip,
.number-card:focus-visible .reservation-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.empty {
  grid-column: 1 / -1;
  padding: 28px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(9, 104, 255, 0.07);
}

.pagination-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: #718097;
  font-size: 14px;
}

.pagination-summary strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.page-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
}

.page-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 38px;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  color: #264162;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  background: #f7faff;
  border: 1px solid #d7e5fb;
  border-radius: 6px;
  box-shadow: none;
  vertical-align: bottom;
}

.page-button:hover:not(:disabled) {
  color: var(--blue);
  border-color: #9fc6ff;
  transform: none;
}

.page-button.is-active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: none;
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.page-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  color: #7a879b;
  font-weight: 500;
}

.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 38px;
}

.process div {
  position: relative;
  min-height: 128px;
  padding: 28px 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}

.process div::after {
  content: "";
  position: absolute;
  right: -27px;
  top: 50%;
  width: 16px;
  height: 16px;
  border-top: 3px solid var(--blue);
  border-right: 3px solid var(--blue);
  transform: translateY(-50%) rotate(45deg);
}

.process div:last-child::after {
  display: none;
}

.process span {
  position: absolute;
  top: -14px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  background: #75a8ff;
  border-radius: 50%;
  font-weight: 500;
  transform: translateX(-50%);
}

.process div > svg {
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  color: var(--blue);
}

.process strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
}

.process p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.advantage-card {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 34px rgba(9, 104, 255, 0.08);
}

.advantage-card div {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  column-gap: 12px;
  text-align: left;
  border-right: 1px solid #edf3fb;
}

.advantage-card div:last-child {
  border-right: 0;
}

.advantage-card strong {
  display: block;
  color: var(--blue);
  font-size: 26px;
  font-weight: 500;
}

.advantage-card svg {
  width: 38px;
  height: 38px;
  grid-row: span 2;
  color: var(--blue);
}

.advantage-card span {
  color: #4c5b73;
}

.success {
  max-width: 1100px;
  margin: 30px auto 0;
  padding: 26px;
  background: #fff;
  border: 1px solid #b8d4ff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.success .eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
}

.reserved-number {
  margin: 14px 0;
  color: var(--blue);
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 600;
}

#countdown {
  display: inline-flex;
  margin-top: 10px;
  padding: 9px 12px;
  color: #fff;
  background: var(--blue);
  border-radius: 4px;
}

dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(7, 27, 68, 0.24);
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(7, 27, 68, 0.46);
  backdrop-filter: blur(3px);
}

dialog form {
  padding: 0;
  background: #fff;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  background: linear-gradient(180deg, #f7fbff, #fff);
  border-bottom: 1px solid #e8f0fb;
}

.dialog-head .eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 20px;
  font-weight: 500;
}

.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  color: var(--blue);
  background: #eaf3ff;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  box-shadow: none;
}

.icon-button:hover {
  color: #fff;
  background: var(--blue);
  transform: none;
}

dialog h2 {
  margin: 0;
  padding: 22px 24px 14px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
}

#selectedNumber {
  display: block;
  color: #071b44;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0;
}

dialog label {
  display: grid;
  gap: 7px;
  margin: 0 24px 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

dialog input {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  color: var(--ink);
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

dialog input:focus {
  background: #fff;
  border-color: #9fc6ff;
  box-shadow: 0 0 0 3px rgba(9, 104, 255, 0.12);
}

.error {
  margin: 0 24px;
  min-height: 22px;
  color: #d11b1b;
  font-size: 13px;
}

#submitReservation {
  width: calc(100% - 48px);
  min-height: 46px;
  margin: 12px 24px 24px;
  border-radius: 7px;
  font-size: 16px;
  font-weight: 500;
}

.footer {
  margin-top: 68px;
  color: #dceaff;
  background: linear-gradient(135deg, #0052d9, #0044b7);
}

.footer-partners {
  overflow: hidden;
  background: #fff;
}

.footer-partners img {
  display: block;
  width: 100%;
  height: clamp(108px, 10vw, 160px);
  object-fit: cover;
  object-position: center;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px 12px;
  text-align: center;
}

.footer-main div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.footer-main strong {
  color: #fff;
}

.footer-main a,
.footer-main p,
.footer-main small {
  margin: 0;
  color: #dceaff;
  font-size: 13px;
}

.footer-phone {
  font-size: 28px;
  font-weight: 500;
}

.copyright {
  margin: 0;
  padding: 14px 20px 22px;
  color: #bdd4ff;
  text-align: center;
  font-size: 13px;
}

.results-grid.is-loading {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent, rgba(9, 104, 255, 0.08), transparent),
    #fff;
  background-size: 220px 100%, auto;
  animation: shimmer 1.2s linear infinite;
}

@keyframes floatUp {
  0%, 100% { transform: translateY(0) rotate(8deg); }
  50% { transform: translateY(-10px) rotate(8deg); }
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  from { background-position: -220px 0, 0 0; }
  to { background-position: calc(100% + 220px) 0, 0 0; }
}

@media (max-width: 980px) {
  .process,
  .advantage-card,
  .footer-main {
    grid-template-columns: 1fr 1fr;
  }

  .process div::after {
    display: none;
  }

  .selection-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-top: 12px;
  }

  .search-wrap {
    order: -1;
  }

  .results-section {
    order: 0;
  }

  .search-panel {
    position: static;
  }

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

  .pagination {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 18px;
  }

  .page-controls {
    justify-content: flex-start;
  }

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

  .contains-filter {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .section-toggle {
    display: inline-flex;
    align-items: center;
  }
}

@media (max-width: 620px) {
  .search-panel {
    padding: 0 14px 16px;
  }

  .search-tab {
    height: 44px;
  }

  .segment-grid,
  .process,
  .advantage-card,
  .footer-main {
    grid-template-columns: 1fr;
  }

  .rules,
  .segment-rules,
  .contains-rules {
    margin-top: 14px;
  }

  .rules-head {
    margin-bottom: 6px;
  }

  .rules-title {
    font-size: 15px;
  }

  .segment-grid,
  .contains-filter,
  .rule-panel {
    padding: 8px;
  }

  .rule-tab {
    min-height: 38px;
    font-size: 15px;
  }

  .rule-grid {
    gap: 8px 4px;
  }

  .rules label {
    min-height: 28px;
    font-size: 13px;
  }

  .number-card {
    min-height: 52px;
    padding: 8px 6px;
  }

  .number-card strong {
    font-size: 17px;
  }

  .footer {
    margin-top: 44px;
  }

  .footer-partners img {
    height: 108px;
  }

  .process-section,
  .advantage-section {
    margin-top: 34px;
  }

  .advantage-card div {
    padding: 12px 0;
    border-right: 0;
    border-bottom: 1px solid #edf3fb;
  }
}

@media (max-width: 420px) {
  .results-grid,
  .contains-filter {
    grid-template-columns: 1fr;
  }

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