/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background-color: #f0f0f0;
    padding: 10px;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ========== 顶部统计结果区域 ========== */
.result-section {
    margin-bottom: 15px;
    padding: 15px;
    background: #fafafa;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.result-section.top-result {
    border: 2px solid #d4a574;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.header-left-group,
.header-right-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-left-group h3 {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.mode-selector {
    flex-shrink: 0;
}

.mode-select {
    padding: 8px 15px;
    font-size: 14px;
    border: 1px solid #999;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.mode-select:focus {
    outline: none;
    border-color: #d4a574;
}

.action-btn-small {
    padding: 6px 12px;
    border: 1px solid #999;
    background: #f5f5f5;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
    white-space: nowrap;
}

.action-btn-small:hover {
    background: #e0e0e0;
}

.result-content {
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    color: #333;
    min-height: 80px;
}

.result-content .placeholder-text {
    color: #999;
    font-style: italic;
}

/* 结果区域 HTML 内容样式 */
.result-content .result-text {
    line-height: 1.8;
    white-space: pre-wrap;
}

.result-content .result-divider {
    border-top: 1px solid #ddd;
    margin: 8px 0;
}

.result-content .conditions-section {
    margin: 6px 0;
}

.result-content .conditions-title {
    font-weight: bold;
    margin-bottom: 2px;
}

.result-content .condition-line {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    line-height: 1.8;
}

.result-content .condition-text {
    flex: 1;
    word-break: break-all;
}

.result-content .condition-remove-btn {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: none;
    background: #e8e8e8;
    color: #999;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    padding: 0;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.result-content .condition-remove-btn:hover {
    background: #e74c3c;
    color: white;
    transform: scale(1.1);
}

/* ========== 整合选号盘 ========== */
.integrated-selector {
    margin-bottom: 15px;
    padding: 15px;
    background: #fafafa;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* 操作面板 */
.operation-panel {
    margin-bottom: 15px;
}

.operation-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.input-wrapper {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    color: #999;
    font-size: 14px;
    pointer-events: none;
}

.custom-input {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border: 1px solid #999;
    border-radius: 4px;
    font-size: 14px;
}

.custom-input:focus {
    outline: none;
    border-color: #d4a574;
}

.custom-input::placeholder {
    color: #999;
}

.op-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.op-btn:hover {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 14px;
}

.op-btn-add,
.op-btn-reverse,
.op-btn-kill,
.op-btn-copy {
    background: #e8e8e8;
    color: #333;
    border: 1px solid #999;
}

.op-btn-add:hover,
.op-btn-reverse:hover,
.op-btn-kill:hover,
.op-btn-copy:hover {
    background: #d0d0d0;
}

/* 号码网格容器 */
.number-grid-container {
    padding: 10px 0;
}

/* 号码网格 */
.number-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    justify-items: center;
}

.number-ball {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    font-weight: bold;
    background: white;
    border: 2px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.number-ball:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border-color: #999;
}

.number-ball .ball-number {
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

.number-ball .ball-zodiac {
    font-size: 12px;
    margin-top: 0;
    opacity: 0.85;
    font-weight: 500;
}


/* 波色 - 使用彩色字体和边框区分 */
.number-ball.ball-red {
    border-color: #e74c3c;
}

.number-ball.ball-red .ball-number,
.number-ball.ball-red .ball-zodiac {
    color: #e74c3c;
}

.number-ball.ball-blue {
    border-color: #3498db;
}

.number-ball.ball-blue .ball-number,
.number-ball.ball-blue .ball-zodiac {
    color: #3498db;
}

.number-ball.ball-green {
    border-color: #27ae60;
}

.number-ball.ball-green .ball-number,
.number-ball.ball-green .ball-zodiac {
    color: #27ae60;
}

.number-ball.highlight {
    background: #d4a574;
    border-color: #b8935f;
    border-width: 2px;
    box-shadow: 0 2px 8px rgba(212, 165, 116, 0.5);
}

/* 高亮时保持原有字体颜色 */
.number-ball.ball-red.highlight .ball-number,
.number-ball.ball-red.highlight .ball-zodiac {
    color: #e74c3c;
}

.number-ball.ball-blue.highlight .ball-number,
.number-ball.ball-blue.highlight .ball-zodiac {
    color: #3498db;
}

.number-ball.ball-green.highlight .ball-number,
.number-ball.ball-green.highlight .ball-zodiac {
    color: #27ae60;
}



.number-ball.killed {
    opacity: 0.25;
}

.number-ball.killed::after {
    content: '';
    position: absolute;
    width: 70%;
    height: 2px;
    background: #999;
    transform: rotate(-45deg);
}


/* ========== 筛选区域 ========== */
.filter-section {
    margin-bottom: 10px;
    padding: 10px 15px;
    background: #fafafa;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.filter-group {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.filter-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.filter-label {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    min-width: 42px;
    flex-shrink: 0;
    padding-top: 8px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.filter-buttons-advanced {
    margin-top: 2px;
}

.filter-btn {
    padding: 8px 0;
    border: 1px solid #999;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    border-radius: 4px;
    width: 64px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filter-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: #d4a574;
    color: white;
    border-color: #b8935f;
}

/* 波色按钮样式已统一应用普通按钮样式 */





/* 拖式类型选择对话框（新版） */
.drag-type-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.drag-type-dialog {
    background: white;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 280px;
}

.drag-type-dialog h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.drag-type-dialog p {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.drag-type-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 15px;
}

.drag-type-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.drag-type-btn.banker-btn {
    background: #6c757d;
    color: white;
}

.drag-type-btn.banker-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.drag-type-btn.leg-btn {
    background: #6c757d;
    color: white;
}

.drag-type-btn.leg-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.drag-type-cancel {
    background: #e8e8e8;
    border: 1px solid #999;
    color: #666;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.drag-type-cancel:hover {
    background: #d0d0d0;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    .app-container {
        padding: 10px;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-left-group,
    .header-right-group {
        width: 100%;
        justify-content: space-between;
    }

    .operation-row {
        flex-direction: column;
    }

    .input-wrapper {
        width: 100%;
    }

    .op-btn {
        width: 100%;
        justify-content: center;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .filter-label {
        min-width: auto;
        padding-top: 0;
    }

    .filter-btn {
        width: 56px;
        padding: 6px 0;
        font-size: 12px;
    }

    .number-grid {
        gap: 5px;
    }

    .number-ball {
        width: 36px;
        height: 36px;
    }

    .number-ball .ball-number {
        font-size: 13px;
    }

    .number-ball .ball-zodiac {
        font-size: 8px;
    }

    .result-content {
        font-size: 12px;
    }

    .drag-dialog-buttons {
        flex-direction: column;
    }

    .drag-type-buttons {
        flex-direction: column;
    }
}

/* 平板端 */
@media (min-width: 769px) and (max-width: 1024px) {
    .app-container {
        max-width: 700px;
    }

    .number-ball {
        width: 40px;
        height: 40px;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
    }

    .filter-section,
    .operation-panel,
    .drag-dialog,
    .drag-type-modal {
        display: none !important;
    }

    .app-container {
        box-shadow: none;
        max-width: 100%;
    }
}
