/* ============================================================
   main.css — 官网入口 · 年龄确认页（Age Gate）
   Google Material Design 极简风格 · 零第三方依赖
   ============================================================ */

:root {
  /* Google Material 配色 */
  --bg: #ffffff;                /* 白底 */
  --surface: #f8f9fa;           /* 浅灰表面 */
  --google-blue: #1a73e8;       /* 主操作 */
  --google-blue-hover: #1967d2;
  --google-blue-focus: #185abc;
  --text-main: #202124;         /* 主文字 */
  --text-sub: #5f6368;          /* 次要文字 */
  --text-faint: #80868b;
  --border: #dadce0;            /* 边框 */
  --divider: rgba(0, 0, 0, 0.12);
  --shadow-1: 0 1px 3px rgba(60, 64, 67, 0.3);
  --shadow-2: 0 1px 4px rgba(60, 64, 67, 0.3);

  --space-2: 0.5rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2.5rem;

  --radius: 8px;
  --radius-sm: 6px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text-main);
  background: var(--bg);
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

img,
video {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: 0.96rem;
}

/* ============================================================
   顶栏
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--divider);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0 0.25rem;
}

.brand-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--google-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-dot::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
}

.brand-name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
  letter-spacing: 0.01em;
}

/* 汉堡按钮 */
.hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.hamburger:hover {
  background: var(--surface);
}

.hamburger .bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--text-main);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.hamburger[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
}
.hamburger[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 移动端折叠菜单 */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease);
}

.mobile-menu.open {
  max-height: 260px;
}

.menu-link {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 52px;
  line-height: 52px;
  padding: 0 var(--space-4);
  font-size: 0.95rem;
  color: var(--text-sub);
  background: transparent;
  border: none;
  border-top: 1px solid var(--divider);
  font-family: inherit;
  cursor: pointer;
}

.menu-link:first-child {
  border-top: none;
}

.menu-link:hover,
.menu-link:focus-visible {
  background: var(--surface);
  color: var(--text-main);
}

.menu-link-btn {
  color: var(--google-blue);
  font-weight: 500;
}

/* ============================================================
   中央年龄确认区
   ============================================================ */
.gate {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  text-align: center;
}

.gate-inner {
  max-width: 440px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- 18+ 徽标（Google Material 简洁风格） ---- */
.age-badge {
  margin-bottom: var(--space-6);
}

.badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 15px;
  background: var(--google-blue);
  color: #fff;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-2);
}

/* ---- 文案 ---- */
.title {
  font-size: 1.55rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: var(--text-main);
}

.subtitle {
  margin-top: 0.6rem;
  font-size: 0.98rem;
  color: var(--text-sub);
}

.site-domain {
  display: inline-block;
  margin-left: 0.2rem;
  font-weight: 600;
  color: var(--google-blue);
  word-break: break-all;
}

.notice {
  margin-top: var(--space-4);
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text-sub);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-align: left;
}

.notice strong {
  color: #d93025; /* Material 错误红，仅用于强调警示 */
  font-weight: 600;
}

/* ---- Material 复选框 ---- */
.remember {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: var(--space-4);
  padding: 0.35rem 0;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
  width: 100%;
}

.remember-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.remember-box {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 2px;
  border: 2px solid var(--border);
  background: var(--bg);
  position: relative;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.remember-input:checked + .remember-box {
  border-color: var(--google-blue);
  background: var(--google-blue);
}

.remember-input:checked + .remember-box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.remember-input:focus-visible + .remember-box {
  outline: 2px solid var(--google-blue-focus);
  outline-offset: 2px;
}

.remember-label {
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.5;
}

/* ---- Material 按钮 ---- */
.actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: var(--space-6);
}

.cta,
.btn-leave {
  width: 100%;
  min-height: 46px;
  padding: 0 var(--space-6);
  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--radius);
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.cta {
  color: #fff;
  background: var(--google-blue);
  border: 1px solid transparent;
  box-shadow: var(--shadow-1);
}

.cta:hover {
  background: var(--google-blue-hover);
  box-shadow: var(--shadow-2);
}

.cta:active {
  background: var(--google-blue-focus);
  box-shadow: var(--shadow-1);
}

.cta:focus-visible {
  outline: 2px solid var(--google-blue-focus);
  outline-offset: 2px;
}

.cta[disabled] {
  opacity: 0.7;
  cursor: default;
}

.btn-leave {
  color: var(--google-blue);
  background: transparent;
  border: 1px solid transparent;
}

.btn-leave:hover {
  background: rgba(26, 115, 232, 0.06);
}

.btn-leave:focus-visible {
  outline: 2px solid var(--google-blue-focus);
  outline-offset: 2px;
}

.hint {
  margin-top: var(--space-4);
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* ---- 离开后的遮罩 ---- */
.blocked {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--bg);
  text-align: center;
}

.blocked.show {
  display: flex;
}

.blocked-inner {
  max-width: 380px;
}

.blocked h2 {
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.blocked p {
  font-size: 0.95rem;
  color: var(--text-sub);
  line-height: 1.8;
}

/* ---- 页脚 ---- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--space-6) var(--space-4);
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* ============================================================
   缓冲加载等待页（年龄确认后的 10 秒加载缓冲）
   ============================================================ */
.loading-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  background: var(--bg);
  text-align: center;
}

.loading-gate.show {
  display: flex;
}

.loading-inner {
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Material 圆形加载指示器 */
.loading-spinner {
  width: 52px;
  height: 52px;
  margin-bottom: var(--space-8);
  border-radius: 50%;
  border: 3px solid rgba(26, 115, 232, 0.2);
  border-top-color: var(--google-blue);
  animation: material-spin 0.85s linear infinite;
}

.loading-title {
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.loading-notice {
  margin-top: var(--space-4);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.8;
  color: var(--text-sub);
}

/* Material 线性进度条 */
.loading-progress {
  width: 100%;
  max-width: 360px;
  height: 4px;
  margin-top: var(--space-6);
  border-radius: 999px;
  background: var(--divider);
  overflow: hidden;
}

.loading-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: var(--google-blue);
  transition: none; /* 宽度由 JS 逐帧更新，保持平滑 */
}

.loading-status {
  width: 100%;
  max-width: 360px;
  margin-top: var(--space-2);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.loading-hint {
  color: var(--text-faint);
  margin-top: var(--space-6);
  max-width: 360px;
}

/* ============================================================
   动画
   ============================================================ */
@keyframes material-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   平板 / 桌面
   ============================================================ */
@media (min-width: 640px) {
  .hamburger {
    display: none;
  }

  .mobile-menu {
    display: none;
  }

  .title {
    font-size: 1.75rem;
  }

  .actions {
    flex-direction: row;
  }

  .cta,
  .btn-leave {
    flex: 1;
  }
}

/* ============================================================
   可访问性：尊重系统减弱动效偏好
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation: none !important;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}