/**
 * ============================================
 * 蛋黄 AI 社交平台 - 公共样式表 (Common Stylesheet)
 * ============================================
 * 【文件说明】本文件包含两页面共用的公共样式
 * 【包含模块】
 *   1. CSS 变量定义
 *   2. 基础重置样式
 *   3. 导航栏样式
 *   4. 按钮组件样式
 *   5. Toast 提示
 *   6. 通用模态框
 *   7. 通用表单样式
 *   8. 通用动画
 * ============================================
 */


/* ============================================
   1. CSS 变量定义 (CSS Variables)
   ============================================ */
:root {
  /* 主要颜色变量 */
  --cream: #FFF8F0;                    /* 奶油色- 主背景*/
  --warm-orange: #FF8A3A;              /* 暖橙色- 主色调*/
  --warm-orange-hover: #E67E22;        /* 暖橙色悬停色*/
  --warm-orange-light: #FFB37D;        /* 暖橙色浅色*/
  --warm-yellow: #FFD166;              /* 暖黄色- 辅助色*/
  --warm-yellow-light: #FFE4A0;        /* 暖黄色浅色*/
  
  /* 文字颜色变量 */
  --dark: #2D2A26;                     /* 深色 - 主文字*/
  --dark-light: #4A4640;               /* 中深色- 次要文字 */
  --text-secondary: #8A8580;            /* 灰色 - 辅助文字 */
  
  /* 功能颜色变量 */
  --error: #EF4444;                    /* 错误/危险 */
  --success: #4CAF50;                /* 成功/确认 */
  
  /* 视觉特效变量 */
  --glass-bg: rgba(255, 248, 240, 0.7);        /* 玻璃态背景*/
  --card-bg: rgba(255, 255, 255, 0.6);         /* 卡片背景 */
  --shadow-soft: 0 8px 32px rgba(255, 140, 66, 0.08);  /* 柔和阴影 */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.06); /* 卡片阴影 */
  
  /* 圆角变量 */
  --radius-lg: 24px;   /* 大圆角*/
  --radius-md: 16px;   /* 中圆角*/
  --radius-sm: 12px;   /* 小圆角*/
  --radius-full: 9999px;  /* 全圆角*/
  
  /* ============================================
     全局缩放控制变量 - 修改这些值可调整页面大小
     ============================================ */
  --content-scale: 1.1;            /* 内容整体缩放比例（按钮、卡片等） */
  --font-scale: 1.15;              /* 字体缩放比例 */
  --spacing-scale: 0.95;           /* 间距缩放比例（越小越紧凑） */
  --container-max-width: 1400px;   /* 容器最大宽度 */
}

/* ============================================
   高分辨率屏幕响应式缩放降级
   ============================================ */
@media (min-width: 1920px) {
  :root {
    --content-scale: 1.0;
    --font-scale: 1.05;
    --spacing-scale: 0.9;
  }
}

@media (min-width: 2560px) {
  :root {
    --content-scale: 0.95;
    --font-scale: 1.0;
    --spacing-scale: 0.85;
  }
}

/* 小高度视口强制紧凑 */
@media (max-height: 700px) {
  :root {
    --spacing-scale: 0.8;
  }
}

/* ============================================
   2. CSS RESET & BASE (基础重置样式)
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --cream: #FFF8F0;
  --warm-orange: #FF8A3A;
  --warm-orange-hover: #E67E22;
  --warm-orange-light: #FFB37D;
  --warm-yellow: #FFD166;
  --warm-yellow-light: #FFE4A0;
  --dark: #2D2A26;
  --dark-light: #4A4640;
  --text-secondary: #8A8580;
  --error: #EF4444;
  --success: #4CAF50;
  --glass-bg: rgba(255, 248, 240, 0.7);
  --card-bg: rgba(255, 255, 255, 0.6);
  --shadow-soft: 0 8px 32px rgba(255, 140, 66, 0.08);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.06);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-full: 9999px;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--cream);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.08;
  background-image: 
    radial-gradient(circle at 10% 20%, var(--warm-orange) 1px, transparent 1px),
    radial-gradient(circle at 90% 80%, var(--warm-orange) 1px, transparent 1px),
    radial-gradient(circle at 40% 60%, var(--warm-yellow) 1px, transparent 1px),
    linear-gradient(90deg, transparent 49%, var(--warm-orange) 49%, var(--warm-orange) 51%, transparent 51%),
    linear-gradient(0deg, transparent 49%, var(--warm-yellow) 49%, var(--warm-yellow) 51%, transparent 51%);
  background-size: 300px 300px, 400px 400px, 500px 500px, 60px 60px, 60px 60px;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--warm-orange-light); border-radius: 3px; }

/* ============================================
   3. NAVIGATION (导航栏样式
   ============================================
   【组件说明】 固定顶部导航栏
   【交互效果】 滚动时背景模糊、高度变化
   【包含模块】
     - Logo 区域
     - 导航链接
     - 登录按钮
     - 移动端菜单按钮
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 20px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav.scrolled {
  background: rgba(255, 248, 240, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 48px;
  box-shadow: 0 1px 20px rgba(255, 140, 66, 0.06);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--dark);
}

.nav-logo-icon {
  width: calc(40px * var(--content-scale));
  height: calc(40px * var(--content-scale));
  background: linear-gradient(135deg, var(--warm-orange), var(--warm-yellow));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(20px * var(--content-scale));
  box-shadow: 0 4px 16px rgba(255, 140, 66, 0.3);
  position: relative;
  overflow: hidden;
}

.nav-logo-icon::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 18px;
  height: 18px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
}

.nav-logo-text {
  font-size: calc(22px * var(--font-scale));
  font-weight: 700;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: calc(36px * var(--spacing-scale));
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--dark-light);
  font-size: calc(15px * var(--font-scale));
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--warm-orange);
  border-radius: 1px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links a:hover { color: var(--warm-orange); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  background: var(--dark) !important;
  color: var(--cream) !important;
  padding: calc(10px * var(--content-scale)) calc(24px * var(--content-scale));
  border-radius: var(--radius-full);
  font-size: calc(14px * var(--font-scale)) !important;
  font-weight: 600 !important;
  transition: transform 0.3s, box-shadow 0.3s !important;
}

.nav-cta:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(45, 42, 38, 0.2) !important;
}

.nav-cta::after { display: none !important; }

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.mobile-menu-btn span {
  width: 24px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ============================================
   4. BUTTONS (按钮组件样式)
   ============================================
   【组件说明】 统一按钮样式系统
   【按钮类型】
     - .btn-primary: 主按钮（渐变橙色）
     - .btn-secondary: 次要按钮（透明边框）
     - .btn-dark: 深色按钮
   【交互效果】 悬停上浮、点击缩放
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: calc(8px * var(--content-scale));
  padding: calc(16px * var(--content-scale)) calc(32px * var(--content-scale));
  border-radius: var(--radius-full);
  font-size: calc(16px * var(--font-scale));
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--warm-orange), #FF6B2C);
  color: white;
  box-shadow: 0 4px 20px rgba(255, 140, 66, 0.35);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 32px rgba(255, 138, 58, 0.45);
}

.btn-primary:active {
  transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--dark);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 140, 66, 0.2);
}

.btn-secondary:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--warm-orange);
  box-shadow: var(--shadow-soft);
}

.btn-secondary:active {
  transform: translateY(-1px) scale(0.98);
}

.btn-dark {
  background: var(--dark);
  color: var(--cream);
  box-shadow: 0 4px 20px rgba(45, 42, 38, 0.2);
}

.btn-dark:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 32px rgba(45, 42, 38, 0.3);
}

.btn-dark:active {
  transform: translateY(-1px) scale(0.98);
}

/* Touch optimization for mobile */
.btn, .nav-cta, .orbit-icon, .timeline-item, .landmark, .envelope-icon, .login-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-icon {
  font-size: 18px;
  transition: transform 0.3s;
}

.btn:hover .btn-icon {
  transform: translateX(3px);
}

/* ============================================
   14. TOAST NOTIFICATION (消息提示组件)
   ============================================
   【组件说明】 操作反馈消息提示
   【提示类型】 success(绿色) / error(红色) / default(深色)
   ============================================ */

/* Top Toast Notification - 顶部提示 */
.top-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 14px 32px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 500;
  z-index: 3001;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.top-toast.success {
  background: linear-gradient(135deg, #4CAF50, #66BB6A);
  color: white;
}

.top-toast.error {
  background: linear-gradient(135deg, #EF4444, #F87171);
  color: white;
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--dark);
  color: var(--cream);
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 500;
  z-index: 3000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  background: linear-gradient(135deg, #4CAF50, #66BB6A);
}

.toast.error {
  background: linear-gradient(135deg, #EF4444, #F87171);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--dark);
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid rgba(255, 138, 58, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  transition: all 0.3s;
  outline: none;
}

.form-input:focus {
  border-color: var(--warm-orange);
  box-shadow: 0 0 0 4px rgba(255, 138, 58, 0.1);
}

.form-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-input.success {
  border-color: var(--success);
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

.form-error {
  font-size: 13px;
  color: var(--error);
  margin-top: 6px;
  display: none;
}

.form-remember {
  margin-bottom: 16px;
}

.form-remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--dark-light);
}

.form-remember-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--warm-orange);
}

.form-error.show {
  display: block;
}

/* ============================================
   验证码输入框样式
   ============================================ */
.verify-code-input {
  display: flex;
  gap: 10px;
}

.verify-code-input .form-input {
  flex: 1;
}

.verify-code-btn {
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--warm-orange), var(--dark-orange));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
  min-width: 100px;
}

.verify-code-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 138, 58, 0.3);
}

.verify-code-btn:disabled {
  background: linear-gradient(135deg, #ccc, #999);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================
   通用动画
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ============================================
   AI社交 动画图标
   ============================================ */
.ai-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 4px;
  position: relative;
}

.ai-social-icon::before,
.ai-social-icon::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  animation: aiSocialBounce 1.5s ease-in-out infinite;
}

/* 第一个蛋黄 */
.ai-social-icon::before {
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, var(--warm-orange), var(--warm-yellow));
  left: 1px;
  animation-delay: 0s;
  box-shadow: 0 1px 3px rgba(255, 138, 58, 0.3);
}

/* 第二个蛋黄 */
.ai-social-icon::after {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--warm-yellow), #FFE4A0);
  right: 1px;
  animation-delay: 0.3s;
  box-shadow: 0 1px 3px rgba(255, 209, 102, 0.3);
}

/* 连接线 */
.ai-social-icon .connection-line {
  position: absolute;
  width: 6px;
  height: 2px;
  background: linear-gradient(90deg, var(--warm-orange), var(--warm-yellow));
  border-radius: 1px;
  animation: aiSocialConnect 1.5s ease-in-out infinite;
  opacity: 0.6;
}

@keyframes aiSocialBounce {
  0%, 100% { 
    transform: translateY(0) scale(1);
  }
  25% { 
    transform: translateY(-3px) scale(1.05);
  }
  50% { 
    transform: translateY(0) scale(1);
  }
  75% { 
    transform: translateY(2px) scale(0.95);
  }
}

@keyframes aiSocialConnect {
  0%, 100% { 
    opacity: 0.3;
    transform: scaleX(0.8);
  }
  50% { 
    opacity: 0.8;
    transform: scaleX(1.2);
  }
}

/* 大尺寸的AI社交图标（用于页面标题） */
.ai-social-icon-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  vertical-align: middle;
  margin-right: 12px;
  position: relative;
}

.ai-social-icon-large::before,
.ai-social-icon-large::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  animation: aiSocialBounceLarge 1.8s ease-in-out infinite;
}

.ai-social-icon-large::before {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--warm-orange), var(--warm-yellow));
  left: 2px;
  animation-delay: 0s;
  box-shadow: 0 2px 8px rgba(255, 138, 58, 0.4);
}

.ai-social-icon-large::after {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--warm-yellow), #FFE4A0);
  right: 2px;
  animation-delay: 0.4s;
  box-shadow: 0 2px 8px rgba(255, 209, 102, 0.4);
}

.ai-social-icon-large .connection-line {
  position: absolute;
  width: 16px;
  height: 4px;
  background: linear-gradient(90deg, var(--warm-orange), var(--warm-yellow));
  border-radius: 2px;
  animation: aiSocialConnectLarge 1.8s ease-in-out infinite;
  opacity: 0.6;
}

@keyframes aiSocialBounceLarge {
  0%, 100% { 
    transform: translateY(0) scale(1);
  }
  25% { 
    transform: translateY(-6px) scale(1.08);
  }
  50% { 
    transform: translateY(0) scale(1);
  }
  75% { 
    transform: translateY(4px) scale(0.95);
  }
}

@keyframes aiSocialConnectLarge {
  0%, 100% { 
    opacity: 0.4;
    transform: scaleX(0.8);
  }
  50% { 
    opacity: 0.9;
    transform: scaleX(1.3);
  }
}

/* ============================================
   AI知己 动画图标
   ============================================ */
.ai-zhiji-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 4px;
  position: relative;
}

.ai-zhiji-icon::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--warm-orange), var(--warm-yellow));
  animation: aiZhijiBounce 1.2s ease-in-out infinite;
  box-shadow: 0 2px 6px rgba(255, 138, 58, 0.4);
}

/* 内圈高光 */
.ai-zhiji-icon::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  top: 3px;
  left: 4px;
  animation: aiZhijiBounce 1.2s ease-in-out infinite;
}

@keyframes aiZhijiBounce {
  0%, 100% { 
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 6px rgba(255, 138, 58, 0.4);
  }
  50% { 
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 4px 10px rgba(255, 138, 58, 0.5);
  }
}

/* 大尺寸的AI知己图标 */
.ai-zhiji-icon-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  vertical-align: middle;
  margin-right: 10px;
  position: relative;
}

.ai-zhiji-icon-large::before {
  content: '';
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--warm-orange), var(--warm-yellow));
  animation: aiZhijiBounceLarge 1.5s ease-in-out infinite;
  box-shadow: 0 3px 12px rgba(255, 138, 58, 0.35);
}

.ai-zhiji-icon-large::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  top: 6px;
  left: 8px;
  animation: aiZhijiBounceLarge 1.5s ease-in-out infinite;
}

@keyframes aiZhijiBounceLarge {
  0%, 100% { 
    transform: translateY(0) scale(1);
    box-shadow: 0 3px 12px rgba(255, 138, 58, 0.35);
  }
  50% { 
    transform: translateY(-8px) scale(1.08);
    box-shadow: 0 6px 18px rgba(255, 138, 58, 0.45);
  }
}

/* ============================================
   通用模态框 (Modal)
   ============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--cream);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: min(600px, 85svh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  animation: modalIn 0.4s ease;
}

@media (max-height: 700px) {
  .modal-overlay {
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  
  .modal {
    max-height: calc(100svh - 24px);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 140, 66, 0.1);
  background: white;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  width: 36px;
  height: 36px;
  background: rgba(255, 140, 66, 0.1);
  border: none;
  border-radius: 50%;
  font-size: 20px;
  color: var(--dark-light);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--warm-orange);
  color: white;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 140, 66, 0.1);
  background: white;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
