* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}
.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
.header p {
    font-size: 1.1em;
    opacity: 0.9;
}
.main-content {
    padding: 30px;
}
.input-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
}
.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.input-group {
    display: flex;
    flex-direction: column;
}
.input-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95em;
}
.input-group input,
.input-group select {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}
.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.simulation-mode {
    background: #e3f2fd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.mode-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}
.mode-option {
    flex: 1;
    padding: 10px;
    border: 2px solid #2196f3;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}
.mode-option.active {
    background: #2196f3;
    color: white;
}
.multi-sim-controls {
    display: none;
}
.multi-sim-controls.show {
    display: block;
}
.advanced-settings {
    margin-top: 20px;
}
.toggle-advanced {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 0.95em;
    text-decoration: underline;
    padding: 5px 0;
}
.advanced-content {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e5e9;
}
.advanced-content.show {
    display: block;
}
.simulate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
    margin: 0 auto;
    position: relative;
}
.simulate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}
.simulate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.progress-bar {
    display: none;
    width: 100%;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}
.results {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-top: 30px;
    display: none;
}
.results.show {
    display: block;
}
.results h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}
.rank-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e1e5e9;
}
.rank-result:last-child {
    border-bottom: none;
}
.rank-name {
    font-weight: 600;
    color: #333;
}
.rank-percentage {
    font-weight: 600;
    font-size: 1.1em;
}
.emerald { color: #50c878; }
.topaz { color: #ffc649; }
.ruby { color: #e0115f; }
.sapphire { color: #0f52ba; }
.diamond { color: #b9f2ff; }
.summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
}
.chart-container {
    margin-top: 30px;
    background: white;
    border-radius: 10px;
    padding: 20px;
}
.chart-title {
    text-align: center;
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}
.chart {
    height: 400px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    border-left: 2px solid #ccc;
    border-bottom: 2px solid #ccc;
    margin: 20px 0;
    padding: 20px;
    position: relative;
}
.bar {
    flex: 1;
    margin: 0 5px;
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: all 0.3s ease;
    min-height: 1px;
}
.bar:hover {
    opacity: 0.8;
    transform: scale(1.05);
}
.bar-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9em;
    font-weight: 600;
    white-space: nowrap;
}
.bar-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8em;
    font-weight: 600;
    color: #333;
}
.y-axis {
    position: absolute;
    left: -15px;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
    font-size: 0.8em;
    color: #666;
}
.multi-results {
    margin-top: 20px;
    background: #e8f5e8;
    border-radius: 8px;
    padding: 15px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.stat-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}
.stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #2e7d32;
}
.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}
@media (max-width: 768px) {
    .container {
        margin: 10px;
    }
    .header {
        padding: 20px;
    }
    .header h1 {
        font-size: 2em;
    }
    .main-content {
        padding: 20px;
    }
    .input-row {
        grid-template-columns: 1fr;
    }
    .mode-selector {
        flex-direction: column;
    }
    .chart {
        height: 300px;
    }
}
