:root {
  --bg: #0b1020;
  --panel: #131b2b;
  --line: rgba(148, 163, 184, .15);
  --text: #e6edf3;
  --sub: #94a3b8;
  --mint: #20c997;
  --mint-soft: #7df0dd;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(22px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom));
  background:
    radial-gradient(70% 45% at 88% 0%, rgba(32, 201, 151, .13), transparent 62%),
    radial-gradient(60% 42% at 0% 100%, rgba(56, 189, 248, .08), transparent 64%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.gate {
  width: 100%;
  max-width: 456px;
  margin: 0 auto;
}

.gate-head {
  padding: 0 2px 22px;
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--mint-soft);
  font-size: 9px;
  letter-spacing: .18em;
}

.gate-brand-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 12px rgba(32, 201, 151, .9);
}

.gate h1 {
  margin: 14px 0 0;
  font-size: clamp(27px, 7.2vw, 32px);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -.03em;
}

.gate-head p {
  margin: 9px 0 0;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.7;
}

.gate-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(19, 27, 43, .82);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
  backdrop-filter: blur(8px);
}

.gate-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.gate-label {
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 500;
}

.gate-field-head > span {
  color: #64748b;
  font-size: 9px;
}

.gate-search {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.gate-input-wrap {
  flex: 1;
  min-width: 0;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 6, 23, .32);
  transition: border-color .18s ease, background .18s ease;
}

.gate-input-wrap:focus-within {
  border-color: rgba(32, 201, 151, .55);
  background: rgba(2, 6, 23, .48);
}

.gate-input-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: #64748b;
}

#city-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

#city-input::placeholder { color: #64748b; }

.gate-locate {
  flex: 0 0 auto;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 13px;
  border: 1px solid rgba(32, 201, 151, .28);
  border-radius: 12px;
  background: rgba(32, 201, 151, .1);
  color: var(--mint-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}

.gate-locate svg { width: 15px; height: 15px; }
.gate-locate:hover { background: rgba(32, 201, 151, .16); border-color: rgba(32, 201, 151, .5); }
.gate-locate:active { transform: scale(.98); }

.gate-results {
  max-height: 228px;
  margin-top: 8px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d1627;
}

.gate-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .08);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.gate-result:last-child { border-bottom: 0; }
.gate-result:hover { background: rgba(32, 201, 151, .06); }
.gate-result b { font-weight: 500; }
.gate-result span { color: var(--sub); font-size: 10px; text-align: right; }

.gate-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(32, 201, 151, .24);
  border-radius: 12px;
  background: rgba(32, 201, 151, .06);
}

.gate-selected-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(32, 201, 151, .14);
  color: var(--mint-soft);
  font-size: 12px;
}

.gate-selected-copy { min-width: 0; flex: 1; }
.gate-selected b { display: block; font-size: 13px; font-weight: 600; }
.gate-selected #selected-coord { display: block; margin-top: 3px; color: var(--sub); font-size: 9px; }
.gate-ok { color: var(--mint); font-size: 9px; }

.gate-hint {
  min-height: 16px;
  margin: 9px 1px 0;
  color: #64748b;
  font-size: 10px;
  line-height: 1.6;
}
.gate-hint.error { color: #f87171; }

.gate-confirm {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  background: var(--mint);
  color: #052e2b;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .18s ease, transform .18s ease;
}

.gate-confirm:hover:not(:disabled) { filter: brightness(1.05); }
.gate-confirm:active:not(:disabled) { transform: scale(.995); }
.gate-confirm:disabled { opacity: .28; cursor: not-allowed; }
.gate-confirm-arrow { font-size: 15px; line-height: 1; }

.gate-next-note {
  margin: 8px 0 0;
  color: #526071;
  font-size: 9px;
  text-align: center;
}

.gate-foot {
  margin: 20px 0 0;
  text-align: center;
  color: #64748b;
  font-size: 10px;
}

.gate-foot a {
  color: #94a3b8;
  text-decoration: none;
  border-bottom: 1px solid rgba(148, 163, 184, .25);
  padding-bottom: 1px;
}

.gate-foot a:hover { color: var(--mint-soft); }

@media (max-width: 380px) {
  body { padding-left: 16px; padding-right: 16px; }
  .gate-card { padding: 14px; }
  .gate-locate { padding: 0 10px; }
  .gate-search { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .gate-input-wrap, .gate-locate, .gate-confirm { transition: none; }
}

/* 定位页：上移布局，减少上下空白 */
body {
    align-items: flex-start;
    justify-content: center;
    padding-top: clamp(44px, 8vh, 84px);
}

/* 禁用确认按钮：可读的薄荷描边，而不是暗色块 */
.gate-confirm:disabled {
    opacity: 1;
    background: rgba(32, 201, 151, .08);
    border: 1px solid rgba(32, 201, 151, .2);
    color: #6f9f96;
}

/* 什么是极光：带缩略图的入口 */
.gate-learn {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 26px;
    padding: 9px 11px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 14px;
    background: rgba(19, 27, 43, .62);
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.gate-learn:hover {
    border-color: rgba(32, 201, 151, .34);
    background: rgba(32, 201, 151, .06);
    transform: translateY(-1px);
}
.gate-learn-thumb {
    width: 52px;
    height: 44px;
    flex: 0 0 52px;
    border-radius: 9px;
    object-fit: cover;
    object-position: center 58%;
    filter: saturate(1.05);
}
.gate-learn-copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.gate-learn-copy b {
    color: #e6edf3;
    font-size: 12px;
    font-weight: 600;
}
.gate-learn-copy small {
    color: #7f8b99;
    font-size: 9px;
    line-height: 1.5;
}
.gate-learn-arrow {
    color: #7df0dd;
    font-size: 16px;
}
.gate-foot {
    margin-top: 13px;
}

/* 搜索清空 */
.gate-clear {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(148, 163, 184, .1);
    color: #94a3b8;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}
.gate-clear:hover { color: #e6edf3; background: rgba(148, 163, 184, .18); }

/* 定位按钮更清晰 */
.gate-locate {
    box-shadow: inset 0 0 0 1px rgba(32, 201, 151, .06);
}

/* 法律同意 */
.gate-consent {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 11px 1px 5px;
    color: #7f8b99;
    font-size: 9px;
    line-height: 1.65;
}
.gate-consent input {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    margin: 1px 0 0;
    border: 1px solid rgba(148, 163, 184, .45);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
}
.gate-consent input:checked {
    border-color: #20c997;
    background: #20c997;
}
.gate-consent input:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 3px;
    height: 7px;
    border: solid #052e2b;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}
.gate-consent a {
    color: #7df0dd;
    text-decoration: none;
    border-bottom: 1px solid rgba(125, 240, 221, .3);
}
