* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 1400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.status {
    display: flex;
    gap: 10px;
    align-items: center;
}

.status span {
    padding: 4px 12px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
}

.sender-id, .receiver-id {
    background: rgba(255, 255, 255, 0.3);
    padding: 4px 12px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 30px;
    overflow-y: auto;
}

/* 发送端样式 */
.preview {
    margin-bottom: 30px;
    text-align: center;
}

.preview canvas {
    max-width: 100%;
    height: auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #f5f5f5;
    max-height: 500px;
}

.preview p {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

/* 接收端样式 */
.control-panel {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-group label {
    white-space: nowrap;
    color: #333;
    font-weight: 500;
}

.input-group input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    min-width: 250px;
}

.video-wrapper {
    flex: 1;
    position: relative;
    margin-bottom: 20px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
}

.video-container.dragging {
    cursor: grabbing;
}

.video-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
}

.video-container video {
    position: absolute;
    object-fit: contain;
    transition: transform 0.1s ease-out;
    width: 100%;
    height: 100%;
}

.video-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px 40px;
    border-radius: 8px;
    text-align: center;
    pointer-events: none;
    z-index: 100;
}

.video-toolbar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 16px;
    border-radius: 8px;
    z-index: 200;
    transition: opacity 0.3s ease;
}

.video-container.fullscreen .video-toolbar {
    bottom: 30px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.toolbar-btn:active {
    transform: scale(0.95);
}

.zoom-level {
    color: white;
    font-size: 13px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
    font-family: monospace;
}

.controls {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stats {
    display: flex;
    gap: 30px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.stats p {
    font-size: 14px;
    color: #333;
}

.stats span {
    font-weight: 600;
    color: #667eea;
    font-family: monospace;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: #ff6b6b;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.footer {
    background: #f5f5f5;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.footer p {
    color: #666;
    font-size: 13px;
    margin: 5px 0;
}

.footer code {
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-family: monospace;
    color: #667eea;
    word-break: break-all;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        height: 100vh;
        border-radius: 0;
    }

    .header {
        padding: 15px;
    }

    .header h1 {
        font-size: 18px;
    }

    .header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .content {
        padding: 15px;
    }

    .control-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group input {
        min-width: unset;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .stats {
        flex-direction: column;
        gap: 10px;
    }

    .preview canvas {
        max-height: 300px;
    }
}

/* 暗黑模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
    }

    .container {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .control-panel,
    .stats,
    .footer {
        background: #1a1a1a;
        border-color: #444;
    }

    .input-group input {
        background: #1a1a1a;
        color: #e0e0e0;
        border-color: #444;
    }

    .input-group label,
    .stats p {
        color: #e0e0e0;
    }

    .footer p {
        color: #999;
    }

    .footer code {
        background: #1a1a1a;
        color: #667eea;
        border-color: #444;
    }
}
