/* =====================================================
   未来智典 - 移动端适配样式
   ===================================================== */

/* 基础样式 */
* {
    box-sizing: border-box;
}

/* 表格容器 */
.table-responsive {
    overflow-x: auto;
    max-width: 100%;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    font-weight: 600;
    color: #666;
    background: #f8f9fa;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    /* 主内容区 */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* 侧边栏 */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    /* 移动端菜单按钮 */
    .mobile-menu-btn {
        display: inline-block !important;
    }
    
    /* 内容区 */
    .content {
        padding: 15px !important;
    }
    
    /* 统计网格 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .stat-card {
        padding: 15px !important;
    }
    
    .stat-card .number {
        font-size: 1.5em !important;
    }
    
    /* 卡片 */
    .card {
        padding: 15px !important;
    }
    
    /* 表格 */
    .data-table {
        font-size: 0.85em;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

/* 超小屏幕 */
@media screen and (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ========== 抓取管理页面移动端优化 ========== */
@media screen and (max-width: 768px) {
    /* 统计卡片 - 2列显示，减小间距 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 15px !important;
    }

    .stat-card {
        padding: 12px 8px !important;
        min-height: auto !important;
    }

    .stat-card .number {
        font-size: 1.4em !important;
    }

    .stat-card .label {
        font-size: 0.8em !important;
        margin-top: 4px !important;
    }

    /* 控制按钮区域 - 垂直排列 */
    #crawler-content-cnki .card[style*="background: linear-gradient"] > div {
        flex-direction: column !important;
        padding: 10px !important;
    }

    #crawler-content-cnki .card[style*="background: linear-gradient"] .btn {
        width: 100% !important;
        padding: 10px !important;
        font-size: 1em !important;
    }

    /* 实时日志卡片 - 减小内边距 */
    #crawler-content-cnki .card:nth-of-type(3) {
        padding: 15px !important;
    }

    #crawler-content-cnki .card:nth-of-type(3) .card-header {
        flex-direction: column !important;
        gap: 10px !important;
        margin-bottom: 15px !important;
    }

    #crawler-content-cnki .card:nth-of-type(3) .card-header h2 {
        font-size: 1.1em !important;
    }

    /* 日志标签 - 减小字体 */
    .log-tab {
        padding: 6px 12px !important;
        font-size: 0.85em !important;
    }

    /* 日志容器 - 减小高度 */
    #logContainer {
        height: 300px !important;
        padding: 10px !important;
        font-size: 0.8em !important;
    }

    /* 配置管理卡片 - 减小内边距 */
    #crawler-content-cnki .card:nth-of-type(4) {
        padding: 15px !important;
    }

    #crawler-content-cnki .card:nth-of-type(4) .card-header {
        flex-direction: column !important;
        gap: 8px !important;
        margin-bottom: 15px !important;
    }

    #crawler-content-cnki .card:nth-of-type(4) .card-header h2 {
        font-size: 1.1em !important;
    }

    /* 配置标签页按钮 - 减小字体和间距 */
    .config-tab-btn {
        padding: 8px 12px !important;
        font-size: 0.85em !important;
    }

    /* 表格操作按钮 - 垂直排列 */
    .data-table td:last-child {
        display: flex !important;
        flex-direction: column !important;
        gap: 5px !important;
    }

    .data-table td:last-child .btn {
        width: 100% !important;
        margin: 0 !important;
        padding: 6px 10px !important;
        font-size: 0.8em !important;
    }

    /* 表格字体减小 */
    .data-table {
        font-size: 0.8em !important;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px !important;
    }
}
