/* ===== 性能优化和响应式设计增强 ===== */

/* 基础性能优化 */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #232323;
    color: #fff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 图片懒加载和优化 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazy-load.loaded {
    opacity: 1;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ffb400;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 骨架屏加载效果 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 改进的导航栏 - 更好的响应式设计 */
.navbar {
  
    padding: 0;
    display: flex;
    align-items: center;
    height: 60px;
   
}



.navbar .logo {
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    letter-spacing: 2px;
}

.navbar nav {
    display: flex;
    align-items: center;
}

.navbar nav a {
    color: #fff;
    text-decoration: none;
    margin: 0 15px;
    font-size: 1em;
    transition: all 0.3s ease;
    position: relative;
}

.navbar nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffb400;
    transition: width 0.3s ease;
}

.navbar nav a:hover::after,
.navbar nav a.active::after {
    width: 100%;
}

.navbar nav a:hover,
.navbar nav a.active {
    color: #ffb400;
}

/* 移动端菜单 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #fff;
    margin: 3px 0;
    transition: 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* 改进的卡片设计 */
.card {
    background: #fff;
    /* color: #232323;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; */
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,180,0,0.1), rgba(255,140,0,0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.card:hover::before {
    opacity: 1;
}

.card img {
    width: 100%;
    height: 165px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.card-content {
    padding: 20px;
    position: relative;
    z-index: 2;
}

.card .card-title {
    font-size: 1.2em;
    font-weight: bold;
    margin: 0 0 10px 0;
    color: #333;
}

.card .card-desc {
    font-size: 0.95em;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* 改进的按钮设计 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #ffb400, #ff8c00);
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,180,0,0.4);
}

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

/* 表单优化 */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #ffb400;
    box-shadow: 0 0 0 3px rgba(255,180,0,0.1);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

/* 错误处理样式 */
.error-message {
    background: #ff4757;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease;
}

.success-message {
    background: #2ed573;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease;
}

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

/* 模态框优化 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

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

/* 响应式网格系统 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    padding: 0 15px;
    flex: 1;
}

.col-1 { flex: 0 0 8.333333%; }
.col-2 { flex: 0 0 16.666667%; }
.col-3 { flex: 0 0 25%; }
.col-4 { flex: 0 0 33.333333%; }
.col-6 { flex: 0 0 50%; }
.col-8 { flex: 0 0 66.666667%; }
.col-9 { flex: 0 0 75%; }
.col-12 { flex: 0 0 100%; }

/* 响应式设计 - 移动优先 */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }
    
    .navbar nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #333;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
    
    .navbar nav.show {
        display: flex;
    }
    
    .navbar nav a {
        margin: 10px 0;
        padding: 10px 0;
        border-bottom: 1px solid #444;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .section-row {
        flex-direction: column;
        align-items: center;
    }
    
    .stats {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 540px;
        padding: 0 15px;
    }
    
    .navbar {
        height: 50px;
    }
    
    .banner .banner-title {
        font-size: 1.8em;
        padding: 16px 24px;
    }
    
    .card {
        width: 100%;
        max-width: 300px;
        margin-bottom: 20px;
    }
    
    .col-md-6 { flex: 0 0 50%; }
    .col-md-12 { flex: 0 0 100%; }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    .navbar-container {
        padding: 0 15px;
    }
    
    .banner .banner-title {
        font-size: 1.5em;
        padding: 12px 20px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .col-sm-12 { flex: 0 0 100%; }
}

/* 性能优化 - 减少重绘和回流 */
.will-change {
    will-change: transform, opacity;
}

/* 无障碍访问优化 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点样式 */
*:focus {
    outline: 2px solid #ffb400;
    outline-offset: 2px;
}

/* 打印样式 */
@media print {
    .navbar,
    .floating-qr,
    .btn {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --card-bg: #2d2d2d;
    }
}

/* 减少动画的用户偏好 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}