:root {
  --bg: #F7F6F2;
  --canvas-bg: #F3F2EE;
  --card-bg: #FFFFFF;
  --text: #111111;
  --text-secondary: #555555;
  --text-muted: #8A8A8A;
  --border: #E6E2DA;
  --border-light: #EFECE6;
  --accent: #C8A96A;
  --accent-green: #B7FF3C;
  --btn-primary: #111111;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.08);
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; background: none; }
input, textarea { outline: none; }

.app-shell {
  display: grid;
  grid-template-rows: 52px 1fr auto;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ===== 顶部项目栏 ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  gap: 16px;
}
.topbar-left, .topbar-center, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.project-info { display: flex; align-items: center; gap: 8px; }
.project-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.project-name {
  font-size: 14px; font-weight: 600; border: 0; background: none; outline: none;
  min-width: 120px; padding: 2px 4px; border-radius: 4px;
}
.project-name:focus { background: #f5f5f5; }
.auto-save { font-size: 11px; color: var(--text-muted); }
.tb-icon {
  width: 32px; height: 32px; border-radius: var(--radius-xs); display: grid; place-items: center;
  color: var(--text-secondary); transition: .15s;
}
.tb-icon:hover { background: #f0f0f0; color: var(--text); }
.zoom-badge {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  padding: 2px 8px; border-radius: 6px; background: #f5f5f5;
}
.tb-btn-text {
  padding: 6px 14px; border-radius: var(--radius-xs); font-size: 13px; font-weight: 600;
  color: var(--text-secondary); transition: .15s;
}
.tb-btn-text:hover { background: #f0f0f0; color: var(--text); }
.tb-btn-text.accent { color: var(--accent); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: #e0e0e0;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--text-secondary);
}

/* ===== 主体区域 ===== */
.main-area {
  display: grid;
  grid-template-columns: 64px 280px 1fr 380px;
  overflow: hidden;
  min-height: 0;
}

/* ===== 左侧一级导航 ===== */
.side-nav {
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  gap: 4px;
  overflow-y: auto;
}
.nav-item {
  width: 48px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border-radius: var(--radius-md); transition: .15s;
  color: var(--text-muted);
}
.nav-item:hover { background: #f5f5f5; color: var(--text); }
.nav-item.active { background: #f0f0f0; color: var(--text); }
.nav-icon { font-size: 20px; line-height: 1; }
.nav-label { font-size: 10px; font-weight: 600; white-space: nowrap; }

/* ===== 左侧功能面板 ===== */
.func-panel {
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: width .25s ease, padding .25s ease, opacity .25s ease;
}
.func-panel.collapsed { width: 0; padding: 0; overflow: hidden; opacity: 0; }
.fp-header { display: flex; align-items: center; justify-content: space-between; }
.fp-title { font-size: 18px; font-weight: 700; letter-spacing: -.03em; }
.fp-collapse {
  width: 28px; height: 28px; border-radius: var(--radius-xs); display: grid; place-items: center;
  color: var(--text-muted); font-size: 12px; transition: .15s;
}
.fp-collapse:hover { background: #f0f0f0; }
.fp-search {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-radius: var(--radius-md); background: #f8f8f6; border: 1px solid var(--border-light);
}
.fp-search input {
  border: 0; background: none; width: 100%; font-size: 13px; color: var(--text);
}
.fp-search input::placeholder { color: var(--text-muted); }
.fp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.fp-card {
  display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--radius-lg);
  background: var(--card-bg); border: 1px solid var(--border-light);
  transition: transform .18s ease, box-shadow .18s ease; text-align: left;
}
.fp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.fpc-thumb {
  width: 100%; height: 64px; border-radius: var(--radius-sm); display: block;
}
.fp-card strong { font-size: 13px; font-weight: 600; }
.fp-card em { font-size: 11px; font-style: normal; color: var(--text-muted); }

/* ===== 中间画布 ===== */
.canvas-area {
  background: var(--canvas-bg);
  overflow: hidden;
  position: relative;
}
.canvas-viewport {
  width: 100%; height: 100%;
  overflow: auto;
  position: relative;
  transition: background .25s ease, box-shadow .25s ease;
}
.canvas-viewport.drag-over {
  background: rgba(200,169,106,.06);
  box-shadow: inset 0 0 0 3px var(--accent);
}
.canvas-viewport.drag-over::after {
  content: '释放以上传图片';
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 28px; font-weight: 700; color: var(--accent);
  background: rgba(247,246,242,.7);
  backdrop-filter: blur(4px);
  z-index: 100; pointer-events: none;
}
.canvas-content {
  min-width: 100%; min-height: 100%;
  display: grid; place-items: center;
  padding: 40px;
  /* 点阵网格 */
  background-image: radial-gradient(circle, rgba(0,0,0,.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* 启动卡片 */
.start-card {
  background: var(--card-bg);
  border-radius: var(--radius-2xl);
  padding: 48px 40px;
  text-align: center;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}
.start-icon {
  width: 80px; height: 80px; margin: 0 auto 20px; border-radius: var(--radius-xl);
  display: grid; place-items: center; background: #f8f8f6;
}
.start-card h1 { font-size: 26px; font-weight: 700; letter-spacing: -.04em; margin-bottom: 10px; }
.start-card p { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: 24px; }
.start-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.start-btn {
  padding: 11px 22px; border-radius: var(--radius-md); font-size: 14px; font-weight: 600;
  transition: .15s; border: 1px solid var(--border);
}
.start-btn:hover { background: #f5f5f5; }
.start-btn.primary { background: var(--btn-primary); color: #fff; border-color: var(--btn-primary); }
.start-btn.primary:hover { background: #333; }
.start-quick { border-top: 1px solid var(--border-light); padding-top: 20px; }
.quick-label { font-size: 12px; color: var(--text-muted); font-weight: 600; display: block; margin-bottom: 10px; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.quick-chip {
  padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #f8f8f6; border: 1px solid var(--border-light); transition: .15s;
}
.quick-chip:hover { background: #f0f0f0; border-color: var(--border); }

/* 画布卡片容器 */
.canvas-cards {
  position: absolute; inset: 0; padding: 40px;
  display: flex; flex-wrap: wrap; gap: 20px; align-content: flex-start;
  pointer-events: none;
}
.canvas-cards > * { pointer-events: auto; }

/* ===== 画布卡片类型 ===== */
.canvas-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  width: 320px;
  transition: box-shadow .2s, transform .2s;
  cursor: grab;
}
.canvas-card:hover { box-shadow: var(--shadow-md); }
.canvas-card.selected { box-shadow: 0 0 0 2px var(--accent), var(--shadow-md); }
.canvas-card.dragging { opacity: .85; cursor: grabbing; }
.cc-image {
  width: 100%; height: 200px; position: relative; overflow: hidden;
}
.cc-image img { width: 100%; height: 100%; object-fit: cover; }
.cc-image-placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 40px; color: rgba(0,0,0,.1);
}
.cc-compare {
  display: grid; grid-template-columns: 1fr 1fr; height: 200px; position: relative;
}
.cc-compare-left, .cc-compare-right {
  overflow: hidden; display: grid; place-items: center;
  font-size: 24px; color: rgba(0,0,0,.08);
}
.cc-compare-left { border-right: 2px solid #fff; }
.cc-compare-slider {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #fff;
  transform: translateX(-50%); cursor: ew-resize;
}
.cc-compare-slider::after {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm);
}
.cc-body { padding: 14px; }
.cc-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.cc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cc-tag {
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: #f5f5f5; color: var(--text-secondary);
}
.cc-tag.accent { background: #fdf6e8; color: var(--accent); }
.cc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-actions button {
  padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
  background: #f8f8f6; color: var(--text-secondary); transition: .15s;
}
.cc-actions button:hover { background: #f0f0f0; color: var(--text); }
.cc-actions button.danger { color: #c44; }
.cc-actions button.danger:hover { background: #fef0f0; }

/* 材质板卡片 */
.material-list { display: grid; gap: 8px; }
.material-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.material-swatch {
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border); flex-shrink: 0;
}
.material-swatch.oak { background: #d4c4a8; }
.material-swatch.cream { background: #f5f0e8; }
.material-swatch.white { background: #fafaf8; }
.material-swatch.warm { background: #f5e8c8; }

/* 提示词卡片 */
.prompt-card-text {
  font-size: 13px; line-height: 1.7; color: var(--text-secondary);
  background: #fafaf8; border-radius: var(--radius-sm); padding: 12px;
  margin-bottom: 10px;
}

/* ===== 右侧对话面板 ===== */
.chat-panel {
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.cp-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border-light);
}
.cp-title { font-size: 15px; font-weight: 700; }
.cp-top-actions { display: flex; align-items: center; gap: 6px; }
.cp-icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius-xs); display: grid; place-items: center;
  font-size: 16px; color: var(--text-secondary); transition: .15s;
}
.cp-icon-btn:hover { background: #f0f0f0; }
.cp-brand-btn {
  width: 30px; height: 30px; border-radius: var(--radius-xs); display: grid; place-items: center;
  background: var(--accent-green); color: #111; font-size: 14px; font-weight: 800;
}

.cp-body {
  flex: 1; overflow-y: auto; padding: 20px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

/* ===== 右下角浮动聊天面板（Lovart 风格） ===== */
.floating-chat {
  position: absolute;
  right: 24px; bottom: 88px;
  width: 360px;
  max-height: calc(100% - 120px);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  display: flex; flex-direction: column;
  z-index: 50;
  overflow: hidden;
  transition: max-height .25s ease, transform .25s ease;
}
.floating-chat.collapsed {
  max-height: 48px;
}
.floating-chat.collapsed .fc-messages,
.floating-chat.collapsed .fc-composer { display: none; }

.fc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: default;
  background: rgba(255,255,255,.6);
}
.fc-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.fc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4caf50; box-shadow: 0 0 0 3px rgba(76,175,80,.15);
}
.fc-toggle {
  width: 24px; height: 24px;
  border: none; background: transparent;
  color: var(--text-muted); cursor: pointer;
  border-radius: 4px; font-size: 16px; line-height: 1;
  display: grid; place-items: center;
}
.fc-toggle:hover { background: rgba(0,0,0,.05); color: var(--text); }

.fc-messages {
  flex: 1; overflow-y: auto; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 120px; max-height: 360px;
}
.fc-messages::-webkit-scrollbar { width: 4px; }
.fc-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.chat-welcome {
  text-align: center; padding: 30px 14px; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.chat-welcome-icon { font-size: 28px; opacity: .4; }
.chat-welcome p { font-size: 12px; line-height: 1.6; max-width: 220px; margin: 0; }

.chat-msg {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; border-radius: var(--radius-md);
  background: #f7f6f3; border: 1px solid var(--border-light);
  animation: msgIn .25s ease;
  max-width: 100%;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.chat-msg.user { background: #ece9e1; border-color: rgba(200,169,106,.25); }
.chat-msg .msg-image {
  width: 100%; max-height: 140px; border-radius: var(--radius-sm);
  object-fit: cover; cursor: pointer;
  transition: transform .15s;
}
.chat-msg .msg-image:hover { transform: scale(1.02); }
.chat-msg .msg-text {
  font-size: 13px; line-height: 1.5; color: var(--text);
  word-break: break-word; white-space: pre-wrap;
}
.chat-msg .msg-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-muted);
}
.chat-msg .msg-meta .msg-tag {
  padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.04); font-weight: 500;
}

.fc-composer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-light);
  background: rgba(255,255,255,.7);
}
.fc-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 13px; line-height: 1.5;
  font-family: inherit;
  background: #fff;
  resize: none;
  outline: none;
  max-height: 120px;
  transition: border-color .15s;
}
.fc-input:focus { border-color: var(--accent); }
.fc-send {
  width: 34px; height: 34px;
  border: none; border-radius: 50%;
  background: var(--text); color: #fff;
  cursor: pointer; font-size: 16px; font-weight: 700;
  display: grid; place-items: center;
  transition: transform .12s, opacity .15s;
  flex-shrink: 0;
}
.fc-send:hover { transform: scale(1.05); }
.fc-send:active { transform: scale(.95); }
.fc-send:disabled { opacity: .4; cursor: not-allowed; }

/* 画布需要 relative 才能定位浮动聊天 */
.canvas-area { position: relative; }

/* Skills 区域 */
.cp-skills { width: 100%; }
.cp-skills-title {
  font-size: 15px; font-weight: 600; text-align: center; margin-bottom: 16px; color: var(--text);
}
.cp-skills-grid {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.skill-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--card-bg); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text);
  transition: .15s;
}
.skill-chip:hover { background: #f8f8f6; border-color: #ccc; }
.sc-icon { font-size: 15px; }

/* 底部输入区 */
.cp-input-area {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--card-bg);
}
.cp-ref-upload {
  margin-bottom: 10px; padding: 10px 14px; border-radius: var(--radius-md);
  background: #f8f8f6; border: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 10px; cursor: pointer; transition: .15s;
}
.cp-ref-upload:hover { background: #f0f0f0; }
.ref-upload-inner { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ref-upload-inner span { font-size: 13px; font-weight: 600; }
.ref-hint { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cp-edit-state {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 6px 12px;
  border-radius: var(--radius-sm); background: #fdf6e8; border: 1px solid rgba(200,169,106,.2);
}
.edit-badge { font-size: 11px; font-weight: 700; color: var(--accent); }
.edit-name { font-size: 12px; font-weight: 600; flex: 1; }
.edit-clear { font-size: 14px; color: var(--text-muted); padding: 2px 6px; }

.cp-input-box {
  border: 1px solid var(--border); border-radius: var(--radius-2xl);
  background: var(--card-bg); padding: 2px; box-shadow: var(--shadow-sm);
}
.cp-input-box textarea {
  width: 100%; border: 0; background: none; padding: 12px 16px;
  font-size: 14px; line-height: 1.6; resize: none; min-height: 44px;
  color: var(--text);
}
.cp-input-box textarea::placeholder { color: var(--text-muted); }

.cp-tool-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; gap: 8px;
}
.cp-tool-left, .cp-tool-right { display: flex; align-items: center; gap: 6px; }

/* 下拉菜单 */
.cp-dropdown { position: relative; }
.cp-dropdown-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #f5f5f5; color: var(--text-secondary); transition: .15s;
}
.cp-dropdown-btn:hover { background: #eee; }
.cp-dropdown-btn.model-btn { font-size: 11px; }
.dd-arrow { font-size: 10px; }
.cp-dropdown-menu {
  display: none; position: absolute; bottom: 100%; left: 0; margin-bottom: 6px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); min-width: 180px; padding: 6px; z-index: 300;
}
.cp-dropdown.open .cp-dropdown-menu { display: block; }
.cp-dropdown-menu.model-menu { min-width: 220px; right: 0; left: auto; }
.dd-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px;
  border-radius: var(--radius-xs); font-size: 12px; font-weight: 500; color: var(--text-secondary);
  transition: .15s; text-align: left;
}
.dd-item:hover { background: #f5f5f5; color: var(--text); }
.dd-item.active { background: #f8f8f6; color: var(--text); font-weight: 600; }
.model-icon { font-size: 14px; }
.check { margin-left: auto; color: var(--accent); font-weight: 700; }

.generate-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--btn-primary); color: #fff;
  display: grid; place-items: center; transition: .15s;
}
.generate-btn:hover { background: #333; transform: scale(1.05); }

/* ===== 底部浮动画布工具栏 ===== */
.floating-toolbar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 18px;
  background: var(--card-bg); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); z-index: 500;
}
.ft-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 12px; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); transition: .15s; white-space: nowrap;
}
.ft-btn:hover { background: #f5f5f5; color: var(--text); }
.ft-btn.active { background: #f0f0f0; color: var(--text); }
.ft-divider { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

/* ===== 项目管理页 ===== */
.projects-view {
  position: absolute; inset: 52px 0 0; background: var(--bg);
  overflow-y: auto; padding: 32px 40px; z-index: 150;
}
.pv-header { margin-bottom: 28px; }
.pv-header h1 { font-size: 28px; font-weight: 700; letter-spacing: -.04em; margin-bottom: 6px; }
.pv-header p { font-size: 14px; color: var(--text-muted); }
.pv-header-actions {
  display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap;
}
.pv-search {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-radius: var(--radius-md); background: var(--card-bg); border: 1px solid var(--border);
  min-width: 200px;
}
.pv-search input { border: 0; background: none; width: 100%; font-size: 13px; }
.pv-filter-btn, .pv-btn {
  padding: 8px 16px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600;
  background: var(--card-bg); border: 1px solid var(--border); transition: .15s;
}
.pv-filter-btn:hover, .pv-btn:hover { background: #f5f5f5; }
.pv-btn.primary { background: var(--btn-primary); color: #fff; border-color: var(--btn-primary); }
.pv-btn.primary:hover { background: #333; }
.pv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.pv-card {
  background: var(--card-bg); border-radius: var(--radius-xl); border: 1px solid var(--border-light);
  overflow: hidden; transition: .2s; position: relative;
}
.pv-card:hover { box-shadow: var(--shadow-md); }
.pv-cover { width: 100%; height: 180px; }
.pv-meta { padding: 16px; }
.pv-meta h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.pv-meta p { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.pv-meta small { font-size: 11px; color: var(--text-muted); }
.pv-hover-actions {
  position: absolute; inset: 0; background: rgba(255,255,255,.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; opacity: 0; transition: .2s; pointer-events: none;
}
.pv-card:hover .pv-hover-actions { opacity: 1; pointer-events: auto; }
.pv-hover-actions button {
  padding: 8px 20px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  background: var(--card-bg); border: 1px solid var(--border); min-width: 140px; transition: .15s;
}
.pv-hover-actions button:hover { background: #f5f5f5; }
.pv-hover-actions button.danger { color: #c44; }
.pv-hover-actions button.danger:hover { background: #fef0f0; }
.pv-card.empty {
  display: grid; place-items: center; text-align: center; padding: 40px 20px; min-height: 300px;
}
.pv-empty-icon {
  width: 56px; height: 56px; border-radius: var(--radius-lg); display: grid; place-items: center;
  background: #f5f5f5; font-size: 28px; color: var(--text-muted); margin-bottom: 12px;
}
.pv-card.empty h3 { font-size: 16px; margin-bottom: 6px; }
.pv-card.empty p { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

/* ===== 浮动聊天增强 ===== */
.floating-chat {
  width: 388px;
  box-shadow: 0 18px 48px rgba(0,0,0,.10), 0 4px 14px rgba(0,0,0,.06);
}
.floating-chat::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.fc-header {
  padding: 12px 14px 10px;
}
.fc-header-actions {
  display: flex; align-items: center; gap: 10px;
}
.fc-status {
  font-size: 11px; color: var(--text-muted);
  padding: 4px 8px; border-radius: 999px; background: #f6f4ef;
}
.fc-context {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, rgba(247,246,242,.85), rgba(255,255,255,.96));
}
.fc-context-kicker {
  display: block; font-size: 10px; font-weight: 700; color: var(--text-muted);
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px;
}
.fc-context-text {
  display: block; font-size: 12px; line-height: 1.5; color: var(--text-secondary);
}
.fc-quick-prompts {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 14px 10px;
}
.fc-quick-prompts button {
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: #faf9f6; font-size: 11px; color: var(--text-secondary);
  transition: .15s;
}
.fc-quick-prompts button:hover {
  background: #f0ede7; color: var(--text);
}
.fc-attachment {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 10px;
  border: 1px solid rgba(200,169,106,.18);
  border-radius: var(--radius-md);
  background: #fbf7ef;
}
.fc-attachment img {
  width: 44px; height: 44px; object-fit: cover; border-radius: 10px; flex-shrink: 0;
  border: 1px solid var(--border-light);
}
.fc-attachment-meta {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1;
}
.fc-attachment-meta strong {
  font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fc-attachment-meta span {
  font-size: 11px; color: var(--text-muted);
}
.fc-attachment-remove {
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,.05); color: var(--text-secondary);
}
.fc-attachment-remove:hover { background: rgba(0,0,0,.10); }
.fc-input-row {
  display: flex; align-items: flex-end; gap: 8px;
}
.fc-input {
  min-height: 48px;
}
.floating-chat .chat-msg.user {
  align-self: flex-end;
  max-width: 92%;
}
.floating-chat .chat-msg:not(.user) {
  align-self: flex-start;
  max-width: 92%;
}
.floating-chat .chat-msg.assistant {
  background: #fff;
  align-self: flex-start;
}

@media (max-width: 1600px) {
  .main-area { grid-template-columns: 64px 260px 1fr 360px; }
}
@media (max-width: 1280px) {
  .main-area { grid-template-columns: 64px 1fr; }
  .func-panel, .chat-panel { display: none; }
  .func-panel.open, .chat-panel.open {
    display: flex; position: fixed; top: 52px; bottom: 0; z-index: 250; width: 300px;
  }
  .func-panel.open { left: 64px; }
  .chat-panel.open { right: 0; }
}
@media (max-width: 800px) {
  .main-area { grid-template-columns: 1fr; }
  .side-nav { display: none; }
  .floating-toolbar { gap: 2px; padding: 4px 6px; }
  .ft-btn span { display: none; }
  .ft-btn { padding: 8px; }
  .topbar-center { display: none; }
}

/* ===== 第二轮深化：多图附件 + 可拖拽缩放命令台 ===== */
.floating-chat.moving,
.floating-chat.resizing { user-select: none; }
.floating-chat.moving { box-shadow: 0 24px 60px rgba(0,0,0,.14), 0 6px 18px rgba(0,0,0,.08); }
.fc-header { cursor: move; }
.fc-header button { cursor: pointer; }
.fc-attachments {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin-bottom: 8px;
}
.fc-attachments[hidden] { display: none; }
.fc-attachments::-webkit-scrollbar { height: 4px; }
.fc-attachments::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.fc-attachment-chip {
  display: grid;
  grid-template-columns: 44px minmax(88px, 1fr) 24px;
  align-items: center;
  gap: 9px;
  min-width: 188px;
  max-width: 228px;
  padding: 8px;
  border: 1px solid rgba(200,169,106,.20);
  border-radius: 14px;
  background: linear-gradient(180deg,#fffaf2,#f8f4ea);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.fc-attachment-chip img {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border-light);
}
.msg-image-grid {
  display: grid;
  gap: 6px;
}
.msg-image-grid.multi {
  grid-template-columns: repeat(2, minmax(0,1fr));
}
.msg-image-grid.multi .msg-image {
  height: 86px;
}
.fc-resize {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  opacity: .45;
}
.fc-resize::before,
.fc-resize::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  border-radius: 1px;
}
.fc-resize::before { width: 12px; height: 12px; }
.fc-resize::after { width: 7px; height: 7px; }
.floating-chat.collapsed .fc-context,
.floating-chat.collapsed .fc-quick-prompts,
.floating-chat.collapsed .fc-resize { display: none; }
@media (max-width: 800px) {
  .floating-chat {
    right: 12px;
    bottom: 76px;
    width: min(388px, calc(100vw - 24px));
  }
}
