/* 响应式设计样式 */

/* 超小屏幕 (手机) */
@media (max-width: 576px) {
    .container {
        padding: 10px;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    .table-responsive {
        font-size: 12px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* 移动端导航栏优化 */
    .header-content {
        padding: 0 15px;
        height: 56px; /* 减小导航栏高度 */
        position: relative;
    }
    
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        padding: 8px;
        margin-right: 10px;
        cursor: pointer;
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1002;
    }
    
    .hamburger-line {
        width: 24px;
        height: 2px;
        background-color: #1890ff;
        margin: 2px 0;
        transition: all 0.3s ease;
        border-radius: 1px;
    }
    
    .mobile-menu-btn.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-btn.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-btn.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .logo {
        margin-left: 50px; /* 为汉堡按钮留出空间 */
        flex: 1;
        justify-content: center;
        padding-right: 50px; /* 保持居中 */
    }
    
    .logo-img {
        width: 28px;
        height: 28px;
    }
    
    .logo-text {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100vw - 120px); /* 防止文字溢出 */
    }
    
    .nav {
        position: fixed;
        top: 56px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 56px);
        background: white;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
        flex-direction: column;
        padding: 20px 0;
        gap: 0;
        transition: left 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
    }
    
    .nav.show {
        left: 0;
    }
    
    .nav-link {
        padding: 15px 20px;
        border-radius: 0;
        border-left: 3px solid transparent;
        font-size: 16px;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background-color: #f0f7ff;
        border-left-color: #1890ff;
        color: #1890ff;
    }
    
    .mobile-nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mobile-nav-overlay.show {
        display: block;
        opacity: 1;
    }
    
    .header-actions {
        display: none; /* 移动端隐藏操作按钮区域 */
    }
    
    /* 防止body滚动当侧边栏打开时 */
    body.menu-open {
        overflow: hidden;
    }
    
    /* 英雄区域按钮优化 */
    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .hero-actions .btn-large {
        width: 200px; /* 统一宽度 */
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .hero-title {
        font-size: 32px; /* 减小标题字体 */
        margin-bottom: 16px;
    }
    
    .hero-description {
        font-size: 16px; /* 减小描述字体 */
        margin-bottom: 24px;
        padding: 0 10px; /* 添加内边距 */
    }
    
    .hero-section {
        padding: 60px 0; /* 减小上下内边距 */
    }

/* 小屏幕 (平板) */
@media (min-width: 577px) and (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .mobile-menu-btn {
        display: none;
    }
}

/* 中等屏幕 (小桌面) */
@media (min-width: 769px) and (max-width: 992px) {
    .sidebar {
        width: 250px;
    }
}

/* 超小屏幕（小于480px） */
@media (max-width: 480px) {
    .logo {
        margin-left: 45px;
        padding-right: 10px;
        justify-content: flex-start;
    }
    
    .logo-text {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100vw - 120px);
        display: block;
    }
    
    .mobile-menu-btn {
        left: 10px;
        width: 35px;
        height: 35px;
        padding: 6px;
    }
    
    .hamburger-line {
        width: 20px;
        height: 2px;
        margin: 1.5px 0;
    }
    
    .mobile-menu-btn.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(4px, 4px);
    }
    
    .mobile-menu-btn.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -5px);
    }
}

/* 大屏幕 (桌面) */
@media (min-width: 993px) {
    .sidebar {
        width: 280px;
    }
}

/* 移动端导航 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #007bff;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* 响应式表格 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 移动端表格优化 */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .data-table {
        min-width: 600px; /* 确保表格有最小宽度 */
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 12px;
        white-space: nowrap;
    }
    
    .data-table th {
        font-size: 12px;
        font-weight: 600;
        background: #f8f9fa;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .data-table td {
        font-size: 13px;
    }
    
    /* 操作按钮在移动端优化 */
    .data-table .btn {
        padding: 4px 8px;
        font-size: 12px;
        margin: 2px;
    }
    
    /* 状态标签优化 */
    .status-badge {
        font-size: 11px;
        padding: 2px 6px;
    }
}

/* 超小屏幕表格优化 */
@media (max-width: 576px) {
    .table-container {
        margin: 0 -10px; /* 扩展到屏幕边缘 */
        border-radius: 0;
    }
    
    .data-table {
        min-width: 500px; /* 减少最小宽度 */
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }
    
    .data-table th {
        font-size: 11px;
    }
    
    .data-table td {
        font-size: 11px;
    }
    
    /* 操作按钮进一步优化 */
    .data-table .btn {
        padding: 3px 6px;
        font-size: 10px;
        margin: 1px;
    }
    
    /* 状态标签进一步优化 */
    .status-badge {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    /* 分页在移动端优化 */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination .page-link {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* 响应式卡片 */
.card {
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .card-columns {
        column-count: 1;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .card-columns {
        column-count: 2;
    }
}

@media (min-width: 993px) {
    .card-columns {
        column-count: 3;
    }
}

/* 响应式表单 */
@media (max-width: 576px) {
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-control,
    .form-select {
        font-size: 16px; /* 防止iOS缩放 */
        min-height: 44px; /* 确保触摸目标足够大 */
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        touch-action: auto; /* 允许滚动 */
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 5px;
    }
    
    /* 移动端select特殊处理 */
    select {
        -webkit-appearance: menulist-button;
        -moz-appearance: menulist-button;
        appearance: menulist-button;
        background-color: white;
        border: 1px solid #d9d9d9;
        border-radius: 4px;
        padding: 12px 16px;
        font-size: 16px;
        min-height: 44px;
        width: 100%;
        cursor: pointer;
        touch-action: auto; /* 允许滚动 */
        -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
        overflow: visible; /* 确保选项可以显示 */
    }
    
    select:focus {
        outline: none;
        border-color: #40a9ff;
        box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
    }
    
    /* 确保select选项可以滚动 */
    select option {
        padding: 8px 12px;
        font-size: 16px;
        line-height: 1.4;
    }
    
    /* 移动端select容器优化 */
    .form-select-wrapper {
        position: relative;
        overflow: visible;
        touch-action: auto;
    }
    
    /* 确保移动端select可以正常交互 */
    select:not([multiple]) {
        -webkit-appearance: menulist;
        -moz-appearance: menulist;
        appearance: menulist;
    }
    
    /* 多选select的特殊处理 */
    select[multiple] {
        -webkit-appearance: listbox;
        -moz-appearance: listbox;
        appearance: listbox;
        height: auto;
        min-height: 120px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* 响应式图表 */
.chart-container {
    position: relative;
    height: 300px;
}

@media (max-width: 768px) {
    .chart-container {
        height: 250px;
    }
}

/* 响应式模态框 */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-content {
        border-radius: 10px;
    }
}

/* 响应式导航栏 */
.navbar-brand {
    font-size: 1.2rem;
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 8px 12px;
    }
}

/* 响应式按钮组 */
@media (max-width: 576px) {
    .btn-group {
        display: flex;
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 4px !important;
        margin-bottom: 5px;
    }
}

/* 响应式搜索框 */
@media (max-width: 576px) {
    .search-container {
        margin-bottom: 15px;
    }
    
    .search-input {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .search-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* 响应式统计卡片 */
.stats-card {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

@media (max-width: 576px) {
    .stats-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .stats-card h3 {
        font-size: 1.5rem;
    }
    
    .stats-card p {
        font-size: 0.9rem;
    }
}

/* 响应式数据表格 */
@media (max-width: 768px) {
    .table th,
    .table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .table .btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* 响应式分页 */
@media (max-width: 576px) {
    .pagination {
        justify-content: center;
    }
    
    .pagination .page-link {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* 响应式工具提示 */
@media (max-width: 576px) {
    .tooltip {
        font-size: 12px;
    }
}

/* 响应式加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 系统介绍响应式样式 */
@media (max-width: 768px) {
    .system-intro-section {
        padding: 60px 0;
    }
    
    .system-intro-content .info-section-item {
        margin-bottom: 36px;
    }
    
    .system-intro-content .info-section-item h4 {
        font-size: 20px;
        margin-bottom: 16px;
    }
    
    .system-intro-content .info-section-item p {
        font-size: 15px;
        line-height: 1.7;
        margin-bottom: 20px;
    }
    
    .system-intro-content .info-section-item li {
        font-size: 14px;
        line-height: 1.7;
        margin-bottom: 12px;
        padding-left: 24px;
    }
    
    .system-intro-content .info-section-item li::before {
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .system-intro-section {
        padding: 40px 0;
    }
    
    .system-intro-content {
        padding: 0 15px;
    }
    
    .system-intro-content .info-section-item {
        margin-bottom: 28px;
    }
    
    .system-intro-content .info-section-item h4 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .system-intro-content .info-section-item p {
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 16px;
    }
    
    .system-intro-content .info-section-item li {
        font-size: 13px;
        line-height: 1.6;
        margin-bottom: 10px;
        padding-left: 20px;
    }
    
    .system-intro-content .info-section-item li::before {
        font-size: 12px;
    }
}

/* 移动端优化 */
@media (max-width: 576px) {
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
    
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .row {
        margin-left: -5px;
        margin-right: -5px;
    }
    
    .col,
    [class*="col-"] {
        padding-left: 5px;
        padding-right: 5px;
    }
}
