/* ==================== 固件升级页面样式 ==================== */

/* 固件升级容器 */
.firmware-container {
    padding: 1.5rem 1.25rem 2rem;
    width: min(1260px, 100%);
    margin: 0 auto;
}

/* 固件升级区域 */
.firmware-section {
    margin-bottom: 1.5rem;
}

/* 版本信息卡片 */
.firmware-info-card {
    flex: 1;
    min-width: 300px;
}

.firmware-info-row {
    justify-content: flex-start;
}

.firmware-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.firmware-info-item:last-child {
    border-bottom: none;
}

.firmware-info-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.firmware-info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
}

/* 固件升级卡片 */
.firmware-upgrade-card {
    flex: 1;
    min-width: 400px;
}

.firmware-upgrade-row {
    justify-content: flex-start;
}

/* 文件选择区域 */
.firmware-file-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.firmware-file-btn {
    align-self: flex-start;
}

.firmware-file-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: rgba(128, 128, 128, 0.1);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.firmware-file-name {
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-all;
}

.firmware-file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 进度条区域 - 使用与音量滑块一致的样式 */
.firmware-progress-section {
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.firmware-progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(128, 128, 128, 0.2);
    border-radius: 5px;
    border: 1px solid #888888;
    overflow: hidden;
    position: relative;
}

.firmware-progress-fill {
    height: 100%;
    background: #d2b16f;
    border-radius: 5px;
    transition: width 0.3s ease;
    width: 0%;
}

.firmware-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 13px;
}

#firmwareProgressPercent {
    font-weight: 500;
    color: var(--text-primary);
}

#firmwareProgressDetail {
    color: var(--text-secondary);
}

/* 警告提示 */
.firmware-warning {
    color: #ff0000;
    font-weight: bold;
    font-size: 14px;
    margin-top: 10px;
    line-height: 1.5;
}

/* 升级状态显示区域 */
.firmware-status-area {
    background: rgba(128, 128, 128, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.firmware-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.firmware-status-item:last-child {
    margin-bottom: 0;
}

.firmware-status-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.firmware-status-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

/* 操作按钮区域 */
.firmware-actions {
    display: flex;
    gap: 12px;
}

.firmware-action-btn {
    min-width: 100px;
}

.firmware-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 设备操作区域 */
.firmware-ops-card {
    flex: 1;
    min-width: 400px;
    margin-top: 1.5rem;
}

.firmware-ops-row {
    justify-content: flex-start;
    margin-top: 1.5rem;
}

.firmware-ops-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.firmware-op-btn {
    min-width: 120px;
}

/* 夜间模式样式 */
body.dark-mode .firmware-file-info {
    background: rgba(255, 255, 255, 0.05);
    border-color: #4a5568;
}

body.dark-mode .firmware-progress-bar {
    background: rgba(255, 255, 255, 0.1);
    border-color: #4a5568;
}

body.dark-mode .firmware-info-item,
body.dark-mode .firmware-status-section {
    border-color: #4a5568;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .firmware-upgrade-card,
    .firmware-ops-card,
    .firmware-info-card {
        min-width: 100%;
    }

    .firmware-actions,
    .firmware-ops-buttons {
        flex-direction: column;
    }

    .firmware-action-btn,
    .firmware-op-btn {
        width: 100%;
    }
}

