/* ============================================================================
   style.css —— 图片背景 + 磨砂玻璃卡片
   色板取自背景图的青 / 紫 / 暖黄，主色只用一处强调，不铺满整屏。
   所有颜色集中在 :root，想换风格改这里即可。
   ========================================================================== */

:root {
  --ink: #f4f7fb;
  --ink-soft: #d7deea;
  --muted: #9aa8bd;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);

  --accent: #5eead4;          /* 青绿：状态点、主按钮 */
  --accent-2: #a5b4fc;        /* 淡紫：标题渐变另一半 */
  --warm: #fcd34d;
  --danger: #fb7185;

  --glass: rgba(14, 18, 26, 0.56);
  --glass-soft: rgba(14, 18, 26, 0.38);

  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 10px;

  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, 0.75), 0 2px 0 rgba(255, 255, 255, 0.06) inset;
  --shadow-md: 0 18px 40px -20px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.05) inset;

  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: #07090d;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, p { margin: 0; }
em { font-style: normal; }
button, input { font: inherit; color: inherit; }

/* ------------------------------- 背景层 ---------------------------------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #07090d;
  pointer-events: none;
}

.bg__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  display: block;
  opacity: 0;
  transform: scale(1.06);
  filter: brightness(0.88) saturate(0.95);
  transition: opacity 1.1s ease;
  will-change: transform, opacity;
}

.bg__img.is-ready {
  opacity: 1;
  animation: drift 46s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: scale(1.05) translate3d(-0.6%, 0.4%, 0); }
  to   { transform: scale(1.13) translate3d(0.8%, -0.8%, 0); }
}

/* 压暗 + 上浅下深，保证白字始终清楚，同时不把图压死 */
.bg-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(10, 12, 18, 0.05), rgba(10, 12, 18, 0.55) 66%),
    linear-gradient(180deg, rgba(8, 10, 16, 0.44) 0%, rgba(8, 10, 16, 0.6) 48%, rgba(6, 8, 12, 0.87) 100%);
  pointer-events: none;
}

/* 极淡的横向纹理：保留一点"屏幕感"，不再是满屏字符 */
.bg-grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.028) 0 1px,
    rgba(0, 0, 0, 0) 1px 3px
  );
  mix-blend-mode: soft-light;
}

/* --------------------------------- 卡片 ---------------------------------- */

.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
}

/* --------------------------------- 门禁 ---------------------------------- */

.gate {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  animation: gate-in 0.7s ease both;
}

@keyframes gate-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.gate.is-leaving {
  animation: gate-out 0.55s ease forwards;
  pointer-events: none;
}

@keyframes gate-out {
  to { opacity: 0; transform: scale(1.03); filter: blur(8px); }
}

.gate__card {
  width: min(452px, 100%);
  padding: 38px 34px 30px;
  animation: card-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(22px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.7);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.6); }
  70%  { box-shadow: 0 0 0 9px rgba(94, 234, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0); }
}

.gate__title {
  font-size: 40px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.gate__title em {
  background: linear-gradient(96deg, var(--accent) 8%, var(--accent-2) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gate__sub {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13.5px;
}

.form { margin-top: 26px; }

.field { display: block; }

.field__label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.field__input {
  width: 100%;
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 20px;
  letter-spacing: 0.32em;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.field__input::placeholder {
  letter-spacing: 0.02em;
  font-family: var(--sans);
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.32);
}

.field__input:focus {
  border-color: rgba(94, 234, 212, 0.55);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.1);
}

/* Turnstile 容器：不显示时完全不占位 */
.turnstile { margin-top: 16px; }
.turnstile[hidden] { display: none; }

/* 人机验证状态提示（Turnstile 失败后显示「本机验证」进度） */
.captcha-hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  min-height: 0;
}
.captcha-hint:empty { display: none; }
.captcha-hint[data-kind="ok"] { color: var(--accent); }

/* --------------------------------- 按钮 ---------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: default; }

.btn--primary {
  width: 100%;
  margin-top: 18px;
  padding: 15px 18px;
  font-weight: 650;
  font-size: 15.5px;
  color: #06120f;
  background: linear-gradient(100deg, var(--accent) 0%, #93f5e6 42%, var(--accent-2) 120%);
  box-shadow: 0 12px 30px -12px rgba(94, 234, 212, 0.65);
}

.btn--primary:hover:not([disabled]) { box-shadow: 0 16px 36px -12px rgba(94, 234, 212, 0.8); }

.btn--tiny {
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.btn--tiny:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--line-strong); }

.btn--sm {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--ink);
  background: rgba(94, 234, 212, 0.12);
  border-color: rgba(94, 234, 212, 0.35);
}

.btn--sm:hover:not([disabled]) { background: rgba(94, 234, 212, 0.2); border-color: rgba(94, 234, 212, 0.6); }

/* --------------------------------- 状态 ---------------------------------- */

.status {
  min-height: 22px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  white-space: pre-wrap;
  transition: color 0.2s;
}

.status.is-err { color: var(--danger); }
.status.is-ok { color: var(--accent); }

.gate__hint {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.42);
}

.gate.shake { animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97); }

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* -------------------------------- 主内容 --------------------------------- */

.vault {
  position: relative;
  z-index: 3;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 26px 40px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.vault.is-in { opacity: 1; transform: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--glass-soft);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}

.brand__dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(94, 234, 212, 0.55);
}

.brand em { color: var(--accent); letter-spacing: 0.24em; }

.topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.chip.is-owner { color: var(--warm); border-color: rgba(252, 211, 77, 0.4); }
.chip.is-empty { color: var(--danger); border-color: rgba(251, 113, 133, 0.4); }

.hero { padding: 44px 6px 30px; }

.hero__title {
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 650;
  letter-spacing: -0.01em;
  background: linear-gradient(100deg, #ffffff 10%, var(--accent) 55%, var(--accent-2) 105%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* -------------------------------- 卡片网格 -------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 20px 22px 14px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  animation: panel-in 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.panel:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 26px 50px -26px rgba(0, 0, 0, 0.85);
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(94, 234, 212, 0.12);
  border: 1px solid rgba(94, 234, 212, 0.24);
  color: var(--accent);
  font-size: 14px;
}

.panel__title { font-size: 15.5px; font-weight: 620; }

.panel__en {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.32);
  text-transform: uppercase;
  margin-left: 2px;
}

.panel__count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.36);
}

.item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
}

.item:last-child { border-bottom: 0; }

.item__body { min-width: 0; flex: 1; }

.item__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 560;
  color: var(--ink);
}

.item__desc {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  font-weight: 400;
}

.item__link {
  font-size: 12.5px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(94, 234, 212, 0.3);
  padding-bottom: 1px;
  transition: border-color 0.2s, color 0.2s;
}

.item__link:hover { color: #a7fff0; border-color: #a7fff0; }

/* --------------------------------- 页脚 ---------------------------------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.34);
}

.foot__sep { opacity: 0.5; }

/* --------------------------------- 提示 ---------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 20px);
  max-width: min(560px, calc(100% - 40px));
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(14, 18, 26, 0.92);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  color: var(--ink-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 20;
}

.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-err { border-color: rgba(251, 113, 133, 0.5); color: #ffd9df; }

/* ------------------------------- 移动端 ---------------------------------- */

@media (max-width: 640px) {
  .gate__card { padding: 30px 22px 24px; }
  .gate__title { font-size: 32px; }
  .vault { padding: 16px 14px 30px; }
  .hero { padding: 28px 4px 20px; }
  .grid { grid-template-columns: 1fr; }
  .topbar { padding: 10px 12px; }
  .chip { font-size: 10.5px; padding: 5px 9px; }
}

/* 减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 截图/预览模式：跳过所有入场动画，方便自动化出图 */
.preview-mode .gate,
.preview-mode .gate__card,
.preview-mode .panel,
.preview-mode .vault {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}
