/* style.css - 性状分离比模拟实验样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);
    color: white;
    padding: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header-icon {
    width: 40px;
    height: 40px;
    fill: white;
}

h1 {
    font-size: 28px;
    margin-bottom: 0;
}

.subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-top: 8px;
    text-align: center;
}

.content {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
}

.control-panel {
    flex: 1;
    min-width: 300px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    margin-right: 20px;
    margin-bottom: 20px;
}

.animation-area {
    flex: 2;
    min-width: 500px;
    padding: 20px;
    background-color: #f0f4f8;
    border-radius: 10px;
    margin-bottom: 20px;
    position: relative;
    min-height: 500px;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.input-error {
    border-color: #f44336 !important;
}

.error-message {
    color: #f44336;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#startBtn {
    background-color: #4CAF50;
    color: white;
}

#startBtn:hover:not(:disabled) {
    background-color: #45a049;
}

#fastBtn {
    background-color: #2196F3;
    color: white;
}

#fastBtn:hover:not(:disabled) {
    background-color: #0b7dda;
}

#stopBtn {
    background-color: #f44336;
    color: white;
}

#stopBtn:hover:not(:disabled) {
    background-color: #d32f2f;
}

#resetBtn {
    background-color: #FF9800;
    color: white;
}

#resetBtn:hover:not(:disabled) {
    background-color: #e68900;
}

.buckets-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

.bucket {
    width: 180px;
    height: 250px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bucket-label {
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 18px;
}

.bucket-body {
    width: 150px;
    height: 200px;
    background: linear-gradient(to bottom, #8B4513 0%, #A0522D 100%);
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: hidden;
    border: 5px solid #5D4037;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.ball {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 3px 5px rgba(0,0,0,0.2);
    transition: all 0.5s;
}

.blue {
    background: linear-gradient(135deg, #2196F3 0%, #0D47A1 100%);
}

.yellow {
    background: linear-gradient(135deg, #FFEB3B 0%, #FBC02D 100%);
    color: #333;
}

.combination-area {
    text-align: center;
    margin: 20px 0;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.result-balls {
    display: flex;
    gap: 20px;
    margin: 10px 0;
}

.result-ball {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 24px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.genotype-display {
    font-size: 24px;
    font-weight: bold;
    margin: 10px 0;
    min-height: 40px;
}

.results-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.results-table {
    flex: 1;
    min-width: 300px;
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
}

.experiment-log {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
}

.log-entry {
    padding: 5px;
    border-bottom: 1px solid #eee;
}

.theory-section {
    background-color: #e8f4f8;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
}

.ratio-display {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    text-align: center;
}

.ratio-item {
    flex: 1;
    padding: 10px;
}

.ratio-value {
    font-size: 24px;
    font-weight: bold;
    margin: 5px 0;
}

@media (max-width: 768px) {
    .content {
        flex-direction: column;
    }
    
    .control-panel, .animation-area {
        margin-right: 0;
        min-width: 100%;
    }
    
    .buckets-container {
        flex-direction: column;
    }
    
    .bucket {
        margin-bottom: 30px;
    }
    
    header {
        flex-direction: column;
        gap: 8px;
    }
}