/* 移动端专用样式 */

/* 桌面端隐藏移动端元素 */
@media screen and (min-width: 769px) {
    .hamburger-btn {
        display: none !important;
    }
    
    .hamburger-menu {
        display: none !important;
    }
}

/* 移动端基础设置 */
@media screen and (max-width: 768px) {
    /* 汉堡菜单样式 */
    .hamburger-menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.8);
        z-index: 1000;
        backdrop-filter: blur(5px);
    }
    
    .hamburger-menu.active {
        display: block;
    }
    
    .hamburger-content {
        position: absolute;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        background: white;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }
    
    .hamburger-menu.active .hamburger-content {
        transform: translateX(0);
    }
    
    .hamburger-header {
        padding: 1rem;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .hamburger-close {
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 50%;
        transition: background 0.3s ease;
    }
    
    .hamburger-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .hamburger-nav {
        padding: 1rem 0;
    }
    
    .hamburger-nav ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .hamburger-nav li {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .hamburger-nav a {
        display: block;
        padding: 1rem 1.5rem;
        color: #333;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s ease;
    }
    
    .hamburger-nav a:hover {
        background: #f8f9fa;
        color: #667eea;
        padding-left: 2rem;
    }
    
    .hamburger-nav a.active {
        background: #667eea;
        color: white;
    }
    
    /* 汉堡按钮 */
    .hamburger-btn {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.5rem;
        margin-right: 1rem;
    }
    
    .hamburger-icon {
        width: 25px;
        height: 20px;
        position: relative;
        transform: rotate(0deg);
        transition: 0.3s ease-in-out;
    }
    
    .hamburger-icon span {
        display: block;
        position: absolute;
        height: 3px;
        width: 100%;
        background: #333;
        border-radius: 2px;
        opacity: 1;
        left: 0;
        transform: rotate(0deg);
        transition: 0.25s ease-in-out;
    }
    
    .hamburger-icon span:nth-child(1) {
        top: 0px;
    }
    
    .hamburger-icon span:nth-child(2) {
        top: 8px;
    }
    
    .hamburger-icon span:nth-child(3) {
        top: 16px;
    }
    
    .hamburger-btn.active .hamburger-icon span:nth-child(1) {
        top: 8px;
        transform: rotate(135deg);
    }
    
    .hamburger-btn.active .hamburger-icon span:nth-child(2) {
        opacity: 0;
        left: -60px;
    }
    
    .hamburger-btn.active .hamburger-icon span:nth-child(3) {
        top: 8px;
        transform: rotate(-135deg);
    }
    
    /* 隐藏桌面端导航 */
    .nav {
        display: none;
    }
    
    /* 移动端头部调整 */
    .header {
        padding: 1.2rem 0;
    }
    
    .header-content {
        display: flex;
        align-items: center;
    }
    
    .header-text {
        flex: 1;
        text-align: center;
    }
    
    .header h1 {
        font-size: 1.6rem;
        margin-bottom: 0.2rem;
        line-height: 1.2;
    }
    
    .header p {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    /* 移动端容器调整 */
    .container {
        padding: 0 15px;
    }
    
    /* 主要内容区域 - 移动端竖屏 */
    .main-content {
        display: block;
        margin-bottom: 1.2rem;
    }
    
    .content {
        margin-bottom: 1.5rem;
    }
    
    .sidebar {
        width: 100%;
        margin-top: 0.8rem;
    }
    
    /* Hero区域优化 */
    .hero-section {
        padding: 2rem 1.5rem;
        margin-bottom: 1.5rem;
        border-radius: 12px;
    }
    
    .hero-content h2 {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
        line-height: 1.3;
    }
    
    .hero-content p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
        line-height: 1.4;
    }
    
    .btn-hero {
        padding: 12px 24px;
        font-size: 1rem;
        border-radius: 25px;
    }
    
    /* 统计卡片 - 移动端竖屏 */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.8rem;
    }
    
    .stat-item {
        padding: 0.8rem 0.5rem;
        text-align: center;
    }
    
    .stat-number {
        font-size: 1.5rem;
        margin-bottom: 0.3rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    /* 图表容器 - 移动端竖屏 */
    .charts-container {
        display: block;
    }
    
    .chart-wrapper {
        margin-bottom: 2rem;
    }
    
    .chart-container {
        height: 250px;
    }
    
    /* 搜索表单 - 移动端 */
    .search-form {
        margin-bottom: 1.2rem;
    }
    
    .search-box {
        flex-direction: column;
        gap: 0.8rem;
        padding: 1rem;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .search-input,
    .form-select {
        width: 100%;
        padding: 0.9rem 1rem;
        font-size: 1rem;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        transition: border-color 0.3s ease;
    }
    
    .search-input:focus,
    .form-select:focus {
        outline: none;
        border-color: #667eea;
    }
    
    .search-btn {
        width: 100%;
        padding: 0.9rem;
        font-size: 1rem;
        font-weight: 600;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        border-radius: 8px;
        color: white;
        transition: transform 0.2s ease;
    }
    
    .search-btn:active {
        transform: scale(0.98);
    }
    
    /* 侧边栏优化 */
    .sidebar-section {
        margin-bottom: 1.5rem;
        padding: 1.2rem;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar-section h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
        color: #2d3748;
    }
    
    .section-desc {
        font-size: 0.85rem;
        color: #718096;
        margin-bottom: 1rem;
        line-height: 1.4;
    }
    
    /* 分类列表 - 移动端 */
    .category-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    .category-link {
        padding: 0.7rem 0.5rem;
        font-size: 0.85rem;
        text-align: center;
        border-radius: 8px;
        transition: all 0.2s ease;
    }
    
    .category-link:active {
        transform: scale(0.98);
        background: rgba(102, 126, 234, 0.1);
    }
    
    /* 快速操作区域优化 */
    .action-list {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .action-item {
        padding: 1rem;
        background: #f8f9fa;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
    }
    
    .action-text {
        font-size: 0.9rem;
        color: #4a5568;
        margin-bottom: 0.8rem;
        line-height: 1.4;
    }
    
    /* 按钮样式调整 */
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        min-height: 44px; /* 触摸友好的最小高度 */
        border-radius: 8px;
        font-weight: 500;
        transition: all 0.2s ease;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .btn-primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        color: white;
    }
    
    .btn-secondary {
        background: #e2e8f0;
        border: 1px solid #cbd5e0;
        color: #4a5568;
    }
    
    .btn-secondary:active {
        background: #cbd5e0;
    }
    
    .btn-small {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        min-height: 44px;
    }
    
    /* 表格响应式 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
    
    /* 表单样式调整 */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        padding: 0.8rem;
        font-size: 1rem;
        min-height: 44px;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    /* 分页样式调整 */
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .pagination a,
    .pagination span {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        min-height: 44px;
        min-width: 44px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 移动端横屏适配 */
@media screen and (max-width: 1024px) and (min-width: 769px) and (orientation: landscape) {
    /* 移动端横屏时保持桌面端导航 */
    .nav {
        display: block;
    }
    
    .hamburger-btn {
        display: none;
    }
    
    /* 主要内容区域 - 移动端横屏 */
    .main-content {
        display: grid;
        grid-template-columns: 1fr 250px;
        gap: 1.5rem;
    }
    
    /* 统计卡片 - 移动端横屏 */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
    
    /* 图表容器 - 移动端横屏 */
    .charts-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .chart-container {
        height: 300px;
    }
    
    /* 分类列表 - 移动端横屏 */
    .category-list {
        display: block;
    }
    
    .category-link {
        display: block;
        padding: 0.6rem 0.8rem;
        margin-bottom: 0.3rem;
    }
}

/* 平板端适配 */
@media screen and (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 0 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .main-content {
        grid-template-columns: 1fr 280px;
        gap: 1.5rem;
    }
    
    .chart-container {
        height: 300px;
    }
}

/* 小屏幕手机适配 */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .header {
        padding: 1rem 0;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 0.8rem;
    }
    
    /* 统计卡片 - 小屏幕 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stat-item {
        padding: 0.6rem 0.3rem;
    }
    
    .stat-number {
        font-size: 1.3rem;
        margin-bottom: 0.2rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    /* 图表容器 - 小屏幕 */
    .chart-container {
        height: 200px;
    }
    
    /* 分类列表 - 小屏幕 */
    .category-list {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
    
    .category-link {
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
    }
    
    /* 汉堡菜单 - 小屏幕 */
    .hamburger-content {
        width: 100%;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增加触摸目标大小 */
    .btn,
    .category-link,
    .pagination a,
    .pagination span,
    .hamburger-nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 移除悬停效果，添加触摸反馈 */
    .btn:active,
    .category-link:active,
    .hamburger-nav a:active {
        transform: scale(0.98);
        opacity: 0.8;
        transition: all 0.1s ease;
    }
    
    /* 图表触摸优化 */
    .chart-container {
        touch-action: pan-x pan-y;
    }
    
    /* 汉堡按钮触摸反馈 */
    .hamburger-btn:active {
        transform: scale(0.95);
        opacity: 0.7;
    }
    
    /* 统计卡片触摸反馈 */
    .stat-item:active {
        transform: scale(0.98);
        background: rgba(102, 126, 234, 0.1);
    }
}

/* 高分辨率屏幕优化 */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
    .hamburger-icon span {
        height: 2px;
    }
    
    .btn {
        border-width: 0.5px;
    }
}

/* 移动端性能优化 */
@media screen and (max-width: 768px) {
    /* 启用硬件加速 */
    .hamburger-menu,
    .hamburger-content,
    .chart-container {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        will-change: transform;
    }
    
    /* 优化滚动性能 */
    .hamburger-content {
        -webkit-overflow-scrolling: touch;
    }
    
    /* 减少重绘 */
    .stat-item,
    .btn,
    .category-link {
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    /* 优化动画性能 */
    .hamburger-icon span {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
}

/* 移动端横屏特殊优化 */
@media screen and (max-width: 1024px) and (min-width: 769px) and (orientation: landscape) {
    /* 横屏时优化图表高度 */
    .chart-container {
        height: 250px;
    }
    
    /* 横屏时优化统计卡片 */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.8rem;
    }
    
    .stat-item {
        padding: 0.8rem;
    }
    
    .stat-number {
        font-size: 1.6rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
}

/* 超小屏幕优化 */
@media screen and (max-width: 360px) {
    .container {
        padding: 0 8px;
    }
    
    .header h1 {
        font-size: 1.4rem;
        line-height: 1.2;
    }
    
    .header p {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    .hero-content h2 {
        font-size: 1.6rem;
    }
    
    .hero-content p {
        font-size: 0.85rem;
    }
    
    .search-box {
        padding: 0.8rem;
        gap: 0.6rem;
    }
    
    .search-input,
    .form-select {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .search-btn {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .hamburger-btn {
        padding: 0.3rem;
        margin-right: 0.5rem;
    }
    
    .hamburger-icon {
        width: 20px;
        height: 16px;
    }
    
    .hamburger-content {
        width: 100%;
    }
    
    .chart-container {
        height: 180px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.3rem;
    }
    
    .stat-item {
        padding: 0.5rem 0.2rem;
    }
    
    .stat-number {
        font-size: 1.2rem;
        margin-bottom: 0.1rem;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    
    .sidebar-section {
        padding: 1rem;
        margin-bottom: 1.2rem;
    }
    
    .action-item {
        padding: 0.8rem;
    }
    
    .action-text {
        font-size: 0.85rem;
        margin-bottom: 0.6rem;
    }
    
    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }
}

/* 移动端竖屏额外优化 */
@media screen and (max-width: 768px) {
    /* 优化滚动体验 */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* 优化触摸反馈 */
    .stat-item,
    .category-link,
    .btn,
    .action-item {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
    }
    
    /* 优化文字选择 */
    .stat-number,
    .stat-label,
    .category-name {
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* 优化输入框 */
    .search-input,
    .form-select {
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* 优化按钮点击 */
    .btn:active,
    .search-btn:active {
        -webkit-tap-highlight-color: transparent;
    }
}
