/* HAITUO LIFE 共享样式 - 导航结构 | v=20260414 */

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

:root {
  --blue: #0071E3;
  --blue-light: #EBF5FF;
  --purple: #5856D6;
  --purple-light: #F3EEFF;
  --green: #34C759;
  --green-light: #ECFDF5;
  --orange: #FF9500;
  --orange-light: #FFF3E0;
  --red: #e54d4d;
  --red-light: #FFF0F0;
  --teal: #14897A;
  --teal-light: #e8f8f6;
  --pink: #ec4899;
  --pink-light: #fdf2f8;
  --bg: #FFFFFF;
  --bg2: #F5F5F7;
  --bg3: #FAFAFA;
  --text: #1D1D1F;
  --text-sub: #6E6E73;
  --text-tertiary: #86868b;
  --border: #D2D2D7;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  min-width: 320px;
}

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

/* ── 导航栏 ── */
.topnav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 60px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.topnav-logo {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: linear-gradient(150deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}

.brand-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.brand-name em {
  font-style: normal;
}

.brand-sub {
  font-size: 0.55rem;
  color: var(--text-tertiary);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}

/* 导航链接 */
.topnav-links {
  display: flex;
  gap: 36px;
}

/* 搜索图标 — 绝对定位在 topnav 最右侧，不影响链接位置 */
.topnav-search-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-tertiary);
  border-radius: 8px;
  transition: color 0.2s, background 0.15s;
  z-index: 10;
}
.topnav-search-btn:hover {
  color: var(--text);
  background: rgba(0,0,0,0.05);
}
.topnav-search-btn svg {
  width: 16px;
  height: 16px;
}

.topnav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

.topnav-links a:hover {
  color: var(--text);
}

.topnav-links a.active {
  color: var(--blue);
}

.topnav-links .nav-zh {
  font-size: 13px;
  font-weight: 500;
}

.topnav-links .nav-en {
  font-size: 10px;
  color: var(--text-tertiary);
  opacity: 0.7;
  margin-top: 1px;
}

.topnav-links a:hover .nav-en {
  opacity: 1;
}

.topnav-links a.active .nav-en {
  color: var(--blue);
  opacity: 0.85;
}

/* 汉堡菜单 */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s;
}

.hamburger:hover {
  background: rgba(0,0,0,0.05);
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 移动端菜单 */
.mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 99;
  padding: 24px 20px;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.2s;
}

.mobile-menu a:hover {
  background: var(--bg2);
}

.mobile-menu a.active {
  color: var(--blue);
  background: var(--blue-light);
}

.mobile-menu .nav-zh {
  font-size: 16px;
  font-weight: 500;
}

.mobile-menu .nav-en {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* 动画 */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式 */
@media (max-width: 768px) {
  .topnav {
    padding: 0 20px;
  }

  .topnav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-menu {
    padding: 16px 20px;
  }
}

/* ── 付费墙内容隐藏 ── */
/* 必须在 CSS 中定义，防止 JS 注入前内容闪烁 */
[data-paywall-content] { display: none; }
[data-paywall-content].unlocked { display: block; }

/* ── Footer 账号链接 ── */
.footer-account-link { color: var(--text-sub); text-decoration: none; transition: color 0.2s, opacity 0.2s; }
.footer-account-link:hover { color: var(--blue); opacity: 0.85; }
.footer-account-link:active { opacity: 0.5; }
