/* 
 * CSS 样式表
 * 包含所有原始 HTML 中的样式定义
 */

/* 基础重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* 全局样式 */
body {
    font-family: "Meiryo", "MS PGothic", sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

/* 顶部导航栏 */
.top-bar {
    background: linear-gradient(135deg, #165DFF, #4080FF);
    color: white;
    padding: 14px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.top-bar h1 { font-size: 22px; font-weight: 700; }
.nav-links a { 
    color: rgba(255,255,255,0.9); 
    text-decoration: none; 
    margin-left: 28px; 
    font-size: 17px;
    font-weight: 600;
    transition: color 0.2s;
}
.nav-links a:hover { color: white; }

/* 主容器布局 */
.main-container {
    max-width: 1150px;
    margin: 40px auto;
    display: flex;
    gap: 20px;
    padding: 0 20px;
}

/* 计算器部分 */
.calculator-section {
    flex: 1;
    max-width: 650px;
}
.calc-card {
    background: white;
    border-radius: 16px;
    padding: 36px 44px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.06);
}
.calc-card h2 {
    text-align: center;
    font-size: 24px;
    color: #1d2129;
    margin-bottom: 32px;
    font-weight: 700;
}

/* 每场比赛输入行 */
.race-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 0 10px;
    position: relative;
}
.race-row label {
    font-size: 17px;
    color: #4e5969;
    width: 80px;
    font-weight: 600;
}

/* 输入组样式 */
.number-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 加减按钮 */
.num-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: #e5e6eb;
    color: #1d2129;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.num-btn:hover { background: #c9cdd4; }
.num-btn:active { transform: scale(0.95); }

/* 输入框 */
.race-input {
    width: 80px;
    height: 40px;
    padding: 0 12px;
    border: 2px solid #e5e6eb;
    border-radius: 8px;
    font-size: 19px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    cursor: pointer;
    font-weight: 600;
}
.race-input:focus {
    border-color: #165DFF;
}

/* 数字选择面板 */
.number-picker {
    position: absolute;
    top: 50px;
    right: 0;
    background: lightBlue;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgb(0,0,0);
    padding: 18px;
    display: none;
    z-index: 100;
    width: auto;
}
.number-picker.show {
    display: block;
}
.number-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
}
.number-grid button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: #f2f3f5;
    color: #1d2129;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.number-grid button:hover {
    background: #165DFF;
    color: white;
}
.number-grid button.active {
    background: #165DFF;
    color: white;
}
.number-grid button:active {
    transform: scale(0.95);
}

/* 结果面板 */
.result-panel {
    margin-top: 36px;
    background: linear-gradient(135deg, #165DFF, #722ED1);
    border-radius: 12px;
    padding: 28px;
    text-align: center;
}
.result-panel .formula-text {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    margin-bottom: 10px;
}
.result-panel .total-number {
    color: white;
    font-size: 36px;
    font-weight: 700;
}
.result-panel .price-text {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    margin-top: 8px;
}
.result-panel .price-value {
    color: white;
    font-size: 28px;
    font-weight: 700;
}

/* 广告侧边栏 */
.ad-sidebar {
    width: 220px;
    flex-shrink: 0;
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ad-block {
    border-radius: 12px;
    padding: 25px 15px;
    text-align: center;
    color: white;
    font-size: 15px;
    font-weight: 600;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.ad-block.red { background: linear-gradient(135deg, #F53F3F, #CB2634); }
.ad-block.blue { background: linear-gradient(135deg, #0FC6C2, #08979C); }
.ad-block.yellow { background: linear-gradient(135deg, #FF7D00, #D96800); }

/* SEO 内容区域 */
.seo-section {
    max-width: 1150px;
    margin: 40px auto;
    padding: 0 20px;
}
.seo-card {
    background: white;
    border-radius: 16px;
    padding: 36px 44px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.06);
}
.seo-card h2 {
    font-size: 20px;
    color: #1d2129;
    margin-bottom: 16px;
    font-weight: 700;
}
.seo-card p {
    font-size: 15px;
    color: #4e5969;
    line-height: 1.8;
    margin-bottom: 24px;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 24px;
    color: #86909C;
    font-size: 13px;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        margin: 20px auto;
    }
    .calc-card, .seo-card {
        padding: 24px 20px;
    }
    .number-picker {
        width: 100%;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        top: auto;
        bottom: 0;
        position: fixed;
        padding: 20px;
    }
    .number-grid {
        grid-template-columns: repeat(10, 1fr);
        gap: 2px;
    }
    .number-grid button {
        width: 100%;
        height: 50px;
        font-size: 18px;
    }
    .ad-sidebar {
        width: 100%;
        flex-direction: row;
        margin-top: 20px;
    }
    .ad-block {
        flex: 1;
        min-height: 100px;
    }
}
