:root {
  /* 布局尺寸 */
  --navbar-h: clamp(44px, 6vw, 56px);
  /* 品牌色 */
  --color-primary: #E87722;
  --color-primary-hover: #d46a1e;
  --color-primary-light: #fff5eb;
  --color-primary-lighter: #ffe8d6;

  /* 强调色 */
  --color-accent: #4c6ef5;
  --color-accent-light: #e7f0ff;
  --color-accent-border: #c7dbfe;

  /* 背景色（收敛到 excalidraw 同源灰阶）*/
  --color-bg: #f8f9fa;
  --color-bg-subtle: #f1f3f5;
  --color-bg-deep: #343a40;
  --color-bg-white: #fff;
  --color-border: #e9ecef;
  --color-border-light: #f1f3f5;
  --color-text: #1a1a2e;
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #666;
  --color-text-tertiary: #999;
  --color-text-muted: #9ca3af;

  /* 功能色 */
  --color-danger: #dc2626;
  --color-danger-light: #fdecec;
  --color-danger-border: #f5c6c6;
  --color-success: #10b981;
  --color-success-light: #e8f5e9;
  --color-warning: #f59e0b;
  --color-warning-light: #fff3e6;
  --color-warning-border: #fcd9a8;
  --color-info: #90CAF9;

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
/* ========== 设计令牌 Design Tokens ========== */


body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  /* 白墙 + 灰色地板渐变 + 百叶窗纹理 */
  background: linear-gradient(180deg, #ffffff 0%, var(--color-bg) 50%, #eef0f2 100%);
  background-attachment: fixed;
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* 百叶窗纹理覆盖层 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 24px,
    rgba(0,0,0,0.015) 24px,
    rgba(0,0,0,0.015) 25px
  );
  pointer-events: none;
  z-index: 0;
}

/* Navbar - 玻璃质感 */
.navbar {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 0 clamp(8px, 3vw, 24px);
  height: var(--navbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-size: clamp(14px, 2.5vw, 20px);
  font-weight: 700;
  color: var(--color-primary);
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--color-text-secondary);
}
.nav-left {
  display: flex;
  align-items: center;
  gap: clamp(16px, 4vw, 32px);
  min-width: 0;
  flex: 1;
}
.nav-links {
  display: flex;
  gap: clamp(12px, 3vw, 24px);
  align-items: center;
  min-width: 0;
  overflow: hidden;
}
.nav-link {
  color: var(--color-primary);
  font-size: clamp(11px, 1.8vw, 14px);
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.nav-link:hover { opacity: 0.7; }
.nav-right {
  display: flex;
  gap: clamp(8px, 2vw, 12px);
  align-items: center;
  flex-shrink: 0;
}
.nav-logo {
  width: clamp(24px, 4vw, 28px);
  height: clamp(24px, 4vw, 28px);
  border-radius: 50%;
}
.nav-register-btn {
  background: var(--color-primary);
  color: #fff;
}
.nav-username {
  font-size: clamp(11px, 1.8vw, 14px);
  color: var(--color-text-secondary);
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius:8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-outline { background: #fff; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn-outline:hover { background: var(--color-primary-light); }
.btn-ghost { background: transparent; color: var(--color-text-secondary); }
.btn-ghost:hover { background: var(--color-bg-subtle); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; padding: 12px; font-size: 16px; }

/* Auth */
.auth-container {
  min-height: calc(100vh - var(--navbar-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius:16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  position: relative;
  z-index: 1;
}
.auth-card h1 {
  font-size: 28px;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 8px;
}
.auth-subtitle {
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 14px;
  margin-bottom: 32px;
}
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--color-bg-subtle);
  margin-bottom: 24px;
}
.tab {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--color-text-tertiary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}
.auth-form input, .auth-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius:8px;
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}
.auth-form input:focus, .auth-form select:focus {
  border-color: var(--color-primary);
}
.auth-error {
  color: var(--color-danger);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0 16px;
  color: var(--color-text-tertiary);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}
.auth-divider span {
  padding: 0 12px;
}

.btn-wechat {
  background: #07c160;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-wechat:hover { background: #06ad56; }
.wechat-icon { font-size: 18px; }

/* Dashboard */
.dashboard {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.dashboard-header h2 { font-size: 22px; }
.dashboard-actions { display: flex; gap: 10px; }
.dashboard-section { margin-top: 40px; }
.dashboard-section h3 { font-size: 18px; margin-bottom: 16px; }

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-content {
  background: #fff;
  border-radius:12px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
}
.modal-content h3 { margin-bottom: 16px; }
.modal-content input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius:8px;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ========== 创建咨询室弹窗扩展 ========== */
.create-modal-content {
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
}
.create-modal-content .form-group {
  margin-bottom: 14px;
}
.create-modal-content .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}
.create-modal-content .form-group input,
.create-modal-content .form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius:8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 0;
}
.create-modal-content .form-group input:focus,
.create-modal-content .form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}
.form-hint {
  font-weight: 400;
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-left: 4px;
}
.form-group-row {
  display: flex;
  gap: 12px;
}
.form-group-row .form-group {
  flex: 1;
}
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar-preview {
  width: 64px;
  height: 64px;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-preview-square { border-radius:8px; }
.avatar-preview-round { border-radius:50%; }
.upload-btn {
  padding: 8px 16px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius:8px;
  font-size: 13px;
  cursor: pointer;
  display: inline-block;
}
.upload-btn:hover { background: var(--color-primary-lighter); }

/* 品牌设置折叠区 */
.brand-section {
  border: 1px solid var(--color-border);
  border-radius:8px;
  margin-bottom: 14px;
  overflow: hidden;
}
.brand-section-header {
  padding: 12px 14px;
  background: var(--color-bg-subtle);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--color-text-secondary);
}
.brand-section-header:hover { background: var(--color-bg); }
.brand-arrow {
  font-size: 14px;
  color: var(--color-text-tertiary);
}
.brand-section-body {
  padding: 14px;
}

/* 标签输入 */
.tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  min-height: 38px;
  border: 1px solid var(--color-border);
  border-radius:8px;
  background: #fff;
}
.tags-input:focus-within { border-color: var(--color-primary); }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-primary-light);
  color: var(--color-primary-hover);
  font-size: 12px;
  padding: 2px 8px;
  border-radius:12px;
  height: 24px;
}
.tag-remove {
  background: none;
  border: none;
  color: var(--color-primary-hover);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.tag-remove:hover { color: var(--color-primary-hover); }

/* Room list */
.room-list {
  display: grid;
  gap: 12px;
}
.room-card {
  background: #fff;
  border-radius:8px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--color-border);
}
.room-info h4 { font-size: 16px; margin-bottom: 4px; }
.room-info .room-meta { font-size: 13px; color: var(--color-text-tertiary); }
.room-code {
  font-family: monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 2px;
}
.room-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius:4px;
  font-size: 12px;
  margin-left: 8px;
}
.status-waiting { background: var(--color-primary-light); color: var(--color-primary); }
.status-active { background: var(--color-success-light); color: var(--color-success); }
.status-ended { background: var(--color-bg); color: var(--color-text-tertiary); }

/* Recording list */
.recording-list {
  display: grid;
  gap: 10px;
}
.recording-item {
  background: #fff;
  border-radius:8px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--color-border);
}
.recording-info h4 { font-size: 14px; margin-bottom: 2px; }
.recording-info .recording-meta { font-size: 12px; color: var(--color-text-tertiary); }

.empty-state {
  text-align: center;
  color: var(--color-text-tertiary);
  padding: 40px;
  font-size: 14px;
}

/* Room page */
.room-container {
  display: flex;
  height: calc(100vh - var(--navbar-h));
  overflow: hidden;
}
.room-sidebar {
  width: clamp(180px, 18vw, 240px);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}
.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.sidebar-header h3 { font-size: 15px; margin-bottom: 4px; }
.sidebar-header .room-code-display {
  font-family: monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 2px;
}
.file-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.file-item {
  padding: 8px 10px;
  border-radius:4px;
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.file-item:hover { background: var(--color-primary-light); }
.file-item.active { background: var(--color-primary-lighter); color: var(--color-primary); font-weight: 500; }
.file-thumb {
  width: 32px;
  height: 32px;
  background: var(--color-bg-subtle);
  border-radius:4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--color-border);
}
.action-buttons {
  display: flex;
  gap: 8px;
}
.action-btn {
  flex: 1;
  height: 40px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius:8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-secondary);
  transition: all 0.2s;
  font-family: inherit;
}
.action-btn:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.action-btn .action-icon {
  font-size: 16px;
}
.action-btn .action-text {
  font-size: 13px;
}
.upload-btn {
  width: 100%;
  padding: 10px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px dashed var(--color-primary);
  border-radius:8px;
  cursor: pointer;
  font-size: 13px;
  text-align: center;
}
.upload-btn:hover { background: var(--color-primary-lighter); }

.room-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-subtle);
}
.canvas-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: auto;
  padding: 20px;
  position: relative;
}
/* 批注模式空状态：背景图填满+上传按钮 */
.annotate-empty-state {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg) url('/static/img/annotated-pdf-bg.png?v=20260821e') center/contain no-repeat;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 38%;
  z-index: 10;
  pointer-events: auto;
}
.annotate-upload-btn {
  background: rgba(255,255,255,0.95);
  border: 2px solid var(--color-primary);
  border-radius:12px;
  padding: 16px 40px;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  position: relative;
  z-index: 11;
}
.annotate-upload-btn:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(232,119,34,0.5);
}
.upload-btn-icon {
  font-size: 22px;
}
.upload-btn-text {
  letter-spacing: 2px;
}
#excalidrawContainer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  background: #fff;
}
#excalidrawContainer .excalidraw {
  height: 100% !important;
}
/* 确保Excalidraw菜单栏和下拉菜单不被遮挡 */
#excalidrawContainer .excalidraw .App-menu_top,
#excalidrawContainer .excalidraw .dropdown-menu,
#excalidrawContainer .excalidraw [role="menu"] {
  z-index: 100 !important;
}
.pdf-navbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  padding: 6px 12px;
  border-radius:8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
}
.canvas-container {
  position: relative;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  border-radius:4px;
  margin: 0 auto;
  display: inline-block;
}
.canvas-container canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}
.canvas-container #bgCanvas {
  position: relative;
  pointer-events: none;
  user-select: none;
}
.canvas-container #webIframeContainer {
  z-index: 1;
  background: var(--color-bg-subtle);
  border-radius:4px;
  overflow: hidden;
}
.canvas-container #drawCanvas {
  z-index: 2;
  cursor: crosshair;
  pointer-events: auto;
}
.text-input-box {
  position: absolute;
  z-index: 10;
  min-width: 80px;
  min-height: 28px;
  padding: 4px 8px;
  border: 2px dashed var(--color-border);
  background: rgba(255,255,255,0.95);
  outline: none;
  font-family: sans-serif;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.text-input-box:focus {
  border-style: solid;
  border-color: var(--color-text-muted);
}
.text-drag-handle {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 14px;
  height: 14px;
  background: var(--color-text-muted);
  border: 2px solid #fff;
  border-radius:50%;
  cursor: move;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  z-index: 11;
}
.text-drag-handle:hover {
  background: var(--color-text-secondary);
}

/* 统一右侧模式切换侧边栏（所有模式下都显示，磁吸在右手边） */
.mode-sidebar {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 10px 6px;
  border-radius:12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.mode-sidebar-btn {
  width: 56px;
  height: 56px;
  border: none;
  background: transparent;
  border-radius:8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.2s ease;
  color: var(--color-text-secondary);
}

.mode-sidebar-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.mode-sidebar-btn.active {
  background: var(--color-primary);
  color: #fff;
}

.mode-sidebar-icon {
  font-size: 20px;
  line-height: 1;
}

.mode-sidebar-label {
  font-size: 11px;
  line-height: 1;
  font-weight: 500;
}

/* 屏幕共享模式：左边摄像头，中间屏幕内容 */
.screen-share-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  background: #1a1a1a;
}

.screen-camera-panel {
  width: 200px;
  min-width: 200px;
  background: #000;
  position: relative;
  border-right: 2px solid var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-camera-panel video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screen-camera-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-bg-deep);
}

.screen-camera-placeholder .placeholder-avatar {
  width: 60px;
  height: 60px;
  border-radius:50%;
  object-fit: cover;
}

.screen-camera-placeholder .placeholder-name {
  color: var(--color-text-tertiary);
  font-size: 12px;
}

.screen-camera-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius:4px;
}

.screen-content-panel {
  flex: 1;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-content-panel video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.screen-content-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--color-text-secondary);
}

.screen-placeholder-icon {
  font-size: 64px;
}

.screen-placeholder-text {
  font-size: 14px;
  color: var(--color-text-tertiary);
}

.room-toolbar {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: none;
  border-radius:12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-width: 90vw;
  overflow-x: auto;
}
.tool-group {
  display: flex;
  gap: 4px;
  padding: 0 8px;
  border-right: 1px solid var(--color-border);
}
.tool-group:last-child { border-right: none; }
.tool-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius:8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--color-text-secondary);
}
.tool-btn:hover { background: var(--color-bg-subtle); }
.tool-btn.active { background: var(--color-primary); color: #fff; }
.color-btn {
  width: 24px;
  height: 24px;
  border-radius:50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.color-btn.active { border-color: var(--color-text); }
.tool-spacer { flex: 1; }

/* Video panel */
.video-panel {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  user-select: none;
  cursor: move;
}
.video-box {
  width: clamp(120px, 15vw, 200px);
  height: clamp(90px, 11vw, 150px);
  background: rgba(26, 26, 46, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius:8px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.1);
}
.video-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-label {
  position: absolute;
  bottom: 4px;
  left: 6px;
  color: #fff;
  font-size: 11px;
  background: rgba(0,0,0,0.5);
  padding: 2px 6px;
  border-radius:4px;
}
.video-placeholder {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-bg-subtle) 0%, var(--color-border) 100%);
  gap: 8px;
}
.placeholder-avatar {
  width: 60%;
  height: 60%;
  object-fit: cover;
  border-radius:50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.placeholder-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}
.video-controls {
  display: flex;
  gap: 6px;
  justify-content: center;
  cursor: default;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px;
  border-radius:8px;
  border: 1px solid rgba(255,255,255,0.8);
}
.video-controls .btn {
  padding: 6px 10px;
  font-size: 14px;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius:8px;
}
.video-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.3) 50%);
  border-bottom-right-radius: 8px;
  z-index: 2;
}

/* Recording indicator */
.recording-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-danger);
  font-size: 13px;
  font-weight: 500;
}
.rec-dot {
  width: 10px;
  height: 10px;
  background: var(--color-danger);
  border-radius:50%;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Mode switch */
.mode-switch {
  display: flex;
  background: var(--color-bg-subtle);
  border-radius:8px;
  padding: 2px;
}
.mode-btn {
  padding: 0 14px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius:8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.mode-btn:hover { background: var(--color-bg-subtle); }
.mode-btn.active {
  background: #fff;
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Toast */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: #fff;
  padding: 10px 20px;
  border-radius:8px;
  font-size: 14px;
  z-index: 1000;
  animation: fadeIn 0.3s;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 768px) {
  /* 手机模式：隐藏所有侧边栏和摄像头，navbar 用 Flex 自适应 */
  .room-sidebar { display: none; }
  .room-video-sidebar { display: none; }
  .video-panel, .video-box { display: none; }
  .talk-video-area, .talk-video { display: none; }
  .floating-camera-box, .pip-video-box { display: none !important; }
}
@media (max-width: 480px) {
  /* 超小屏：navbar 链接自动收缩，不隐藏 */
}

/* ========== 右侧视频栏 ========== */
.room-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.room-video-sidebar {
  width: clamp(160px, 18vw, 240px);
  flex-shrink: 0;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-left: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}
.video-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}
/* 视频面板在右侧栏内：去掉浮动定位 */
.room-video-sidebar .video-panel {
  position: static;
  padding: 12px;
  gap: 10px;
  cursor: default;
  flex-shrink: 0;
}
/* 右侧视频栏：复用对谈模式样式，整体缩小 */
.room-video-sidebar .video-panel {
  position: static;
  padding: 12px;
  gap: 10px;
  cursor: default;
  flex-shrink: 0;
}
.sidebar-video-box {
  width: 100%;
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
  border-radius:12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  background: #000;
}
.sidebar-video-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-video-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius:4px;
  z-index: 5;
}
.sidebar-video-controls {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 10;
}
.sidebar-control-with-volume {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-control-btn {
  width: 34px;
  height: 34px;
  border-radius:50%;
  border: 2px solid #fff;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #fff;
  line-height: 1;
}
.sidebar-control-btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.1);
}
.sidebar-control-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.sidebar-mic-volume-container {
  width: 4px;
  height: 24px;
  background: rgba(255,255,255,0.3);
  border-radius:4px;
  overflow: hidden;
  position: relative;
}
.sidebar-mic-volume-container .mic-volume-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--color-success);
  border-radius:4px;
  transition: height 0.1s;
}

/* 右侧文件面板（摄像头下方） */
.sidebar-file-panel {
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  max-height: 300px;
}
.sidebar-file-header {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.sidebar-file-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
}
.sidebar-file-list .file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius:8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--color-text);
  transition: background 0.15s;
  margin-bottom: 2px;
}
.sidebar-file-list .file-item:hover {
  background: rgba(232, 119, 34, 0.08);
}
.sidebar-file-list .file-item.active {
  background: rgba(232, 119, 34, 0.15);
  color: var(--color-primary);
  font-weight: 500;
}
.sidebar-file-list .file-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.sidebar-file-list .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-file-footer {
  padding: 8px 12px;
  border-top: 1px solid rgba(0,0,0,0.04);
}

/* ========== 对谈模式 ========== */
#talkModeContainer {
  display: flex;
}
#talkModeContainer video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#talkModePlaceholder {
  position: absolute;
  color: rgba(255,255,255,0.5);
  font-size: 18px;
}

/* ========== 对谈模式：咨询室场景 ========== */
.talk-mode-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: url('/static/img/talk-mode-bg.png?v=20260821c') center/cover no-repeat;
  z-index: 0;
}
.talk-brand-name {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 8px;
  z-index: 2;
  padding: 30px 80px;
  white-space: nowrap;
  /* 墙上射灯光斑：三盏灯的叠加效果 */
  background: 
    radial-gradient(ellipse 40% 70% at 25% 50%, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%),
    radial-gradient(ellipse 40% 70% at 50% 50%, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 70%),
    radial-gradient(ellipse 40% 70% at 75% 50%, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
}
/* 橙色烫金文字 */
.talk-brand-name span {
  background: linear-gradient(135deg, 
    #ffb347 0%, 
    var(--color-primary) 25%, 
    #ff8c00 50%, 
    var(--color-primary) 75%, 
    #cc6600 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 2px 4px rgba(232,119,34,0.4)) 
          drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}
/* 三盏轨道射灯容器 */
.talk-spotlights {
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 420px;
  z-index: 1;
  pointer-events: none;
}
/* 吊杆 */
.talk-spotlights::before,
.talk-spotlights::after {
  content: '';
  position: absolute;
  top: -40px;
  width: 2px;
  height: 40px;
  background: linear-gradient(180deg, var(--color-text) 0%, #1a1a1a 100%);
}
.talk-spotlights::before { right: 20px; }
.talk-spotlights::after { right: 20px; }
/* 轨道 */
.spotlight-track {
  width: 100%;
  height: 8px;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 50%, #0d0d0d 100%);
  border-radius:4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  position: relative;
}
/* 射灯安装座 */
.spotlight {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}
.spotlight-mount {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 36px;
  height: 16px;
  background: linear-gradient(180deg, #222 0%, #111 100%);
  border-radius:4px;
  transform: translateX(-50%);
}
/* 射灯连接颈 */
.spotlight-neck {
  position: absolute;
  top: 22px;
  left: 50%;
  width: 10px;
  height: 14px;
  background: #1a1a1a;
  transform: translateX(-50%);
}
/* 射灯灯体（圆柱形，倾斜角度） */
.spotlight-body {
  position: absolute;
  top: 34px;
  left: 50%;
  width: 32px;
  height: 56px;
  background: linear-gradient(90deg, #3a3a3a 0%, #1a1a1a 30%, #0d0d0d 70%, #2a2a2a 100%);
  border-radius:4px 4px 16px 16px;
  transform: translateX(-50%) rotate(-15deg);
  transform-origin: top center;
  box-shadow: 2px 4px 8px rgba(0,0,0,0.4);
}
/* 射灯尾部散热纹 */
.spotlight-body::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  height: 12px;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.3) 2px,
    rgba(0,0,0,0.3) 3px
  );
  border-radius:4px;
}
/* 射灯口亮光 */
.spotlight-body::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 8px;
  background: radial-gradient(ellipse at center, 
    #fff 0%, 
    #fff8e7 30%, 
    rgba(255,248,231,0) 100%);
  border-radius:50%;
  box-shadow: 0 0 12px rgba(255,248,231,0.8);
}
/* 光束效果 */
.spotlight-beam {
  position: absolute;
  top: 88px;
  left: 50%;
  width: 140px;
  height: 180px;
  background: linear-gradient(180deg, 
    rgba(255,255,255,0.18) 0%, 
    rgba(255,255,255,0.08) 40%, 
    rgba(255,255,255,0) 100%);
  clip-path: polygon(42% 0%, 58% 0%, 100% 100%, 0% 100%);
  transform: translateX(-50%);
  pointer-events: none;
}
.talk-video {
  position: absolute;
  width: 28%;
  aspect-ratio: 4/3;
  border-radius:16px;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  border: 3px solid rgba(255,255,255,0.9);
  background: linear-gradient(135deg, var(--color-bg-deep) 0%, var(--color-text) 100%);
}
.talk-video-left {
  left: 10%;
  top: 58%;
  transform: translateY(-50%);
}
.talk-video-right {
  right: 10%;
  top: 58%;
  transform: translateY(-50%);
}
.talk-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.talk-video-label {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  background: rgba(0,0,0,0.6);
  padding: 3px 12px;
  border-radius:8px;
  white-space: nowrap;
}
/* 对谈模式控制栏：放在左侧视频窗口下方 */
.talk-controls {
  position: absolute;
  top: calc(58% + 14% + 12px);
  left: calc(10% + 14%);
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 20;
}
.talk-control-btn {
  width: 44px;
  height: 44px;
  border-radius:50%;
  border: 2px solid #fff;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.talk-control-btn:hover {
  background: var(--color-primary);
  transform: scale(1.1);
  border-color: var(--color-primary);
}
.talk-control-btn:active {
  transform: scale(0.95);
}
.talk-video-placeholder {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-bg-subtle) 0%, var(--color-border) 100%);
}
.talk-placeholder-avatar {
  width: 70%;
  height: 70%;
  object-fit: cover;
  border-radius:50%;
}
.talk-placeholder-name {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* ========== 录屏框线 ========== */
.record-border {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 3px solid var(--color-danger);
  pointer-events: none;
  z-index: 100;
  display: none;
  animation: recordBorderPulse 1.5s infinite;
}
@keyframes recordBorderPulse {
  0%, 100% { border-color: var(--color-danger); opacity: 1; }
  50% { border-color: rgba(229, 72, 77, 0.5); opacity: 0.7; }
}
@keyframes recordPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.record-border-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid var(--color-danger);
}
.record-border-corner.tl { top: -3px; left: -3px; border-right: none; border-bottom: none; }
.record-border-corner.tr { top: -3px; right: -3px; border-left: none; border-bottom: none; }
.record-border-corner.bl { bottom: -3px; left: -3px; border-right: none; border-top: none; }
.record-border-corner.br { bottom: -3px; right: -3px; border-left: none; border-top: none; }
.record-border-label {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(229, 72, 77, 0.9);
  color: #fff;
  padding: 4px 12px;
  border-radius:12px;
  font-size: 13px;
  font-weight: 600;
}

/* ========== 浮动摄像头（单人录屏模式） ========== */
.floating-camera {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 240px;
  background: #000;
  border-radius:8px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 50;
  border: 2px solid rgba(255,255,255,0.2);
}
.floating-camera-header {
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  user-select: none;
}
.floating-camera-close {
  cursor: pointer;
  opacity: 0.7;
  font-size: 14px;
}
.floating-camera-close:hover {
  opacity: 1;
}
.floating-camera video {
  width: 100%;
  display: block;
  background: #000;
}
.floating-camera-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 6px;
  background: rgba(0,0,0,0.8);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.floating-control-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.15);
  border-radius:8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.floating-control-btn:hover {
  background: rgba(255,255,255,0.25);
}
.floating-control-btn.active {
  background: var(--color-primary);
}
.floating-camera-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.5) 50%);
  border-radius:0 0 8px 0;
}

/* ========== 单人录屏模式按钮 ========== */
.mode-btn.mode-record {
  background: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}
.mode-btn.mode-record:hover {
  background: var(--color-primary-light);
}
.mode-btn.mode-record.active {
  background: var(--color-primary) !important;
  color: #fff !important;
}

/* ========== 麦克风音量动态条 ========== */
.talk-control-with-volume {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mic-volume-container {
  width: 6px;
  height: 32px;
  background: rgba(255,255,255,0.2);
  border-radius:4px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.mic-volume-bar {
  width: 100%;
  height: 0%;
  background: var(--color-info);
  border-radius:4px;
  transition: height 0.05s ease, background 0.2s ease;
  min-height: 2px;
}

/* 对谈模式左侧模式选择按钮组 */
.talk-mode-sidebar {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
}
.talk-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid transparent;
  border-radius:12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 0;
}
.talk-mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  border-color: var(--color-primary);
}
.talk-mode-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 4px 16px rgba(232, 119, 34, 0.4);
}
.talk-mode-btn.active .talk-mode-icon,
.talk-mode-btn.active .talk-mode-label {
  color: #fff;
}
.talk-mode-icon {
  font-size: 24px;
  line-height: 1;
  margin-bottom: 4px;
}
.talk-mode-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1;
}
