/* 移动端响应式样式 - 功能完整保留 */

/* 移动端断点：768px 以下 */
@media screen and (max-width: 768px) {
    /* 基础布局调整 */
    body {
        overflow: auto;
        height: auto;
        min-height: 100vh;
    }

    .container {
        height: auto;
        min-height: 100vh;
    }

    .header {
        padding: 10px 15px;
        font-size: 14px;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .header h1 {
        font-size: 14px;
    }

    /* 主布局改为垂直堆叠 */
    .main-layout {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
        overflow: visible;
    }

    /* 左侧面板 - 移动端全宽 */
    .left-panel {
        width: 100%;
        max-height: 50vh;
        min-height: 300px;
        order: 1;
    }

    .panel-title {
        padding: 10px 15px;
        font-size: 14px;
    }

    .tabs-container {
        display: flex;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 14px;
        min-height: 44px; /* 触摸友好 */
    }

    /* 右侧面板 - 移动端全宽 */
    .right-panel {
        width: 100%;
        order: 2;
        flex-direction: column;
        min-height: 50vh;
    }

    /* 控制栏 - 移动端优化 */
    .control-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
        background: #f8f9fa;
        border-radius: 8px;
        margin-bottom: 10px;
    }

    .control-bar label {
        width: 100%;
        margin-bottom: 5px;
        font-size: 14px;
    }

    .control-bar .btn {
        flex: 1 1 calc(50% - 4px);
        min-width: calc(50% - 4px);
        padding: 12px 8px;
        font-size: 13px;
        min-height: 44px; /* 触摸友好 */
        margin: 2px;
    }

    .control-bar .status-label {
        width: 100%;
        margin-top: 8px;
        text-align: center;
        font-size: 12px;
    }

    /* 赔率标签页 - 移动端优化 */
    .odds-tabs {
        display: flex;
        gap: 5px;
        padding: 8px;
        background: #f8f9fa;
        border-radius: 8px;
        margin-bottom: 10px;
    }

    .odds-tab-btn {
        flex: 1;
        padding: 10px 8px;
        font-size: 13px;
        min-height: 44px; /* 触摸友好 */
    }

    /* 表格容器 - 移动端横向滚动 */
    .odds-table-container {
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: 60vh;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: white;
    }

    /* 表格 - 移动端优化 */
    .odds-table,
    .unified-odds-table {
        min-width: 1200px; /* 确保表格可以横向滚动 */
        font-size: 11px;
    }

    .odds-table th,
    .unified-odds-table th {
        padding: 8px 6px;
        font-size: 11px;
        white-space: nowrap;
    }

    .odds-table td,
    .unified-odds-table td {
        padding: 6px 4px;
        font-size: 11px;
        white-space: nowrap;
    }

    /* 固定列 - 移动端调整 */
    .lottery-type-header,
    .lottery-num-header,
    .match-info-header,
    .odds-type-header {
        position: sticky;
        left: 0;
        z-index: 5;
        background: #d9edf7 !important;
    }

    .lottery-type-cell,
    .lottery-num-cell,
    .match-info-cell,
    .odds-type-cell {
        position: sticky;
        left: 0;
        z-index: 4;
        background: white;
    }

    /* 日志容器 - 移动端优化 */
    .log-container {
        margin-top: 10px;
        max-height: 200px;
        border-radius: 8px;
    }

    .log-header {
        padding: 8px 12px;
        font-size: 13px;
    }

    .log-text {
        font-size: 11px;
        padding: 8px;
        max-height: 150px;
    }

    /* 比赛列表表格 - 移动端优化 */
    .match-list-table {
        font-size: 11px;
    }

    .match-list-table th {
        padding: 8px 6px;
        font-size: 11px;
    }

    .match-list-table td {
        padding: 6px 4px;
        font-size: 11px;
    }

    /* 弹窗 - 移动端优化 */
    .modal-content {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        margin: 5vh auto;
    }

    .modal-large {
        width: 95%;
        max-width: 95%;
    }

    .modal-header {
        padding: 12px 15px;
        font-size: 14px;
    }

    .modal-body {
        padding: 15px;
        font-size: 13px;
        max-height: calc(90vh - 100px);
        overflow-y: auto;
    }

    /* Gemini 配置弹窗 - 移动端优化 */
    .gemini-modal {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        margin: 5vh auto;
    }

    .gemini-header {
        padding: 12px 15px;
        font-size: 14px;
    }

    .gemini-content {
        padding: 15px;
        max-height: calc(90vh - 150px);
        overflow-y: auto;
    }

    .gemini-form-group {
        margin-bottom: 15px;
    }

    .gemini-form-input {
        width: 100%;
        padding: 10px;
        font-size: 14px;
        min-height: 44px; /* 触摸友好 */
    }

    .gemini-btn-group {
        flex-direction: column;
        gap: 10px;
    }

    .gemini-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        min-height: 44px; /* 触摸友好 */
    }

    /* 历史赔率表格 - 移动端横向滚动 */
    .history-table {
        min-width: 500px;
        font-size: 11px;
    }

    .history-table th,
    .history-table td {
        padding: 8px 6px;
        font-size: 11px;
        white-space: nowrap;
    }

    /* 按钮组 - 移动端优化 */
    .btn {
        min-height: 44px; /* 触摸友好 */
        padding: 10px 12px;
        font-size: 13px;
    }

    /* 提示词文本区域 - 移动端优化 */
    #prompt-textarea {
        font-size: 12px;
        min-height: 300px;
    }

    /* 滚动条优化 */
    .odds-table-container::-webkit-scrollbar,
    .match-list::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .odds-table-container::-webkit-scrollbar-thumb,
    .match-list::-webkit-scrollbar-thumb {
        background: #999;
        border-radius: 3px;
    }
}

/* 小屏幕手机优化（480px 以下） */
@media screen and (max-width: 480px) {
    .header {
        padding: 8px 12px;
        font-size: 13px;
    }

    .header h1 {
        font-size: 13px;
    }

    .main-layout {
        padding: 8px;
        gap: 8px;
    }

    .left-panel {
        max-height: 40vh;
        min-height: 250px;
    }

    .control-bar .btn {
        flex: 1 1 100%;
        min-width: 100%;
        font-size: 12px;
        padding: 10px 6px;
    }

    .odds-table,
    .unified-odds-table {
        min-width: 1000px;
        font-size: 10px;
    }

    .odds-table th,
    .unified-odds-table th,
    .odds-table td,
    .unified-odds-table td {
        padding: 5px 3px;
        font-size: 10px;
    }

    .match-list-table {
        font-size: 10px;
    }

    .match-list-table th,
    .match-list-table td {
        padding: 5px 3px;
        font-size: 10px;
    }

    .modal-content,
    .modal-large,
    .gemini-modal {
        width: 98%;
        max-width: 98%;
        margin: 2vh auto;
    }

    .log-container {
        max-height: 150px;
    }

    .log-text {
        font-size: 10px;
        max-height: 120px;
    }
}

/* 横屏模式优化 */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .left-panel {
        max-height: 45vh;
    }

    .right-panel {
        min-height: 45vh;
    }

    .odds-table-container {
        max-height: 50vh;
    }

    .log-container {
        max-height: 150px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 移除 hover 效果，使用 active 状态 */
    .btn:hover,
    .tab-btn:hover,
    .odds-tab-btn:hover {
        opacity: 1;
    }

    .btn:active,
    .tab-btn:active,
    .odds-tab-btn:active {
        opacity: 0.8;
        transform: scale(0.98);
    }

    /* 增加触摸目标大小 */
    .match-list-table input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    /* 优化滚动性能 */
    .odds-table-container,
    .match-list {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

