/* 全局样式 */
:root {
  --primary: #0F7AF5;
  --primary-dark: #0a5bbf;
  --secondary: #6366f1;
  --bg-dark: #0a0e14;
  --bg-card: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --text-light: rgba(255, 255, 255, 0.4);
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #111827 50%, #0f172a 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* 导航栏 */
.navbar {
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  z-index: 100;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, #57A2F8 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
  position: relative;
  padding: 8px 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
}

/* 移动端汉堡菜单按钮 */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  border: none;
  background: transparent;
  margin-left: auto; /* 关键修复：让按钮贴到右边 */
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s;
  border-radius: 2px;
  display: block;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* 页面标题 */
.page-title {
  padding: 48px 0 32px;
  text-align: center;
}

.page-title h1 {
  font-size: 42px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text) 0%, #57A2F8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  line-height: 1.2;
}

.page-title p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* 卡片 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s;
}

.card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  text-decoration: none;
  min-height: 44px;
  touch-action: manipulation;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #328DF6 100%);
  color: var(--text);
  box-shadow: 0 4px 20px rgba(15, 122, 245, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(15, 122, 245, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* 网格 */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* 特性图标 */
.feature-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(15, 122, 245, 0.2) 0%, rgba(87, 162, 248, 0.2) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

/* 表单 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  transition: all 0.3s;
  min-height: 44px;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

/* 底部 */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  margin-top: 48px;
}

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

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.animate {
  animation: fadeIn 0.6s ease-out;
}

/* 响应式 - 平板 */
@media (max-width: 1024px) {
  .page-title h1 {
    font-size: 36px;
  }
  
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 响应式 - 手机 */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .navbar {
    padding: 12px 0;
  }
  
  /* 汉堡菜单 */
  .menu-toggle {
    display: flex;
    margin-left: auto; /* 贴到右边 */
    padding: 10px;     /* 加大点击热区 */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  }
  
  .menu-toggle span {
    width: 26px;       /* 加大横线长度 */
    height: 3px;       /* 加粗横线 */
  }
  
  /* 关键修复：在手机端完全移除 <nav> 元素，避免占位推偏 menu-toggle */
  .navbar > nav {
    display: none;
  }
  
  /* 菜单面板 —— 默认隐藏在屏幕右侧，通过 transform 滑动显示 */
  .nav-links {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    width: min(280px, 85vw);
    height: 100vh;
    height: 100dvh;
    /* 半透明深色背景 + 阴影 */
    background: linear-gradient(180deg, rgba(8, 12, 20, 0.96) 0%, rgba(10, 14, 20, 0.98) 100%);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    flex-direction: column;
    gap: 0;
    padding: 72px 24px 24px;
    /* 默认推到屏幕外 */
    transform: translateX(100%);
    /* 流畅的滑入动画 */
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    z-index: 99;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .nav-links.active {
    transform: translateX(0);
  }
  
  /* 修复导航链接在菜单中的样式 —— 字体清晰、颜色对比度强 */
  .nav-links li {
    width: 100%;
    margin-bottom: 4px;
  }
  
  .nav-links a {
    display: block;
    font-size: 17px;
    font-weight: 500;
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
    width: 100%;
    /* 强制白色，确保在深色菜单背景下清晰可见 */
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    -webkit-text-stroke: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: none;
  }
  
  .nav-links a.active {
    color: #57A2F8 !important;
    -webkit-text-fill-color: #57A2F8;
  }
  
  .nav-links a.active::after {
    display: none;
  }
  
  .page-title {
    padding: 32px 0 24px;
  }
  
  .page-title h1 {
    font-size: 28px;
  }
  
  .page-title p {
    font-size: 14px;
  }
  
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .card {
    padding: 20px;
  }
  
  .feature-icon {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
  
  .btn {
    width: 100%;
    padding: 14px 20px;
  }
  
  .btn-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .footer {
    margin-top: 32px;
    padding: 24px 0;
  }
  
  /* 菜单打开时防止页面滚动 */
  body.menu-open {
    overflow: hidden;
  }
}

/* 响应式 - 小屏手机 */
@media (max-width: 480px) {
  .page-title h1 {
    font-size: 24px;
  }
  
  .logo {
    font-size: 16px;
  }
  
  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  
  .card {
    padding: 16px;
  }
  
  .feature-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .form-group input,
  .form-group textarea {
    padding: 10px 12px;
    font-size: 14px;
  }
}

/* 横屏手机优化 */
@media (max-width: 768px) and (orientation: landscape) {
  .page-title {
    padding: 24px 0 16px;
  }
  
  .page-title h1 {
    font-size: 24px;
  }
  
  .footer {
    margin-top: 24px;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: light) {
  :root {
    --bg-dark: #f5f7fa;
    --bg-card: rgba(0, 0, 0, 0.03);
    --border: rgba(0, 0, 0, 0.08);
    --text: #1a1a2e;
    --text-muted: rgba(0, 0, 0, 0.6);
    --text-light: rgba(0, 0, 0, 0.4);
  }
  
  body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 50%, #dfe4ea 100%);
  }
  
  .card {
    background: rgba(255, 255, 255, 0.8);
  }
  
  .form-group input,
  .form-group textarea {
    background: rgba(255, 255, 255, 0.9);
  }
  
  /* 浅色模式下的菜单样式调整 */
  @media (max-width: 768px) {
    .nav-links {
      background: linear-gradient(180deg, rgba(245, 247, 250, 0.98) 0%, rgba(230, 234, 240, 0.99) 100%);
      box-shadow: -8px 0 32px rgba(0, 0, 0, 0.1);
    }
  }
}

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