/* 功率换算工具专用样式 */

/* 换算区域 */
.converter-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

/* 输入行 */
.input-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* 输入组 */
.input-group {
    display: flex;
    flex-direction: column;
}

/* 选择组 */
.select-group {
    display: flex;
    flex-direction: column;
}

/* 输入标签 */
.input-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-label i {
    color: #4CAF50;
}

/* 数值输入框 */
.value-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
}

.value-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.value-input.result-input {
    background: #f5f5f5;
    font-weight: 600;
    color: #2196F3;
}

/* 单位选择框 */
.unit-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.unit-select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* 交换按钮容器 */
.swap-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
}

/* 交换按钮 */
.swap-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.swap-btn:active {
    transform: rotate(180deg) scale(0.95);
}

/* 实时转换开关 */
.auto-convert-switch {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
}

.switch-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.switch-container input[type="checkbox"] {
    display: none;
}

.switch-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 26px;
    transition: background-color 0.3s ease;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.switch-container input[type="checkbox"]:checked + .switch-slider {
    background-color: #4CAF50;
}

.switch-container input[type="checkbox"]:checked + .switch-slider::before {
    transform: translateX(24px);
}

.switch-label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

/* 快捷示例区域 */
.example-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.example-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.example-header i {
    color: #FF9800;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.example-btn {
    padding: 10px 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.example-btn:hover {
    border-color: #4CAF50;
    background: #f1f8f4;
    color: #4CAF50;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.2);
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.btn-copy {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4);
}

/* 历史记录区域 */
.history-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid #e0e0e0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.history-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.history-title i {
    color: #FF9800;
}

.history-count {
    color: #999;
    font-size: 13px;
}

.btn-text {
    background: none;
    border: none;
    color: #f44336;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-text:hover {
    color: #d32f2f;
    transform: translateX(-2px);
}

/* 历史记录列表 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #e3f2fd;
    transform: translateX(5px);
}

.history-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.history-from {
    font-weight: 600;
    color: #333;
}

.history-content i {
    color: #999;
    font-size: 12px;
}

.history-to {
    font-weight: 600;
    color: #2196F3;
}

.history-delete {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e0e0e0;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.history-delete:hover {
    background: #ffebee;
    border-color: #f44336;
    color: #f44336;
}

/* 复制提示 */
.copy-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #323232;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.copy-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.copy-toast i {
    color: #4CAF50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .converter-section {
        padding: 20px;
    }

    .input-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .example-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .history-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .history-item:hover {
        transform: none;
    }

    .swap-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .converter-section {
        padding: 15px;
    }

    .example-grid {
        grid-template-columns: 1fr;
    }

    .value-input,
    .unit-select {
        font-size: 14px;
        padding: 10px 12px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}
