* {
    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, #9c27b0, #7b1fa2);
    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;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: #9c27b0;
    border: 1px solid #9c27b0;
}

.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: 26px;
}

.select-ball {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    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: #9c27b0;
    transform: scale(1.05);
}

.select-ball.selected {
    background: #9c27b0;
    color: #fff;
    border-color: #9c27b0;
}

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

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

.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: 3px;
    flex-wrap: wrap;
}

.result-item .ball {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    background: #9c27b0;
    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: #9c27b0;
}

.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: 32px;
    height: 32px;
    line-height: 32px;
    border-radius: 50%;
    background: #9c27b0;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    margin: 0 auto 5px;
}

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

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

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

.number-card.hot .num {
    background: #7b1fa2;
}

.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, #9c27b0, #ba68c8);
    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: #f3e5f5;
    padding: 10px;
    margin: 10px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: #666;
}

.intro-section strong {
    color: #9c27b0;
}

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

.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;
}

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

.filter-group {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.filter-title input[type="checkbox"] {
    margin-right: 8px;
}

.filter-content {
    padding-left: 25px;
}

.filter-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.filter-row label {
    width: 80px;
    font-size: 13px;
    color: #666;
}

.filter-row input[type="text"],
.filter-row input[type="number"],
.filter-row select {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.filter-row input[type="text"] {
    width: 150px;
}

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

.filter-row select {
    width: 100px;
}

.range-input {
    display: flex;
    align-items: center;
    gap: 5px;
}

.range-input span {
    color: #999;
}

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

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

    .container {
        padding: 5px;
    }

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

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

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

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

    .btn-group {
        flex-direction: column;
    }
}
