:root {
  --gate-page-bg: #f4f4f2;
  --gate-surface: #ffffff;
  --gate-ink: #141414;
  --gate-muted: #74746f;
  --gate-line: #d8d8d2;
  --gate-accent: #0f766e;
  --gate-accent-pressed: #115e59;
  --gate-danger: #b42318;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  font-family:
    -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    sans-serif;
  color: var(--gate-ink);
  background: var(--gate-page-bg);
}

body {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
}

button,
input {
  font: inherit;
}

.gate-page {
  min-height: calc(100vh - 86px);
  display: grid;
  place-items: center;
  padding: 48px 16px 28px;
}

.gate-form {
  display: grid;
  gap: 16px;
  width: min(340px, calc(100vw - 32px));
  justify-items: stretch;
}

.gate-brand {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-bottom: 4px;
}

.gate-logo,
.gate-logo-mark {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gate-line);
  border-radius: 18px;
  background: var(--gate-surface);
}

.gate-logo {
  object-fit: cover;
}

.gate-logo-mark {
  color: var(--gate-ink);
  font-size: 22px;
  font-weight: 700;
}

.gate-product {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 650;
}

.gate-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--gate-line);
  border-radius: 8px;
  background: var(--gate-surface);
  color: var(--gate-ink);
}

.gate-input::placeholder {
  color: #9a9a94;
}

.gate-input:focus {
  outline: none;
  border-color: var(--gate-line);
  background: #ececea;
}

.gate-message {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--gate-danger);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.gate-submit,
.gate-test-page__back {
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--gate-ink);
  color: #ffffff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0;
}

.gate-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 120ms ease, opacity 120ms ease;
}

.gate-submit:active,
.gate-test-page__back:active {
  background: var(--gate-accent-pressed);
}

.gate-submit:disabled {
  opacity: 0.72;
  cursor: wait;
}

.gate-submit:focus,
.gate-test-page__back:focus {
  outline: none;
}

.gate-submit:focus-visible,
.gate-test-page__back:focus-visible {
  background: #353535;
}

.gate-footer {
  padding: 0 24px 18px;
  color: var(--gate-muted);
  text-align: center;
  font-size: 10px;
  line-height: 1.5;
}

.gate-footer p {
  margin: 0;
}

.gate-beian-link,
.gate-beian-link:visited {
  color: inherit;
  text-decoration: none;
}

.gate-test-page__card {
  width: min(440px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid var(--gate-line);
  border-radius: 18px;
  background: var(--gate-surface);
}

.gate-test-page__eyebrow {
  margin: 0 0 8px;
  color: var(--gate-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gate-test-page__title {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.gate-test-page__description {
  margin: 14px 0 22px;
  color: var(--gate-muted);
  font-size: 14px;
  line-height: 1.6;
}

.gate-test-page__back {
  min-width: 132px;
  padding: 0 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.debug-panel,
.debug-panel--collapsed {
  position: fixed;
  z-index: 2147483647;
  margin: 0;
  color: #f7f7f7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  direction: ltr;
}

.debug-panel__card {
  width: max-content;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(28, 28, 30, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
}

.debug-panel__header {
  width: 176px;
  max-width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.debug-panel__title {
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 18px;
}

.debug-panel__drag,
.debug-panel__collapse,
.debug-panel__expand,
.debug-panel__test-page {
  --debug-state-layer-opacity: 0;

  border: 1px solid transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.debug-panel__drag,
.debug-panel__collapse {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 8px;
  background: rgb(0 0 0 / var(--debug-state-layer-opacity));
}

.debug-panel__drag,
.debug-panel__expand {
  touch-action: none;
  cursor: grab;
}

.debug-panel__drag:active,
.debug-panel__expand:active {
  cursor: grabbing;
}

.debug-panel__grip {
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 -5px 0 rgba(255, 255, 255, 0.66), 0 5px 0 rgba(255, 255, 255, 0.66);
}

.debug-panel__collapse {
  font-size: 20px;
  line-height: 1;
}

.debug-panel__content {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.debug-panel__test-page {
  min-height: 36px;
  padding: 8px 14px;
  border-color: rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(
      rgb(0 0 0 / var(--debug-state-layer-opacity)),
      rgb(0 0 0 / var(--debug-state-layer-opacity))
    ),
    rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 700;
}

.debug-panel--collapsed {
  width: 44px;
  height: 44px;
}

.debug-panel__expand {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background:
    linear-gradient(
      rgb(0 0 0 / var(--debug-state-layer-opacity)),
      rgb(0 0 0 / var(--debug-state-layer-opacity))
    ),
    rgba(28, 28, 30, 0.94);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  font-size: 15px;
  font-weight: 800;
}

.debug-panel__drag:focus,
.debug-panel__collapse:focus,
.debug-panel__expand:focus,
.debug-panel__test-page:focus {
  outline: none;
}

.debug-panel__drag:focus-visible,
.debug-panel__collapse:focus-visible,
.debug-panel__expand:focus-visible,
.debug-panel__test-page:focus-visible {
  --debug-state-layer-opacity: 0.32;
}

@media (hover: hover) and (pointer: fine) {
  .gate-submit:hover,
  .gate-test-page__back:hover {
    background: #0b0b0b;
  }

  .gate-beian-link:hover {
    text-decoration: underline;
  }

  .debug-panel__drag:hover,
  .debug-panel__collapse:hover {
    --debug-state-layer-opacity: 0.18;
  }

  .debug-panel__test-page:hover,
  .debug-panel__expand:hover {
    --debug-state-layer-opacity: 0.28;
  }
}

@media (max-width: 640px) {
  .gate-page {
    min-height: calc(100vh - 92px);
    padding: 32px 16px 20px;
  }

  .gate-logo,
  .gate-logo-mark {
    width: 68px;
    height: 68px;
    border-radius: 16px;
  }

  .gate-product {
    font-size: 18px;
  }

  .gate-footer {
    padding: 0 18px 14px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate-submit {
    transition: none;
  }
}
