/* ==================== 基础变量定义 ==================== */
:root {
  /* 主色调 */
  --primary-color: #5e6ad2;       /* 主品牌色 */
  --primary-hover: #4a58c8;       /* 悬停状态色 */
  
  /* 文字颜色 */
  --text-color: #2d3748;          /* 主要文字颜色 */
  --text-light: #718096;          /* 次要文字颜色 */
  
  /* 背景色 */
  --bg-color: #ffffff;            /* 主背景色 */
  --bg-secondary: #f7fafc;        /* 次要背景色 */
  
  /* 边框与阴影 */
  --border-color: #e2e8f0;        /* 边框颜色 */
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);  /* 基础阴影 */
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); /* 中等阴影 */
  
  /* 圆角 */
  --radius: 6px;                  /* 统一圆角大小 */
  
  /* 卡片背景 */
  --card-bg: #ffffff;             /* 卡片背景色 */
}



/* ==================== 全局基础样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;          /* 盒模型设置为border-box */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 
               Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: var(--text-color);
  background-color: var(--bg-secondary);
  line-height: 1.5;               /* 行高设置为1.5倍 */
}

/* 容器样式 - 用于内容居中 */
.container {
  width: 100%;
  max-width: 1200px;              /* 最大宽度限制 */
  margin: 0 auto;                 /* 水平居中 */
  padding: 0 20px;                /* 左右内边距 */

}


/* ==================== 头部样式 ==================== */
header {
  background-color: var(--bg-color);
  box-shadow: var(--shadow);
  padding: 15px 0;
  position: sticky;               /* 粘性定位 */
  top: 0;
  z-index: 100;                   /* 确保在顶层 */
}

/* Logo区域样式 */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;                      /* 元素间距 */
  font-weight: 600;
  font-size: 1.2rem;
}

.logo img {
  height: 40px;                   /* 固定高度，宽度自适应 */
}

/* 导航菜单 */
nav {
  display: flex;
  gap: 20px;                      /* 导航项间距 */
}

nav a {
  text-decoration: none;
  color: var(--text-light);
  font-weight: 500;
  transition: color 0.2s;         /* 颜色过渡动画 */
}

nav a:hover {
  color: var(--primary-color);    /* 悬停颜色变化 */
}

/* 头部布局容器 */
header .container {
  display: flex;
  justify-content: space-between; /* 两端对齐 */
  align-items: center;            /* 垂直居中 */
}

/* ==================== 主要内容区域 ==================== */
/* 英雄区域（主标题区） */
.hero {
  text-align: center;
  padding: 40px 0;                /* 上下内边距 */
  max-width: 800px;               /* 限制最大宽度 */
  margin: 0 auto;                 /* 水平居中 */
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  font-weight: 700;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 5px;
}

/* 行动按钮区域 */
.cta-buttons {
  display: flex;
  gap: 15px;                      /* 按钮间距 */
  justify-content: center;        /* 水平居中 */
}

/* ==================== 按钮样式 ==================== */
.button {
  display: inline-block;
  padding: 10px 15px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;           /* 所有属性过渡动画 */
  margin-bottom: 10px;
}

/* 主要按钮样式 */
.button.primary {
  background-color: var(--primary-color);
  color: white;
}

.button.primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);    /* 悬停上浮效果 */
  box-shadow: var(--shadow-md);
}

/* 次要按钮样式 */
.button.secondary {
  background-color: white;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.button.secondary:hover {
  background-color: var(--bg-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ==================== 特性卡片区域 ==================== */
.features {
  padding: 20px 0;                /* 上下内边距 */
}

.features h2 {
  text-align: center;
  margin-bottom: 25px;
  font-size: 2rem;
}


/* 卡片网格布局 */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 自适应列数 */
  gap: 30px;                                                    /* 卡片间距 */
}

/* 针对桌面设备设置3列布局 */
@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);                    /* 3列布局 */
  }
}

/* 单个卡片样式 */
.feature-card {
  background-color: var(--bg-color);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s; /* 过渡效果 */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-5px);     /* 悬停上浮 */
  box-shadow: var(--shadow-md);
}

.feature-card img {
  width: 50px;
  height: 50px;
  margin-bottom: 20px;
}

.feature-card h3 {
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.feature-card p {
  color: var(--text-light);
  margin-bottom: 10px;
  flex-grow: 1;                   /* 弹性增长 */
}

/* ==================== 内容卡片样式 ==================== */
/* 卡片网格布局 - 用于文章/工具等 */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 40px;
  margin-bottom: 25px;
}

/* 计算器专用网格 */
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

/* 通用卡片样式 */
.content-card, .calc-card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-color);
  display: block;
}

.content-card:hover, .calc-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

/* 卡片内图片样式 */
.content-card img, .calc-card img {
  width: 30px;
  height: 30px;
  margin: 0 auto 15px; 
  display: block; 
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transition: transform 0.3s ease;
}

/* 卡片内标题样式 */
.content-card h3, .calc-card h3 {
  margin: 10px 0;
  color: var(--primary-color);
  font-size: 1.2rem;
}

/* 卡片内文字样式 */
.content-card p, .calc-card p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.9rem;
}


/* 图标悬停效果 */
.content-card:hover img,
.calc-card:hover img {
  transform: scale(1.1);
}

/* =====  =====  ===== 联系栏样式 =====  =====  ===== */
.site-footer {
background: var(--bg-color);
padding: 18px 0 0;
position: relative;
text-align: center;
font-size: 0.75rem;
}

.contact-title {
color: var(--text-color);
margin-bottom: 9px;
font-size: 1.0rem;
letter-spacing: 0.4px;
}

.contact-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 12px;
max-width: 800px;
margin: 0 auto 20px;
padding: 0 10px;
}

.contact-card {
background: var(--card-bg);
border-radius: 10px;
padding: 12px 5px;
cursor: pointer;
transition: all 0.3s;
}

.contact-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.contact-card img {
margin-bottom: 8px;
}

.contact-card h3 {
color: var(--primary-color);
margin-bottom: 4px;
font-size: 0.9rem;
}

.footer-copyright {
background: var(--bg-secondary);
padding: 15px;
font-size: 0.9rem;
}


/* ==================== 响应式调整 ==================== */
@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  
  .contact-card {
    padding: 20px;
  }
  
  .footer-copyright p {
    line-height: 1.5;
  }
}


/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
  /* 移动端标题调整 */
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  /* 按钮垂直排列 */
  .cta-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  /* 头部布局调整 */
  header .container {
    flex-direction: column;
    gap: 15px;
  }
  
  nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  /* 页脚调整 */
  .footer-container {
    grid-template-columns: 1fr;
  }
  
  .qr-section {
    justify-content: flex-start;
  }
}

/* ==================== 实用类 ==================== */
/* 头部操作按钮 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.home-button, .theme-toggle, .back-button {
  padding: 8px 12px;
  border-radius: var(--radius);
  background-color: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.home-button:hover, .theme-toggle:hover, .back-button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}
/* ==================== 弹窗样式 ==================== */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  background: var(--bg-color);
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.contact-info {
  font-size: 1.2rem; 
  margin-bottom: 20px; 
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--primary-color);
}

.highlight-text {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin: 20px 0;
  word-break: break-all;
}

.popup-btns {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.copy-btn, .email-btn {
  padding: 4px 10px;
  border-radius: 15px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s;
}

 
    .copy-btn:hover {
      background-color: #eaeaea;
      transform: translateY(-1px);
    }

    .copy-btn:active {
      transform: scale(0.98);
    }

.email-btn {
  background: var(--bg-secondary);
  color: var(--text-color);
  text-decoration: none;
}

.email-btn:hover {
  background: var(--border-color);
}，



/* 头部整体布局 */
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* 搜索框区域 */
.search-box {
  flex: 1;
  max-width: 300px; /* 增加宽度 */
  margin-left: 1rem;
}

.search-box input {
  width: 100%;
  padding: 10px 15px; /* 增加内边距 */
  border-radius: 4px; /* 更小的圆角 */
  border: 1px solid #ddd; /* 添加轻微的边框 */
  font-size: 16px; /* 增加字体大小 */
  background-color: #ffffff; /* 使用白色背景 */
  color: #333; /* 深色文字 */
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s; /* 仅过渡边框颜色和阴影 */
}

.search-box input::placeholder {
  color: #aaa; /* 占位符颜色 */
}

.search-box input:focus {
  border-color: #66bfff; /* 聚焦时边框颜色 */
  box-shadow: 0 0 5px rgba(102, 191, 255, 0.5); /* 聚焦阴影 */
}


.search-results-container {
  margin-bottom: 2rem;
}

.results-cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 2rem;
}

.result-card {
  border-radius: 16px;
  padding: 1.2rem 1.5rem;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-left: 4px solid #0066ff20;
}

.result-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.card-type {
  font-size: 0.75rem;
  font-weight: bold;
  color: #0066ff;
  text-transform: uppercase;
  opacity: 0.8;
  letter-spacing: 0.5px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  color: #333;
}

.card-title:hover {
  text-decoration: underline;
}

/* 已复制弹窗通知 */
.notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 1000;
    transition: opacity 0.5s ease;
    text-align: center;
}

/* 分页 */
.pagination {
  position: static;
  margin: 40px auto;  
  display: flex;
  justify-content: center;    /* 按钮水平居中排布 */
  gap: 8px;
  background: ransparent !important;
  padding: 0 !important;
  box-shadow: none !important;
  border-radius: 6px;
  z-index: 1000;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
}
.pagination button:hover:not(:disabled) { background: #f0f0f0; }
.pagination button:disabled { opacity: 0.5; cursor: default; }
.pagination button.active {
  background: #007BFF;
  color: #fff;
  border-color: #007BFF;
}
