/* ============================================
   AE Mate - 全局通用样式 (style.css)
   ============================================ */

/* --- 全局变量 --- */
:root {
  --primary-color: #4E7EFE;
  --primary-color-hover: #3a6aef;
  --primary-gradient: linear-gradient(135deg, #4E7EFE 0%, #6b92ff 100%);
  --background-color: #FAFAFA;
  --text-color: #212529;
  --text-muted: #6c757d;
  --card-bg: #f8f9fa;
  --border-color: #dee2e6;
}

/* --- 全局样式重置 --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  padding-top: 80px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

h1 {
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
  line-height: 1.6;
}

ul, ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.5em;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

.site {
  overflow-x: hidden;
}

/* ============================================
   头部导航
   ============================================ */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 15px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(250, 250, 250, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  box-sizing: border-box;
}

/* Logo区域 */
.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary-color);
}

/* 汉堡菜单按钮（默认隐藏） */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-menu-toggle span {
  width: 30px;
  height: 3px;
  background-color: var(--text-color);
  border-radius: 2px;
  transition: all 0.3s;
}

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

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

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

/* 导航菜单 */
nav a {
  margin: 0 18px;
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

nav a:hover {
  color: var(--text-color);
}

/* 登录按钮区域 */
.header-auth {
  display: flex;
  align-items: center;
}

.header-auth .auth-button {
  font-size: 0.95rem;
  padding: 8px 20px;
}

.auth-button {
  background-color: var(--primary-color);
  color: white;
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.2s, transform 0.2s;
}

.auth-button:hover {
  background-color: var(--primary-color-hover);
  transform: scale(1.05);
}

/* 用户头像和下拉菜单 */
.user-menu-wrapper {
  position: relative;
  display: inline-block;
}

.avatar {
  width: 40px;
  height: 40px;
  background-color: #e9ecef;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.avatar:hover {
  transform: scale(1.1);
}

.user-dropdown-menu {
  position: absolute;
  top: 55px;
  right: 0;
  width: 240px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 200;
  overflow: hidden;
}

.user-menu-wrapper:hover .user-dropdown-menu,
.user-dropdown-menu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-info-section {
  padding: 16px;
  background-color: var(--card-bg);
}

.user-email {
  font-size: 0.9rem;
  color: var(--text-color);
  font-weight: 600;
  margin-bottom: 8px;
  word-break: break-all;
}

.user-badge {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--primary-color);
  background-color: rgba(0, 122, 204, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.user-badge.pro {
  color: #ffa500;
  background-color: rgba(255, 165, 0, 0.1);
}

.menu-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  width: 100%;
  border: none;
  background: none;
  color: var(--text-color);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
  font-family: inherit;
}

.menu-item:hover {
  background-color: var(--card-bg);
}

.menu-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

/* ============================================
   通用页面样式
   ============================================ */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 80px 20px;
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

/* 主页 Hero 区 */
.hero {
  text-align: center;
}

.hero h1 {
  font-size: 3.5rem;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 30px auto;
}

.hero .hero-description {
  line-height: 1.8;
  text-align: center;
}

/* 功能展示区 */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: left;
  margin-top: 60px;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 25px;
}

.feature-card h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

.feature-card p {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ============================================
   页面特定样式已移至独立文件
   - pricing.css (定价页)
   - account.css (账户页)
   - tutorial.css (教程页)
   ============================================ */

/* ============================================
   Footer
   ============================================ */
footer {
  border-top: 1px solid var(--border-color);
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  background-color: #FAFAFA;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 0.85rem;
}

.footer-row a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-row a:hover {
  color: var(--text-color);
}

.footer-row .divider {
  color: var(--border-color);
}

/* ============================================
   模态框
   ============================================ */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--background-color);
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-content h2 {
  margin-top: 0;
  color: var(--text-color);
}

.auth-method-button {
  display: block;
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  color: var(--text-color);
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
}

.form-group input {
  width: 100%;
  padding: 12px;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: #fff;
  color: var(--text-color);
  font-size: 1rem;
  margin-bottom: 10px;
}

.form-group {
  position: relative;
}

.get-code-button {
  position: absolute;
  right: 10px;
  top: 9px;
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 0.9rem;
}

.submit-button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background-color: var(--primary-color);
  color: white;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}

.switch-auth-mode {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.switch-auth-mode a {
  color: var(--primary-color);
  cursor: pointer;
}

/* 消息提示 */
.message-box {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  display: none;
}

.message-box.show {
  display: block;
}

.message-box.error {
  background-color: #fee;
  color: #c33;
  border: 1px solid #fcc;
}

.message-box.success {
  background-color: #efe;
  color: #3c3;
  border: 1px solid #cfc;
}

.message-box.info {
  background-color: #e7f3ff;
  color: #0066cc;
  border: 1px solid #b3d9ff;
}

/* ============================================
   响应式设计 - 全局
   ============================================ */
@media (max-width: 1200px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 70px;
  }

  header {
    padding: 12px 20px;
  }

  .logo-img {
    width: 32px;
    height: 32px;
  }

  .logo {
    font-size: 1.2rem;
  }

  /* 显示汉堡菜单按钮 */
  .mobile-menu-toggle {
    display: flex;
  }

  /* 移动端导航样式 */
  nav {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background-color: rgba(250, 250, 250, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  }

  nav.active {
    max-height: 400px;
    padding: 20px 0;
  }

  nav a {
    margin: 12px 0;
    font-size: 1.1rem;
    padding: 8px 0;
    width: 100%;
    text-align: center;
  }

  /* 移动端隐藏登录按钮旁边的导航（保留用户头像菜单） */
  .header-auth {
    z-index: 1002;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .footer-row {
    flex-wrap: wrap;
    justify-content: center;
  }
}
