.login-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.login-overlay.hidden {
  display: none;
}
.login-box {
  background: #1a1a1a;
  padding: 40px;
  border-radius: 12px;
  border: 1px solid #333;
  text-align: center;
  max-width: 360px;
  width: 90%;
}
.login-box h1 {
  color: #d4a574;
  font-size: 24px;
  margin-bottom: 8px;
}
.login-box p {
  color: #666;
  font-size: 14px;
  margin-bottom: 24px;
}
.login-box input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #0a0a0a;
  color: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}
.login-box input:focus {
  border-color: #d4a574;
}
.login-box input::placeholder {
  color: #555;
}
.login-box button {
  width: 100%;
  padding: 12px;
  margin-top: 16px;
  border: none;
  border-radius: 8px;
  background: #d4a574;
  color: #000;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.login-box button:hover {
  background: #e0b68a;
}
.login-box button:disabled {
  background: #555;
  cursor: not-allowed;
}
.login-error {
  color: #ef4444;
  font-size: 14px;
  margin-top: 12px;
  display: none;
}
.login-error.show {
  display: block;
}
.login-version {
  color: #444;
  font-size: 12px;
  margin-top: 20px;
}

.header {
  background: #1a1a1a;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-left .logo {
  color: #d4a574;
  font-size: 16px;
  font-weight: 700;
}
.header-left .model-badge {
  background: #2a2a2a;
  color: #aaa;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  border: 1px solid #333;
}
.header-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
}
.header-nav::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
.nav-btn {
  background: transparent;
  color: #888;
  border: 1px solid transparent;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-btn:hover {
  color: #fff;
  background: #2a2a2a;
}
.nav-btn.active {
  color: #d4a574;
  background: #2a2a2a;
  border-color: #d4a574;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.code-btn {
  background: #2a2a2a;
  color: #aaa;
  border: 1px solid #444;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.code-btn:hover {
  background: #3a3a3a;
  color: #fff;
  border-color: #555;
}
.status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #888;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #555;
}
.status-dot.connected {
  background: #22c55e;
}
.status-dot.disconnected {
  background: #ef4444;
}

@media (max-width: 768px) {
  .header {
    padding: 8px 12px;
    flex-wrap: nowrap;
  }
  .header-left .logo {
    font-size: 14px;
  }
  .header-left .model-badge {
    display: none;
  }
  .header-nav {
    flex: 1;
    gap: 6px;
    padding: 0 4px;
    min-width: 0; /* 允许收缩 */
    order: 2; /* 移动端导航放中间 */
  }
  .nav-btn {
    font-size: 13px;
    padding: 6px 12px;
    white-space: nowrap; /* 防止文字换行 */
    flex-shrink: 0; /* 防止按钮被压缩 */
  }
  .header-right {
    gap: 10px;
    flex-shrink: 0;
    order: 3;
  }
  .header-left {
    flex-shrink: 0;
    order: 1;
  }
  .code-btn {
    font-size: 12px;
    padding: 4px 10px;
  }
  .status span {
    display: none;
  }
}

.terminal-container {
  flex: 1;
  padding: 8px;
  overflow: hidden;
  min-height: 0;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.terminal-wrap {
  height: 100%;
  width: 100%;
}

/* xterm overrides */
.xterm {
  height: 100%;
  width: 100%;
}
.xterm-screen {
  width: 100% !important;
}
.xterm-viewport::-webkit-scrollbar {
  width: 8px;
}
.xterm-viewport::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .terminal-container {
    padding: 4px;
  }
  .xterm {
    padding: 4px;
  }
}

.mobile-bottom-area {
  display: none;
  flex-direction: column;
  background: #1a1a1a;
  border-top: 1px solid #333;
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mobile-bottom-area.show {
  display: flex;
}

/* Control key toolbar */
.mobile-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
}
.mobile-toolbar button {
  min-width: 40px;
  height: 44px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #2a2a2a;
  color: #ccc;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
  touch-action: manipulation;
}
.mobile-toolbar button:active {
  background: #d4a574;
  color: #000;
  border-color: #d4a574;
}
.mobile-toolbar button.active {
  background: #d4a574;
  color: #000;
  border-color: #d4a574;
}

/* Scroll control buttons (fixed right side) */
.mobile-scroll-btns {
  display: none;
  position: fixed;
  right: 8px;
  bottom: 140px;
  flex-direction: column;
  gap: 4px;
  z-index: 50;
}
.mobile-scroll-btns.show {
  display: flex;
}
.mobile-scroll-btns button {
  width: 44px;
  height: 36px;
  border: 1px solid #2a5a2a;
  border-radius: 6px;
  background: rgba(26, 58, 26, 0.9);
  color: #8f8;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.1s;
  /* 禁止 iOS 长按选中和弹出菜单 */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.mobile-scroll-btns button:active {
  background: #2a6a2a;
  border-color: #3a8a3a;
  color: #fff;
  transform: scale(0.95);
}
.mobile-scroll-btns button.scrolling {
  background: #3a8a3a;
  border-color: #4aa84a;
  color: #fff;
  box-shadow: 0 0 8px rgba(58, 138, 58, 0.6);
}

/* PC端：滚动按钮内联显示 */
.mobile-scroll-btns.inline {
  position: static;
  display: flex;
  flex-direction: row;
  padding: 6px 8px;
  gap: 4px;
  background: transparent;
}
.mobile-scroll-btns.inline button {
  flex: 1;
  height: 32px;
}

/* 移动端：滚动按钮固定在右侧 */
.mobile-scroll-btns.fixed-right {
  position: fixed;
  right: 8px;
  bottom: 140px;
}

/* Hidden mobile input for keyboard triggering */
.mobile-input-hidden {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  font-size: 16px;
}

/* Custom mobile input area */
.mobile-input-area {
  display: flex;
  padding: 6px 8px;
  gap: 6px;
  align-items: flex-end;
}
.mobile-input-area textarea {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 12px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  height: 44px;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  line-height: 1.3;
  font-family: inherit;
  overflow: hidden;
}
.mobile-input-area textarea:focus {
  border-color: #d4a574;
}
.mobile-input-area .send-btn {
  background: #d4a574;
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  height: 44px;
}
.mobile-input-area .send-btn:hover {
  background: #e0b68a;
}
.mobile-input-area .extra-btns {
  display: flex;
  gap: 4px;
}
.mobile-input-area .extra-btn {
  background: #2a2a2a;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  cursor: pointer;
  min-width: 44px;
  height: 44px;
  text-align: center;
}
.mobile-input-area .extra-btn:active {
  background: #d4a574;
  color: #000;
  border-color: #d4a574;
}

.code-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.code-viewer {
  width: 95%;
  height: 90%;
  background: #1e1e1e;
  border-radius: 12px;
  border: 1px solid #333;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.code-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #252526;
  border-bottom: 1px solid #333;
}

.code-viewer-header .header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-tree-btn {
  background: transparent;
  border: 1px solid #444;
  color: #888;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  line-height: 1;
}

.toggle-tree-btn:hover {
  background: #444;
  color: #fff;
  border-color: #555;
}

.code-viewer-header .title {
  color: #d4a574;
  font-weight: 600;
  font-size: 15px;
}

.close-btn {
  background: transparent;
  border: none;
  color: #888;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.close-btn:hover {
  background: #444;
  color: #fff;
}

.code-viewer-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.file-tree {
  width: 240px;
  background: #252526;
  border-right: 1px solid #333;
  overflow-y: auto;
  flex-shrink: 0;
  transition: width 0.2s ease, opacity 0.2s ease;
}

.file-tree.hidden {
  width: 0;
  border-right: none;
  opacity: 0;
  overflow: hidden;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  cursor: pointer;
  color: #ccc;
  font-size: 13px;
  transition: background 0.15s;
  white-space: nowrap;
}

.tree-item:hover {
  background: #2a2d2e;
}

.tree-item.selected {
  background: #094771;
}

.tree-item .icon {
  font-size: 14px;
  flex-shrink: 0;
}

.tree-item .name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-item.directory .name {
  font-weight: 500;
}

.file-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.file-path {
  padding: 8px 16px;
  background: #2d2d2d;
  color: #888;
  font-size: 12px;
  font-family: monospace;
  border-bottom: 1px solid #333;
}

.editor-container {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

/* 加宽 minimap */
.editor-container .minimap {
  width: 120px !important;
}

.editor-container .minimap .minimap-slider {
  width: 120px !important;
}

.placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 14px;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 14px;
  padding: 20px;
}

.error-msg {
  color: #f44336;
  padding: 12px;
  font-size: 13px;
}

/* 滚动条样式 */
.file-tree::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.file-tree::-webkit-scrollbar-track {
  background: #1e1e1e;
}

.file-tree::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

.file-tree::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .code-viewer {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .code-viewer-header {
    padding: 8px 12px;
  }

  .code-viewer-header .header-left {
    gap: 8px;
  }

  .toggle-tree-btn {
    font-size: 11px;
    padding: 3px 6px;
  }

  .code-viewer-header .title {
    font-size: 13px;
  }

  .close-btn {
    font-size: 14px;
    padding: 2px 6px;
  }

  .file-tree {
    width: 140px;
    min-width: 100px;
  }

  .tree-item {
    padding: 5px 6px;
    font-size: 11px;
    gap: 4px;
  }

  .tree-item .icon {
    font-size: 12px;
  }

  .file-path {
    padding: 6px 10px;
    font-size: 10px;
  }

  .placeholder,
  .loading {
    font-size: 12px;
    padding: 12px;
  }

  .error-msg {
    font-size: 11px;
    padding: 8px;
  }

  .file-tree::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
}

.vision-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: #0a0a0a;
}

.vision-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  width: 100%;
}

.vision-container h1 {
  color: #d4a574;
  font-size: 28px;
  margin-bottom: 8px;
}

.vision-desc {
  color: #666;
  font-size: 14px;
  margin-bottom: 32px;
}

/* 上传区域 */
.upload-zone {
  border: 2px dashed #333;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #111;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: #d4a574;
  background: #1a1a1a;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.upload-text {
  color: #aaa;
  font-size: 16px;
  margin-bottom: 8px;
}

.upload-hint {
  color: #555;
  font-size: 12px;
}

/* 预览区域 */
.preview-section {
  margin-top: 24px;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: #888;
  font-size: 14px;
}

.clear-btn {
  background: none;
  border: 1px solid #444;
  color: #888;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.clear-btn:hover {
  border-color: #d4a574;
  color: #d4a574;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a1a;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.remove-btn:hover {
  background: #ef4444;
}

/* 提示词区域 */
.prompt-section {
  margin-top: 24px;
}

.prompt-section label {
  display: block;
  color: #888;
  font-size: 14px;
  margin-bottom: 8px;
}

.prompt-section textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 14px;
  resize: none;
  outline: none;
  font-family: inherit;
  min-height: 44px;
  max-height: 300px;
  overflow-y: auto;
  line-height: 1.5;
}

/* 自定义滚动条样式 */
.prompt-section textarea::-webkit-scrollbar {
  width: 6px;
}

.prompt-section textarea::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.prompt-section textarea::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
  transition: background 0.2s;
}

.prompt-section textarea::-webkit-scrollbar-thumb:hover {
  background: #666;
}

.prompt-section textarea.auto-expand {
  overflow-y: auto;
}

.prompt-section textarea:focus {
  border-color: #d4a574;
}

.prompt-section textarea::placeholder {
  color: #555;
}

/* 分析按钮 */
.analyze-btn {
  width: 100%;
  padding: 14px;
  margin-top: 24px;
  border: none;
  border-radius: 8px;
  background: #d4a574;
  color: #000;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.analyze-btn:hover:not(:disabled) {
  background: #e0b68a;
}

.analyze-btn:disabled {
  background: #444;
  color: #888;
  cursor: not-allowed;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 结果区域 */
.result-section {
  margin-top: 24px;
  padding: 20px;
  border-radius: 12px;
  background: #1a1a1a;
  border: 1px solid #333;
}

.result-section.success {
  border-color: #22c55e33;
}

.result-section.error {
  border-color: #ef444433;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-weight: 600;
  color: #fff;
}

.result-timing {
  font-weight: normal;
  font-size: 12px;
  color: #666;
}

.result-content {
  color: #ccc;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.result-model {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #333;
  font-size: 12px;
  color: #555;
}

/* 移动端适配 */
@media (max-width: 600px) {
  .vision-container {
    padding: 20px 16px;
  }

  .vision-container h1 {
    font-size: 22px;
  }

  .upload-zone {
    padding: 32px 16px;
  }

  .upload-icon {
    font-size: 36px;
  }

  .preview-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}


.upload-page {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
  color: #e0e0e0;
}

.upload-title {
  font-size: 20px;
  font-weight: 600;
  color: #d4a574;
  margin-bottom: 20px;
}

/* ========== Drop Zone ========== */
.drop-zone {
  border: 2px dashed #444;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #111;
  margin-bottom: 24px;
}

.drop-zone:hover {
  border-color: #d4a574;
  background: #1a1a1a;
}

.drop-zone.drag-over {
  border-color: #d4a574;
  background: rgba(212, 165, 116, 0.08);
}

.drop-zone-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.7;
}

.drop-zone-text {
  font-size: 16px;
  color: #999;
  margin-bottom: 8px;
}

.drop-zone-hint {
  font-size: 13px;
  color: #666;
}

.drop-zone input[type="file"] {
  display: none;
}

.upload-btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: #d4a574;
  color: #000;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 16px;
}

.upload-btn:hover {
  background: #e0b68a;
}

.upload-btn:disabled {
  background: #555;
  cursor: not-allowed;
}

/* ========== Upload Progress ========== */
.upload-progress-list {
  margin-bottom: 24px;
}

.upload-progress-item {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
}

.upload-progress-name {
  font-size: 13px;
  color: #ccc;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upload-progress-name .status {
  font-size: 12px;
}

.upload-progress-name .status.uploading {
  color: #d4a574;
}

.upload-progress-name .status.done {
  color: #4ade80;
}

.upload-progress-name .status.error {
  color: #ef4444;
}

.progress-bar-bg {
  width: 100%;
  height: 4px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #d4a574;
  border-radius: 2px;
  transition: width 0.2s ease;
}

/* ========== File List ========== */
.file-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.file-list-title {
  font-size: 16px;
  font-weight: 600;
  color: #e0e0e0;
}

.file-list-count {
  font-size: 13px;
  color: #666;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  margin-bottom: 6px;
  transition: background 0.2s;
}

.file-item:hover {
  background: #222;
}

.file-item-icon {
  font-size: 20px;
  margin-right: 12px;
  flex-shrink: 0;
}

.file-item-info {
  flex: 1;
  min-width: 0;
}

.file-item-name {
  font-size: 14px;
  color: #e0e0e0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-name a {
  color: #d4a574;
  text-decoration: none;
}

.file-item-name a:hover {
  text-decoration: underline;
}

.file-item-meta {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.file-item-delete {
  background: none;
  border: 1px solid #444;
  border-radius: 6px;
  color: #888;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: 12px;
}

.file-item-delete:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ========== Empty State ========== */
.file-empty {
  text-align: center;
  padding: 32px;
  color: #555;
  font-size: 14px;
}

/* ========== Loading ========== */
.upload-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #666;
}

.word-paste-converter {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px;
  color: #e0e0e0;
  box-sizing: border-box;
  background: #0a0a0a;
}

.converter-title {
  font-size: 18px;
  font-weight: 600;
  color: #d4a574;
  margin-bottom: 12px;
  flex-shrink: 0;
}

/* ========== Main Layout ========== */
.converter-main {
  display: flex;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ========== Panel Header ========== */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  font-size: 12px;
  color: #888;
  font-weight: 500;
  flex-shrink: 0;
}

.panel-hint {
  font-size: 11px;
  color: #666;
}

/* ========== Left Panel (Paste Area) ========== */
.converter-left {
  width: 280px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  border: 1px solid #333;
  border-radius: 8px;
  background: #111;
  overflow: hidden;
  flex-shrink: 0;
}

.paste-area {
  flex: 1;
  padding: 12px;
  border: none;
  background: #0a0a0a;
  color: #e0e0e0;
  font-size: 14px;
  line-height: 1.5;
  cursor: text;
  outline: none;
  overflow: auto;
  resize: none;
}

.paste-area:focus {
  background: #0f0f0f;
  box-shadow: inset 0 0 0 1px #d4a57433;
}

.paste-area.has-content {
  background: #0a1a0a;
}

.paste-area:empty:before {
  content: attr(data-placeholder);
  color: #555;
  pointer-events: none;
}

/* ========== Action Buttons ========== */
.action-buttons {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: #111;
  border-top: 1px solid #333;
  flex-shrink: 0;
}

.action-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.copy-btn {
  background: #d4a574;
  color: #000;
}

.copy-btn:hover:not(:disabled) {
  background: #e0b68a;
}

.clear-btn {
  background: #1a1a1a;
  color: #aaa;
  border: 1px solid #333;
}

.clear-btn:hover:not(:disabled) {
  background: #252525;
  border-color: #ef4444;
  color: #ef4444;
}

/* ========== Right Panel (Code Editor) ========== */
.converter-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid #333;
  border-radius: 8px;
  background: #111;
  overflow: hidden;
  min-width: 0;
}

.code-editor-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Monaco 编辑器自己处理滚动，容器只需给定大小 */

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .converter-main {
    flex-direction: column;
  }

  .converter-left {
    width: 100%;
    min-width: unset;
    height: 200px;
    flex-shrink: 0;
  }

  .converter-right {
    flex: 1;
    min-height: 300px;
  }
}

.webrtc-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
  gap: 16px;
  box-sizing: border-box;
}

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

.webrtc-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.state-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background: #e0e0e0;
  color: #666;
}

.state-badge.state-active {
  background: #e8f5e9;
  color: #2e7d32;
}

.state-badge.state-error {
  background: #ffebee;
  color: #c62828;
}

.state-badge.state-loading {
  background: #fff3e0;
  color: #ef6c00;
}

/* 视频预览区 */
.video-wrapper {
  position: relative;
  flex: 1;
  min-height: 300px;
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.video-placeholder,
.video-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #888;
  font-size: 14px;
}

.placeholder-icon {
  font-size: 48px;
  opacity: 0.5;
}

.video-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #333;
  border-top-color: #4caf50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 错误提示 */
.error-message {
  padding: 12px 16px;
  background: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 6px;
  color: #c62828;
  font-size: 14px;
}

/* 设备选择 */
.device-selector {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.selector-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.selector-group label {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
}

.selector-group select {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  background: white;
  min-width: 180px;
  max-width: 250px;
}

.selector-group select:focus {
  outline: none;
  border-color: #4caf50;
}

/* 控制按钮 */
.control-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.btn-primary {
  background: #4caf50;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #43a047;
}

.btn-secondary {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.btn-secondary:hover:not(:disabled) {
  background: #eee;
}

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

.btn-danger:hover:not(:disabled) {
  background: #e53935;
}

.btn-muted {
  background: #bdbdbd;
  color: #666;
}

/* 轨道信息 */
.track-info {
  display: flex;
  gap: 20px;
  padding: 10px 14px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 13px;
}

.track-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.track-on {
  color: #2e7d32;
  font-weight: 500;
}

.track-off {
  color: #9e9e9e;
}

/* 录制指示器 */
.recording-indicator {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  color: white;
  font-size: 13px;
}

.rec-dot {
  width: 8px;
  height: 8px;
  background: #f44336;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 录制按钮 */
.btn-record {
  background: #f44336;
  color: white;
}

.btn-record:hover:not(:disabled) {
  background: #d32f2f;
}

.btn-stop-record {
  background: #f44336;
  color: white;
  animation: pulse-bg 1s infinite;
}

@keyframes pulse-bg {
  0%, 100% { background: #f44336; }
  50% { background: #d32f2f; }
}

/* 录制状态 */
.state-recording {
  background: #ffebee;
  color: #c62828;
  animation: pulse 1s infinite;
}

/* 录制列表面板 */
.recordings-panel {
  margin-top: 16px;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
}

.recordings-panel h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

.no-recordings {
  text-align: center;
  color: #999;
  padding: 20px;
}

.recordings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.recording-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}

.rec-info {
  display: flex;
  gap: 16px;
  font-size: 13px;
}

.rec-time {
  color: #333;
}

.rec-duration {
  color: #666;
}

.rec-size {
  color: #999;
}

.rec-actions {
  display: flex;
  gap: 8px;
}

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}

/* 直播按钮 */
.btn-live {
  background: #2196f3;
  color: white;
}

.btn-live:hover {
  background: #1976d2;
}

.btn-stop-live {
  background: #f44336;
  color: white;
  animation: pulse-bg 1s infinite;
}

/* 直播指示器 */
.live-indicator {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(33, 150, 243, 0.9);
  border-radius: 4px;
  color: white;
  font-size: 13px;
  font-weight: 500;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

/* 响应式 */
@media (max-width: 600px) {
  .webrtc-container {
    padding: 12px;
  }

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

  .selector-group select {
    flex: 1;
    min-width: 0;
  }

  .control-buttons {
    justify-content: center;
  }

  .btn {
    padding: 12px 16px;
  }
}

.ssl-manager {
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.ssl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.ssl-header h2 {
  margin: 0;
  font-size: 20px;
}

/* 状态显示 */
.ssl-status {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.ssl-status.has-cert {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
}

.ssl-status.no-cert {
  background: #fff3e0;
  border: 1px solid #ffcc80;
}

.status-icon {
  font-size: 36px;
}

.status-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
}

.status-details {
  font-size: 13px;
  color: #666;
}

/* 上传区域 */
.upload-section {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.upload-section h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

.upload-info {
  margin-bottom: 16px;
}

.upload-info p {
  margin: 0 0 4px 0;
  font-size: 13px;
  color: #666;
}

.upload-info .hint {
  font-size: 12px;
  color: #999;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
}

.form-group input[type="file"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  background: white;
}

.upload-actions {
  display: flex;
  gap: 10px;
}

/* 按钮 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary {
  background: #4caf50;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #43a047;
}

.btn-secondary {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.btn-secondary:hover:not(:disabled) {
  background: #eee;
}

.btn-warning {
  background: #ff9800;
  color: white;
}

.btn-warning:hover:not(:disabled) {
  background: #f57c00;
}

/* 消息 */
.message {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

.message-success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.message-error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

/* 帮助信息 */
.help-section {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
}

.help-section h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

.help-content {
  font-size: 13px;
  color: #666;
}

.help-content p {
  margin: 0 0 8px 0;
}

.help-content a {
  color: #1976d2;
}

.help-content code {
  display: block;
  background: #e0e0e0;
  padding: 8px 12px;
  border-radius: 4px;
  margin: 8px 0;
  font-family: monospace;
}

.help-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.help-content li {
  margin: 4px 0;
}

/* 响应式 */
@media (max-width: 600px) {
  .ssl-manager {
    padding: 12px;
  }

  .ssl-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .upload-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

.live-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
  gap: 16px;
  box-sizing: border-box;
}

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

.live-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.live-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.live-status.live {
  background: #ffebee;
  color: #c62828;
}

.live-status.offline {
  background: #f5f5f5;
  color: #999;
}

/* 视频区域 */
.video-wrapper {
  position: relative;
  flex: 1;
  min-height: 300px;
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #888;
  font-size: 14px;
}

.placeholder-icon {
  font-size: 48px;
  opacity: 0.5;
}

/* 直播指示器 */
.live-indicator {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  color: white;
  font-size: 13px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #f44336;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 错误提示 */
.error-message {
  padding: 12px 16px;
  background: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 6px;
  color: #c62828;
  font-size: 14px;
}

/* 控制按钮 */
.control-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: #4caf50;
  color: white;
}

.btn-primary:hover {
  background: #43a047;
}

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

.btn-danger:hover {
  background: #e53935;
}

/* 信息面板 */
.info-panel {
  padding: 12px 16px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 13px;
  color: #666;
}

.info-panel p {
  margin: 0;
}

/* 响应式 */
@media (max-width: 600px) {
  .live-viewer {
    padding: 12px;
  }

  .control-buttons {
    justify-content: center;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  background: #0a0a0a;
}
#root {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
}
.app-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* 初始化loading */
.init-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.init-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #333;
  border-top-color: #d4a574;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


/*# sourceMappingURL=main.bab12441.css.map*/