/* ==========================================================================
   DLSS Studio - 专业 GPU 工具台设计系统
   规范：
   - 浅灰背景 (#f4f5f7 / #e9ebf0)
   - 白色工作区 (#ffffff)
   - 深石墨文字 (#1e2329 / #4b5563)
   - 单一青绿色强调色 (#0d9488 / #14b8a6)
   - 无紫蓝渐变、无卡片套卡片、无 emoji
   - 圆角 <= 8px
   - 响应式适配桌面与移动端
   ========================================================================== */

:root {
  /* 颜色调色板 */
  --bg-app: #f2f4f8;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-hover: #edf0f5;
  --bg-active: #e2e7ef;

  --border-color: #dbe0ea;
  --border-light: #eceff5;
  --border-focus: #0d9488;

  /* 文字 */
  --text-primary: #191f28;
  --text-secondary: #4e5968;
  --text-muted: #8b95a1;
  --text-inverse: #ffffff;

  /* 强调色：单一精密青绿色 (Teal) */
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-light: #ccfbf1;
  --accent-subtle: #f0fdfa;
  --accent-ring: rgba(13, 148, 136, 0.25);

  /* 语义色 */
  --status-success: #10b981;
  --status-warning: #f59e0b;
  --status-error: #ef4444;
  --status-error-bg: #fef2f2;
  --status-error-border: #fecaca;
  --status-offline: #9ca3af;

  /* 几何与阴影 */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);

  /* 字体与间距 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --header-height: 52px;
  --status-height: 28px;
  --sidebar-width: 360px;
}

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

body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-app);
  min-height: 100dvh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* 图标基础样式 */
.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-sm {
  width: 14px;
  height: 14px;
}

/* 按钮通用 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  white-space: nowrap;
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-hover);
  border-color: #cbd5e1;
}

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

.btn-lg {
  font-size: 14px;
  padding: 10px 16px;
  font-weight: 600;
}

.btn-icon {
  padding: 6px;
  background-color: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-icon:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.btn-block {
  width: 100%;
}

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

/* ==========================================================================
   Header 顶栏
   ========================================================================== */
.app-header {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 20;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.logo-mark svg {
  color: var(--accent);
}

.gpu-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status-offline);
  flex-shrink: 0;
}

.status-dot.online {
  background-color: var(--status-success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-dot.busy {
  background-color: var(--status-warning);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   主工作区双栏布局
   ========================================================================== */
.workbench {
  flex: 1;
  display: flex;
  height: calc(100vh - var(--header-height) - var(--status-height));
  position: relative;
  overflow: hidden;
}

/* 左侧主视口 */
.viewport-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
  overflow: hidden;
  position: relative;
}

.viewport-toolbar {
  height: 44px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tab-group {
  display: inline-flex;
  background-color: var(--bg-app);
  padding: 2px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background-color: var(--bg-surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.file-name-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 2px 8px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.tag-label {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-meta {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* 画布容器 */
.canvas-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px;
}

/* 拖拽空状态 / 提示 */
.drop-zone {
  position: absolute;
  inset: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-surface);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  z-index: 5;
}

.drop-zone.dragover {
  border-color: var(--accent);
  background-color: var(--accent-subtle);
}

.drop-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 360px;
  padding: 24px;
}

.drop-icon {
  width: 48px;
  height: 48px;
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
  margin-bottom: 12px;
}

.drop-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.drop-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.drop-actions {
  margin-bottom: 12px;
}

.drop-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* 图像舞台 */
.image-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.single-preview-wrap {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-conic-gradient(#f0f0f0 0% 25%, transparent 0% 50%) 50% / 16px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.single-preview-wrap img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  display: block;
}

.stage-watermark {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: rgba(25, 31, 40, 0.7);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

/* 分割对比视图 */
.compare-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.compare-wrapper {
  position: relative;
  max-width: 100%;
  max-height: calc(100vh - 170px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  user-select: none;
  background: repeating-conic-gradient(#f0f0f0 0% 25%, transparent 0% 50%) 50% / 16px 16px;
}

.compare-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
  pointer-events: none;
}

.compare-overlay {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.8);
  pointer-events: none;
  z-index: 2;
}

.compare-overlay .compare-img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  /* 由 JS 同步精准对齐 */
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 40px;
  margin-left: -20px;
  cursor: ew-resize;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.divider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background-color: var(--accent);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

.divider-handle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 2;
}

.icon-divider {
  width: 16px;
  height: 16px;
  stroke: var(--accent);
  stroke-width: 2.5;
  fill: none;
}

.compare-badges {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 12;
}

.badge-tag {
  background-color: rgba(25, 31, 40, 0.75);
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

.badge-tag.after-tag {
  background-color: rgba(13, 148, 136, 0.85);
}

.compare-ctrls {
  position: absolute;
  bottom: 24px;
  display: flex;
  gap: 8px;
  z-index: 12;
}

.btn-ctrl {
  background-color: rgba(25, 31, 40, 0.75);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.15s ease;
}

.btn-ctrl:hover {
  background-color: rgba(25, 31, 40, 0.95);
  border-color: var(--accent);
}

/* 并排对比模式 */
.compare-container.side-by-side .compare-wrapper {
  display: flex;
  flex-direction: row;
  gap: 8px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.compare-container.side-by-side .compare-overlay {
  position: static;
  width: auto;
  border-right: none;
  overflow: visible;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: repeating-conic-gradient(#f0f0f0 0% 25%, transparent 0% 50%) 50% / 16px 16px;
}

.compare-container.side-by-side .compare-overlay .compare-img {
  position: static;
  max-height: calc(100vh - 190px);
}

.compare-container.side-by-side .compare-after {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: calc(100vh - 190px);
}

.compare-container.side-by-side .compare-divider {
  display: none;
}

/* 视频舞台 */
.video-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-player-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
}

.video-player-grid.has-result {
  grid-template-columns: 1fr 1fr;
}

.video-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.video-box-header {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.video-box video {
  width: 100%;
  max-height: calc(100vh - 220px);
  background-color: #000;
  display: block;
}

/* 悬浮指标栏 */
.metrics-overlay {
  position: absolute;
  top: 24px;
  right: 24px;
  background-color: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 15;
  backdrop-filter: blur(8px);
  font-size: 11px;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.metric-item .m-k {
  color: var(--text-muted);
}

.metric-item .m-v {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

.metric-item.highlight .m-v {
  color: var(--accent);
}

/* 加载覆盖状态 */
.loading-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(244, 245, 247, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
}

.spinner-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 36px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 280px;
  max-width: 360px;
  text-align: center;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

.loading-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.loading-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background-color: var(--bg-app);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 14px;
}

.progress-fill {
  height: 100%;
  background-color: var(--accent);
  transition: width 0.2s ease;
}

.progress-status {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 4px;
}

/* 错误 Banner */
.error-banner {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
  background-color: var(--status-error-bg);
  border: 1px solid var(--status-error-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  z-index: 30;
}

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

.icon-error {
  stroke: var(--status-error);
}

.error-texts {
  display: flex;
  flex-direction: column;
}

.error-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--status-error);
}

.error-msg {
  font-size: 12px;
  color: var(--text-secondary);
}

.btn-close-error {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}

.btn-close-error:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   右侧参数侧边栏
   ========================================================================== */
.sidebar-pane {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

.sidebar-header {
  height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.pane-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-text-sub {
  background: transparent;
  border: none;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}

.btn-text-sub:hover {
  background-color: var(--bg-hover);
  color: var(--accent);
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.param-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 表单组件 */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

/* 单选分段控制 */
.radio-segment {
  display: flex;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2px;
}

.segment-item {
  flex: 1;
  position: relative;
  text-align: center;
  cursor: pointer;
}

.segment-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment-item span {
  display: block;
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.segment-item input[type="radio"]:checked + span {
  background-color: var(--bg-surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* 倍率选择器 */
.scale-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.scale-btn {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 6px 0;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.scale-btn:hover {
  border-color: #cbd5e1;
  color: var(--text-primary);
}

.scale-btn.active {
  background-color: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* 下拉与输入框 */
.form-select, .form-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-select:focus, .form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

/* 滑块控件 */
.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.form-range {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border-color);
  outline: none;
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease;
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* 参数分块 */
.param-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}

.block-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--text-muted);
}

/* 不可用项 / 即将开放 */
.form-group-disabled {
  opacity: 0.75;
}

.disabled-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feature-tag-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-active);
  color: var(--text-secondary);
}

.form-tip {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 视频作业状态卡片 */
.video-job-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.job-title {
  font-size: 12px;
  font-weight: 600;
}

.job-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-light);
  color: var(--accent-hover);
}

.job-meta-row {
  display: flex;
  font-size: 11px;
  font-family: var(--font-mono);
  gap: 6px;
}

.job-progress-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.job-progress-txt {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* 侧边栏操作底栏 */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  flex-shrink: 0;
}

/* ==========================================================================
   状态栏 Footer
   ========================================================================== */
.app-status-bar {
  height: var(--status-height);
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  user-select: none;
}

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

.status-divider {
  color: var(--border-color);
}

.status-item .k {
  color: var(--text-muted);
}

.status-item .v {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* ==========================================================================
   Token 模态框
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(25, 31, 40, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-dialog {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  margin: 16px;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-close-modal {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}

.btn-close-modal:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-desc code {
  background-color: var(--bg-app);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
}

.modal-footer {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ==========================================================================
   响应式设计 (桌面与移动端)
   ========================================================================== */
@media (max-width: 900px) {
  body {
    height: auto;
    overflow-y: auto;
  }

  .workbench {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .viewport-pane {
    height: 480px;
  }

  .sidebar-pane {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-color);
  }

  .metrics-overlay {
    top: 8px;
    right: 8px;
    padding: 6px 10px;
  }

  .compare-badges {
    top: 8px;
    left: 8px;
    right: 8px;
  }
}
