/* 摄像头录像工具：仅保留工具特有样式，公共样式复用 common.css */

/* 设置区控件补充（common.css 未覆盖的部分） */
.setting-control {
    display: flex;
    align-items: center;
    gap: 10px;
}
.setting-hint {
    font-size: 12px;
    color: #6b7280;
}
.error-text {
    font-size: 13px;
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 12px;
}

/* 开关（toggle）样式，避免与 common.css 的 .slider(range) 冲突 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: 0.2s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: #8b5cf6; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* 暗色模式补充 */
body.dark .setting-hint { color: #9ca3af; }
body.dark .error-text { background: #3a2326; border-color: #5b2a2e; color: #fca5a5; }
body.dark .toggle-slider { background: #374151; }

/* 录制中红点与计时 */
.rec-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    animation: rec-pulse 1s infinite;
}
@keyframes rec-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.timer {
    color: #ef4444;
    font-weight: bold;
    margin-left: 6px;
}

/* 预览区域 */
.preview-area {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preview-video {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    background: #000;
}
.preview-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    text-align: center;
    padding: 20px;
}
.placeholder-icon { font-size: 48px; margin-bottom: 12px; }
.placeholder-text { font-size: 14px; }

.preview-controls {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.screenshot-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

/* 录制列表 */
.record-list {
    margin-top: 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}
.list-items {
    display: flex;
    flex-direction: column;
    max-height: 320px;
    overflow-y: auto;
}
.record-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}
.record-item:last-child { border-bottom: none; }
.record-item:hover { background: #f9fafb; }
.record-thumb {
    width: 100px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: #111;
    flex-shrink: 0;
}
.record-meta { flex: 1; min-width: 0; }
.record-name {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.record-info { font-size: 12px; color: #6b7280; margin-top: 2px; }
.record-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 暗色模式 */
body.dark .preview-area { background: #000; }
body.dark .record-list { border-color: #2b3035; background: #1e2227; }
body.dark .list-header { background: #252a30; border-color: #2b3035; color: #e5e7eb; }
body.dark .record-item { border-color: #2b3035; }
body.dark .record-item:hover { background: #252a30; }
body.dark .record-name { color: #e5e7eb; }
body.dark .record-info { color: #9ca3af; }
