/* 隐藏元素的通用类 */
.hidden {
    display: none !important;
}

/* 隐藏原生的文件输入框 */
.hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 次要文本颜色 */
.text-secondary {
    color: #555;
    font-size: 0.9rem;
}

/* 页面主布局 */
.page-layout {
    display: flex;
    gap: calc(var(--space-unit) * 3); /* 24px */
}

.controls-panel {
    flex: 0 0 320px; /* 固定左侧面板宽度 */
}

.workspace {
    flex: 1; /* 右侧工作区占据剩余空间 */
}

#workspace-card {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    padding: 0; /* 移除内边距，让子元素完全填充 */
}

/* 工作区内所有直接子元素（步骤）的通用样式 */
#workspace-card > div {
    width: 100%;
    flex-grow: 1; /* 占据所有可用垂直空间 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 上传区域样式 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background-color: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    padding: calc(var(--space-unit) * 4);
    box-sizing: border-box;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: #f5fbfb;
}

/* 视频容器 */
#video-container {
    position: relative;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

#video-player {
    width: 100%;
    display: block;
}

#selection-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* 结果视频容器 */
#result-container {
    width: 100%;
}
#result-video {
    width: 100%;
    border-radius: 8px;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: calc(var(--space-unit) * 1.5); /* 12px */
    width: 100%;
}

/* 加载指示器 */
#loading-indicator {
    text-align: center;
}

.spinner {
    border: 5px solid rgba(0, 128, 128, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: calc(var(--space-unit) * 2);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

progress {
    width: 100%;
    max-width: 320px;
    margin-top: var(--space-unit);
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    -webkit-appearance: none;
    appearance: none;
}

progress::-webkit-progress-bar {
    background-color: #e9ecef;
}

progress::-webkit-progress-value {
    background-color: var(--primary-color);
    transition: width 0.2s ease;
}

progress::-moz-progress-bar {
    background-color: var(--primary-color);
}
