/* 响应式设计统一管理 */

/* 全局样式优化 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fafbfc;
    overflow-x: hidden;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.d-none { display: none; }
.d-block { display: block; }

.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* 间距工具类 */
.m-0 { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

/* 断点定义 */
/* 超小屏幕 (手机竖屏) */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .d-sm-none { display: none; }
    .d-sm-block { display: block; }
    .d-sm-flex { display: flex; }
    
    .text-sm-center { text-align: center; }
    .text-sm-left { text-align: left; }
}

/* 小屏幕 (手机横屏) */
@media (min-width: 481px) and (max-width: 600px) {
    .container {
        padding: 0 16px;
    }
}

/* 中等屏幕 (平板) */
@media (min-width: 601px) and (max-width: 900px) {
    .container {
        padding: 0 24px;
    }
    
    .d-md-none { display: none; }
    .d-md-block { display: block; }
    .d-md-flex { display: flex; }
}

/* 大屏幕 (桌面) */
@media (min-width: 901px) {
    .container {
        padding: 0 32px;
    }
    
    .d-lg-none { display: none; }
    .d-lg-block { display: block; }
    .d-lg-flex { display: flex; }
}

/* 移动端特殊处理 */
@media (max-width: 600px) {
    /* 防止水平滚动 */
    html, body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* 触摸优化 */
    button, a, [role="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 字体大小优化 */
    body {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 图片响应式 */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* 表格响应式 */
    table {
        font-size: 14px;
    }
    
    /* 表单元素优化 */
    input, textarea, select {
        font-size: 16px; /* 防止iOS缩放 */
        border-radius: 8px;
    }
}

/* 平板端优化 */
@media (min-width: 601px) and (max-width: 900px) {
    /* 触摸优化 */
    button, a, [role="button"] {
        min-height: 40px;
        min-width: 40px;
    }
}

/* 动画优化 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .mobile-sidebar {
        border: 2px solid #000;
    }
    
    .sidebar-nav .nav-item > a,
    .sidebar-nav .nav-item > span.nav-label {
        border: 1px solid #000;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    /* 这里可以添加深色模式样式 */
}

/* 打印样式 */
@media print {
    .mobile-sidebar,
    .mobile-sidebar-mask,
    .menu-toggle {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
} 