/* ========== 主题色（与原站一致，可被 JS 动态覆盖） ========== */
:root {
  --brand-h: 352;
  --brand-s: 99%;
  --brand-l: 65%;
  --brand: hsl(var(--brand-h), var(--brand-s), var(--brand-l));
  --brand-lt: hsl(var(--brand-h), calc(var(--brand-s) - 4%), calc(var(--brand-l) + 8%));
  --brand-dk: hsl(var(--brand-h), calc(var(--brand-s) - 2%), calc(var(--brand-l) - 10%));
  --brand-gradient: linear-gradient(135deg, var(--brand-lt), var(--brand));
  --brand-a10: hsla(var(--brand-h), var(--brand-s), var(--brand-l), 0.1);
  --brand-a15: hsla(var(--brand-h), var(--brand-s), var(--brand-l), 0.15);
  --brand-a20: hsla(var(--brand-h), var(--brand-s), var(--brand-l), 0.2);
  --brand-a30: hsla(var(--brand-h), var(--brand-s), var(--brand-l), 0.3);
  --brand-a40: hsla(var(--brand-h), var(--brand-s), var(--brand-l), 0.4);
  --brand-a45: hsla(var(--brand-h), var(--brand-s), var(--brand-l), 0.45);
}

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

html,
body {
  -webkit-font-smoothing: antialiased;
  background: #0a0a0a;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: #fff;
  min-height: 100%;
  overflow: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img {
  display: block;
  max-width: 100%;
}

input {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

/* ========== 滚动背景 ========== */
.bg-wrap {
  z-index: 0;
  background: #1a1a1a;
  width: 100%;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  overflow: hidden;
}

.bg-track {
  width: 100%;
  height: 200%;
  animation: 30s linear infinite bgScroll;
  position: absolute;
  top: 0;
  left: 0;
}

.bg-img {
  object-fit: cover;
  width: 100%;
  height: 50%;
}

.bg-overlay {
  background: linear-gradient(#0000004d 0%, #00000073 40%, #000000b3 75%, #0a0005eb 100%);
  position: absolute;
  inset: 0;
}

@keyframes bgScroll {
  0% { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

@media (width >= 768px) {
  .bg-wrap {
    width: 400px;
    left: 50%;
    transform: translate(-50%);
  }
}

/* ========== 首页 ========== */
.ml-home {
  z-index: 10;
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.ml-top {
  pointer-events: auto;
  flex-direction: column;
  gap: 14px;
  width: min(100%, 400px);
  padding: 0 20px;
  display: flex;
  position: absolute;
  top: 62px;
  left: 50%;
  transform: translate(-50%);
}

.brand-title {
  letter-spacing: 2px;
  color: var(--brand);
  text-align: center;
  text-shadow: 0 4px 8px #000000b3;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 42px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
}

.locale-switch {
  pointer-events: auto;
  z-index: 20;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 4px;
  display: flex;
  gap: 4px;
  position: fixed;
  top: 12px;
  right: max(16px, calc((100vw - 400px) / 2 + 16px));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.locale-switch button {
  color: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.locale-switch button.active {
  color: #fff;
  background: var(--brand);
}

.brand-row {
  align-items: center;
  gap: 12px;
  display: flex;
}

.brand-thumb {
  border-radius: 8px;
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  overflow: hidden;
  box-shadow: 0 4px 12px #00000080;
}

.brand-thumb img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.brand-desc {
  color: #fff;
  text-shadow: 0 2px 4px #0009;
  flex: 1;
  min-width: 0;
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  font-size: 16px;
  font-style: italic;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.thumb-bar {
  z-index: 11;
  pointer-events: auto;
  width: 100%;
  position: fixed;
  bottom: 110px;
  left: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #0000 0%, #000 6% 94%, #0000 100%);
  mask-image: linear-gradient(90deg, #0000 0%, #000 6% 94%, #0000 100%);
}

.thumb-track {
  gap: 6px;
  width: max-content;
  animation: 22s linear infinite thumbScroll;
  display: flex;
}

.thumb {
  object-fit: cover;
  border-radius: 16px;
  flex-shrink: 0;
  width: 120px;
  height: 200px;
  box-shadow: 0 6px 16px #00000080;
}

.thumb-btn {
  flex-shrink: 0;
  border-radius: 16px;
}

.cta-btn {
  z-index: 12;
  pointer-events: auto;
  background: var(--brand-gradient);
  min-width: 300px;
  height: 70px;
  box-shadow: 0 10px 32px var(--brand-a45), 0 0 0 1px #ffffff14 inset;
  border-radius: 35px;
  transition: transform 0.2s;
  animation: 2.4s ease-in-out infinite ctaPulse;
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%);
}

.cta-btn:active {
  transform: translate(-50%) scale(0.97);
}

.cta-text {
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px #00000059;
  font-size: 22px;
  font-weight: 900;
}

@keyframes thumbScroll {
  0% { transform: translate(0); }
  to { transform: translate(-50%); }
}

@keyframes ctaPulse {
  0%, to { transform: translate(-50%) scale(1); }
  50% { transform: translate(-50%) scale(1.04); }
}

@media (width >= 768px) {
  .ml-top { top: 28px; }
  .brand-title { font-size: 48px; }
  .thumb-bar {
    width: 400px;
    left: 50%;
    transform: translate(-50%);
  }
  .cta-btn {
    min-width: 360px;
    height: 76px;
  }
  .cta-text { font-size: 26px; }
}

/* ========== 登录弹窗 ========== */
.modal-overlay {
  z-index: 1000;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-sizing: border-box;
  background: #000000d9;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  display: flex;
  position: fixed;
  inset: 0;
  animation: fadeIn 0.25s ease;
}

.modal-wrap {
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 560px;
  display: flex;
  position: relative;
  animation: popIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-close {
  color: #fff;
  background: #ffffff1f;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 22px;
  line-height: 1;
  transition: background 0.2s, transform 0.2s;
  position: absolute;
  top: -42px;
  right: 0;
}

.modal-close:hover {
  background: #ffffff38;
  transform: rotate(90deg);
}

.text-info {
  text-align: center;
  margin-bottom: 18px;
}

.text-info h2 {
  color: #fff;
  letter-spacing: -0.2px;
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
}

.text-info p {
  color: #ffffffb3;
  font-size: 14px;
  line-height: 1.5;
}

.login-box {
  background: linear-gradient(135deg, var(--brand-a30) 0%, var(--brand-a20) 30%, var(--brand-a15) 60%, #ffffff0f 100%);
  border: 2px solid var(--brand-a40);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
  padding: 22px 18px;
  display: flex;
  transition: border-color 0.2s;
}

.login-box.shake {
  border-color: #ff4d4d;
  animation: 0.4s ease-in-out shake;
}

@keyframes shake {
  0%, to { transform: translate(0); }
  25% { transform: translate(-8px); }
  50% { transform: translate(8px); }
  75% { transform: translate(-4px); }
}

.input-label {
  color: #fff;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.phone-row {
  display: flex;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(5, 2, 4, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.country-btn {
  display: flex;
  height: 48px;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  min-width: 86px;
  background: rgba(255, 255, 255, 0.07);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 500;
}

.country-flag {
  width: 24px;
  height: 16px;
  border-radius: 2px;
  object-fit: cover;
}

.chevron {
  width: 12px;
  height: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.phone-input {
  flex: 1;
  height: 48px;
  background: transparent;
  border: none;
  outline: none;
  padding: 0 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.95);
  caret-color: var(--brand);
}

.phone-row-single .phone-input {
  width: 100%;
  min-width: 0;
  padding: 0 16px;
  font-size: 16px;
}

.phone-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.phone-error {
  color: #ff6b6b;
  font-size: 13px;
  text-align: center;
}

.continue-btn {
  background: var(--brand-gradient);
  color: #fff;
  letter-spacing: 1px;
  width: 100%;
  max-width: 560px;
  height: 52px;
  box-shadow: 0 6px 20px var(--brand-a45);
  border-radius: 26px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  transition: transform 0.15s, opacity 0.15s;
  display: inline-flex;
}

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

.continue-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.continue-btn .spin {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: 0.9s linear infinite spin;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(14px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ========== 国家选择底栏 ========== */
.sheet-overlay {
  z-index: 2000;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.sheet-panel {
  width: 100%;
  max-width: 400px;
  max-height: 78vh;
  background: #1a1a1a;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sheet-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 20px;
  line-height: 1;
}

.sheet-search {
  padding: 10px 16px;
  flex-shrink: 0;
}

.sheet-search input {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}

.sheet-search input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.sheet-list {
  overflow-y: auto;
  flex: 1;
  padding-bottom: 20px;
  -webkit-overflow-scrolling: touch;
}

.country-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  color: #fff;
  text-align: left;
  transition: background 0.15s;
}

.country-item:active,
.country-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.country-item.selected {
  background: var(--brand-a15);
}

.country-item .flag {
  width: 28px;
  height: 18px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
}

.country-item .name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.country-item .dial {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}

/* ========== 配对码弹窗 ========== */
.step1-overlay {
  z-index: 1000;
  box-sizing: border-box;
  background: #000000d9;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  display: flex;
  position: fixed;
  inset: 0;
  overflow-y: auto;
  animation: fadeIn 0.25s ease;
}

.pc-modal {
  text-align: center;
  border: 2px solid var(--brand-a40);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: #141414d9;
  border-radius: 20px;
  width: 80%;
  max-width: 320px;
  margin: 0 auto;
  padding: 35px 25px;
  position: relative;
  animation: popIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pc-close {
  color: #fff;
  background: #ffffff1a;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 22px;
  line-height: 1;
  transition: background 0.2s, transform 0.2s;
  position: absolute;
  top: 12px;
  right: 12px;
}

.pc-close:hover {
  background: #fff3;
  transform: rotate(90deg);
}

.pc-title {
  letter-spacing: -0.2px;
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand-lt);
}

.pc-associate {
  color: #888;
  margin-top: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.pc-desc {
  color: #eee;
  margin-top: 15px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.pc-attention {
  color: var(--brand-lt);
  margin-top: 6px;
  margin-bottom: 4px;
  font-size: 0.85rem;
  font-weight: 700;
}

.code-display-container {
  justify-content: center;
  gap: 4px;
  width: 100%;
  margin: 18px 0;
  display: flex;
}

.code-char {
  aspect-ratio: 32 / 42;
  border: 1px solid var(--brand);
  background: var(--brand-a10);
  color: #fff;
  min-width: 0;
  max-width: 36px;
  text-shadow: 0 0 5px var(--brand);
  border-radius: 6px;
  flex: 1 1 0;
  justify-content: center;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  animation: 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both charPop;
  display: flex;
}

@keyframes charPop {
  0% {
    opacity: 0;
    transform: scale(0.4) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tip-img-wrap {
  margin: 14px 0;
}

.tip-img {
  border: 1px solid #ffffff1a;
  border-radius: 10px;
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
}

.pc-btn {
  background: var(--brand-gradient);
  color: #fff;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  width: 100%;
  height: 52px;
  box-shadow: 0 6px 20px var(--brand-a45);
  border-radius: 30px;
  margin-top: 6px;
  font-size: 16px;
  font-weight: 800;
  transition: transform 0.15s;
}

.pc-btn:active {
  transform: scale(0.98);
}

.pc-status {
  color: rgba(255, 255, 255, 0.62);
  min-height: 20px;
  margin: 4px 0 8px;
  font-size: 13px;
  line-height: 1.5;
}

.profile-modal {
  padding-top: 28px;
}

.profile-avatar {
  border: 2px solid var(--brand-a40);
  border-radius: 18px;
  width: 132px;
  height: 132px;
  margin: 0 auto 16px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.profile-avatar img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.qr-overlay {
  z-index: 1000;
  box-sizing: border-box;
  background: #000000d9;
  justify-content: center;
  align-items: center;
  padding: 20px;
  display: flex;
  position: fixed;
  inset: 0;
  animation: fadeIn 0.25s ease;
}

.qr-panel {
  text-align: center;
  border: 2px solid var(--brand-a40);
  background: linear-gradient(180deg, #211016e6, #10080ce6);
  border-radius: 24px;
  width: min(92vw, 420px);
  padding: 30px 24px 24px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
  animation: popIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.qr-panel-head {
  margin-bottom: 18px;
}

.qr-kicker {
  color: var(--brand-lt);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
  font-weight: 900;
}

.qr-panel h2 {
  color: #fff;
  margin-top: 6px;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.qr-panel p {
  color: rgba(255, 255, 255, 0.72);
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.55;
}

.qr-card {
  background: #fff;
  border: 8px solid #fff;
  border-radius: 24px;
  width: min(78vw, 300px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 42px var(--brand-a30);
}

.qr-live-image {
  object-fit: contain;
  width: 100%;
  height: 100%;
  background: #fff;
}

.qr-refresh-cover {
  color: #fff;
  background: rgba(20, 20, 20, 0.84);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 100%;
  padding: 22px;
  display: flex;
  position: absolute;
  inset: 0;
}

.qr-refresh-cover[data-state="loading"] .qr-refresh-spinner {
  display: block;
}

.qr-refresh-spinner {
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: none;
  animation: spin 0.85s linear infinite;
}

.qr-refresh-title {
  font-size: 20px;
  font-weight: 900;
}

.qr-refresh-desc {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 700;
}

.qr-note {
  min-height: 22px;
}

/* ========== Toast ========== */
/* 兼容历史语言控件：本模板使用内置本地化切换器。 */
#translate {
  display: none !important;
}

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid var(--brand-a40);
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, -120%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}
