:root {
  color-scheme: dark;
  --eh-bg: #071113;
  --eh-panel: #0b1517;
  --eh-text: #cddcde;
  --eh-muted: #8c8c8e;
  --eh-title: #feffef;
  --eh-accent: #52b2cd;
  --eh-accent-deep: #16749d;
  font-family: Inter, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--eh-bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--eh-bg);
  color: var(--eh-text);
}

body.eh-dialog-open:not(.eh-login-only) {
  overflow: hidden;
}

.eh-top-bar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
  padding: 0 1.25rem 0;
  padding-top: max(1.5rem, calc(env(safe-area-inset-top, 0px) + 0.75rem));
  background: transparent;
  pointer-events: none;
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.eh-top-bar.eh-top-bar--hidden {
  transform: translateY(calc(-100% - env(safe-area-inset-top, 0px)));
  opacity: 0;
  pointer-events: none;
}

.eh-top-bar .eh-locale-wrap {
  pointer-events: auto;
}

body.eh-login-only .eh-top-bar {
  padding-top: max(1.25rem, calc(env(safe-area-inset-top, 0px) + 0.5rem));
  transform: none;
  opacity: 1;
}

body.eh-login-only {
  background: var(--eh-bg);
}

body.eh-login-only .eh-dialog {
  position: static;
  display: flex !important;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1rem 1.5rem;
  background: var(--eh-bg);
  backdrop-filter: none;
}

body.eh-login-only .eh-dialog[hidden] {
  display: none !important;
}

body.eh-login-only .eh-dialog-panel {
  max-height: none;
}

body.eh-login-only .eh-dialog-close {
  display: none;
}

.eh-page {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
}

.eh-glow {
  pointer-events: none;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: min(22rem, 52vh);
  background: radial-gradient(ellipse 120% 80% at 50% -10%, rgba(82, 178, 205, 0.32), transparent 68%);
}

.eh-container {
  position: relative;
  margin: 0 auto;
  max-width: 28rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
}

.eh-landing > .eh-container {
  padding-top: max(3.75rem, calc(env(safe-area-inset-top, 0px) + 2.75rem));
  padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
}

.eh-hero {
  text-align: center;
  padding-top: 2rem;
}

.eh-hero-icon {
  margin: 0 auto 1.25rem;
  width: 9rem;
  height: 9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2rem;
  border: 1px solid rgba(82, 178, 205, 0.25);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 34px rgba(82, 178, 205, 0.28);
}

.eh-hero-icon img {
  width: 7rem;
  height: 7rem;
  object-fit: contain;
}

.eh-brand {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--eh-accent);
}

.eh-locale-wrap {
  display: block;
  margin-top: 0.75rem;
}

.eh-locale {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--eh-text);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.eh-card {
  margin-top: 1rem;
  padding: 1.25rem;
  border-radius: 1.625rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.32);
}

.eh-card--accent {
  border-color: rgba(82, 178, 205, 0.2);
  background: rgba(82, 178, 205, 0.06);
}

.eh-card--warn {
  border-color: rgba(251, 191, 36, 0.2);
  background: rgba(251, 191, 36, 0.06);
}

.eh-card-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--eh-title);
}

.eh-card-sub {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--eh-accent);
}

.eh-card-text {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.75;
  color: rgba(205, 220, 222, 0.9);
}

.eh-footer-actions {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 40;
  width: 100%;
  max-width: 28rem;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--eh-bg) 55%, rgba(7, 17, 19, 0.96) 80%, transparent);
}

.eh-btn {
  height: 3rem;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.eh-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.eh-btn--outline {
  border: 1px solid rgba(82, 178, 205, 0.45);
  background: rgba(255, 255, 255, 0.04);
  color: var(--eh-accent);
}

.eh-btn--primary {
  background: linear-gradient(90deg, var(--eh-accent-deep), var(--eh-accent));
  color: #fff;
  box-shadow: 0 0 20px rgba(82, 178, 205, 0.35);
}

.eh-btn--block {
  width: 100%;
  margin-top: 1.5rem;
}

.eh-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 1.25rem 1rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.eh-dialog:not([hidden]) {
  display: flex;
}

@media (min-width: 640px) {
  .eh-dialog:not([hidden]) {
    align-items: center;
  }
}

.eh-dialog-panel {
  width: 100%;
  max-width: 28rem;
  max-height: 88dvh;
  overflow: auto;
  padding: 1.25rem;
  border-radius: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--eh-panel);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.55);
}

.eh-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.eh-dialog-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--eh-accent);
}

.eh-dialog-title {
  margin: 0.25rem 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--eh-title);
}

.eh-dialog-close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--eh-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.eh-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.25rem;
  margin-bottom: 0.75rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
}

.eh-tabs--method {
  margin-bottom: 1.5rem;
}

.eh-tab {
  border: none;
  background: transparent;
  color: var(--eh-muted);
  border-radius: 999px;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.eh-tab--active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--eh-title);
}

.eh-tab--pill.eh-tab--active,
.eh-tab--pill-active.eh-tab--active {
  background: linear-gradient(90deg, var(--eh-accent-deep), var(--eh-accent));
  color: #fff;
  box-shadow: 0 0 16px rgba(82, 178, 205, 0.32);
}

.eh-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.eh-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.eh-phone-row {
  display: flex;
  gap: 0.5rem;
}

.eh-tel-code-select {
  position: relative;
  width: 4.75rem;
  flex-shrink: 0;
}

.eh-tel-code-trigger {
  width: 100%;
  height: 100%;
  min-height: 3rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  color: var(--eh-text);
  padding: 0.75rem 0.5rem;
  font-size: 0.875rem;
  text-align: center;
  cursor: pointer;
}

.eh-tel-code-dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  width: min(16rem, 75vw);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.85rem;
  background: #121d20;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 40;
  padding: 0.55rem;
}

.eh-tel-code-search {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.7rem;
  background: rgba(0, 0, 0, 0.25);
  color: var(--eh-title);
  font-size: 0.84rem;
  outline: none;
  padding: 0.55rem 0.65rem;
}

.eh-tel-code-options {
  margin-top: 0.45rem;
  max-height: 13rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.eh-tel-code-option {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--eh-text);
  border-radius: 0.65rem;
  text-align: left;
  font-size: 0.82rem;
  padding: 0.5rem 0.55rem;
  cursor: pointer;
}

.eh-tel-code-option--active {
  border-color: rgba(82, 178, 205, 0.5);
  background: rgba(82, 178, 205, 0.12);
}

.eh-tel-code-empty {
  font-size: 0.8rem;
  color: var(--eh-muted);
  padding: 0.5rem 0.35rem;
}

.eh-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  padding: 0.75rem 1rem;
}

.eh-input-wrap--grow {
  flex: 1;
}

.eh-input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--eh-title);
  font-size: 1rem;
  outline: none;
}

.eh-input::placeholder {
  color: rgba(140, 140, 142, 0.7);
}

.eh-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--eh-muted);
}

.eh-sms-row {
  display: flex;
  gap: 0.5rem;
}

.eh-sms-btn {
  flex-shrink: 0;
  border-radius: 1rem;
  border: 1px solid rgba(82, 178, 205, 0.4);
  background: transparent;
  color: var(--eh-accent);
  padding: 0.75rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.eh-sms-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.eh-toggle-pwd {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--eh-muted);
  cursor: pointer;
  transition: color 0.15s;
}

.eh-toggle-pwd:hover {
  color: var(--eh-accent);
}

.eh-icon {
  width: 1rem;
  height: 1rem;
  display: block;
}

.eh-icon[hidden] {
  display: none;
}

.eh-feedback {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  border: 1px solid transparent;
}

.eh-feedback--error {
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

.eh-feedback--success {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
}

.eh-feedback--info {
  border-color: rgba(34, 211, 238, 0.3);
  background: rgba(6, 182, 212, 0.1);
  color: #67e8f9;
}

.eh-terms {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--eh-muted);
}

.eh-captcha-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  padding: 1rem;
}

.eh-captcha-dialog {
  position: relative;
  width: min(100%, 22rem);
  height: min(80dvh, 28rem);
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
}

.eh-captcha-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
}

.eh-captcha-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.eh-boot-error {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: rgba(185, 28, 28, 0.95);
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
