:root {
    --bg-base: #0b0c10;
    --header-bg: rgba(11, 12, 16, 0.6);
    --panel-bg: rgba(26, 27, 33, 0.75);
    --panel-inner-bg: rgba(18, 18, 22, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-shadow: 0 25px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --accent: #0a84ff;
    --accent-hover: #0071e3;
    --accent-green: #30d158;
    --accent-orange: #ff9f0a;
    --accent-red: #ff453a;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --pattern-opacity: 0.05;
    --pattern-invert: 0;
    --preview-bg: #060709;
    --select-bg: rgba(255, 255, 255, 0.06);
    --select-border: rgba(255, 255, 255, 0.12);
    --select-opt-bg: #1e1e24;
    --select-color: #f5f5f7;
    --card-hover-bg: rgba(255, 255, 255, 0.06);
    --footer-border: rgba(255, 255, 255, 0.06);
}

/* 浅色主题变量覆盖 */
body.light-mode {
    --bg-base: #f2f2f7;
    --header-bg: rgba(255, 255, 255, 0.8);
    --panel-bg: rgba(255, 255, 255, 0.82);
    --panel-inner-bg: rgba(242, 242, 247, 0.7);
    --panel-border: rgba(0, 0, 0, 0.08);
    --panel-shadow: 0 20px 40px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --pattern-opacity: 0.04;
    --pattern-invert: 1;
    --preview-bg: #1c1c1e;
    --select-bg: rgba(0, 0, 0, 0.05);
    --select-border: rgba(0, 0, 0, 0.12);
    --select-opt-bg: #ffffff;
    --select-color: #1d1d1f;
    --card-hover-bg: rgba(0, 0, 0, 0.04);
    --footer-border: rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 背景平铺图标层 */
.bg-pattern-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: var(--pattern-opacity);
    filter: invert(var(--pattern-invert));
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='440' height='440' viewBox='0 0 440 440'%3E%3Cstyle%3Epath%7Bfill:%23ffffff;%7D%3C/style%3E%3C!-- 经典单反相机 --%3E%3Cg transform='translate(45, 35) rotate(-14 20 20) scale(0.95)'%3E%3Cpath d='M4 7c0-1.1.9-2 2-2h3l1.5-2.5C10.8 2.2 11.2 2 11.7 2h8.6c.5 0 .9.2 1.2.5L23 5h3c1.1 0 2 .9 2 2v14c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V7zm12 14c4.4 0 8-3.6 8-8s-3.6-8-8-8-8 3.6-8 8 3.6 8 8 8zm0-3c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5z'/%3E%3C/g%3E%3C!-- 摄影机 --%3E%3Cg transform='translate(265, 45) rotate(18 20 20) scale(0.9)'%3E%3Cpath d='M4 6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-2.8l5.4 3.4c.7.4 1.6-.1 1.6-.9V8.3c0-.8-.9-1.3-1.6-.9L20 10.8V8c0-1.1-.9-2-2-2H4zm2 3h4c.6 0 1 .4 1 1s-.4 1-1 1H6c-.6 0-1-.4-1-1s.4-1 1-1z'/%3E%3C/g%3E%3C!-- 播放按键 --%3E%3Cg transform='translate(80, 240) rotate(24 20 20) scale(1)'%3E%3Cpath d='M16 2C8.3 2 2 8.3 2 16s6.3 14 14 14 14-6.3 14-14S23.7 2 16 2zm-3 20V10l10 6-10 6z'/%3E%3C/g%3E%3C!-- 胶卷放映机 --%3E%3Cg transform='translate(230, 205) rotate(-11 20 20) scale(0.85)'%3E%3Cpath d='M8 3a5 5 0 1 0 0 10A5 5 0 0 0 8 3zm14 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM3 15v11c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-3l4 2.5V14.5L25 17v-2c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2zm13 8H6v-6h10v6z'/%3E%3C/g%3E%3C!-- 紧凑卡片相机 --%3E%3Cg transform='translate(150, 115) rotate(7 20 20) scale(0.85)'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h1.5l1.2-1.6A2 2 0 0 1 9.3 2.5h5.4a2 2 0 0 1 1.6.9L17.5 5H19a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7zm9 10a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9z'/%3E%3C/g%3E%3C!-- 磁带盒 --%3E%3Cg transform='translate(330, 310) rotate(-19 20 20) scale(0.95)'%3E%3Cpath d='M3 5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h20c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2H3zm2 4h16v3H5V9zm3 8c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3zm10 0c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3z'/%3E%3C/g%3E%3C!-- 三角播放图标 --%3E%3Cg transform='translate(40, 360) rotate(13 20 20) scale(0.85)'%3E%3Cpath d='M7 4.5v15c0 .8.9 1.3 1.6.9l12-7.5c.7-.4.7-1.4 0-1.8l-12-7.5c-.7-.4-1.6.1-1.6.9z'/%3E%3C/g%3E%3C!-- 手持DV机 --%3E%3Cg transform='translate(190, 345) rotate(-6 20 20) scale(0.9)'%3E%3Cpath d='M3 8a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1l4-2.5c.7-.4 1.6.1 1.6.9v7.2c0 .8-.9 1.3-1.6.9L17 13v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8zm-2 9h12v2H1v-2z'/%3E%3C/g%3E%3C!-- 影视场记板 --%3E%3Cg transform='translate(355, 130) rotate(-15 20 20) scale(0.9)'%3E%3Cpath d='M22 6.5l-2.4-3.5-3.3 2.3 2.4 3.5 3.3-2.3zM16.3 5.3L14 1.8l-3.3 2.3 2.4 3.5 3.2-2.3zM10.6 4.1L8.2.6 4.9 2.9l2.4 3.5 3.3-2.3zM3 9v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9H3z'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 440px 440px;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.bg-glow-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 25% 20%, rgba(10, 132, 255, 0.08) 0%, transparent 65%),
                radial-gradient(circle at 80% 80%, rgba(255, 69, 58, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

/* 顶部通栏 Header */
.site-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(20px);
    background: var(--header-bg);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 14px;
}
.brand-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
}
.brand-text h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}
.brand-text p {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-badge {
    font-family: "SF Mono", Menlo, Monaco, monospace;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    background: var(--panel-inner-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 主题切换按钮 */
.theme-toggle-btn {
    background: var(--panel-inner-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.2s ease;
}
.theme-toggle-btn:hover {
    background: var(--card-hover-bg);
    transform: scale(1.05);
}

/* 主体左右双栏布局容器 */
.main-wrapper {
    position: relative;
    z-index: 2;
    flex: 1;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 40px;
    display: grid;
    grid-template-columns: 1fr 440px;
    gap: 28px;
    align-items: stretch;
}

/* 通用毛玻璃卡片 */
.glass-card {
    background: var(--panel-bg);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--panel-border);
    box-shadow: var(--panel-shadow);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 左侧主监视工作台 */
.workbench-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview-box {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--preview-bg);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
    transition: background-color 0.3s ease;
}
#previewVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}
.tip-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 15px;
}
.tip-empty i {
    font-size: 48px;
    opacity: 0.4;
}

.status-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    font-size: 12px;
    color: #ffffff;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 5;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #86868b;
}
.status-dot.active {
    background: var(--accent-red);
    box-shadow: 0 0 10px var(--accent-red);
    animation: pulse 1.5s infinite;
}
.status-dot.paused {
    background: var(--accent-orange);
}
@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.25); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.fullscreen-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
    z-index: 5;
}
.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.audio-meter-wrap {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
}
body.light-mode .audio-meter-wrap {
    background: rgba(0, 0, 0, 0.06);
}
.audio-meter-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #30d158, #ffd60a, #ff453a);
    transition: width 0.08s ease-out;
}

/* 录制操作按钮主排版 */
.controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px 20px;
    background: var(--panel-inner-bg);
    border-radius: 14px;
    border: 1px solid var(--panel-border);
    transition: background 0.3s ease;
}
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-weight: 500;
}
button:active:not(:disabled) {
    transform: scale(0.97);
}
button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.btn-start {
    background: var(--accent-green);
    color: #000;
    flex: 1;
    min-width: 130px;
}
.btn-start:hover:not(:disabled) {
    background: #28b84c;
    box-shadow: 0 4px 15px rgba(48, 209, 88, 0.35);
}
.btn-stop {
    background: var(--accent-red);
    color: #fff;
}
.btn-stop:hover:not(:disabled) {
    background: #e63b31;
    box-shadow: 0 4px 15px rgba(255, 69, 58, 0.35);
}
.btn-pause {
    background: rgba(255, 159, 10, 0.15);
    border: 1px solid rgba(255, 159, 10, 0.3);
    color: #ff9f0a;
}
.btn-pause:hover:not(:disabled) {
    background: rgba(255, 159, 10, 0.25);
}
.btn-download {
    background: var(--accent);
    color: #fff;
}
.btn-download:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 4px 15px rgba(10, 132, 255, 0.35);
}
.btn-clear {
    background: var(--panel-inner-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
}
.btn-clear:hover:not(:disabled) {
    background: var(--card-hover-bg);
}

/* 右侧边栏排版 */
.sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.section-title i {
    margin-right: 6px;
    color: var(--accent);
}

/* 侧边栏配置项表单 */
.config-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.config-select-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.config-select-group label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}
.mac-select {
    background: var(--select-bg);
    border: 1px solid var(--select-border);
    color: var(--select-color);
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}
.mac-select:focus {
    border-color: var(--accent);
}
.mac-select option {
    background: var(--select-opt-bg);
    color: var(--select-color);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 6px;
    border-top: 1px solid var(--panel-border);
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--text-primary);
}
.checkbox-item input[type="checkbox"] {
    display: none;
}
.checkbox-custom {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid #8e8e93;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}
.checkbox-custom i {
    font-size: 11px;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.checkbox-item input:checked + .checkbox-custom {
    background-color: var(--accent);
    border-color: var(--accent);
}
.checkbox-item input:checked + .checkbox-custom i {
    opacity: 1;
    transform: scale(1);
}

/* 历史列表 */
.history-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--panel-inner-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    transition: all 0.2s;
}
.history-item:hover {
    background: var(--card-hover-bg);
}
.history-info {
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.history-time {
    color: var(--text-secondary);
    font-size: 11px;
}
.history-actions {
    display: flex;
    gap: 6px;
}
.history-actions button {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 6px;
}

/* 日志窗口 */
.log-box {
    max-height: 140px;
    overflow-y: auto;
    font-family: "SF Mono", Menlo, monospace;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    background: var(--panel-inner-bg);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
}
.log-line {
    margin-bottom: 2px;
}
.log-time {
    color: var(--text-secondary);
    opacity: 0.7;
    margin-right: 6px;
}

/* 模态弹窗 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-content {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    max-width: 860px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}
.modal-header {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text-primary);
}
.modal-body video {
    width: 100%;
    max-height: 60vh;
    background: #000;
    display: block;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.25);
    border-radius: 3px;
}

.footer {
    padding: 20px 40px;
    border-top: 1px solid var(--footer-border);
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    position: relative;
    z-index: 2;
    transition: border-color 0.3s ease;
}
.footer a {
    color: var(--accent);
    text-decoration: none;
}

/* 响应式适配 */
@media (max-width: 1080px) {
    .main-wrapper {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    .site-header {
        padding: 16px 20px;
    }
}
@media (max-width: 640px) {
    .btn-group {
        flex-direction: column;
    }
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }
}