/**
 * 响应式样式
 */

/* 超大屏幕 (≥1400px) */
@media (min-width: 1400px) {
    .container-xxl {
        max-width: 1320px;
    }
    
    .auth-container {
        padding: 2rem;
    }
    
    .dashboard-stats .stat-card {
        padding: 2rem;
    }
}

/* 大屏幕 (≥1200px) */
@media (min-width: 1200px) {
    .sidebar {
        width: 280px;
    }
    
    .main-content {
        margin-left: 280px;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 中等屏幕 (≥992px) */
@media (min-width: 992px) {
    .auth-card {
        max-width: 450px;
        padding: 3rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .data-table-container {
        overflow-x: visible;
    }
}

/* 小屏幕 (≥768px) */
@media (min-width: 768px) {
    .auth-container {
        padding: 1.5rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mobile-menu-toggle {
        display: none;
    }
}

/* 超小屏幕 (<768px) */
@media (max-width: 767.98px) {
    /* 认证页面 */
    .auth-container {
        padding: 1rem;
        min-height: 100vh;
        display: flex;
        align-items: center;
    }
    
    .auth-card {
        width: 100%;
        max-width: none;
        padding: 2rem 1.5rem;
        margin: 0;
        border-radius: 0;
        min-height: auto;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
    }
    
    .auth-logo {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* 侧边栏 */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        background: #fff;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    /* 主内容区 */
    .main-content {
        margin-left: 0;
        padding-top: 70px;
    }
    
    .top-navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        padding: 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #666;
        cursor: pointer;
    }
    
    /* 仪表板 */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-stats .stat-card {
        padding: 1.5rem 1rem;
        text-align: center;
    }
    
    .stat-card .stat-value {
        font-size: 1.8rem;
    }
    
    /* 表格 */
    .data-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    /* 表单 */
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        margin-bottom: 1rem;
    }
    
    /* 按钮 */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
    }
    
    /* 卡片 */
    .card {
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .card-header {
        padding: 1rem;
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* 模态框 */
    .modal-dialog {
        margin: 1rem;
        max-width: none;
    }
    
    .modal-content {
        border-radius: 8px;
    }
    
    /* 积分操作面板 */
    .point-operation-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        padding: 1rem;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 1020;
    }
    
    /* 学生列表 */
    .student-card {
        padding: 1rem;
        margin-bottom: 0.5rem;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        background: #fff;
    }
    
    .student-card .student-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.5rem;
    }
    
    .student-card .student-points {
        font-size: 1.2rem;
        font-weight: 600;
        color: #007bff;
    }
    
    /* 小组管理 */
    .group-card {
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .group-members {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    /* 商城 */
    .shop-item-card {
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .shop-item-image {
        height: 150px;
        object-fit: cover;
        border-radius: 8px 8px 0 0;
    }
    
    /* 统计图表 */
    .chart-container {
        position: relative;
        height: 250px;
        margin: 1rem 0;
    }
    
    /* 浮动操作按钮 */
    .fab {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: #007bff;
        color: #fff;
        border: none;
        font-size: 1.5rem;
        box-shadow: 0 4px 12px rgba(0,123,255,0.4);
        z-index: 1000;
        transition: all 0.3s ease;
    }
    
    .fab:hover {
        background: #0056b3;
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0,123,255,0.6);
    }
}

/* 超小屏幕 (<576px) */
@media (max-width: 575.98px) {
    .auth-card {
        padding: 1.5rem 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .dashboard-stats .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.25rem;
        font-size: 0.8rem;
    }
}

/* 横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-container {
        padding: 0.5rem;
    }
    
    .auth-card {
        padding: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .auth-header {
        margin-bottom: 1rem;
    }
    
    .auth-logo {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .auth-header h1 {
        font-size: 1.25rem;
        margin: 0.5rem 0;
    }
}

/* 打印样式 */
@media print {
    .sidebar,
    .top-navbar,
    .fab,
    .btn,
    .point-operation-panel {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .data-table {
        font-size: 12px !important;
    }
    
    .data-table th,
    .data-table td {
        padding: 4px !important;
        border: 1px solid #000 !important;
    }
}