
.keno {
    max-width: 1200px;
    margin: 5px;
}

.lottery-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;  /* 手机端：单列 */
}

/* 平板端布局 */
@media (min-width: 768px) {
    .lottery-grid {
        grid-template-columns: repeat(2, 1fr);  /* 2列 */
    }
}

/* PC端布局 - 最多3列 */
@media (min-width: 1200px) {
    .lottery-grid {
        grid-template-columns: repeat(3, 1fr);  /* 3列，最多3个 */
        max-width: 1400px;  /* 限制最大宽度 */
        margin: 0 auto;     /* 居中显示 */
    }
}

.lottery-item {
    background: linear-gradient(180deg, #092f5c, #6187ad);
    border-radius: 12px;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 号码网格 */
.number-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    background: #0d3360;
    border-radius: 8px;
    overflow: hidden;
}

.number-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.number-cell:hover {
    transform: scale(1.05);
}

.number-cell.selected-blue {
    background: #4a90e2;
    color: white;
}

.number-cell.selected-red {
    background: #e74c3c;
    color: white;
}

/* 计算面板 */
.calculation-panel {
    color: white;
    padding: 5px;
    border-radius: 12px;
    text-align: center;
}

.period-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.equation-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.number-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.number-circle.result {
    background: #e74c3c;
    border-color: #e74c3c;
}

.operator {
    font-size: 24px;
    font-weight: bold;
}

/* 计算过程面板 */
.process-panel {
    background: #ffffff;  /* 白色背景 */
    color: #333;          /* 深灰色文字 */
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.process-title {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: #f0f0f0;  /* 浅灰色背景 */
    color: #333;
    border-radius: 6px;
}

.process-item {
    margin: 5px 0;          /* 减少上下间隔 */
    padding: 8px 12px;      /* 减少内边距 */
    background: #fafafa;    /* 极浅灰背景 */
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid #ccc;
    white-space: nowrap;    /* 不换行 */
    overflow-x: auto;       /* 允许横向滚动 */
}

/* 移动端优化 */
@media (max-width: 767px) {
    .keno {
        margin: 0;
        padding: 0;
    }
    
    .lottery-grid {
        gap: 5px;  /* 减小卡片间距 */
    }
    
    .lottery-item {
        padding: 8px;  /* 减小内边距 */
    }

    .period-title {
        font-size: 20px;  /* 减小期号字体 */
        margin-bottom: 8px;
    }

    .number-circle {
        width: 35px;  /* 减小圆圈 */
        height: 35px;
        font-size: 14px;
    }
    
    .number-circle.result {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .operator {
        font-size: 18px;
    }
    
    .equation-container {
        gap: 5px;  /* 减小间距 */
    }

    /* 号码网格 - 关键优化 */
    .number-grid {
        gap: 1px;  /* 减小网格间距 */
    }
    
    .number-cell {
        font-size: 10px;  /* 减小字体 */
        min-height: 28px; /* 最小高度 */
    }
    
    /* 计算过程 */
    .process-panel {
        padding: 6px;
    }
    
    .process-title {
        font-size: 14px;
        padding: 4px 8px;
        margin-bottom: 5px;
    }
    
    .process-item {
        font-size: 11px;  /* 减小字体 */
        padding: 5px 8px;  /* 减小内边距 */
        margin: 3px 0;     /* 减小间距 */
        overflow-x: auto;  /* 允许横向滚动 */
        -webkit-overflow-scrolling: touch;  /* 平滑滚动 */
    }
}

/* 超小屏幕优化（iPhone SE等） */
@media (max-width: 375px) {
    .number-cell {
        font-size: 9px;   /* 更小字体 */
        min-height: 24px;
    }
    
    .period-title {
        font-size: 18px;
    }
    
    .number-circle {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .process-item {
        font-size: 10px;
    }
}
