/**
 * 速度单位换算工具样式
 */

/* 错误提示样式 */
.error-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    margin: 10px 0;
}

.error-icon {
    font-size: 18px;
}

/* 复制提示文字 */
.copy-hint {
    font-size: 12px;
    color: #999;
    font-weight: normal;
}

/* 可复制元素 */
.copyable {
    cursor: pointer;
}

.copyable:hover {
    text-decoration: underline;
}

/* 高亮行 */
.highlight-row {
    background-color: #e7f3ff !important;
}

.highlight-row td {
    font-weight: 600;
}

/* 单位选择行布局 */
.unit-select-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.unit-select-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.unit-select-group label {
    font-size: 14px;
    color: #666;
}

.unit-arrow {
    font-size: 24px;
    color: #007bff;
    font-weight: bold;
    padding: 0 10px;
    margin-top: 20px;
}

.unit-arrow::after {
    content: '→';
}

/* 下拉选择框样式 */
.query-select {
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    min-width: 150px;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.query-select:hover {
    border-color: #007bff;
}

.query-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 快捷示例区域 */
.quick-examples {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 0;
    border-top: 1px dashed #eee;
    margin-top: 10px;
}

.example-label {
    font-size: 14px;
    color: #666;
}

.example-btn {
    padding: 6px 12px;
    font-size: 13px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-btn:hover {
    background-color: #e9ecef;
    border-color: #007bff;
    color: #007bff;
}

/* 结果高亮显示 */
.result-highlight {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    margin: 10px 0;
}

.result-value {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.result-value.highlight {
    font-size: 24px;
    color: #007bff;
    background: #e7f3ff;
    padding: 5px 12px;
    border-radius: 6px;
}

.result-unit {
    font-size: 16px;
    color: #666;
}

.result-equal {
    font-size: 20px;
    color: #999;
    padding: 0 5px;
}

/* 结果表格 */
.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

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

.result-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.result-table tr:hover {
    background-color: #f5f5f5;
}

.result-cell {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 15px;
    color: #007bff;
    cursor: pointer;
    position: relative;
}

.result-cell:hover {
    background-color: #e7f3ff;
}

.copy-tip {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #28a745;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
}

/* 参考表格区域 */
.reference-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.reference-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.reference-table th,
.reference-table td {
    padding: 10px 12px;
    text-align: left;
    border: 1px solid #dee2e6;
}

.reference-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.reference-table tr:nth-child(even) {
    background-color: #fafafa;
}

/* 所有结果区域 */
.all-results {
    margin-top: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .unit-select-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .unit-arrow::after {
        content: '↓';
    }
    
    .unit-arrow {
        text-align: center;
        margin: 5px 0;
        padding: 0;
    }
    
    .query-select {
        width: 100%;
    }
    
    .result-highlight {
        flex-direction: column;
        text-align: center;
    }
    
    .reference-table {
        font-size: 12px;
    }
    
    .reference-table th,
    .reference-table td {
        padding: 8px 6px;
    }
}

/* 暗黑模式支持 */
@media (prefers-color-scheme: dark) {
    .error-tip {
        background-color: #4a3c00;
        border-color: #665200;
        color: #ffc107;
    }

    .unit-select-group label,
    .example-label {
        color: #aaa;
    }

    .result-unit,
    .result-equal {
        color: #999;
    }

    .copy-hint {
        color: #888;
    }

    .query-select {
        background-color: #2d2d2d;
        border-color: #444;
        color: #fff;
    }
    
    .result-highlight {
        background: linear-gradient(135deg, #2d2d2d 0%, #3d3d3d 100%);
    }
    
    .result-value {
        color: #fff;
    }
    
    .result-value.highlight {
        background: #1e3a5f;
        color: #5dade2;
    }
    
    .result-table th {
        background-color: #2d2d2d;
        color: #fff;
    }
    
    .result-table tr:hover {
        background-color: #3d3d3d;
    }
    
    .reference-table th {
        background-color: #2d2d2d;
        color: #fff;
    }
    
    .reference-table tr:nth-child(even) {
        background-color: #2d2d2d;
    }
    
    .result-table td,
    .reference-table td {
        color: #ddd;
    }

    .result-cell {
        color: #5dade2;
    }

    .highlight-row {
        background-color: #1e3a5f !important;
    }

    .highlight-row td {
        color: #5dade2;
    }

    .example-btn {
        background-color: #2d2d2d;
        border-color: #444;
        color: #ccc;
    }
    
    .example-btn:hover {
        background-color: #3d3d3d;
    }
}
