﻿/* ========================================
   般若鲲企业官网 - 全局重置与基础样式
   ========================================

   目录：
   1. CSS重置 - 消除浏览器默认样式差异
   2. 基础元素 - html/body/链接/图片等
   3. 通用工具类 - 容器/按钮/卡片等
   4. 动画效果 - fadeIn/slideIn等
   5. 页面布局 - 侧边栏/面包屑等
   6. 响应式适配 - @media queries

   依赖：
   - variables.css（必须先加载）
   ======================================== */

/* ========================================
   1. CSS重置（Reset）
   ======================================== */

/* 通配符选择器：重置所有元素的外边距和内边距 */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* 盒模型：border-box便于计算 */
}

/* ========================================
   2. 基础元素样式
   ======================================== */

/* HTML根元素 */
html {
  font-size: var(--font-size-base); /* 16px基准 */
  scroll-behavior: smooth; /* 平滑滚动 */
  -webkit-font-smoothing: antialiased; /* 抗锯齿：Mac Chrome/Safari */
  -moz-osx-font-smoothing: grayscale; /* 抗锯齿：Mac Firefox */
}

/* 页面主体 */
body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.6; /* 行高1.6倍 */
  overflow-x: hidden; /* 隐藏水平溢出 */
}

/* 链接默认样式 */
a {
  color: inherit;
  text-decoration: none; /* 去除下划线 */
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent); /* 悬停变橙色 */
}

/* 图片：响应式、块级显示 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 列表：去除默认列表样式 */
ul, ol {
  list-style: none;
}

/* 按钮：继承字体、指针、去除边框 */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
}

/* 表单元素 */
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  outline: none; /* 去除默认轮廓 */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

/* 表单聚焦状态 */
input:focus, textarea:focus, select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(13, 43, 92, 0.1);
}

/* 标题：统一字体粗细和行高 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

/* ========================================
   3. 通用工具类
   ======================================== */

/* 标准容器：居中、最大宽度 */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* 宽容器 */
.container-wide {
  max-width: var(--container-wide);
}

/* 窄容器 */
.container-narrow {
  max-width: var(--container-narrow);
}

/* 区块：上下内边距 */
.section {
  padding: var(--section-padding);
}

/* 内页顶部装饰条 */
.page-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(90deg, #0d2b5c, #1a4a8a);
  height: 80px;
  width: 100%;
}

/* 内页第一个section移除上边距 */
.page-main > .section:first-child {
  padding-top: 0;
}

/* ========================================
   3.1 区块标题
   ======================================== */

/* 区块标题容器：居中 */
.section-header {
  text-align: center;
  margin-bottom: 50px;
}

/* 二级标题：居中、深蓝色 */
.section-header h2 {
  font-size: var(--font-size-3xl);
  color: var(--primary);
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
}

/* 标题下方装饰线：橙色 */
.section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* 副标题：浅色、居中 */
.section-header p {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

/* ========================================
   3.2 按钮
   ======================================== */

/* 按钮基础样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

/* 主要按钮：深蓝背景 */
.btn-primary {
  background: var(--primary);
  color: var(--text-white);
}

.btn-primary:hover {
  background: var(--primary-light);
  color: var(--text-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 强调按钮：橙色背景 */
.btn-accent {
  background: var(--accent);
  color: var(--text-white);
}

.btn-accent:hover {
  background: var(--accent-dark);
  color: var(--text-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 轮廓按钮：透明背景、深蓝边框 */
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--text-white);
  transform: translateY(-2px);
}

/* 白色轮廓按钮：用于深色背景 */
.btn-outline-white {
  background: transparent;
  color: var(--text-white);
  border: 2px solid var(--text-white);
}

.btn-outline-white:hover {
  background: var(--text-white);
  color: var(--primary);
}

/* 大按钮 */
.btn-lg {
  padding: 14px 36px;
  font-size: var(--font-size-base);
}

/* 小按钮 */
.btn-sm {
  padding: 8px 20px;
  font-size: var(--font-size-xs);
}

/* ========================================
   3.3 面包屑导航
   ======================================== */

/* 面包屑容器：水平排列 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  font-size: var(--font-size-sm);
  color: var(--text-light);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .separator {
  color: var(--border-color);
}

.breadcrumb .current {
  color: var(--text-secondary);
}

/* ========================================
   3.4 分页
   ======================================== */

/* 分页容器：居中 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.pagination a:hover {
  background: var(--bg-tertiary);
  color: var(--primary);
}

.pagination .active {
  background: var(--primary);
  color: var(--text-white);
}

.pagination .disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========================================
   3.5 卡片
   ======================================== */

/* 卡片基础样式 */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

/* ========================================
   3.6 标签
   ======================================== */

/* 小标签：胶囊形状 */
.tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* ========================================
   4. 动画效果
   ======================================== */

/* 淡入上移动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 淡入动画 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 从左滑入动画 */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 从右滑入动画 */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 动画类 */
.animate-fadeInUp {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-fadeIn {
  animation: fadeIn 0.6s ease forwards;
}

.animate-slideInLeft {
  animation: slideInLeft 0.6s ease forwards;
}

.animate-slideInRight {
  animation: slideInRight 0.6s ease forwards;
}

/* ========================================
   5. 页面主体布局
   ======================================== */

/* 页面主体：最小高度 */
.page-main {
  min-height: calc(100vh - var(--header-height) - 300px);
  position: relative;
  padding-top: 80px;
}

/* ========================================
   5.1 内页横幅
   ======================================== */

/* 内页顶部横幅 */
.page-banner {
  background: var(--primary-gradient);
  padding: calc(var(--header-height) + 30px) 0 50px;
  color: var(--text-white);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* 横幅装饰背景 */
.page-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

/* 横幅标题 */
.page-banner h1 {
  font-size: var(--font-size-4xl);
  color: var(--text-white);
  margin-bottom: 12px;
  position: relative;
}

/* 横幅副标题 */
.page-banner p {
  font-size: var(--font-size-lg);
  opacity: 0.8;
  position: relative;
}

/* ========================================
   5.2 侧边栏布局
   ======================================== */

/* 侧边栏布局：flex */
.page-with-sidebar {
  display: flex;
  gap: 40px;
}

/* 侧边栏容器 */
.sidebar {
  flex-shrink: 0;
  width: 240px;
}

/* 侧边导航 */
.sidebar-nav {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-height) + 20px); /* 滚动时固定 */
}

.sidebar-nav-title {
  background: var(--primary);
  color: var(--text-white);
  padding: 16px 20px;
  font-size: var(--font-size-base);
  font-weight: 600;
}

.sidebar-nav a {
  display: block;
  padding: 14px 20px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-fast);
  position: relative;
}

/* 侧边导航激活指示器 */
.sidebar-nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform var(--transition-fast);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--bg-secondary);
  color: var(--primary);
}

.sidebar-nav a:hover::before,
.sidebar-nav a.active::before {
  transform: scaleY(1);
}

.sidebar-nav a:last-child {
  border-bottom: none;
}

/* 主内容区 */
.page-content {
  flex: 1;
  min-width: 0;
}

/* ========================================
   6. 响应式断点
   ======================================== */

/* 平板（<=992px） */
@media (max-width: 992px) {
  .section {
    padding: 60px 0;
  }

  .section-header h2 {
    font-size: var(--font-size-2xl);
  }

  .page-banner {
    padding: calc(var(--header-height) + 20px) 0 35px;
  }

  .page-banner h1 {
    font-size: var(--font-size-3xl);
  }

  /* 侧边栏布局改为垂直 */
  .page-with-sidebar {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .sidebar-nav {
    position: static;
  }

  /* 侧边导航水平滚动 */
  .sidebar-nav-inner {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-nav-title {
    display: none;
  }

  .sidebar-nav a {
    white-space: nowrap;
    border-bottom: none;
    border-right: 1px solid var(--border-light);
  }

  .sidebar-nav a::before {
    display: none;
  }
}

/* 大手机（<=768px） */
@media (max-width: 768px) {
  :root {
    --section-padding: 50px 0;
    --header-height: 60px; /* 移动端头部降低 */
  }

  .section-header {
    margin-bottom: 36px;
  }

  .section-header h2 {
    font-size: var(--font-size-xl);
  }

  .section-header p {
    font-size: var(--font-size-base);
  }

  .page-banner h1 {
    font-size: var(--font-size-2xl);
  }

  .page-banner p {
    font-size: var(--font-size-base);
  }

  .btn-lg {
    padding: 12px 28px;
    font-size: var(--font-size-sm);
  }
}

/* 平板和大手机（768px-1024px） - 侧边栏优化 */
@media (max-width: 1024px) {
  .page-with-sidebar {
    flex-direction: column;
    gap: 30px;
  }

  .sidebar {
    width: 100%;
    margin-bottom: 20px;
  }

  .sidebar-nav {
    position: relative;
    top: auto;
  }

  .sidebar-nav a {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }

  .page-content {
    flex: 1;
  }
}

/* 手机（<=576px） */
@media (max-width: 576px) {
  .container {
    padding: 0 16px;
  }

  /* 侧边栏响应式 */
  .page-with-sidebar {
    gap: 20px;
  }

  .sidebar-nav a {
    padding: 12px 16px;
    font-size: var(--font-size-xs);
  }

  .sidebar-nav-title {
    padding: 12px 16px;
    font-size: var(--font-size-sm);
  }

  /* 网格优化 */
  .about-highlights {
    grid-template-columns: 1fr;
  }

  /* 面包屑换行 */
  .breadcrumb {
    flex-wrap: wrap;
  }

  .breadcrumb .separator {
    margin: 0 4px;
  }

  /* 按钮尺寸优化 */
  .btn {
    min-height: 44px;
    padding: 12px 20px;
  }

  .btn-sm {
    min-height: 40px;
    padding: 10px 16px;
  }

  .section-header h2 {
    font-size: var(--font-size-lg);
  }

  .section-header p {
    font-size: var(--font-size-sm);
  }

  /* 禁用粘性侧边栏（移动端不适用） */
  .sidebar-nav {
    position: relative !important;
    top: auto !important;
  }
}

/* 超小屏手机（<375px） */
@media (max-width: 374px) {
  .container {
    padding: 0 12px;
  }

  .section-header h2 {
    font-size: var(--font-size-base);
  }

  .section-header p {
    font-size: var(--font-size-xs);
  }

  .page-banner h1 {
    font-size: var(--font-size-lg);
  }

  .page-banner p {
    font-size: var(--font-size-xs);
  }

  .btn {
    padding: 10px 16px;
    font-size: var(--font-size-xs);
  }

  .breadcrumb {
    gap: 4px;
    font-size: var(--font-size-xs);
  }

  .sidebar-nav a {
    padding: 10px 12px;
    font-size: 12px;
  }
}
