/* 运费查询页面 - 移动端优化样式 */

/* 仅在移动端生效 */
@media (max-width: 890px) {
    /* ==================== 基础布局 ==================== */
    .main-content {
        margin: 0;
        padding: 0;
    }

    .freight-container {
        margin-bottom: 15px;
    }

    /* ==================== 切换按钮优化 ==================== */
    .freight-tabs {
        display: flex;
        gap: 10px;
        margin: 0;
        padding: 15px;
        justify-content: stretch;
        background: #f8f9fa;
        border-bottom: 1px solid #e0e0e0;
        position: relative;
        z-index: 10;
    }

    .tab-btn {
        flex: 1;
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 6px;
        border: 2px solid #d9d9d9;
        background: #ffffff;
        transition: all 0.3s;
        cursor: pointer;
        position: relative;
        z-index: 11;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }

    .tab-btn.active {
        background: #e74c3c;
        border-color: #e74c3c;
        color: #ffffff;
        box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    }
    
    .tab-btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .tab-text {
        font-size: 15px;
        pointer-events: none;
    }
    
    /* ==================== 模块显示控制 ==================== */
    .freight-module {
        display: none !important;
    }
    
    .freight-module.active {
        display: block !important;
    }

    /* ==================== 模块头部优化 ==================== */
    .module-header {
        background: #e74c3c;
        padding: 15px;
    }

    .module-title {
        font-size: 16px;
        font-weight: 600;
        margin: 0 0 5px 0;
    }

    .module-tips {
        font-size: 12px;
        margin-top: 4px;
        opacity: 0.95;
    }

    /* ==================== 筛选栏优化 ==================== */
    .filter-bar {
        padding: 15px;
        gap: 12px;
        background: #f8f9fa;
        border-bottom: 1px solid #e9ecef;
    }

    .filter-item {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .filter-label {
        font-size: 13px;
        flex: 0 0 auto;
        min-width: 80px;
    }

    .filter-select,
    .filter-date {
        flex: 1;
        padding: 10px 12px;
        font-size: 14px;
        border-radius: 6px;
        min-width: 0;
        max-width: 100%;
    }

    /* ==================== 运费列表优化 ==================== */
    .freight-list-wrapper {
        padding: 15px;
        max-height: none;
    }

    .freight-item {
        background: #ffffff;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .freight-item:active {
        background: #f8f9fa;
    }

    .freight-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 12px;
    }

    .freight-route {
        font-size: 15px;
        font-weight: 600;
        color: #333;
        width: 100%;
    }

    .route-arrow {
        color: #e74c3c;
        margin: 0 6px;
        font-size: 14px;
    }

    .freight-price-info {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .freight-price-value {
        font-size: 18px;
        font-weight: 700;
        color: #e74c3c;
    }

    .price-change {
        font-size: 13px;
        padding: 3px 8px;
        border-radius: 4px;
    }

    .freight-item-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-top: 10px;
        border-top: 1px solid #f0f0f0;
    }

    .freight-meta {
        flex-direction: row;
        gap: 15px;
        font-size: 12px;
    }

    .freight-time {
        color: #6c757d;
        font-size: 12px;
    }

    .history-btn {
        width: 100%;
        padding: 10px;
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        font-size: 13px;
        text-align: center;
        min-height: 42px;
    }

    .history-btn:active {
        background: #e74c3c;
        color: #ffffff;
        border-color: #e74c3c;
    }

    /* ==================== 空状态优化 ==================== */
    .empty-state {
        padding: 60px 20px;
        text-align: center;
    }

    .empty-text {
        font-size: 14px;
        color: #999;
    }

    /* ==================== 分页优化 ==================== */
    .pagination {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 15px !important;
        gap: 8px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .pagination::-webkit-scrollbar {
        display: none;
    }

    .page-btn {
        padding: 10px 16px !important;
        font-size: 13px !important;
        border-radius: 6px !important;
        flex: 0 0 auto !important;
        min-height: 42px !important;
        white-space: nowrap !important;
    }

    .page-numbers {
        display: flex !important;
        flex-direction: row !important;
        gap: 6px !important;
        flex: 0 0 auto !important;
    }

    .page-number {
        min-width: 38px !important;
        height: 38px !important;
        font-size: 13px !important;
        border-radius: 6px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .page-ellipsis {
        min-width: 30px !important;
        height: 38px !important;
        font-size: 13px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* ==================== 铁运iframe优化 ==================== */
    .rail-iframe-container {
        height: auto;
        min-height: 600px;
        position: relative;
        background: #f8f9fa;
    }

    /* iframe缩放控制条 */
    .iframe-controls {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 12px 15px;
        background: #ffffff;
        border-bottom: 1px solid #e0e0e0;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .zoom-btn,
    .reset-btn {
        padding: 8px 16px;
        background: #ffffff;
        border: 1px solid #d9d9d9;
        border-radius: 6px;
        font-size: 16px;
        font-weight: 600;
        color: #333;
        cursor: pointer;
        transition: all 0.3s;
        min-width: 42px;
        min-height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .zoom-btn:active,
    .reset-btn:active {
        background: #e74c3c;
        color: #ffffff;
        border-color: #e74c3c;
        transform: scale(0.95);
    }

    .reset-btn {
        font-size: 13px;
        padding: 8px 12px;
    }

    .zoom-level {
        font-size: 14px;
        font-weight: 600;
        color: #333;
        min-width: 50px;
        text-align: center;
    }

    /* iframe包装器 - 支持缩放 */
    .iframe-wrapper {
        width: 100%;
        height: 600px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        background: #ffffff;
    }

    .rail-query-iframe {
        width: 100%;
        height: 100%;
        border: none;
        transform-origin: 0 0;
        transition: transform 0.3s ease;
    }

    /* ==================== 历史数据弹窗优化 ==================== */
    /* 通过JS动态生成的弹窗样式已优化,在JS中控制 */
}

/* 小屏手机额外优化 */
@media (max-width: 480px) {
    .freight-tabs {
        padding: 12px;
        gap: 8px;
    }

    .tab-btn {
        padding: 12px 15px;
        font-size: 14px;
    }

    .filter-bar {
        padding: 12px;
        gap: 10px;
    }

    .filter-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-label {
        width: 100%;
        margin-bottom: 6px;
    }

    .filter-select,
    .filter-date {
        width: 100%;
    }

    .freight-list-wrapper {
        padding: 12px;
    }

    .freight-item {
        padding: 12px;
    }

    .freight-route {
        font-size: 14px;
    }

    .freight-price-value {
        font-size: 16px;
    }

    .price-change {
        font-size: 12px;
    }

    .freight-time {
        font-size: 11px;
    }

    .history-btn {
        font-size: 12px;
        padding: 8px;
    }

    .page-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .page-number {
        min-width: 34px;
        height: 34px;
        font-size: 12px;
    }
}
