/**
 * 厦门大学金融系网站 - 移动端适配CSS (基于实际CSS分析)
 * 
 * 使用方法：
 * 1. 在页面 <head> 中添加 viewport meta 标签：
 *    <meta name="viewport" content="width=device-width, initial-scale=1.0">
 * 2. 将此文件引入到页面中：
 *    <link rel="stylesheet" href="mobile.css">
 * 
 * 基于实际获取的 site.css 和 menu.css 分析生成
 */

/* ============================================
   1. 移动端菜单 (基于 #menu 和 #jsddm)
   ============================================ */
/* 导航栏容器 */
        .nav-container {
            position: relative;
        }

        /* 汉堡菜单按钮 - 默认在移动端显示 */
        .menu-toggle {
            display: none;  /* 默认隐藏，通过媒体查询显示 */
            background: none;
            border: none;
            cursor: pointer;
            padding: 15px;
            position: absolute;
            right: 15px;
            top: 0;
            background-color: #333;
        }

        .menu-toggle span {
            display: block;
            width: 25px;
            height: 3px;
            background-color: white;
            margin: 5px 0;
            transition: 0.3s;
        }

        /* 你的原始菜单结构 - 保持原有 id */
        #jsddm {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;  /* 桌面端水平排列 */
        }

        #jsddm li {
            position: relative;
        }

        #jsddm li a {
            display: block;
            padding: 15px 20px;
            color: white;
            text-decoration: none;
            transition: background 0.3s;
        }

        #jsddm li a:hover {
            background-color: #555;
        }

        /* 二级菜单 - 桌面端悬停显示 */
        #jsddm li ul {
            position: absolute;
            top: 100%;
            left: 0;
            background-color: #444;
            min-width: 180px;
            display: none;
            list-style: none;
            padding: 0;
            margin: 0;
            z-index: 100;
        }

        #jsddm li:hover > ul {
            display: block;
        }

        #jsddm li ul li {
            width: 100%;
        }

        #jsddm li ul li a {
            padding: 12px 20px;
        }

        /* ========== 移动端样式（屏幕宽度 ≤ 768px） ========== */
        @media screen and (max-width: 768px) {
            /* 显示汉堡菜单按钮 */
            .menu-toggle {
                display: block;
            }

            /* 菜单默认隐藏，添加 .active 类后显示 */
            #jsddm {
                display: none;
                flex-direction: column;
                width: 100%;
                padding-top: 50px; /* 给汉堡按钮留出空间 */
            }

            #jsddm.active {
                display: flex;
            }

            /* 移动端菜单项样式 */
            #jsddm li {
                border-top: 1px solid #555;
            }

            #jsddm li a {
                padding: 12px 20px;
            }

            /* 二级菜单在移动端的处理 */
            #jsddm li ul {
                position: static;
                display: none;
                background-color: #444;
                width: 100%;
                box-shadow: none;
            }

            /* 移动端：点击父级时显示子菜单（需要配合JS） */
            #jsddm li ul.show {
                display: block;
            }

            /* 为包含子菜单的项添加箭头指示（可选） */
            #jsddm li.has-submenu > a::after {
                content: " ▼";
                font-size: 12px;
                float: right;
            }
        }



/* ============================================
   2. 容器与布局适配 (基于 site.css 实际宽度)
   ============================================ */

@media screen and (max-width: 768px) {
    /* 主容器 - 1050px -> 100% */
    #main {
        width: 100% !important;
        min-width: auto !important;
        margin: 0 !important;
        padding: 0 10px !important;
        box-sizing: border-box;
        display: block !important;
    }
    
    /* 新闻轮播区域 - 1050px -> 100% */
    #slidnews {
        width: 100% !important;
        height: auto !important;
        min-height: 200px;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* 头部 - 1050px -> 100% */
    #header {
        width: 100% !important;
        min-width: auto !important;
        height: auto !important;
        min-height: 100px;
        margin: 0 !important;
        padding: 10px !important;
        box-sizing: border-box;
    }
    
    #header #nav {
        width: 100% !important;
        height: auto !important;
        background-color: #12489E !important;
        margin-top: 60px;
    }
    
    #header #nav ul {
        display: none; /* 顶部小导航在移动端也隐藏 */
    }
    
    #main_wrap {
        width: 100% !important;
    }
    
    /* Footer */
    #footer {
        width: 100% !important;
        min-width: auto !important;
        padding: 15px 10px !important;
        text-align: center !important;
        box-sizing: border-box;
    }
}

/* ============================================
   3. 模块与列表样式
   ============================================ */

@media screen and (max-width: 768px) {
    /* 新闻列表 - 基于 .module */
    .module {
        margin-bottom: 15px;
        background: #fff;
        border: 1px solid #eee;
        border-radius: 4px;
        overflow: hidden;
        width: 95%;
    }
    
    .module h1 {
        height: auto !important;
        padding: 10px 12px !important;
        border-bottom: 2px solid #C41E1E !important;
        margin: 0 !important;
    }
    
    .module h1 .title {
        font-family: "微软雅黑", "PingFang SC", "Heiti SC", sans-serif !important;
        font-size: 16px !important;
        height: auto !important;
        line-height: 30px !important;
        color: #144B9B !important;
        text-align: center !important;
        display: block !important;
        position: relative !important;
        padding: 0 10px !important;
        float: none !important;
    }
    
    .module .more {
        font-size: 12px;
        display: block;
        line-height: 30px;
        height: 29px;
        width: 40px;
        background: url(images/more.jpg) no-repeat 0 15px;
        font-weight: normal;
        float: right !important;
    }
    
    .module .content {
        padding: 10px 12px;
    }
    
    /* 列表项 - 基于 .module li */
    .module li {
        line-height: 30px !important;
        border-bottom: 1px dashed #ccc !important;
        list-style-type: none !important;
        padding: 5px 0 !important;
    }
    
    .module li:last-child {
        border-bottom: none !important;
    }
    
    .module li a {
        font-size: 14px !important;
        color: #000 !important;
        font-family: "宋体", "SimSun", sans-serif !important;
        background: url(images/arrow_hover1.gif) no-repeat left !important;
        padding-left: 12px !important;
        text-decoration: none !important;
    }
    
    .module li a:hover {
        color: Red !important;
    }
    
    /* 讲座列表 - 基于 .lecturelist */
    .lecturelist {
        width: 95%;
    }
    
    .lecturelist li {
        margin-top: 10px !important;
    }
    
    .lecturelist .tit {
        width: 100% !important;
    }
    
    .lecturelist .tim {
        width: 100% !important;
        margin-top: 10px !important;
        font-size: 12px !important;
        padding-left: 12px !important;
        color: #ff5e01 !important;
    }
    
    .lecturelist li .tit a {
        font-size: 15px !important;
    }
    
    .lecturelist table {
        width: 100% !important;
        margin-left: 0 !important;
        font-size: 14px !important;
    }
    .detail
   {
    margin: 10px 10px 10px 10px !important;
    }
   .detail .article_info
 {
    border-bottom: 1px solid #ccc;
    height: auto !important;
}
.detail .article_info .i
 {
    float: right;
    width: 100%;
    line-height: 30px !important;
    text-align: right;
}
}

/* ============================================
   4. 三栏布局适配
   ============================================ */

@media screen and (max-width: 768px) {
    /* 左栏 */
    #main #left {
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }
    
    /* 中栏 */
    #main #center {
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }
    
    /* 右栏 */
    #main #right {
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }
    
    /* 教师内容区域 */
    .teacher_content {
        width: 100% !important;
    }
    
    .teacher_content .teachertb {
        font-size: 12px !important;
        width: 100% !important;
        margin-left: 0 !important;
    }
    
    .teacher_content .teachertb tr td {
        padding: 5px !important;
    }
    
    .teacher_content .teachertb .imgtd {
        width: 75px !important;
        height: 100px !important;
    }
    
    .teacher_content #jysname span {
        text-align: center !important;
        font-size: 18px !important;
        font-weight: bolder !important;
        float: none !important;
    }
}

/* ============================================
   5. 图片与媒体适配
   ============================================ */

@media screen and (max-width: 768px) {
    img {
        max-width: 100% !important;
        height: auto !important;
        display: block;
    }
    
    #slidnews a img {
        border: 0 !important;
        width: 100% !important;
        height: auto !important;
    }
    
    /* Tab 切换 - 基于 #outer, #tab */
    #outer {
        width: 95%;
        margin: 10px auto 0 auto !important;
    }
    
    #tab {
        overflow: hidden;
        zoom: 1;
        border-bottom: 2px solid #C41E1E;
        height: 30px;
        width: 100% !important;
    }
    
    #tab li {
        cursor: pointer;
        line-height: 30px;
        font-family: "微软雅黑", "PingFang SC", "Heiti SC", sans-serif;
        font-size: 14px !important;
        font-weight: bold;
        height: 30px;
        line-height: 30px;
        color: #144B9B;
        text-align: center;
        display: block;
        position: relative;
        padding: 0 5px !important;
        float: left;
        border-bottom-style: none;
    }
    
    #tab li.current {
        color: #000;
        background: #ccc;
    }
    
    #content {
        border: 0px solid #000 !important;
        border-top-width: 0 !important;
        width: 100% !important;
    }
    
    #content ul {
        line-height: 25px;
        display: none;
        margin: 0 3px;
        padding: 10px 0;
        width: 100% !important;
    }
    
    /* 表格响应式 */
    .teacher_content .teachertb table,
    table {
        width: 100% !important;
        overflow-x: auto !important;
        display: block;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   6. 字体与排版适配
   ============================================ */

@media screen and (max-width: 768px) {
    body {
        font-size: 14px !important;
        line-height: 1.6 !important;
        -webkit-text-size-adjust: 100%;
    }
    
    #header #menu ul li a {
        font-size: 16px !important;
    }
    
    /* 链接样式 */
    #main a:hover {
        color: Red !important;
    }
    
    a {
        overflow-wrap: break-word;
        word-break: break-word;
    }
}

/* ============================================
   7. 底部Footer适配
   ============================================ */

@media screen and (max-width: 768px) {
 #footer .foot_link {
   background-color:#12489E;
}
 #footer .foot_weixin {
   background-color:#12489E;
}
    #footer {
        width: 100% !important;
        min-width: auto !important;
        padding: 15px 12px !important;
        text-align: center !important;
        box-sizing: border-box;
    }
    
    #footer ul {
        padding: 0;
        margin: 10px 0 !important;
        list-style: none;
        text-align: center;
    }
    
    #footer ul li {
        display: inline-block;
        margin: 0 8px !important;
    }
    
    #footer address {
        font-style: normal;
        font-size: 13px;
        line-height: 1.8;
    }
    
    #footer p {
        font-size: 13px;
        line-height: 1.8;
        margin: 5px 0;
    }
}

/* ============================================
   8. 小屏幕设备额外适配 (480px及以下)
   ============================================ */

@media screen and (max-width: 480px) {
    #header {
        min-height: 80px;
        padding: 5px !important;
    }
    
    .navbar-toggle {
        top: 5px;
        right: 5px;
        width: 40px;
        height: 40px;
    }
    
    #header #nav {
        margin-top: 50px;
    }
    
    .module h1 .title {
        font-size: 14px !important;
    }
    
    .module li a {
        font-size: 13px !important;
    }
    
    .xsdtmore {
        float: right !important;
        font-size: 12px !important;
        display: block;
        line-height: 30px;
        height: 30px;
        width: 30px;
        padding-left: 12px;
        background: url(images/more.gif) no-repeat 0 10px;
        font-weight: normal;
    }
}

/* ============================================
   9. 触摸交互优化
   ============================================ */

@media screen and (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: rgba(18, 72, 158, 0.2);
    }
    
    a:active,
    button:active {
        opacity: 0.8;
    }
    
    /* 禁用长按菜单 */
    * {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    input,
    textarea,
    select {
        -webkit-user-select: auto;
        user-select: auto;
    }
    
    /* 按钮最小触摸尺寸 */
    button,
    .btn,
    input[type="submit"] {
        min-height: 44px;
        padding: 10px 20px;
        cursor: pointer;
        touch-action: manipulation;
    }
}

/* ============================================
   10. 安全区域适配 (iPhone X及以上)
   ============================================ */

@supports (padding: max(0px)) {
    @media screen and (max-width: 768px) {
        #jsddm-mobile {
            padding-top: max(0px, env(safe-area-inset-top));
            padding-bottom: max(0px, env(safe-area-inset-bottom));
            padding-left: max(0px, env(safe-area-inset-left));
            padding-right: max(0px, env(safe-area-inset-right));
        }
        
        .navbar-toggle {
            top: max(10px, env(safe-area-inset-top));
            right: max(10px, env(safe-area-inset-right));
        }
    }
}

/* ============================================
   11. 打印样式优化
   ============================================ */

@media print {
    .navbar-toggle,
    #jsddm-mobile,
    .menu-overlay {
        display: none !important;
    }
    
    #menu {
        display: block !important;
    }
    
    #main,
    #header,
    #slidnews,
    #footer {
        width: 100% !important;
    }
}