/* base.css - 重置+变量+工具类（全局加载） */

/* ===== CSS变量 ===== */
:root {
  --primary: #2F1B3D;
  --secondary: #00D9C0;
  --dark-bg: #1A0F2E;
  --page-bg: #F5F3F7;
  --text-white: #FFFFFF;
  --text-dark: #333333;
  --text-gray: #666666;
  --border-color: #D5D0E0;
  --font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  --container-width: 1200px;
  --transition: all 0.3s ease;
}

/* ===== 重置样式 ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
  vertical-align: middle;
}

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

a:hover {
  color: var(--secondary);
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-dark);
}

p {
  margin-bottom: 10px;
}

input, textarea, select, button {
  font-family: var(--font-family);
  font-size: 14px;
  outline: none;
  border: 1px solid var(--border-color);
}

button {
  cursor: pointer;
  border: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ===== 工具类 ===== */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.fl {
  float: left;
}

.fr {
  float: right;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Flex工具类 */
.flex {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
}

.flex-wrap {
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}

.justify-between {
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  -ms-flex-pack: justify;
  justify-content: space-between;
}

.justify-center {
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
}

.align-center {
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
}

/* 间距工具类 */
.mt10 { margin-top: 10px; }
.mt20 { margin-top: 20px; }
.mt30 { margin-top: 30px; }
.mt40 { margin-top: 40px; }
.mb10 { margin-bottom: 10px; }
.mb20 { margin-bottom: 20px; }
.mb30 { margin-bottom: 30px; }
.mb40 { margin-bottom: 40px; }
.pt20 { padding-top: 20px; }
.pt40 { padding-top: 40px; }
.pt60 { padding-top: 60px; }
.pb20 { padding-bottom: 20px; }
.pb40 { padding-bottom: 40px; }
.pb60 { padding-bottom: 60px; }

/* 颜色工具类 */
.color-primary { color: var(--primary); }
.color-secondary { color: var(--secondary); }
.color-white { color: var(--text-white); }
.color-dark { color: var(--text-dark); }
.color-gray { color: var(--text-gray); }

.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-dark { background-color: var(--dark-bg); }
.bg-page { background-color: var(--page-bg); }

/* 按钮基础样式 */
.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background-color: var(--secondary);
  color: var(--dark-bg);
}

.btn-primary:hover {
  background-color: #00c4ae;
  color: var(--dark-bg);
}

.btn-outline {
  background-color: transparent;
  color: var(--secondary);
  border: 1px solid var(--secondary);
}

.btn-outline:hover {
  background-color: var(--secondary);
  color: var(--dark-bg);
}

/* 标题装饰线 */
.section-title {
  position: relative;
  padding-bottom: 15px;
  margin-bottom: 40px;
  text-align: center;
}

.section-title h2 {
  font-size: 28px;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--secondary);
}

/* 面包屑 */
.breadcrumb {
  padding: 15px 0;
  font-size: 13px;
  color: var(--text-gray);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 30px;
}

.breadcrumb a {
  color: var(--text-gray);
}

.breadcrumb a:hover {
  color: var(--secondary);
}

.breadcrumb .sep {
  margin: 0 8px;
  color: var(--border-color);
}

/* 返回顶部 */
.back-to-top {
  position: fixed;
  right: 30px;
  bottom: 80px;
  width: 44px;
  height: 44px;
  background-color: var(--primary);
  color: var(--text-white);
  border-radius: 4px;
  text-align: center;
  line-height: 44px;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  font-size: 18px;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--secondary);
}
