/* ==================== 响应式设计 - 手机端适配 ==================== */

/* 平板和手机设备 (最大宽度 1024px) */
@media screen and (max-width: 1024px) {
    #header-full {
        min-width: auto;
    }

    #header,
    #nav-container,
    #content,
    #footer-copyright-content,
    #footer-container {
        width: 100%;
        padding: 0 15px;
    }

    .home #main-content {
        width: 100%;
    }

    #sidebar-footer-left,
    #sidebar-footer-middle {
        width: 48%;
        margin-right: 4%;
    }

    #footer-address {
        width: 100%;
        float: none;
        margin: 20px 0 0 0;
    }

    .news-sidebar table,
    .event-sidebar table {
        border-spacing: 0 10px;
    }
}

/* 小型平板设备 (最大宽度 768px) - 隐藏Banner */
@media screen and (max-width: 768px) {
    /* 隐藏Banner轮播图 */
    #img_bar_list {
        display: none !important;
    }

    /* 隐藏学术信息日期小部件 */
    .event-date-widget {
        display: none !important;
    }

    .event-content-widget {
        width: 100% !important;
        float: none !important;
    }

    /* Header 响应式 */
    #header-full {
        min-width: auto;
    }

    #header {
        height: 60px;
        padding: 0 15px;
    }

    #main-header {
        height: 110px;
    }

    #logo {
        margin: 10px 0 0 0;
    }

    #logo img {
        max-width: 180px;
        height: auto;
    }

    /* 导航菜单响应式 */
    #nav {
        position: relative;
        height: auto;
        background: #09F;
    }

    #nav-container {
        height: auto;
        padding: 0;
        width: 100%;
    }

    .open-menu {
        display: block;
        position: absolute;
        top: -45px;
        right: 15px;
        z-index: 3000;
    }

    .open-menu .icon-bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 6px 0;
        background: #333;
        transition: all 0.3s;
    }

    #nav-main {
        display: none;
        float: none;
        width: 100%;
        height: auto;
        background: #fff;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 2500;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    #nav-main li {
        float: none;
        width: 100%;
        height: auto;
        border-bottom: 1px solid #e5e5e5;
    }

    #nav-main li a {
        float: none;
        display: block;
        width: 100%;
        height: auto;
        padding: 15px 20px;
        font-size: 15px;
        color: #333;
        background: #fff;
    }

    #nav-main li:hover ul {
        display: none;
    }

    /* 当菜单激活时显示 */
    #nav-main.active {
        display: block;
    }

    .close-menu {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
        z-index: 3000;
    }

    .close-menu .icon-bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 6px 0;
        background: #333;
    }

    .close-menu .icon-bar:first-child {
        transform: rotate(45deg);
        position: relative;
        top: 9px;
    }

    .close-menu .icon-bar:nth-child(2) {
        opacity: 0;
    }

    .close-menu .icon-bar:last-child {
        transform: rotate(-45deg);
        position: relative;
        top: -9px;
    }

    /* 内容区域响应式 */
    .home #content-container {
        min-width: auto;
        padding-top: 20px;
    }

    #main-content {
        width: 100%;
        float: none;
        padding: 0;
    }

    .sidebar-homepage {
        width: 100%;
        margin-bottom: 20px;
    }

    #news-slider {
        width: 100%;
        float: none;
        margin-bottom: 20px;
    }

    #u_u3_centerCutImg {
        width: 100% !important;
        height: auto !important;
    }

    #u_u3_div {
        width: 100% !important;
        height: auto !important;
    }

    #u_u3_pic {
        width: 100% !important;
        height: auto !important;
    }

    #news-list {
        width: 100%;
        float: none;
    }

    .news-sidebar table,
    .event-sidebar table {
        border-spacing: 0;
    }

    .news-sidebar tr,
    .event-sidebar tr {
        display: block;
        margin-bottom: 15px;
    }

    .news-sidebar td,
    .event-sidebar td {
        display: block;
        width: 100% !important;
        padding: 15px !important;
        border-radius: 8px;
        margin-bottom: 10px;
        text-align: left !important;
    }

    .news-sidebar h4 a,
    .event-sidebar h5 a {
        font-size: 15px !important;
        line-height: 1.6;
        text-align: left !important;
        display: block;
    }

    .news-sidebar h4,
    .event-sidebar h5 {
        text-align: left !important;
        height: auto !important;
    }

    .date-news {
        text-align: left !important;
        display: inline-block;
    }

    .news-sidebar li,
    .event-sidebar li {
        text-align: left !important;
    }

    /* Footer 响应式 */
    #main-footer {
        min-width: auto;
    }

    #footer-copyright {
        min-width: auto;
        height: auto;
        padding: 30px 0;
    }

    #footer-copyright-content {
        height: auto;
        padding: 0 15px;
    }

    #logo-footer {
        width: 180px;
        height: 50px;
        float: none;
        margin: 0 auto 20px 0;
    }

    #logo-footer img {
        width: 100%;
        height: auto;
    }

    #text-address,
    #text-address.p {
        float: none;
        margin: 10px 0;
        text-align: left;
    }

    #nav-footer {
        flex-direction: column;
        align-items: flex-start;
        margin: 20px 0 0 0;
    }

    #nav-footer li {
        float: none;
        border-left: none;
        border-bottom: 1px solid rgba(255,255,255,0.3);
        padding: 10px 0;
        width: 100%;
    }

    #nav-footer li:last-child {
        border-bottom: none;
    }
}

/* 手机设备 (最大宽度 480px) */
@media screen and (max-width: 480px) {
    /* 基础设置 */
    body {
        font-size: 13px;
    }

    /* Header */
    #header {
        height: 50px;
    }

    #main-header {
        height: 95px;
    }

    #logo img {
        max-width: 150px;
        height: auto;
    }

    .open-menu {
        top: -40px;
        right: 10px;
    }

    /* 导航菜单 */
    #nav-main li a {
        padding: 12px 15px;
        font-size: 14px;
    }

    /* Widget 标题 */
    .widget-title {
        font-size: 18px !important;
        padding: 0 0 12px 0 !important;
    }

    .widget-title .more {
        font-size: 12px;
        padding: 2px 8px;
    }

    /* 新闻列表 */
    .news-sidebar td,
    .event-sidebar td {
        padding: 12px !important;
        text-align: left !important;
    }

    .news-sidebar h4 a,
    .event-sidebar h5 a {
        font-size: 14px !important;
        line-height: 1.5;
        text-align: left !important;
        display: block;
    }

    .news-sidebar h4,
    .event-sidebar h5 {
        text-align: left !important;
        height: auto !important;
    }

    .date-news {
        font-size: 11px !important;
        text-align: left !important;
        display: inline-block;
    }

    .event-content-widget article > div {
        font-size: 11px !important;
        line-height: 1.6;
    }

    /* 侧边栏 */
    .sidebar-homepage .widget-container {
        padding: 20px 15px !important;
        margin-bottom: 25px !important;
    }

    /* Footer */
    #footer-copyright {
        padding: 20px 0;
    }

    #logo-footer {
        width: 150px;
        height: 42px;
    }

    #text-address {
        font-size: 11px;
    }

    #nav-footer {
        font-size: 13px;
    }
}

/* 超小屏幕设备 (最大宽度 360px) */
@media screen and (max-width: 360px) {
    body {
        font-size: 12px;
    }

    #logo img {
        max-width: 130px;
    }

    .widget-title {
        font-size: 16px !important;
    }

    .news-sidebar h4 a,
    .event-sidebar h5 a {
        font-size: 13px !important;
    }

    .event-content-widget article > div {
        font-size: 10px !important;
    }
}

/* 横屏手机适配 */
@media screen and (max-width: 768px) and (orientation: landscape) {
    #main-header {
        height: 90px;
    }

    #header {
        height: 50px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .sidebar-homepage .widget-container:hover {
        transform: none;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    }

    .news-sidebar td:hover,
    .event-sidebar td:hover {
        background: #fdfdfd;
        border-color: #f0f3f5;
    }

    .widget-title .more:hover {
        background: transparent;
        color: #999 !important;
    }
}

/* iOS Safari 特殊处理 */
@supports (-webkit-touch-callout: none) {
    #nav-main li a {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }

    .sidebar-homepage .widget-container {
        -webkit-overflow-scrolling: touch;
    }
}

/* 图片响应式 */
@media screen and (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }

    .event-date-widget img {
        display: none;
    }
}
