/* Sun Team Design System - 统一UI变量 */

/* ========== 字体系统 ========== */
:root {
  --font-display: 'DM Sans', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

/* ========== 核心颜色 - 统一调色板 ========== */
:root {
  /* 背景色 - 浅色纸张风格，类似Voxyz */
  --bg-primary: #f5f2eb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e8e4dc;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  
  /* 文字色 - 适配浅色背景 */
  --text-primary: #1a1a1a;
  --text-secondary: #5a5a5a;
  --text-muted: #8a8a8a;
  
  /* 强调色 - 统一命名 */
  --accent-orange: #ff9500;    /* 太阳橙 - 主品牌色 */
  --accent-pink: #ff2d55;       /* 玫瑰粉 - 辅助色 */
  --accent-blue: #0071e3;       /* 科技蓝 */
  --accent-purple: #875af9;     /* 神秘紫 */
  --accent-green: #34c759;      /* 成功绿 */
  --accent-cyan: #32d3eb;      /* 青色 - 办公室专用 */
  
  /* 渐变色 */
  --gradient-brand: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
  --gradient-hero: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-orange) 50%, var(--accent-pink) 100%);
  
  /* 边框 - 适配浅色背景 */
  --border-color: #d0ccc4;
  --border-light: #e8e4dc;
  
  /* 阴影 - 适配浅色背景 */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-hover: 0 12px 32px rgba(255, 149, 0, 0.12);
}

/* 浅色主题 */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #e5e5e7;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #aeaeb2;
  
  --border-color: #d2d2d7;
  --border-light: #e5e5e7;
  
  --shadow-card: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-hover: 0 12px 32px rgba(255, 149, 0, 0.15);
}

/* 深色主题 - 与Voxyz风格一致 */
[data-theme="dark"] {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1c1c1e;
  --bg-tertiary: #2c2c2e;
  --bg-card: #1c1c1e;
  --bg-card-hover: #242426;
  
  --text-primary: #f5f5f7;
  --text-secondary: #98989d;
  --text-muted: #636366;
  
  --border-color: #38383a;
  --border-light: #2c2c2e;
  
  --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-hover: 0 12px 32px rgba(255, 149, 0, 0.15);
}

/* 深色页面默认样式 - 不使用data-theme属性 */
.dark-page {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1c1c1e;
  --bg-tertiary: #2c2c2e;
  --bg-card: #1c1c1e;
  --bg-card-hover: #242426;
  
  --text-primary: #f5f5f7;
  --text-secondary: #98989d;
  --text-muted: #636366;
  
  --border-color: #38383a;
  --border-light: #2c2c2e;
  
  --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-hover: 0 12px 32px rgba(255, 149, 0, 0.15);
}

/* ========== Agent 颜色映射 ========== */
:root {
  /* 团队成员品牌色 */
  --agent-taiyang: #ff9500;    /* 太阳 - 橙 */
  --agent-xunyu: #0071e3;      /* 荀彧 - 蓝 */
  --agent-guanzhong: #34c759;  /* 管仲 - 绿 */
  --agent-fanyong: #875af9;    /* 范雍 - 紫 */
  --agent-zhangliang: #ffcc00; /* 张良 - 金 */
  --agent-xiaohe: #636366;     /* 萧何 - 灰 */
}

/* ========== 通用样式重置 ========== */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body {
  font-family: var(--font-display);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ========== 通用组件样式 ========== */

/* 按钮基础 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-brand);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-hover);
}

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

.btn-signin {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.2s;
}

.btn-signin:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-secondary);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

/* 主题切换按钮 */
.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
}

/* 汉堡菜单按钮 - 默认隐藏 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* 导航遮罩层 */
.nav-overlay {
  display: none;
}

/* 桌面版导航 - 基础样式 */
.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  position: static;
  width: auto;
  height: auto;
  background: none;
  border: none;
  padding: 0;
}

/* 桌面版 - 隐藏汉堡菜单 */
@media (min-width: 769px) {
  .nav-toggle {
    display: none !important;
  }
  
  .nav {
    display: flex !important;
    right: auto !important;
  }
}

/* 移动端 - 显示汉堡菜单 */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex !important;
  }
  
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    gap: 0;
    padding: 80px 24px 24px;
    transition: right 0.3s ease;
    border-left: 1px solid var(--border-color);
    z-index: 100;
  }
  
  .nav.active {
    right: 0;
  }
  
  .nav a {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 16px;
  }
}

/* 卡片基础 */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-orange);
  box-shadow: var(--shadow-hover);
}

/* Live 徽章 */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(52, 199, 89, 0.15);
  border: 1px solid rgba(52, 199, 89, 0.3);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-green);
}

.live-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Live刷新倒计时 */
.live-refresh-info {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.live-refresh-info #refresh-countdown {
  font-weight: 600;
  color: var(--accent-green);
  min-width: 16px;
  text-align: center;
}

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}

@keyframes gradientMove {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* ========== 响应式断点 ========== */
@media (max-width: 1024px) {
  :root {
    font-size: 15px;
  }
}

@media (max-width: 768px) {
  :root {
    font-size: 16px;
  }
  
  body {
    -webkit-text-size-adjust: 100%;
  }
  
  /* ===== 移动端导航 ===== */
  .header-inner {
    padding: 0 16px;
    height: 56px;
  }
  
  .logo {
    font-size: 18px;
  }
  
  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  
  /* 汉堡菜单按钮 */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    z-index: 101;
  }
  
  .nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
  }
  
  .nav-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  
  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  
  /* 移动端导航菜单 */
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    gap: 0;
    padding: 80px 24px 24px;
    transition: right 0.3s ease;
    border-left: 1px solid var(--border-color);
    z-index: 100;
  }
  
  .nav.active {
    right: 0;
  }
  
  .nav a {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 16px;
  }
  
  /* 遮罩层 */
  .nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
  }
  
  .nav-overlay.active {
    display: block;
  }
  
  /* ===== 移动端主内容 ===== */
  main {
    padding: 40px 16px;
  }
  
  /* Hero 按钮组 */
  .hero .cta-buttons {
    flex-direction: column;
    gap: 12px;
    padding: 0 8px;
    align-items: stretch;
  }
  
  .hero .cta-buttons .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }
  
  /* Start Here 快速入门区域 */
  .start-here {
    margin-top: 60px;
    padding: 32px;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
  }
  
  .start-here-header {
    text-align: center;
    margin-bottom: 24px;
  }
  
  .start-badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 12px;
  }
  
  .start-here-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
  }
  
  .start-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .start-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
  }
  
  .start-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-orange);
    box-shadow: 0 8px 20px rgba(255, 149, 0, 0.15);
  }
  
  .start-icon {
    font-size: 24px;
    flex-shrink: 0;
  }
  
  .start-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  
  .start-content strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
  }
  
  .start-content span {
    font-size: 12px;
    color: var(--text-secondary);
  }
  
  .start-arrow {
    font-size: 18px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
  }
  
  .start-card:hover .start-arrow {
    transform: translateX(4px);
    color: var(--accent-orange);
  }
  
  @media (max-width: 640px) {
    .start-cards {
      grid-template-columns: 1fr;
    }
    
    .start-here {
      margin-top: 40px;
      padding: 24px 16px;
    }
  }
  
  /* 功能卡片 */
  .feature-card {
    padding: 20px !important;
    border-radius: 12px !important;
  }
  
  .feature-card h3 {
    font-size: 1.1rem !important;
  }
  
  .feature-card p {
    font-size: 0.9rem !important;
  }
  
  /* Agent 网格 */
  .agents-grid {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
  }
  
  .agents-grid > div {
    padding: 16px;
  }
  
  /* Office链接按钮 */
  .office-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.1), rgba(255, 45, 85, 0.05));
    border: 1px solid rgba(255, 149, 0, 0.3);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
  }
  
  .office-link-btn:hover {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.2), rgba(255, 45, 85, 0.1));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 149, 0, 0.2);
  }
  
  .office-icon {
    font-size: 20px;
  }
  
  .office-text {
    font-size: 15px;
  }
  
  /* 模型提供商网格 */
  .model-providers-grid {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
  }
  
  .model-provider-card {
    padding: 16px !important;
  }
  
  /* Live Feed 网格 */
  .agents-live-grid {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
  }
  
  /* 评价卡片网格 */
  .reviews-grid {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
  }
  
  .review-card {
    padding: 16px !important;
  }
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }
  
  /* ===== 移动端网格布局 ===== */
  .grid {
    display: flex !important;
    flex-direction: column;
    gap: 16px;
  }
  
  .grid-2, .grid-3, .grid-4, .grid-6 {
    grid-template-columns: 1fr;
  }
  
  /* 卡片移动端 */
  .card {
    padding: 20px;
    border-radius: 12px;
  }
  
  .card h3 {
    font-size: 1.1rem;
  }
  
  .card p {
    font-size: 0.9rem;
  }
  
  /* Agent 卡片 */
  .agent-card, .agents-grid > div {
    padding: 16px;
  }
  
  .agent-card .agent-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  /* 统计数据 */
  .stats {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }
  
  .stat-item {
    padding: 16px 12px;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  /* Live Feed */
  .live-feed {
    margin: 0 -16px;
    padding: 20px 16px;
    border-radius: 0;
  }
  
  .live-feed .feed-item {
    padding: 12px;
  }
  
  /* 用户评价 */
  .testimonials {
    flex-direction: column;
  }
  
  .testimonial-card {
    padding: 16px;
  }
  
  /* 服务和产品卡片 */
  .services-grid, .products-grid {
    display: flex !important;
    flex-direction: column;
    gap: 16px;
  }
  
  .service-card, .product-card {
    padding: 20px;
  }
  
  /* 页脚 */
  footer {
    padding: 40px 16px;
  }
  
  footer .footer-content {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }
  
  /* 订阅表单 */
  .newsletter {
    flex-direction: column;
    gap: 12px;
  }
  
  .newsletter input {
    width: 100%;
  }
  
  .newsletter button {
    width: 100%;
  }
  
  /* 区块标题 */
  section h2 {
    font-size: 1.5rem !important;
    margin-bottom: 8px;
  }
  
  section > p {
    font-size: 0.9rem;
    margin-bottom: 24px;
  }
  
  /* 过滤按钮 */
  .filters {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .filter-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  /* 时间线 */
  .timeline {
    padding-left: 20px;
  }
  
  .timeline-item {
    padding-left: 16px;
  }
}

@media (max-width: 400px) {
  :root {
    font-size: 14px;
  }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
  .btn, .card, a, button {
    min-height: 44px;
    min-width: 44px;
  }
  
  .btn:active, .card:active {
    transform: scale(0.97);
  }
}

/* ========== 像素风格模式 ========== */
:root {
  --pixel-scale: 1px;
  --pixel-border: 2px solid var(--text-primary);
  --pixel-shadow: 4px 4px 0 var(--text-primary);
  --pixel-font: 'JetBrains Mono', monospace;
}

.pixel-mode {
  --pixel-scale: 2px;
  --pixel-border: 3px solid var(--text-primary);
  --pixel-shadow: 6px 6px 0 var(--text-primary);
}

/* ========== 移动端额外优化 ========== */

/* 改善移动端触摸区域 */
@media (max-width: 768px) {
  /* 确保移动端导航链接可点击 */
  .nav a {
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  
  /* 移动端Hero区域优化 */
  .hero {
    padding: 40px 0 60px;
  }
  
  .hero h1 {
    font-size: 2rem !important;
    line-height: 1.2;
  }
  
  .hero p {
    font-size: 1rem !important;
    padding: 0 8px;
  }
  
  /* 移动端Stats数字优化 */
  .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }
  
  .stat-item {
    padding: 16px 12px !important;
  }
  
  .stat-number {
    font-size: 1.8rem !important;
  }
  
  /* 移动端模型提供商 */
  .model-provider-card {
    flex-direction: row !important;
    text-align: left !important;
    gap: 12px !important;
  }
  
  /* 移动端Live Feed卡片 */
  .agent-card {
    flex-direction: row !important;
    gap: 16px !important;
  }
  
  .agent-icon {
    width: 48px !important;
    height: 48px !important;
    font-size: 24px !important;
  }
  
  /* 移动端评价卡片 */
  .review-card {
    padding: 16px !important;
  }
  
  .review-text {
    font-size: 0.95rem !important;
  }
  
  /* 移动端服务卡片 */
  .service-card {
    padding: 20px !important;
  }
  
  .service-icon {
    font-size: 28px !important;
  }
  
  /* 移动端产品卡片 */
  .product-card {
    padding: 20px !important;
  }
  
  /* 移动端联系我们 */
  .contact-buttons {
    flex-direction: column;
    gap: 12px;
  }
  
  .contact-buttons .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* 移动端页脚 */
  footer {
    padding: 32px 16px;
  }
  
  /* 改善移动端输入框 */
  input, textarea {
    font-size: 16px !important; /* 防止iOS缩放 */
  }
  
  /* 移动端模态框 */
  .modal-content {
    margin: 16px;
    padding: 24px 16px !important;
  }
  
  /* 移动端表格 */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* 移动端图片 */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* 移动端暗色模式适配 */
  [data-theme="dark"] .header {
    background: rgba(10, 10, 10, 0.95);
  }
  
  .dark-page .header {
    background: rgba(10, 10, 10, 0.95);
  }
}

/* 更小屏幕优化 (iPhone SE等) */
@media (max-width: 375px) {
  .hero h1 {
    font-size: 1.75rem !important;
  }
  
  .start-cards {
    gap: 8px;
  }
  
  .start-card {
    padding: 12px 14px;
  }
  
  .start-icon {
    font-size: 20px !important;
  }
  
  .start-content strong {
    font-size: 13px !important;
  }
  
  .start-content span {
    font-size: 11px !important;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  
  .cta-buttons {
    gap: 10px;
  }
  
  .btn {
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    padding: 24px 0 40px;
  }
  
  .nav {
    width: 50%;
    max-width: 200px;
  }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo-icon, .agent-icon, .service-icon {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}
