/* ============================================
   私密资源导航 — 全局样式
   Dark Mode · 响应式 · 移动端优先
   ============================================ */

/* --- CSS 变量 --- */
:root {
  --bg-primary: #121212;
  --bg-card: #1e1e1e;
  --bg-card-hover: #252525;
  --bg-elevated: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --text-muted: #707070;
  --gradient-btn: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
  --gradient-btn-alt: linear-gradient(135deg, #1e3a8a 0%, #9333ea 100%);
  --gradient-glow: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(219, 39, 119, 0.4));
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(124, 58, 237, 0.35);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-btn: 0 4px 16px rgba(124, 58, 237, 0.35);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- 重置与基础 --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

main {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* --- 背景装饰：渐变光晕 + 噪点纹理 --- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
  radial-gradient(ellipse 80% 60% at 20% 10%, rgba(124, 58, 237, 0.12) 0%, transparent 60%),
  radial-gradient(ellipse 60% 50% at 80% 80%, rgba(219, 39, 119, 0.1) 0%, transparent 55%),
  radial-gradient(ellipse 50% 40% at 50% 50%, rgba(30, 58, 138, 0.08) 0%, transparent 50%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* --- 抽象几何装饰 --- */
.bg-shapes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-shapes .shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}

.bg-shapes .shape-1 {
  width: 400px;
  height: 400px;
  background: #7c3aed;
  top: -100px;
  right: -100px;
}

.bg-shapes .shape-2 {
  width: 300px;
  height: 300px;
  background: #db2777;
  bottom: 10%;
  left: -80px;
}

.bg-shapes .shape-3 {
  width: 200px;
  height: 200px;
  background: #1e3a8a;
  top: 40%;
  right: 20%;
}

/* --- 主容器（mobile-first） --- */
.page-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 40px;
  box-sizing: border-box;
}

@media (min-width: 641px) {
  .page-wrapper {
    padding: 56px 20px 48px;
  }
}

/* ============================================
   语言切换器
   ============================================ */
.language-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 20px;
  padding: 6px;
  box-sizing: border-box;
}

.lang-btn {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(30, 30, 30, 0.75);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.lang-btn.active {
  background: var(--gradient-btn);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.45);
}

@media (hover: hover) and (pointer: fine) {
  .lang-btn:hover:not(.active) {
    color: var(--text-primary);
    border-color: var(--border-glow);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.25);
  }
}

/* PC 端：右上角定位 */
@media (min-width: 641px) {
  .language-switcher {
    position: absolute;
    top: 16px;
    right: 20px;
    left: auto;
    width: auto;
    max-width: calc(100% - 40px);
    margin: 0;
    justify-content: flex-end;
    padding: 4px;
  }
}

@media (max-width: 640px) {
  .language-switcher {
    margin: 16px auto 20px;
    padding: 6px;
  }

  .lang-btn {
    font-size: 13px;
    min-height: 36px;
    padding: 7px 10px;
  }

  .hero {
    padding-top: 0;
  }
}

/* ============================================
   年龄验证遮罩层
   ============================================ */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.97);
  padding: 24px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.age-gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.age-gate__content {
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .age-gate {
    padding: 16px;
  }

  .age-gate__content {
    max-width: calc(100% - 32px);
  }

  .age-gate__icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
  }

  .age-gate__warning {
    font-size: 1rem;
    margin-bottom: 24px;
    padding: 0 4px;
    word-break: break-word;
  }

  .age-gate__actions .btn {
    width: 100%;
    min-height: 48px;
  }
}

.age-gate__icon {
  font-size: 3rem;
  margin-bottom: 20px;
  display: block;
  filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.5));
}

.age-gate__warning {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 32px;
  line-height: 1.7;
  padding: 0 8px;
}

.age-gate__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================
   按钮通用样式
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    filter var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn--primary {
  background: var(--gradient-btn);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.btn--primary:active {
  filter: brightness(1.05);
}

.btn--secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn--secondary:active {
  color: var(--text-primary);
}

.btn--card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--gradient-btn-alt);
  color: #fff;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.4);
  text-align: center;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ============================================
   Hero 区域
   ============================================ */
.hero {
  text-align: center;
  padding: 56px 0 40px;
}

.hero__badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c4b5fd;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  margin-bottom: 20px;
}

.hero__title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 50%, #f9a8d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.hero__subtitle {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 16px;
  line-height: 1.7;
}

.hero__notice {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}

/* ============================================
   卡片网格（mobile-first）
   ============================================ */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  margin-bottom: 40px;
  box-sizing: border-box;
}

/* 平板端：双列 */
@media (min-width: 641px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 48px;
  }
}

/* PC 端：四列 */
@media (min-width: 1025px) {
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

/* --- 单个卡片：玻璃拟态 + 霓虹边框 --- */
.card {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: rgba(30, 30, 30, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius-lg) + 1px);
  background: var(--gradient-glow);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--transition);
}

/* hover 效果仅在有精确指针的设备上启用（保留 PC 端体验） */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    background: rgba(37, 37, 37, 0.85);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(124, 58, 237, 0.1);
  }

  .card:hover::before {
    opacity: 0.5;
  }

  .btn--primary:hover,
  .btn--primary:focus-visible {
    transform: scale(1.04);
    box-shadow: 0 6px 28px rgba(124, 58, 237, 0.55), 0 0 40px rgba(219, 39, 119, 0.25);
    filter: brightness(1.08);
  }

  .btn--secondary:hover,
  .btn--secondary:focus-visible {
    transform: scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }

  .btn--card:hover,
  .btn--card:focus-visible {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(147, 51, 234, 0.5), 0 0 30px rgba(124, 58, 237, 0.2);
    filter: brightness(1.1);
  }

  .pikpak-link:hover {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(168, 85, 247, 0.8);
    text-decoration: underline;
  }
}

.card__icon {
  font-size: 1.75rem;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(124, 58, 237, 0.3));
}

.card__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.card__desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex-grow: 1;
  overflow-wrap: anywhere;
}

.card__action {
  margin-top: 4px;
  width: 100%;
  min-width: 0;
}

/* ============================================
   底部 PikPak 推荐区域
   ============================================ */
.pikpak-promo {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  text-align: center;
  overflow: hidden;
  box-sizing: border-box;
}

/* 轻微渐变边框发光 */
.pikpak-promo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(219, 39, 119, 0.3), rgba(30, 58, 138, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.pikpak-promo__text {
  font-size: clamp(0.85rem, 2.2vw, 0.95rem);
  color: var(--text-secondary);
  line-height: 1.75;
  position: relative;
  z-index: 1;
}

.pikpak-link {
  color: #c4a6ff;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.25s ease, text-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  word-break: keep-all;
}

/* --- 页脚 --- */
.footer {
  width: 100%;
  max-width: 100%;
  text-align: center;
  padding: 32px 0 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  box-sizing: border-box;
}

/* ============================================
   手机端专项优化（≤640px）
   ============================================ */
@media (max-width: 640px) {
  .bg-shapes .shape-1 {
    width: 280px;
    height: 280px;
    right: -60px;
  }

  .bg-shapes .shape-2 {
    width: 220px;
    height: 220px;
    left: -60px;
  }

  .hero {
    padding: 48px 0 32px;
  }

  .hero__badge {
    margin-bottom: 14px;
    font-size: 0.7rem;
  }

  .hero__title {
    font-size: clamp(34px, 10vw, 44px);
    line-height: 1.15;
    word-break: keep-all;
  }

  .hero__subtitle {
    font-size: 15px;
    line-height: 1.7;
    padding: 0 4px;
  }

  .hero__notice {
    font-size: 13px;
    line-height: 1.6;
    padding: 0 4px;
  }

  .card {
    padding: 22px 18px;
  }

  .card__title {
    font-size: 1.375rem; /* 22px */
    line-height: 1.3;
  }

  .card__desc {
    font-size: 0.9375rem; /* 15px */
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .btn--card {
    min-height: 52px;
    font-size: 0.875rem;
    padding: 14px 16px;
    line-height: 1.35;
  }

  .pikpak-promo {
    padding: 18px 20px;
    margin: 0 0 24px;
  }

  .pikpak-promo__text {
    font-size: 14px;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }

  .footer {
    padding: 24px 0 12px;
    font-size: 0.7rem;
    padding-left: 4px;
    padding-right: 4px;
  }
}

/* ============================================
   无障碍 & 动画偏好
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 3px;
}
