/* 主题色定义 */
:root {
  --primary-color: #390302;
  --dark-color: #330201;
  --accent-color: #920508;
  --secondary-color: #370302;
  --deep-color: #290202;
  --light-color: #f8f5f5;
  --text-color: #333;
  --border-color: #ddd;
}

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

body {
  font-family: 'Microsoft YaHei', Arial, sans-serif;
  color: var(--text-color);
  background-color: var(--light-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 公共容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 手机端容器 */
@media (max-width: 768px) {
  .container {
    padding: 0 10px;
  }
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 8px 20px;
  background-color: var(--accent-color);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.btn:hover {
  background-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
  transform: translateY(0);
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 15px;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 18px;
}

/* 文本样式 */
p {
  margin-bottom: 15px;
  font-size: 14px;
}

/* 图片样式 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 列表样式 */
ul, ol {
  list-style: none;
}

/* 链接样式 */
a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* 输入框样式 */
input[type="text"], input[type="search"] {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
  transition: border-color 0.3s ease;
}

input[type="text"]:focus, input[type="search"]:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(146, 5, 8, 0.1);
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.slide-in {
  animation: slideIn 0.6s ease forwards;
}

.pulse {
  animation: pulse 1s ease-in-out infinite;
}

/* 加载状态 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(146, 5, 8, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 弹窗样式 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  animation: fadeIn 0.3s ease;
}

.modal-close {
  position: absolute;
  top: -30px;
  right: -30px;
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.modal-close:hover {
  transform: rotate(90deg);
}

.modal-text {
  position: absolute;
  top: -60px;
  left: 0;
  color: white;
  font-size: 14px;
  text-align: center;
  width: 100%;
}

/* 响应式图片网格 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
}

@media (max-width: 768px) {
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* 分类标签样式 */
.category-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--accent-color);
  color: white;
  padding: 4px 8px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
  z-index: 10;
}

/* 导航栏样式 */
.nav {
  background-color: var(--primary-color);
  padding: 10px 0;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.nav::-webkit-scrollbar {
  height: 4px;
}

.nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.nav-item {
  display: inline-block;
  padding: 8px 15px;
  color: white;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.nav-item.active,
.nav-item:hover {
  border-bottom-color: var(--accent-color);
  color: var(--accent-color);
  transform: translateY(-2px);
}

/* 搜索区域样式 */
.search-area {
  display: flex;
  gap: 10px;
  padding: 15px 0;
  align-items: center;
}

.search-area input {
  flex: 1;
}

.search-area button {
  flex-shrink: 0;
}

/* 卡片样式 */
.card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.card-image {
  position: relative;
  overflow: hidden;
  padding-top: 100%;
}

.card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card-image img {
  transform: scale(1.05);
}

.card-title {
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: var(--primary-color);
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 20px 0;
}

.pagination-item {
  padding: 8px 15px;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-item:hover,
.pagination-item.active {
  background-color: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* 隐藏元素 */
.hidden {
  display: none !important;
}

/* 清除浮动 */
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}