* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "SimHei", Arial, sans-serif;
    font-size: 14px;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

.container {
    padding: 10px;
    max-width: 800px;
    margin: 0 auto;
}

.header {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: #fff;
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

.back-btn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    text-decoration: none;
    font-size: 18px;
}

.btn-group {
    display: flex;
    gap: 10px;
    padding: 10px;
    justify-content: center;
    flex-wrap: nowrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-primary {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-secondary {
    background: #fff;
    color: #1e88e5;
    border: 2px solid #1e88e5;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.section-title {
    font-size: 14px;
    font-weight: bold;
    padding: 10px;
    background: #f5f5f5;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title .hint {
    font-size: 12px;
    color: #999;
    font-weight: normal;
}

.ball-area {
    padding: 10px;
    background: #fff;
}

.ball-row {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
}

.ball-row .select-ball {
    width: 100%;
    aspect-ratio: 1;
    max-width: 36px;
    min-width: 28px;
}

.select-ball {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid #ddd;
    background: #fff;
    color: #333;
    user-select: none;
}

.select-ball:hover {
    border-color: #1e88e5;
    transform: scale(1.05);
}

.select-ball.selected {
    background: #1e88e5;
    color: #fff;
    border-color: #1e88e5;
}

.position-section {
    background: #fff;
    margin: 10px;
    padding: 15px;
    border-radius: 8px;
}

.position-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1e88e5;
}

.result-section {
    background: #fff;
    margin: 10px;
    padding: 15px;
    border-radius: 8px;
}

.result-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 15px;
}

.result-list {
    max-height: 400px;
    overflow-y: auto;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #f9f9f9;
    margin-bottom: 5px;
    border-radius: 4px;
    gap: 10px;
}

.result-item .index {
    width: 40px;
    font-size: 12px;
    color: #999;
}

.result-item .balls {
    display: flex;
    gap: 5px;
}

.result-item .ball {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    background: #1e88e5;
    color: #fff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 10px;
}

.stat-card {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.stat-card .value {
    font-size: 24px;
    font-weight: bold;
    color: #1e88e5;
}

.stat-card .label {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
}

.number-card {
    text-align: center;
    padding: 10px 5px;
    background: #f5f5f5;
    border-radius: 8px;
}

.number-card .num {
    width: 36px;
    height: 36px;
    line-height: 36px;
    border-radius: 50%;
    background: #1e88e5;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    margin: 0 auto 5px;
}

.number-card .count {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.number-card .miss {
    font-size: 12px;
    color: #999;
}

.number-card.hot {
    background: #e3f2fd;
}

.number-card.hot .num {
    background: #1565c0;
}

.number-card.cold {
    background: #fff3e0;
}

.number-card.cold .num {
    background: #ff9800;
}

.chart-section {
    background: #fff;
    margin: 10px;
    padding: 15px;
    border-radius: 8px;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bar-item .label {
    width: 30px;
    font-size: 12px;
    text-align: right;
}

.bar-item .bar-bg {
    flex: 1;
    height: 18px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.bar-item .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e88e5, #42a5f5);
    border-radius: 3px;
}

.bar-item .value {
    width: 50px;
    font-size: 12px;
    color: #666;
}

.data-section {
    background: #fff;
    margin: 10px;
    padding: 15px;
    border-radius: 8px;
}

.data-section textarea {
    width: 100%;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-size: 12px;
    font-family: monospace;
    resize: vertical;
}

.data-hint {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.intro-section {
    background: #e3f2fd;
    padding: 10px;
    margin: 10px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: #666;
}

.intro-section strong {
    color: #1e88e5;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: nowrap;
    justify-content: center;
}

.form-row label {
    width: 80px;
    font-size: 14px;
}

.form-row input,
.form-row select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-row input[type="number"] {
    width: 80px;
}

.form-row input[type="text"] {
    flex: 1;
    min-width: 150px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: #666;
}

.tab.active {
    color: #1e88e5;
    border-bottom-color: #1e88e5;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

@media screen and (max-width: 480px) {
    .header {
        padding: 12px 10px;
    }

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

    .container {
        padding: 5px;
    }

    .ball-row {
        grid-template-columns: repeat(5, 1fr);
        gap: 3px;
    }

    .ball-row .select-ball {
        max-width: none;
        min-width: 0;
        font-size: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .number-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .btn-group {
        gap: 8px;
    }

    .btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    .form-row {
        gap: 8px;
    }
}

@media screen and (max-width: 360px) {
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

.page-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
}

.site-title {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 3px;
}

.sub-title {
    font-size: 12px;
    text-align: center;
    opacity: 0.9;
}

.main-content {
    padding: 15px;
}

.section {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #eee;
}

.section-header {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-body {
    padding: 15px;
}

.footer {
    text-align: center;
    padding: 15px;
    color: #999;
    font-size: 12px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

.stats-summary {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px;
    background: #fafafa;
    border-radius: 6px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 12px;
    color: #999;
}

.summary-value {
    font-size: 16px;
    font-weight: bold;
    color: #1565c0;
}

.weichu-tables {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.weichu-table {
    background: #fafafa;
    border-radius: 8px;
    padding: 12px;
}

.table-title {
    font-size: 13px;
    font-weight: bold;
    color: #666;
    margin-bottom: 10px;
    text-align: center;
}

.weichu-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.weichu-grid.all-grid {
    grid-template-columns: repeat(10, 1fr);
}

.weichu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #eee;
}

.weichu-num {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.weichu-count {
    font-size: 12px;
    color: #999;
}

.weichu-item.hot {
    border-color: #1565c0;
    background: #e3f2fd;
}

.weichu-item.hot .weichu-count {
    color: #1565c0;
    font-weight: bold;
}

.weichu-item.cold {
    border-color: #43a047;
    background: #e8f5e9;
}

.weichu-item.cold .weichu-count {
    color: #43a047;
}

.update-time {
    font-size: 12px;
    color: #999;
}

@media screen and (max-width: 480px) {
    .weichu-tables {
        grid-template-columns: 1fr;
    }

    .weichu-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .weichu-grid.all-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
