/* v2.0 特定样式 */

.algorithm-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    color: white;
}

.algorithm-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.3rem;
}

.algorithm-formula {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
}

.algorithm-formula code {
    color: #ffd700;
    font-size: 0.95rem;
    line-height: 1.6;
}

.algorithm-rules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.algorithm-rules .rule {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
}

.algorithm-rules .rule.good {
    border-left: 4px solid #2ecc71;
}

.algorithm-rules .rule.mild {
    border-left: 4px solid #f39c12;
}

.algorithm-rules .rule.bad {
    border-left: 4px solid #e74c3c;
}

.algorithm-note {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.algorithm-note strong {
    color: #ffd700;
}

/* 图例 */
.legend {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.8);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: white;
    z-index: 5;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
}

.legend-line {
    width: 20px;
    height: 3px;
    background: linear-gradient(to right, #00ff00, #ff9900, #ff0000);
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.95rem;
}

.data-table thead {
    background: #34495e;
    color: white;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.data-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table .good-row {
    background: rgba(46, 204, 113, 0.1);
}

.data-table .bad-row {
    background: rgba(231, 76, 60, 0.1);
}

/* 版本信息 */
.version-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.version-info h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.version-info ul {
    padding-left: 25px;
    margin: 0;
}

.version-info li {
    margin-bottom: 5px;
    color: #555;
}

/* 指标提示 */
.metric-hint {
    display: block;
    font-size: 0.7rem;
    color: #95a5a6;
    margin-top: 5px;
}

/* 声音开关 */
.sound-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.sound-toggle:hover {
    background: #e9ecef;
}

.sound-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.sound-toggle span {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.sound-toggle input[type="checkbox"]:checked + span {
    color: #3498db;
}

/* 声音选择器 */
.sound-selector {
    padding: 12px 20px;
    font-size: 1rem;
    border: 2px solid #3498db;
    border-radius: 8px;
    background: white;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.sound-selector:hover {
    border-color: #2980b9;
    background: #f8f9fa;
}

.sound-selector:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* 试听按钮 */
.btn-test {
    background: #f39c12;
    color: white;
}

.btn-test:hover:not(:disabled) {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(243, 156, 18, 0.3);
}

/* 语言切换按钮 */
.lang-switch {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.lang-switch:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* 响应式 */
@media (max-width: 768px) {
    .algorithm-rules {
        grid-template-columns: 1fr;
    }

    .legend {
        position: static;
        margin-bottom: 15px;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }

    .sound-toggle {
        width: 100%;
        justify-content: center;
    }
}
