/* 响应式设计 - 通用移动端适配 */
/* 适用于所有页面的移动端优化 */

/* 基础响应式设置 */
* {
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

html {
    scroll-behavior: smooth; /* 平滑滚动 */
}

body {
    overflow-x: hidden; /* 防止水平滚动 */
    -webkit-text-size-adjust: 100%; /* 防止iOS字体缩放 */
}

/* 容器响应式 */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏移动端适配 */
@media (max-width: 992px) {
    .navbar .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .navbar-brand {
        margin-bottom: 10px;
    }
    
    .navbar-links {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-link {
        font-size: 14px;
        padding: 6px 10px;
    }
}

@media (max-width: 768px) {
    .navbar .container {
        padding: 10px 15px;
    }
    
    .navbar-brand {
        font-size: 18px;
    }
    
    .logo-img {
        width: 36px;
        height: 36px;
        margin-right: 8px;
    }
    
    .navbar-links {
        gap: 6px;
    }
    
    .nav-link {
        font-size: 13px;
        padding: 5px 8px;
    }
}

@media (max-width: 480px) {
    .navbar .container {
        padding: 8px 10px;
    }
    
    .navbar-brand {
        font-size: 16px;
    }
    
    .logo-img {
        width: 32px;
        height: 32px;
        margin-right: 6px;
    }
    
    .navbar-links {
        gap: 4px;
    }
    
    .nav-link {
        font-size: 12px;
        padding: 4px 6px;
    }
}

/* 顶部信息栏移动端适配 */
@media (max-width: 768px) {
    .top-bar {
        font-size: 11px;
        height: auto;
        padding: 6px 0;
    }
}

/* 英雄区域移动端适配 */
@media (max-width: 768px) {
    .hero-section {
        height: 60vh;
        min-height: 400px;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero .sub-title {
        font-size: 18px;
    }
    
    .hero p {
        font-size: 14px;
        padding: 0 20px;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 10px;
        padding: 0 20px;
    }
    
    .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: 50vh;
        min-height: 350px;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .hero .sub-title {
        font-size: 16px;
    }
    
    .hero p {
        font-size: 13px;
        padding: 0 15px;
    }
}

/* 页面标题移动端适配 */
@media (max-width: 768px) {
    .page-title {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .page-subtitle {
        font-size: 14px;
        margin-bottom: 30px;
    }
}

/* 卡片网格移动端适配 */
@media (max-width: 992px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card {
        padding: 20px;
    }
}

/* 时间线滑块移动端适配 */
@media (max-width: 768px) {
    .timeline-slider {
        padding: 0 10px;
    }
    
    .timeline-dots {
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .dot-month {
        font-size: 12px;
    }
    
    .card-single {
        width: 85%;
    }
    
    .card-single.prev {
        transform: translateX(calc(-50% - 70%)) scale(0.9);
    }
    
    .card-single.next {
        transform: translateX(calc(-50% + 70%)) scale(0.9);
    }
}

/* 文化板块移动端适配 */
@media (max-width: 768px) {
    .culture-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .culture-card {
        padding: 20px;
    }
    
    .culture-content h3 {
        font-size: 18px;
    }
    
    .culture-feature {
        font-size: 14px;
    }
}

/* AI浮窗移动端适配 */
@media (max-width: 480px) {
    #ai-float-widget {
        right: 12px;
        bottom: 12px;
    }
    
    .ai-float-chat {
        width: calc(100vw - 24px);
        height: 70vh;
        right: 0;
        bottom: 70px;
        border-radius: 12px;
    }
    
    .ai-float-toggle {
        width: 50px;
        height: 50px;
    }
    
    .ai-float-toggle-icon {
        font-size: 24px;
    }
    
    .ai-float-backtop {
        width: 40px;
        height: 40px;
        bottom: 80px;
    }
}

/* 页脚移动端适配 */
@media (max-width: 768px) {
    .footer {
        padding: 15px 0;
    }
    
    .footer p {
        font-size: 12px;
    }
}

/* 表格移动端适配 */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    thead, tbody, th, td, tr {
        display: block;
    }
    
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
    }
    
    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }
    
    td:before {
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
    }
}

/* 图片响应式 */
img {
    max-width: 100%;
    height: auto;
}

/* 视频响应式 */
video {
    max-width: 100%;
    height: auto;
}

/* 表单元素移动端适配 */
@media (max-width: 768px) {
    input, textarea, select {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    button, .btn {
        min-height: 44px; /* 最小点击区域 */
    }
}

/* 滚动条美化（可选） */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none !important;
}

.visible-mobile {
    display: none !important;
}

.visible-desktop {
    display: block !important;
}

@media (max-width: 768px) {
    .visible-mobile {
        display: block !important;
    }
    
    .visible-desktop {
        display: none !important;
    }
    
    .hidden-mobile {
        display: none !important;
    }
}

/* 打印样式 */
@media print {
    .navbar, .top-bar, .ai-float-widget, .footer {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}