/*
 * 首页样式 - 合并优化版本
 * 合并了 home.css 和 index.css 的所有功能
 */

/* ===== CSS变量定义 - 紫色配色方案 ===== */
:root {
  --primary-color: #7c3aed;        /* 紫色主色 */
  --primary-dark: #5b21b6;         /* 深紫色 */
  --primary-light: #a855f7;        /* 浅紫色 */
  --secondary-color: #4c1d95;      /* 深紫色调 */
  --accent-color: #f59e0b;         /* 金色点缀 */
  --success-color: #10b981;        /* 绿色 */
  --danger-color: #ef4444;         /* 红色 */
  --warning-color: #f59e0b;        /* 橙色 */
  --info-color: #8b5cf6;           /* 信息紫 */
  --light-color: #faf5ff;          /* 浅紫背景 */
  --dark-color: #262626;           /* 深色文字 */
  --purple-color: #7c3aed;         /* 紫色 */
  --pink-color: #ec4899;           /* 粉色 */

  --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  --gradient-secondary: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
  --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #7c3aed 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --gradient-info: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);

  --shadow-sm: 0 0.125rem 0.5rem rgba(124, 58, 237, 0.08);
  --shadow: 0 0.5rem 1.5rem rgba(124, 58, 237, 0.12);
  --shadow-lg: 0 1rem 3rem rgba(124, 58, 237, 0.15);
  --box-shadow: 0 0.5rem 1.5rem rgba(124, 58, 237, 0.1);

  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 12px;
}

body {
  overflow-x: hidden;
}

/* ===== 全局卡片悬停效果 ===== */
.product-card, .category-item, .vendor-item, .region-item, .article-card {
  transition: var(--transition);
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
  border: none;
  border-radius: var(--border-radius);
  overflow: hidden;
}

/* 简化悬停效果 */
.category-item:hover, .vendor-item:hover, .region-item:hover {
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
}

.product-card:hover, .article-card:hover {
  box-shadow: var(--shadow);
}

/* ===== 按钮样式增强 ===== */
.btn {
  transition: var(--transition);
}

.btn-primary, .btn-success, .btn-info, .btn-danger, .btn-warning {
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: var(--gradient-primary);
  box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.btn-success {
  background: var(--gradient-success);
}

.btn-info {
  background: var(--gradient-info);
}

.btn-primary:hover, .btn-success:hover, .btn-info:hover, .btn-danger:hover, .btn-warning:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-outline-primary:hover {
  background: var(--gradient-primary);
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

/* ===== 装饰性元素 ===== */
.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(67, 97, 238, 0.05);
  z-index: -1;
}

/* 地图点标签 */
.map-point {
  z-index: 1;
}

.point-label {
  transform: translateX(-50%);
  margin-top: 10px;
  z-index: 2;
  transition: var(--transition);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.map-point:hover .point-label {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 英雄区域样式 - 支付宝蓝升级版 ===== */
.hero-area {
  position: relative;
  background: var(--gradient-primary);
  color: white;
  overflow: hidden;
  padding: 140px 0;
  margin-bottom: -50px; /* 首页特殊负边距 */
  min-height: 650px;
  box-shadow: 0 20px 60px rgba(124, 58, 237, 0.2);
}

/* 首页普通页面重置边距 */
body:not(.home-page) .hero-area {
  margin-bottom: 0;
}

.hero-area::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='smallGrid' width='10' height='10' patternUnits='userSpaceOnUse'%3E%3Cpath d='M 10 0 L 0 0 0 10' fill='none' stroke='rgba(255,255,255,0.1)' stroke-width='0.5'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23smallGrid)'/%3E%3C/svg%3E");
  opacity: 0.4;
}

.hero-area .display-4 {
  font-weight: 800;
  margin-bottom: 1.5rem;
  position: relative;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-area .display-4::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 0;
  width: 80px;
  height: 4px;
  background: var(--accent-color);
  border-radius: 2px;
}

.search-box {
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: var(--border-radius);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

.search-box:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ===== 分类导航样式 ===== */
.category-nav {
  position: relative;
  z-index: 10;
}

.category-wrapper {
  margin-top: -50px;
  border-radius: var(--border-radius);
}

.category-item {
  transition: var(--transition);
  border-radius: var(--border-radius);
}

.category-item:hover {
  box-shadow: var(--shadow);
}

.icon-circle {
  width: 70px;
  height: 70px;
  transition: var(--transition);
}

/* ===== 产品卡片样式 ===== */
.product-card {
  perspective: 1000px;
  transform-style: preserve-3d;
}

.product-card .card-header {
  border-bottom: none;
  padding-bottom: 0;
}

/* 产品卡片装饰元素 */
.ribbon {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
}

.ribbon-top-right span {
  position: absolute;
  display: block;
  width: 80px;
  padding: 5px 0;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: white;
  transform: rotate(45deg);
  right: -20px;
  top: 20px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.spec-item {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition);
}

.spec-item:hover {
  background-color: #e9ecef;
}

.spec-icon {
  margin-bottom: 5px;
  font-size: 1.2rem;
}

.spec-label {
  font-size: 0.75rem;
  color: #6c757d;
}

.spec-value {
  font-weight: 600;
}

.price-tag {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

.price-currency {
  font-size: 1rem;
  vertical-align: super;
}

.price-period {
  font-size: 0.9rem;
  color: #6c757d;
}

/* 主题区块增强 */
.section-title {
  position: relative;
  padding-bottom: 15px;
  margin-bottom: 30px;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 3px;
}

.text-center .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}

/* 信息卡片增强 */
.region-item, .vendor-item {
  transition: var(--transition);
}

.vendor-logo-container {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== 厂商展示样式 ===== */
.vendor-swiper {
  padding-bottom: 50px;
}

.vendor-swiper .swiper-pagination {
  bottom: 0;
}

.vendor-swiper .swiper-button-next,
.vendor-swiper .swiper-button-prev {
  color: var(--primary-color);
}

/* ===== 文章卡片样式 ===== */
.article-img-container {
  overflow: hidden;
  height: 180px;
}

.article-image {
  transition: all 0.3s ease;
}

.article-title {
  transition: var(--transition);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 服务特点区域 ===== */
.feature-item {
  transition: var(--transition);
  border-radius: var(--border-radius);
  backdrop-filter: blur(4px);
}

.feature-item:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.feature-icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  transition: all 0.3s ease;
}

.feature-item:hover .feature-icon {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== 地区展示 ===== */
.world-map-container {
  min-height: 300px;
}

/* Existing styles from previous edit */
.price-tag-home .price-period {
    font-size: 0.7em;
    color: #6c757d;
}

/* 酷炫美化推荐云资源产品卡片 */
.home-featured-card-horizontal {
    background: linear-gradient(135deg, #f8fafc 60%, #e0e7ff 100%);
    border: 2px solid #e0e7ff;
    border-radius: 18px;
    box-shadow: 0 4px 32px 0 rgba(67,97,238,0.10), 0 1.5px 8px 0 rgba(67,97,238,0.08);
    transition: all 0.35s cubic-bezier(.4,2,.6,1);
    position: relative;
    overflow: hidden;
}

.home-featured-card-horizontal:hover {
    box-shadow: 0 8px 40px 0 rgba(67,97,238,0.18), 0 2px 16px 0 rgba(67,97,238,0.12);
    border-color: #4361ee;
}

.product-icon-area-h {
    background: linear-gradient(135deg, #e0e7ff 60%, #4361ee 100%);
    border-right: 2px solid #e0e7ff;
    border-radius: 18px 0 0 18px;
    min-height: 160px;
    box-shadow: 0 0 24px 0 rgba(67,97,238,0.08);
}

/* 修复厂商logo样式 */
.vendor-logo-sm-h {
    max-height: 24px;
    max-width: 80px;
    object-fit: contain;
    filter: grayscale(20%);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.home-featured-card-horizontal:hover .vendor-logo-sm-h {
    filter: grayscale(0%);
    opacity: 1;
}

.product-type-badge-h {
    margin-top: 8px;
    font-size: 1.1em !important;
    font-weight: 600;
    padding: 0.5em 1.2em;
    border-radius: 2em;
    background: linear-gradient(90deg, #4361ee 60%, #4cc9f0 100%) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px 0 rgba(67,97,238,0.10);
    letter-spacing: 1px;
    border: none;
}

.product-specs-list-h {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.product-specs-list-h .spec-item-h {
    display: inline-flex;
    align-items: center;
    background: #f1f5fa;
    color: #3f37c9;
    border-radius: 1.2em;
    padding: 0.35em 1em 0.35em 0.8em;
    font-size: 0.9em;
    font-weight: 500;
    box-shadow: 0 1px 4px 0 rgba(67,97,238,0.06);
    transition: all 0.2s ease;
}

.product-specs-list-h .spec-item-h:hover {
    background: #e0e7ff;
}

.product-specs-list-h .spec-item-h i {
    color: #4361ee;
    margin-right: 0.4em;
    font-size: 1em;
}

.price-tag-home {
    font-size: 1.3rem;
    font-weight: 800;
    color: #4361ee;
    background: linear-gradient(90deg, #e0e7ff 60%, #4cc9f0 100%);
    border-radius: 1.2em;
    padding: 0.3em 1.2em;
    box-shadow: 0 2px 8px 0 rgba(67,97,238,0.10);
    letter-spacing: 1px;
}

.home-featured-card-horizontal .btn-sm {
    font-size: 0.95rem;
    padding: 0.35rem 1.2rem;
    border-radius: 2em;
    font-weight: 600;
    box-shadow: 0 2px 8px 0 rgba(67,97,238,0.10);
    background: linear-gradient(90deg, #4361ee 60%, #4cc9f0 100%);
    border: none;
    color: #fff;
    transition: all 0.2s ease;
}

.home-featured-card-horizontal .btn-sm:hover {
    background: linear-gradient(90deg, #a855f7 60%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 4px 12px 0 rgba(124,58,237,0.15);
}

/* 产品标题样式优化 */
.product-title {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 8px;
}

.product-title a {
    color: #2d3748;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-title a:hover {
    color: #7c3aed;
}

.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color), #20a39e);
}

.bg-gradient-info {
    background: linear-gradient(135deg, var(--info-color), #4895ef);
}

.rounded-4 {
    border-radius: 10px !important;
}

.rounded-top-4 {
    border-top-left-radius: 10px !important;
    border-top-right-radius: 10px !important;
}

.article-card:hover .article-title {
    color: var(--primary-color) !important;
}

.icon-circle {
    transition: all 0.3s ease;
}

.product-category-card {
    transition: all 0.3s ease;
}

/* ===== 简化效果 ===== */
.btn-shine {
  background: linear-gradient(to right, var(--primary-color) 0%, var(--secondary-color) 50%, var(--primary-color) 100%);
  background-size: 200% auto;
}

.hover-shadow {
  transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ===== 响应式设计 ===== */
@media (max-width: 992px) {
  .hero-area {
    padding: 100px 0;
    min-height: 550px;
  }

  .category-wrapper {
    margin-top: -30px;
  }

  .specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-area {
    padding: 80px 0;
    min-height: 500px;
  }

  .hero-area .display-4 {
    font-size: 2.2rem;
  }

  .specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .world-map-container {
    display: none;
  }
}

@media (max-width: 576px) {
  .hero-area {
    padding: 60px 0;
    min-height: 450px;
  }

  .hero-area .display-4 {
    font-size: 1.8rem;
  }

  .category-wrapper {
    margin-top: 0;
  }
}

/* 移动端适配 */
@media (max-width: 767.98px) {
    /* 1. 隐藏英雄区的二维码 */
    .hero-area .col-lg-6:last-child {
        display: none;
    }

    /* 调整英雄区内容宽度 */
    .hero-area .col-lg-6:first-child {
        width: 100%;
    }

    /* 调整英雄区下边距 */
    .hero-area {
        padding: 70px 0;
        margin-bottom: 0;
        min-height: 400px;
    }
    
    /* 2. 产品类型卡片，每行显示4个，显示两行 */
    .category-nav .row-cols-2 {
        --bs-gutter-x: 0.5rem;
    }
    
    .category-nav .col {
        flex: 0 0 25%;
        max-width: 25%;
        padding-left: calc(var(--bs-gutter-x) * .5);
        padding-right: calc(var(--bs-gutter-x) * .5);
    }
    
    .category-nav .category-item {
        padding: 0.5rem !important;
    }
    
    .category-nav .icon-circle {
        width: 40px;
        height: 40px;
        padding: 0.5rem !important;
    }
    
    .category-nav .fa-3x {
        font-size: 1.5em;
    }
    
    /* 只显示前8个类别（两行） */
    .category-nav .col:nth-child(n+9) {
        display: none;
    }
    
    /* 3. 不显示页脚 */
    footer.footer {
        display: none;
    }
    
    /* 新增：1. 推荐云资源卡片不显示详情按钮 */
    .home-top-featured-products .btn-sm {
        display: none;
    }
    
    /* 新增：2. 增大热门VPS产品的厂商LOGO */
    .product-card .vendor-logo {
        max-height: 60px !important;
        max-width: 140px !important;
    }
    
    /* 新增：3. 服务特点卡片一行显示两个 */
    .feature-item {
        margin-bottom: 20px;
    }
    
    /* 服务特点部分的列布局调整为一行两个 */
    .row-cols-1.row-cols-md-2.row-cols-lg-4 .col {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* 添加新颜色的文本和背景类 */
.text-purple {
  color: var(--purple-color) !important;
}

.text-pink {
  color: var(--pink-color) !important;
}

.bg-purple {
  background-color: var(--purple-color) !important;
}

.bg-pink {
  background-color: var(--pink-color) !important;
} 