/* 移动端顶部logo样式 */
@media screen and (max-width: 768px) {
    header.top-logo-only {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 15px;
        background: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    #cd-logo img {
        height: 40px;
        width: auto;
    }
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    margin: 6px 0;
    transition: 0.4s;
}

/* 响应式布局样式 */
/* 移动端导航菜单样式 */
.nav.mobile-menu-open ul {
    display: block;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 999;
}

.nav.mobile-menu-open ul li {
    border-bottom: 1px solid #eee;
}

.submenu-expand {
    display: none;
    float: right;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    margin-left: 10px;
    cursor: pointer;
}

/* 通用响应式样式 */
img {
    max-width: 100%;
    height: auto;
}

@media screen and (max-width: 768px) {
    /* 移动端菜单样式 */
    .nav {
        position: relative;
    }
    
    .nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 0;
        margin: 0;
        background-color: #fff;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 1000;
    }
    
    .nav.mobile-menu-open ul {
        display: flex;
    }
    
    .nav ul li {
        width: 100%;
        padding: 0;
        border-bottom: 1px solid #eee;
    }
    
    .nav ul li a {
        padding: 15px;
        display: block;
        text-align: left;
    }
    
    .nav ul li ul {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        background-color: #f9f9f9;
    }
    
    .nav ul li.submenu-open > ul {
        display: block;
    }
    
    .nav ul li ul li {
        border-bottom: none;
        border-top: 1px solid #eee;
    }
    
    .nav ul li ul li a {
        padding-left: 30px;
    }
    
    /* 移动端菜单按钮样式 */
    .mobile-menu-btn {
        position: absolute !important;
        right: 15px !important;
        top: 15px !important;
        width: 30px !important;
        height: 25px !important;
        cursor: pointer !important;
        z-index: 1001 !important;
        transition: all 0.3s ease !important;
    }
    
    .mobile-menu-btn span {
        display: block !important;
        position: absolute !important;
        height: 3px !important;
        width: 100% !important;
        background: #333 !important;
        border-radius: 3px !important;
        opacity: 1 !important;
        left: 0 !important;
        transform: rotate(0deg) !important;
        transition: .25s ease-in-out !important;
    }
    
    /* 菜单展开/折叠动画 */
    .nav ul {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
    }
    
    .nav.mobile-menu-open ul {
        max-height: 1000px; /* 足够大的高度以容纳所有内容 */
    }
    
    .nav ul li ul {
        max-height: 0;
        transition: max-height 0.3s ease-in-out;
    }
    
    .nav ul li.submenu-open > ul {
        max-height: 500px; /* 足够大的高度以容纳子菜单内容 */
    }
    
    /* 子菜单展开按钮样式 */
    .submenu-expand {
        display: inline-block;
        width: 30px;
        height: 30px;
        line-height: 30px;
        text-align: center;
        margin-left: 10px;
        cursor: pointer;
        font-weight: bold;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0,0,0,0.05);
        border-radius: 50%;
        transition: all 0.3s ease;
    }
    
    .submenu-expand:hover {
        background: rgba(0,0,0,0.1);
    }
    
    /* 移动端菜单触摸反馈 */
    .nav ul li a {
        position: relative;
        overflow: hidden;
    }
    
    .nav ul li a::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 5px;
        height: 5px;
        background: rgba(0,0,0,0.2);
        opacity: 0;
        border-radius: 100%;
        transform: scale(1, 1) translate(-50%);
        transform-origin: 50% 50%;
    }
    
    .nav ul li a:active::after {
        animation: ripple 1s ease-out;
    }
    
    @keyframes ripple {
        0% {
            transform: scale(0, 0);
            opacity: 0.5;
        }
        100% {
            transform: scale(100, 100);
            opacity: 0;
        }
    }
    
    /* 优化菜单在不同设备上的显示 */
    @supports (-webkit-touch-callout: none) {
        /* iOS设备特定样式 */
        .nav ul {
            -webkit-overflow-scrolling: touch;
        }
        
        .nav ul li a {
            padding: 15px 20px; /* 增加点击区域 */
        }
    }
    
    /* 顶部区域响应式 */
    .top {
        padding: 10px 15px;
    }
    
    .top-logo {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .top-logo img {
        max-width: 80%;
    }
    
    .top-mindle {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .top-right {
        width: 100%;
        text-align: center;
    }
    
    .top-right-l, .top-right-r {
        float: none;
        display: inline-block;
        vertical-align: middle;
    }

    /* 底部区域响应式 */
    .kell-footer-wrap {
        padding: 20px 15px;
    }

    .kell-footer-wrap-ul li,
    .kell-footer-wrap-ul-1 li,
    .kell-footer-wrap-ul-2 li {
        width: 100%;
        float: none;
        margin-bottom: 20px;
        text-align: center;
    }

    .kell-footer-wrap-ul-2 ul li {
        width: 100%;
        margin-right: 0;
    }

    /* 新闻列表优化 */
    .news-xj-wrap {
        padding: 15px;
    }

    .news-xj-wrap h3,
    .news-xj-wrap h4 {
        text-align: center;
    }

    .news-xj-wrap-content-list li {
        margin-bottom: 15px;
        padding: 10px;
        /* background: #fff; */
        /* box-shadow: 0 2px 5px rgba(0,0,0,0.1); */
        transition: transform 0.3s ease;
    }

    .news-xj-wrap-content-list li:hover {
        transform: translateY(-3px);
    }

    /* 分页导航优化 */
    .hzal-fy {
        padding: 20px 0;
    }

    .hzal-fy-page {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }

    .hzal-fy-page li {
        margin: 0;
    }

    .hzal-fy-page li a,
    .hzal-fy-page li span {
        padding: 8px 12px;
        font-size: 14px;
    }

    /* 添加平滑过渡效果 */
    .nav ul li a,
    .news-page-right-l-desc-a,
    .hzal-fy-page li a {
        transition: all 0.3s ease;
    }

    /* 优化移动端触摸体验 */
    .nav ul li a,
    .news-page-right-l-desc-a,
    .hzal-fy-page li a {
        -webkit-tap-highlight-color: transparent;
    }
    /* 显示移动端菜单按钮 */
    .mobile-menu-btn {
        display: block;
    }

    /* 默认隐藏导航菜单 */
    .nav > ul {
        display: none;
    }

    /* 显示子菜单展开按钮 */
    .submenu-expand {
        display: inline-block;
    }

    /* 移动端导航样式 */
    .nav {
        position: relative;
        padding: 15px 0;
    }

    .nav ul li {
        padding: 0;
    }

    .nav ul li a {
        padding: 12px 15px;
        display: block;
    }

    .nav ul li ul {
        display: none;
        background: #f5f5f5;
    }

    .nav ul li.submenu-open > ul {
        display: block;
    }

    /* 移除新闻列表样式，由mobile-news.css处理 */
    /* 这里故意留空，移除了可能与mobile-news.css冲突的样式 */

    .news-page-right-l h3 {
        margin-top: 10px;
    }

    .news-page-right-l-desc {
        margin: 10px 0;
    }

    .news-page-right-l-desc-a {
        display: inline-block;
        margin-top: 10px;
    }

    /* 整体容器宽度调整 */
    .news-xj-wrap,
    .news-banner-wrap,
    .hzal-fy-wrap {
        width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
    }

    /* 导航菜单响应式 */
    .nav ul {
        flex-direction: column;
    }
    
    .nav ul li {
        width: 100%;
        text-align: center;
    }
    
    .nav ul li ul {
        position: static;
        width: 100%;
    }

    /* 新闻列表响应式 */
    .news-page-left,
    .news-page-right {
        width: 100%;
        float: none;
    }
    
    .news-page-left {
        margin-bottom: 15px;
    }
    
    .news-page-left img {
        width: 100%;
        height: auto;
    }

    /* 新闻标题和描述 */
    .news-page-right-l h3 {
        font-size: 16px;
        line-height: 1.4;
    }
    
    .news-page-right-l-desc {
        font-size: 14px;
        line-height: 1.6;
    }

    /* 日期显示 */
    .news-page-right-date {
        position: static;
        margin-top: 10px;
        text-align: left;
    }

    /* 分页按钮 */
    .hzal-fy-page li {
        margin: 0 2px;
    }
    
    .hzal-fy-page li a {
        padding: 5px 10px;
    }

    /* Banner图片 */
    .news-banner {
        height: auto;
    }
    
    .news-banner-wrap-right img {
        width: 100%;
        height: auto;
    }

    /* 清除浮动影响 */
    .clear {
        clear: both;
        display: block;
    }
}

/* 平板设备样式 */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .news-xj-wrap,
    .news-banner-wrap,
    .hzal-fy-wrap {
        width: 95%;
        margin: 0 auto;
    }
    
    .news-page-left {
        width: 30%;
    }
    
    .news-page-right {
        width: 67%;
    }
    
    /* 平板导航优化 */
    .nav ul li {
        padding: 0 10px;
    }
    
    .nav ul li a {
        font-size: 14px;
    }
    
    /* 顶部区域优化 */
    .top-logo {
        width: 25%;
    }
    
    .top-mindle {
        width: 45%;
    }
    
    .top-right {
        width: 30%;
    }
    
    /* 底部区域优化 */
    .kell-footer-wrap-ul li {
        width: 30%;
    }
    
    .kell-footer-wrap-ul-1 li {
        width: 30%;
    }
    
    .kell-footer-wrap-ul-2 li {
        width: 30%;
        margin-right: 3%;
    }
}

/* 小屏幕电脑样式 */
@media screen and (min-width: 1025px) and (max-width: 1366px) {
    .news-xj-wrap,
    .news-banner-wrap,
    .hzal-fy-wrap {
        width: 90%;
        margin: 0 auto;
    }
    
    /* 新闻列表项悬停效果 */
    .news-xj-wrap-content-list-item-page li {
        transition: all 0.3s ease;
    }
    
    .news-xj-wrap-content-list-item-page li:hover {
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        transform: translateY(-5px);
    }
    
    .news-page-right-l-desc-a {
        transition: all 0.3s ease;
    }
    
    .news-page-right-l-desc-a:hover {
        background-color: #0056b3;
    }
}

/* 返回顶部按钮响应式样式 */
@media screen and (max-width: 768px) {
    .back-to-top {
        right: 15px;
        bottom: 15px;
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 20px;
    }
}

/* 触摸反馈样式 */
.touch-active {
    opacity: 0.7 !important;
    transition: opacity 0.2s ease !important;
}

/* 移动端表单元素优化 */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important; /* 防止iOS自动缩放 */
        padding: 10px !important;
        margin-bottom: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 4px !important;
        border: 1px solid #ddd !important;
    }
    
    button,
    input[type="submit"],
    input[type="button"] {
        padding: 12px 20px !important;
        font-size: 16px !important;
        width: 100% !important;
        margin-bottom: 15px !important;
        border-radius: 4px !important;
        background-color: #0066cc !important;
        color: white !important;
        border: none !important;
        cursor: pointer !important;
        -webkit-appearance: none !important; /* 移除iOS默认样式 */
    }
    
    /* 确保所有交互元素有足够的点击区域 */
    .nav ul li a,
    .news-page-right-l-desc-a,
    .hzal-fy-page li a,
    .back-to-top {
        min-height: 44px !important; /* Apple推荐的最小触摸目标尺寸 */
        min-width: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* 优化移动端搜索框 */
    .search-form {
        display: flex !important;
        width: 100% !important;
    }
    
    .search-form input[type="text"] {
        flex: 1 !important;
        margin-right: 10px !important;
        margin-bottom: 0 !important;
    }
    
    .search-form button {
        width: auto !important;
        margin-bottom: 0 !important;
    }
    
    /* 添加一些动画效果 */
    .news-xj-wrap-content-list li {
        animation: fadeIn 0.5s ease-in-out;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

/* 超小屏幕设备样式 */
@media screen and (max-width: 374px) {
    .top-logo img {
        max-width: 200px;
    }
    
    .nav ul li a {
        font-size: 14px;
        padding: 10px 8px;
    }
    
    .news-page-right-l h3 {
        font-size: 16px;
    }
    
    .news-page-right-l-desc {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .hzal-fy-page li a {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* 大屏幕设备优化 */
@media screen and (min-width: 1367px) {
    .news-xj-wrap,
    .news-banner-wrap,
    .hzal-fy-wrap {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .news-xj-wrap-content-list li {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    
    .news-xj-wrap-content-list li:hover {
        background: #666;
        transform: translateY(-5px);
        box-shadow: 0 10px 20px #0066cc14;
    }
}

/* 横屏模式样式 */
@media screen and (orientation: landscape) and (max-width: 900px) {
    .nav.mobile-menu-open ul {
        max-height: 80vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .top {
        padding: 5px 15px;
    }
    
    .top-logo {
        width: auto;
        margin-bottom: 0;
    }
    
    .top-logo img {
        max-height: 50px;
        width: auto;
    }
}

/* 辅助功能样式 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    body {
        background: white !important;
        color: black !important;
    }
    
    a {
        color: #0000EE !important;
    }
    
    .news-page-right-l-desc-a {
        background: black !important;
        color: white !important;
    }
    
    .nav ul li a:hover,
    .news-xj-wrap-content-list li:hover {
        background: black !important;
        color: white !important;
    }
}

/* 设备特定样式 */
.is-mobile .nav {
    -webkit-overflow-scrolling: touch;
}

.is-mobile .nav ul {
    max-height: calc(var(--vh, 1vh) * 100 - 60px);
}

.is-ios {
    /* 防止iOS中的橡皮筋效果 */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.is-ios .nav.mobile-menu-open {
    position: fixed;
    width: 100%;
    height: 100%;
    height: calc(var(--vh, 1vh) * 100);
    overflow: hidden;
}

.is-android .input-focused {
    /* 修复Android键盘弹出时的布局问题 */
    position: relative;
    height: auto !important;
}

/* 输入框焦点状态样式 */
.is-mobile input:focus,
.is-mobile textarea:focus,
.is-mobile select:focus {
    font-size: 16px !important; /* 防止iOS自动缩放 */
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,102,204,0.2);
}

/* 表单错误状态样式 */
.error {
    border-color: #ff3b30 !important;
    background-color: rgba(255,59,48,0.05) !important;
}

.error-message {
    color: #ff3b30;
    font-size: 12px;
    margin-top: 5px;
    animation: fadeIn 0.3s ease;
}

/* 辅助类和工具类 */
.touch-scroll {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

.no-scroll {
    overflow: hidden !important;
}

.hide-on-mobile {
    display: none !important;
}

.show-on-mobile {
    display: block !important;
}

@media screen and (min-width: 769px) {
    .hide-on-mobile {
        display: block !important;
    }
    
    .show-on-mobile {
        display: none !important;
    }
}

/* 性能优化相关样式 */
.will-change {
    will-change: transform;
}

.hardware-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 加载状态样式 */
.lazy-loading {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-loaded {
    opacity: 1;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        /* color: #f0f0f0; */
    }
    
    .nav ul li a,
    .news-page-right-l h3,
    .news-page-right-l-desc {
        /* color: #1e1e1e; */
    }
    
    .news-xj-wrap-content-list li {
        /* background: #2a2a2a; */
        /* border-color: #333; */
    }
    
    .news-page-right-l-desc-a {
        background: #0066cc;
        color: white;
    }
    
    .back-to-top {
        background: #0066cc;
        color: white;
    }
}

/* 打印样式 */
@media print {
    .nav,
    .top-right,
    .news-banner,
    .news-xj-wrap-content-list,
    .hzal-fy,
    .back-to-top,
    .news-page-right-l-desc-a {
        display: none !important;
    }
    
    .news-xj-wrap {
        width: 100% !important;
        padding: 0 !important;
    }
    
    .news-page-left,
    .news-page-right {
        width: 100% !important;
        float: none !important;
    }
    
    .news-page-right-l h3 {
        font-size: 18px !important;
        margin-top: 15px !important;
    }
    
    .news-page-right-l-desc {
        font-size: 14px !important;
    }
    
    .news-page-right-date {
        color: #666 !important;
    }
    
    a {
        color: #000 !important;
        text-decoration: none !important;
    }
}