/* 
 * 成都嘉美地毯有限公司 - 主样式文件
 * 文件：main.css
 * 版本：2.0.0
 * 日期：2026年3月13日
 * 描述：统一的企业网站样式，响应式设计，现代化界面
 */

/* ============================================
   基础重置和变量定义
============================================ */

:root {
    /* 品牌颜色 - 基于成都嘉美地毯的品牌形象 */
    --primary-blue: #3498DB;       /* 主蓝色 - 专业、信任 */
    --primary-dark: #2C3E50;       /* 深蓝色 - 稳重、可靠 */
    --accent-orange: #E67E22;      /* 橙色 - 活力、温暖 */
    --success-green: #2ECC71;      /* 绿色 - 成功、环保 */
    --warning-yellow: #F39C12;     /* 黄色 - 注意、优惠 */
    --danger-red: #E74C3C;         /* 红色 - 紧急、重要 */
    
    /* 营销型网站特有颜色 */
    --cta-primary: #FF6B35;        /* CTA按钮主色 - 突出、引人注目 */
    --cta-secondary: #00B894;      /* CTA按钮辅助色 - 成功、行动 */
    --highlight-yellow: #FFD700;   /* 高亮黄色 - 强调重要信息 */
    
    /* 中性色 */
    --light-gray: #F8F9FA;         /* 浅灰背景 */
    --medium-gray: #ECF0F1;        /* 中灰背景 */
    --border-gray: #BDC3C7;        /* 边框灰色 */
    --text-dark: #2C3E50;          /* 正文深色 */
    --text-medium: #566573;        /* 正文中色 */
    --text-light: #7F8C8D;         /* 辅助文字 */
    --text-white: #FFFFFF;         /* 白色文字 */
    
    /* 布局变量 */
    --container-width: 1200px;     /* 容器最大宽度 */
    --container-padding: 20px;     /* 容器内边距 */
    --header-height: 80px;         /* 头部高度（带导航栏） */
    --header-height-scrolled: 70px; /* 滚动后头部高度 */
    --footer-height: 300px;        /* 底部高度 */
    
    /* 导航栏特定变量 */
    --nav-bg: rgba(255, 255, 255, 0.98); /* 导航栏背景 */
    --nav-bg-scrolled: rgba(255, 255, 255, 0.95); /* 滚动后背景 */
    --nav-text: var(--text-dark);        /* 导航文字颜色 */
    --nav-text-hover: var(--primary-blue); /* 导航文字悬停颜色 */
    --nav-cta-bg: var(--cta-primary);    /* 导航CTA按钮背景 */
    --nav-cta-text: var(--text-white);   /* 导航CTA按钮文字 */
    
    /* 响应式断点 */
    --breakpoint-xs: 576px;        /* 手机 */
    --breakpoint-sm: 768px;        /* 平板 */
    --breakpoint-md: 992px;        /* 小桌面 */
    --breakpoint-lg: 1200px;       /* 大桌面 */
    
    /* 阴影效果 */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
    --shadow-xl: 0 12px 24px rgba(0,0,0,0.25);
    
    /* 过渡效果 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-full: 9999px;
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-gray);
    overflow-x: hidden;
}

/* ============================================
   布局容器
============================================ */

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--container-padding);
}

/* ============================================
   排版样式
============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.5rem;
    margin-bottom: 0.875rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-medium);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============================================
   按钮样式
============================================ */

.btn {
    display: inline-block;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    user-select: none;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    border: 2px solid var(--primary-blue);
}

.btn-primary:hover {
    background-color: #2980B9;
    border-color: #2980B9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: white;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background-color: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background-color: var(--success-green);
    color: white;
    border: 2px solid var(--success-green);
}

.btn-success:hover {
    background-color: #27AE60;
    border-color: #27AE60;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-warning {
    background-color: var(--warning-yellow);
    color: white;
    border: 2px solid var(--warning-yellow);
}

.btn-warning:hover {
    background-color: #D68910;
    border-color: #D68910;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-lg {
    padding: 16px 40px;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.875rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ============================================
   导航栏样式
============================================ */

.navbar {
    background-color: white;
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-dark);
}

.logo-img {
    height: 50px;
    margin-right: 10px;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-item {
    margin-left: 2rem;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-blue);
    text-decoration: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-blue);
    transition: width var(--transition-normal);
}

.nav-link:hover::after {
    width: 100%;
}

/* ============================================
   英雄区域样式
============================================ */

.hero {
    background: linear-gradient(135deg, #3498DB 0%, #2C3E50 100%);
    color: white;
    padding: 120px 0 80px;
    margin-top: var(--header-height);
    text-align: center;
}

.hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto 2rem;
}

/* ============================================
   卡片组件
============================================ */

.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--text-medium);
    margin-bottom: 1rem;
}

/* ============================================
   表单样式
============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-control::placeholder {
    color: var(--text-light);
}

/* ============================================
   产品展示区域
============================================ */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-img-container {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.img-source {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    opacity: 0.8;
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.product-features {
    list-style: none;
    margin-bottom: 1rem;
}

.product-features li {
    padding: 4px 0;
    color: var(--text-medium);
    position: relative;
    padding-left: 1.5rem;
}

.product-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-green);
    font-weight: bold;
}

/* ============================================
   页脚样式
============================================ */

.footer {
    background-color: var(--primary-dark);
    color: white;
    padding: 60px 0 30px;
}

.footer h4 {
    color: white;
    margin-bottom: 1.5rem;
}

.footer p, .footer a {
    color: rgba(255, 255, 255, 0.8);
}

.footer a:hover {
    color: white;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 3rem;
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   响应式设计
============================================ */

/* 平板设备 */
@media (max-width: 992px) {
    h1 {
        font-size: 2.25rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

/* 手机设备 */
@media (max-width: 768px) {
    :root {
        --container-padding: 15px;
        --header-height: 70px;
    }
    
    html {
        font-size: 14px;
    }
    
    .navbar .container {
        flex-direction: column;
        justify-content: center;
    }
    
    .nav-menu {
        margin-top: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-item {
        margin: 0 0.75rem 0.5rem;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* 小手机设备 */
@media (max-width: 576px) {
    .btn {
        padding: 10px 24px;
    }
    
    .btn-lg {
        padding: 12px 32px;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* ============================================
   工具类
============================================ */

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-circle { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ============================================
   动画效果
============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.fade-in {
    animation: fadeIn var(--transition-normal);
}

.slide-up {
    animation: slideUp var(--transition-normal);
}

.slide-in-left {
    animation: slideInLeft var(--transition-normal);
}

.slide-in-right {
    animation: slideInRight var(--transition-normal);
}

/* ============================================
   打印样式
============================================ */

@media print {
    .navbar,
    .footer,
    .btn {
        display: none;
    }
    
    body {
        font-size: 12pt;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}