/**
 * 响应式CSS框架
 * 支持PC端、平板端、手机端
 * 兼容IE11+、Chrome、Firefox、Safari、Edge等主流浏览器
 */

/* ===== CSS变量定义 ===== */
:root {
    --primary: #0066cc;
    --primary-dark: #004fa3;
    --primary-light: #e8f0fe;
    --text: #333;
    --text-light: #666;
    --bg-light: #f5f7fa;
    --border: #e9ecef;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0,0,0,.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,.15);
    --radius: 8px;
    --transition: .3s ease;
    
    /* 响应式断点 */
    --breakpoint-xs: 0;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-xxl: 1400px;
}

/* ===== 基础重置与浏览器兼容 ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', Arial, sans-serif;
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    min-width: 320px;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 0;
}

ul, ol {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    outline: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* ===== 网格系统 ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.container-fluid {
    width: 100%;
    padding: 0 15px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.row.no-gutters {
    margin: 0;
}

.row.no-gutters > [class*="col-"] {
    padding: 0;
}

/* 列基础样式 */
[class*="col-"] {
    position: relative;
    width: 100%;
    padding: 0 10px;
}

/* 12列网格系统 */
.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* ===== 通用工具类 ===== */
/* 显示/隐藏 */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }

/* Flex布局 */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-stretch { align-items: stretch !important; }

/* 间距 */
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.ml-0 { margin-left: 0 !important; }
.mr-0 { margin-right: 0 !important; }

.m-1 { margin: 5px !important; }
.m-2 { margin: 10px !important; }
.m-3 { margin: 15px !important; }
.m-4 { margin: 20px !important; }
.m-5 { margin: 30px !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 5px !important; }
.p-2 { padding: 10px !important; }
.p-3 { padding: 15px !important; }
.p-4 { padding: 20px !important; }
.p-5 { padding: 30px !important; }

/* 文字对齐 */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* 文字截断 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-wrap {
    white-space: normal;
}

/* 图片响应式 */
.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== 响应式断点 - 小屏幕 (sm: 576px+) ===== */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
    
    .col-sm-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-sm-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
    .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-sm-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-sm-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-sm-9 { flex: 0 0 75%; max-width: 75%; }
    .col-sm-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-sm-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
    
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
}

/* ===== 响应式断点 - 中等屏幕 (md: 768px+) ===== */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding: 0 20px;
    }
    
    .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
}

/* ===== 响应式断点 - 大屏幕 (lg: 992px+) ===== */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .col-lg-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
    .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
    
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
}

/* ===== 响应式断点 - 超大屏幕 (xl: 1200px+) ===== */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .col-xl-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-xl-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-xl-3 { flex: 0 0 25%; max-width: 25%; }
    .col-xl-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-xl-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-xl-6 { flex: 0 0 50%; max-width: 50%; }
    .col-xl-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-xl-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-xl-9 { flex: 0 0 75%; max-width: 75%; }
    .col-xl-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-xl-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-xl-12 { flex: 0 0 100%; max-width: 100%; }
    
    .d-xl-none { display: none !important; }
    .d-xl-block { display: block !important; }
    .d-xl-flex { display: flex !important; }
}

/* ===== 响应式断点 - 特大屏幕 (xxl: 1400px+) ===== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .col-xxl-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-xxl-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-xxl-3 { flex: 0 0 25%; max-width: 25%; }
    .col-xxl-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-xxl-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-xxl-6 { flex: 0 0 50%; max-width: 50%; }
    .col-xxl-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-xxl-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-xxl-9 { flex: 0 0 75%; max-width: 75%; }
    .col-xxl-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-xxl-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-xxl-12 { flex: 0 0 100%; max-width: 100%; }
}

/* ===== 移动端优化 (max-width: 767px) ===== */
@media (max-width: 767px) {
    /* 基础调整 */
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-header {
        margin-bottom: 30px;
    }
    
    .section-header h2 {
        font-size: 22px;
    }
    
    .section-header p {
        font-size: 13px;
        margin-top: 12px;
    }
    
    /* 按钮调整 */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    /* 移动端隐藏 */
    .hide-mobile {
        display: none !important;
    }
    
    /* 移动端全宽 */
    .w-mobile-full {
        width: 100% !important;
    }
    
    /* 移动端文本居中 */
    .text-mobile-center {
        text-align: center !important;
    }
}

/* ===== 平板端优化 (768px - 991px) ===== */
@media (min-width: 768px) and (max-width: 991px) {
    .section {
        padding: 50px 0;
    }
    
    .section-header h2 {
        font-size: 26px;
    }
    
    .hide-tablet {
        display: none !important;
    }
}

/* ===== IE浏览器兼容 ===== */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    /* IE10+ 特定样式 */
    .row {
        display: block;
    }
    
    .row::after {
        content: "";
        display: table;
        clear: both;
    }
    
    [class*="col-"] {
        float: left;
    }
}

/* ===== 打印样式 ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a {
        text-decoration: underline;
    }
    
    .container {
        max-width: 100%;
    }
}

/* ===== 触摸设备优化 ===== */
@media (hover: none) and (pointer: coarse) {
    /* 触摸设备：移除hover效果，使用active */
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        opacity: 0.8;
    }
}

/* ===== 减少动画（用户偏好） ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== 暗黑模式支持 ===== */
@media (prefers-color-scheme: dark) {
    /* 如需支持暗黑模式可在此添加 */
}
