        :root {
            --primary-color: #ff2e63;
            --secondary-color: #08d9d6;
            --dark-bg: #0f0f23;
            --card-bg: rgba(255, 255, 255, 0.08);
            --card-bg-solid: #1a1a2e;
            --text-color: #ffffff;
            --text-secondary: #b8b8b8;
            --border-radius: 12px;
            --blur: blur(10px);
            --transition: all 0.3s ease;
        }
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
            min-height: 100vh;
            color: var(--text-color);
            overflow: hidden;
            /* 禁止滚动 */
            display: flex;
            flex-direction: column;
        }
        .container {
            flex: 1;
            display: grid;
            grid-template-columns: 1fr 400px;
            gap: 20px;
            padding: 20px;
            height: 100vh;
            max-height: 100vh;
        }
        @media (max-width: 1200px) {
            .container {
                grid-template-columns: 1fr;
                grid-template-rows: 1fr auto;
            }
        }
        .main-panel {
            display: flex;
            flex-direction: column;
            gap: 20px;
            min-height: 0;
            /* 重要：允许内部flex子元素收缩 */
        }
        .video-container {
            flex: 1;
            background: #000;
            border-radius: var(--border-radius);
            overflow: hidden;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 0;
            /* 重要：允许视频容器收缩 */
        }
        #local-video {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
            /* 保持原始比例，不剪切 */
            background: #000;
        }
        .video-placeholder {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(45deg, #1a1a2e, #16213e);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.2rem;
            flex-direction: column;
        }
        .video-placeholder i {
            font-size: 4rem;
            margin-bottom: 15px;
            color: var(--secondary-color);
        }
        .video-controls {
            display: flex;
            gap: 10px;
            background: var(--card-bg);
            backdrop-filter: var(--blur);
            border-radius: var(--border-radius);
            padding: 15px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.1);
            flex-wrap: wrap;
        }
        .control-btn {
            flex: 1;
            min-width: 120px;
            padding: 12px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
            transition: var(--transition);
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-color);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .control-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: translateY(-2px);
        }
        .control-btn.active {
            background: var(--secondary-color);
            color: #000;
        }
        #start-btn {
            background: rgba(46, 213, 115, 0.2);
            color: #2ed573;
            border: 1px solid rgba(46, 213, 115, 0.3);
        }
        #start-btn:hover {
            background: rgba(46, 213, 115, 0.3);
        }
        #stop-btn {
            background: rgba(255, 71, 87, 0.2);
            color: #ff4757;
            border: 1px solid rgba(255, 71, 87, 0.3);
        }
        #stop-btn:hover {
            background: rgba(255, 71, 87, 0.3);
        }
        .sidebar {
            display: flex;
            flex-direction: column;
            gap: 20px;
            height: 100%;
            max-height: 100vh;
            overflow: hidden;
        }
        .config-panel {
            background: var(--card-bg);
            backdrop-filter: var(--blur);
            border-radius: var(--border-radius);
            padding: 20px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.1);
            overflow-y: auto;
            flex: 1;
            min-height: 0;
        }
        .panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        .panel-header h3 {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .form-group {
            margin-bottom: 20px;
        }
        label {
            display: block;
            margin-bottom: 8px;
            font-weight: bold;
            color: var(--text-secondary);
        }
        select,
        input,
        textarea {
            width: 100%;
            padding: 12px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--text-color);
            font-size: 1rem;
        }
        textarea {
            height: 80px;
            resize: vertical;
        }
        .stream-info {
            background: rgba(255, 227, 18, 0.1);
            border: 1px solid rgba(255, 227, 18, 0.3);
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 20px;
        }
        .info-title {
            font-weight: bold;
            margin-bottom: 10px;
            color: #ffd700;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .stream-url {
            background: rgba(0, 0, 0, 0.2);
            padding: 10px;
            border-radius: 4px;
            word-break: break-all;
            margin-bottom: 10px;
            font-size: 0.9rem;
        }
        .copy-btn {
            background: var(--secondary-color);
            color: #000;
            border: none;
            padding: 8px 15px;
            border-radius: 4px;
            cursor: pointer;
            font-weight: bold;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 5px;
        }
        .copy-btn:hover {
            background: #06b6b3;
            transform: translateY(-2px);
        }
        .stats-container {
            background: var(--card-bg);
            backdrop-filter: var(--blur);
            border-radius: var(--border-radius);
            padding: 20px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        .stats {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
        }
        .stat-item {
            text-align: center;
            padding: 15px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
        }
        .stat-value {
            font-size: 1.5rem;
            font-weight: bold;
            color: var(--secondary-color);
        }
        .stat-label {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-top: 5px;
        }
        .chat-container {
            background: var(--card-bg);
            backdrop-filter: var(--blur);
            border-radius: var(--border-radius);
            padding: 20px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            height: 300px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        .chat-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        .chat-header h3 {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .messages {
            flex: 1;
            overflow-y: auto;
            margin-bottom: 15px;
            padding: 10px;
            background: rgba(0, 0, 0, 0.2);
            border-radius: 8px;
        }
        .message {
            margin-bottom: 12px;
            padding: 10px 15px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            border-left: 3px solid var(--secondary-color);
            transition: var(--transition);
        }
        .message:hover {
            background: rgba(255, 255, 255, 0.08);
        }
        .message-header {
            display: flex;
            align-items: center;
            margin-bottom: 5px;
        }
        .message-avatar {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            font-weight: bold;
            margin-right: 8px;
            background-size: cover;
            background-position: center;
        }
        .message .user {
            font-weight: bold;
            color: var(--secondary-color);
            margin-right: 8px;
        }
        .message .time {
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-left: auto;
        }
        /* 新增：聊天输入区域 */
        .chat-input-container {
            display: flex;
            gap: 10px;
        }
        #chat-message-input {
            flex: 1;
            padding: 10px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            color: var(--text-color);
            font-size: 0.9rem;
        }
        #chat-send-btn {
            padding: 10px 15px;
            background: var(--secondary-color);
            color: #000;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-weight: bold;
            transition: var(--transition);
        }
        #chat-send-btn:hover {
            background: #06b6b3;
        }
        .error {
            background: rgba(255, 71, 87, 0.2);
            color: #ff4757;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 20px;
            text-align: center;
            border: 1px solid rgba(255, 71, 87, 0.3);
        }
        .success {
            background: rgba(46, 213, 115, 0.2);
            color: #2ed573;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 20px;
            text-align: center;
            border: 1px solid rgba(46, 213, 115, 0.3);
        }
        .hidden {
            display: none;
        }
        .status-indicators {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
        }
        .status-item {
            flex: 1;
            text-align: center;
            padding: 10px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            color: white;
        }
        .status-value {
            font-size: 1.2rem;
            font-weight: bold;
            margin-top: 5px;
        }
        .video-source-selector {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
        }
        .source-btn {
            flex: 1;
            padding: 10px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-color);
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .source-btn.active {
            background: var(--secondary-color);
            color: #000;
        }
        .source-btn:hover:not(.active) {
            background: rgba(255, 255, 255, 0.1);
        }
        /* 滚动条样式 */
        .messages::-webkit-scrollbar {
            width: 6px;
        }
        .messages::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 3px;
        }
        .messages::-webkit-scrollbar-thumb {
            background: var(--secondary-color);
            border-radius: 3px;
        }
        .messages::-webkit-scrollbar-thumb:hover {
            background: #06b6b3;
        }
        .config-panel::-webkit-scrollbar {
            width: 6px;
        }
        .config-panel::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 3px;
        }
        .config-panel::-webkit-scrollbar-thumb {
            background: var(--secondary-color);
            border-radius: 3px;
        }
        .config-panel::-webkit-scrollbar-thumb:hover {
            background: #06b6b3;
        }