/* === 08-responsive.css (原 user.css L2502-L2815,Section 13 PC 响应式 @media) === */

/* ========================================
   13. 响应式（@media）
   ======================================== */
@media (min-width: 1024px) {
  /* P428:PC 全屏空间骨架第一刀
     - body 作为全屏 stage,max-width 解除(原 1920 限制让超宽屏中心化),宽度铺满
     - 外层 padding / gap / 三栏宽度全部走 layout token(单一源头,见 01-variables.css)
     - #app-main 去 border + radius,只留 box-shadow,改为"空间分区"而非"卡片浮岛" */
  body {
    display: grid;
    grid-template-columns: var(--pc-nav-width) var(--pc-sidebar-width) minmax(0, 1fr);
    gap: var(--pc-shell-gap);
    padding: var(--pc-shell-padding);
    max-width: none;
    width: 100vw;
    margin: 0;
    height: var(--app-height, 100dvh);
  }
  .bg-ambient { display: none; }

  .sidebar-nav { display: flex; }
  #sidebar { display: flex; }

  /* P428-2:左栏第 2 列拆为"列表卡 + 品牌卡"两张独立卡,中间 gap = pc-shell-gap
     .sidebar-column 是布局壳,本身无视觉(透明),只控两个子卡的垂直排列。
     - #sidebar 自适应剩余高度(flex: 1),内部 #sidebar-body 仍 overflow auto
     - .sidebar-circuit 取自然高度(flex: 0 0 auto),不挤压列表 */
  .sidebar-column {
    display: flex;
    flex-direction: column;
    gap: var(--pc-shell-gap);
    min-height: 0;
    height: calc(var(--app-height, 100dvh) - var(--pc-shell-padding) * 2);
  }
  .sidebar-column #sidebar {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    animation: none;  /* P428-2:.sidebar slideInLeft 在拆出后由 .sidebar-column 整体承担,避免子卡片独立动画跳动 */
  }
  .sidebar-column .sidebar-circuit {
    display: flex;  /* 显式声明,与 11-mobile.css 内的 display:none 形成对称覆盖,避免依赖默认值 */
    flex: 0 0 auto;
  }

  #app-main {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: calc(var(--app-height, 100dvh) - var(--pc-shell-padding) * 2);
    background: var(--chat-main-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-ambient);
  }

  /* 隐藏移动端导航 */
  #home-view { display: none !important; }
  #conv-view { display: none !important; }
  .tab-bar { display: none !important; }
  .fab { display: none !important; }

  /* chat-view 变为常驻主区域(P428:高度 100dvh → 100%,自然跟随 #app-main) */
  #chat-view {
    position: relative !important;
    display: flex !important;
    height: 100%;
    z-index: auto;
    background: transparent;  /* PC 端不染色,让父级 #app-main 的对话底色透出 */
  }
  #chat-view .topbar {
    position: sticky;
    top: 0; left: 0; right: 0;
    transform: none;
    width: auto;
    z-index: 10;
  }
  .chat-area {
    margin-top: 0;
    max-width: 900px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 20px 32px 140px;
  }
  .input-bar {
    position: sticky;
    bottom: 0;
    width: 100%;
    max-width: none;
    padding: 20px 32px 24px;
    transform: none;
  }
  .input-container {
    max-width: 840px;
    margin: 0 auto;
    padding: 8px;
    border-radius: 24px;
  }
  .input-bar textarea {
    font-size: 15px; min-height: 24px; max-height: 160px;
    padding: 10px 0;
    line-height: 1.5;
  }
  #btn-send { width: 44px; height: 44px; }
  #btn-send svg { width: 20px; height: 20px; }
  .upload-btn { width: 44px; height: 44px; }
  .upload-btn svg { width: 20px; height: 20px; }
  .input-container > .image-preview { padding: 4px 4px 6px; gap: 8px; }

  /* 弹窗居中 */
  .modal-overlay { align-items: center; }
  .modal-sheet { max-width: 520px; border-radius: 20px; max-height: 70vh; animation: fadeIn .25s ease; }

  /* Toast 居中:用 margin auto 不用 transform,避免和 slideUp 的 translateY 打架致先偏右再跳中(P602) */
  .toast { left: 0; right: 0; margin-inline: auto; width: fit-content; max-width: 400px; }

}

/* 协作任务进度卡片 + VNC 查看器（P183 Part 2 — 卡片化 + 中性底）*/
.task-progress-card {
  margin: 12px 0;
  padding: 16px;
  max-width: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow-ambient);
}
.task-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-card-icon {
  display: flex; align-items: center;
  color: var(--brand-secondary);
}
.task-card-icon svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none; stroke-width: 2;
}
.task-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  flex: 1;
}
.task-card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-layer-1);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.task-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
}
.task-status-dot.pulse {
  background-color: var(--brand-primary);
  animation: taskPulse 2s infinite;
}
.task-status-dot.done { background: var(--success-color); animation: none; }
.task-status-dot.failed { background: var(--error-color); animation: none; }
/* P413 扁平化:taskPulse 删 glow ring,保留缩放节拍作 pulse 反馈 */
@keyframes taskPulse {
  0%   { transform: scale(0.95); }
  70%  { transform: scale(1);    }
  100% { transform: scale(0.95); }
}
.task-card-progress {
  font-size: 13px;
  color: var(--text-dim);
  word-break: break-all;
}
/* P443 回注失败 UI */
.task-feedback-fail {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.task-feedback-reason {
  color: var(--error-color);
  font-size: 13px;
  line-height: 1.5;
}
.task-feedback-actions {
  display: flex;
  gap: var(--space-2);
}
.task-feedback-actions button {
  flex: 0 0 auto;
  padding: var(--space-1) var(--space-3);
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.task-feedback-actions button:disabled {
  opacity: 0.6;
  cursor: progress;
}
.task-feedback-retry {
  background: var(--brand-primary);
  color: var(--text-on-color);
  border: 1px solid var(--brand-border);
}
.task-feedback-abandon {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
/* VNC 内嵌查看器 */
.task-card-vnc {
  margin-top: 4px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.vnc-viewer {
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: var(--bg-deep);
}
.vnc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-layer-1);
  border-bottom: 1px solid var(--border-glass);
  gap: 6px;
}
.vnc-toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.vnc-toolbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.vnc-toolbar-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 3px 6px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
  line-height: 1;
}
.vnc-toolbar-btn:hover {
  background: var(--bg-active);
  color: var(--text-bright);
}
.vnc-frame-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  overflow: hidden;
  transition: height 0.25s ease, padding-bottom 0.25s ease, opacity 0.2s ease;
}
.vnc-frame-wrap.collapsed {
  padding-bottom: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
.vnc-frame-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
/* 接管状态 */
.vnc-takeover-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--warning-bg);
  border-top: 1px solid var(--warning-border);
  gap: 8px;
}
.vnc-takeover-reason {
  flex: 1;
  font-size: 12px;
  color: var(--accent-orange);
}
.vnc-btn {
  border: 1px solid var(--cyan-border);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.vnc-btn-resume {
  background: var(--success-bg);
  color: var(--accent-green);
  border-color: var(--success-glow);
}
.vnc-btn-resume:hover { background: var(--success-glow); }
/* iframe 不可用时的 fallback */
.vnc-fallback-btn {
  background: var(--info-bg-strong);
  color: var(--accent-cyan);
  border: 1px solid var(--cyan-border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.vnc-fallback-btn:hover { background: var(--info-bg); }
.task-steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.task-step {
  font-size: 11px;
  color: var(--text-dim);
  padding: 1px 0;
}
.task-step.active {
  color: var(--accent-cyan);
  font-weight: 500;
}
.task-step.done {
  color: var(--text-dim);
}
