/* ============ 攀涵AI工作台 · 极简科技风 v2.9 ============ */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #e0e7ff;
  --primary-glow: rgba(99, 102, 241, .22);
  --green: #059669;
  --green-light: #d1fae5;
  --red: #dc2626;
  --red-light: #fee2e2;
  --orange: #d97706;
  --orange-light: #fffbeb;
  --gray: #6b7280;
  --gray-light: #f3f4f8;
  --text: #111827;
  --text-2: #4b5563;
  --border: #e7e8ee;
  --bg: #f7f8fa;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 6px rgba(16, 24, 40, .05);
  --shadow-lg: 0 10px 32px -8px rgba(16, 24, 40, .14), 0 2px 8px rgba(16, 24, 40, .05);
  --ring: 0 0 0 3px var(--primary-glow);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.7;
  min-height: 100vh; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--primary-light); color: var(--primary-dark); }
/* 全局细滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d3d6df; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b9bdc9; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- 布局骨架：左侧深色侧边栏 + 右侧内容区 ---- */
:root { --side-w: 224px; --side-w-min: 62px; --side-bg: #000; --side-bg-2: #181818; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side-w); background: #000;
  color: #a1a1a1; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 100; transition: width .18s ease; overflow: hidden;
}
.main-wrap { flex: 1; margin-left: var(--side-w); display: flex; flex-direction: column; min-height: 100vh; min-width: 0; transition: margin-left .18s ease; }
body.side-collapsed .sidebar { width: var(--side-w-min); }
body.side-collapsed .main-wrap { margin-left: var(--side-w-min); }
.mobile-nav-toggle,.mobile-nav-backdrop{display:none}
@media(max-width:700px){
  body:not(.is-login){overflow-x:hidden}
  body:not(.is-login) .main-wrap,body:not(.is-login).side-collapsed .main-wrap{margin-left:0;width:100%;max-width:100vw}
  body:not(.is-login) .sidebar,body:not(.is-login).side-collapsed .sidebar{width:var(--side-w);transform:translateX(-100%);transition:transform .18s ease;box-shadow:8px 0 24px #0004}
  body:not(.is-login).mobile-nav-open .sidebar{transform:translateX(0)}
  body.mobile-nav-open .sidebar .side-brand,body.mobile-nav-open .sidebar .side-brand-text,body.mobile-nav-open .sidebar .side-group-head,body.mobile-nav-open .sidebar .si-label{display:initial}
  body.mobile-nav-open .sidebar .side-head{justify-content:space-between;padding:16px 12px}
  body.mobile-nav-open .sidebar .side-item{justify-content:flex-start;padding:10px 14px}
  body.mobile-nav-open .sidebar .side-group-head{display:flex}
  .mobile-nav-toggle{display:inline-flex;flex:none;align-items:center;justify-content:center;width:34px;height:34px;border:1px solid var(--border);border-radius:7px;background:var(--workspace-surface,#fff);color:var(--workspace-text,#222);font-size:20px;cursor:pointer}
  .mobile-nav-toggle:focus-visible{outline:2px solid #65d9ef;outline-offset:2px}
  .mobile-nav-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:90;border:0;background:#0006;cursor:pointer}
  .topbar{padding-inline:8px!important;gap:6px!important;min-width:0}
  .topbar-right{gap:5px!important;min-width:0;margin-left:auto}
  .top-actions{gap:2px!important;flex:none}
  .top-actions .top-icon-btn{width:30px;height:32px;flex:none;padding:3px}
  .topbar .env-slot{max-width:80px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px}
  .topbar .account-name,.topbar .account-caret{display:none}
  .topbar .account-badge{padding:2px}
}
/* 登录页：隐藏侧边栏 */
body.is-login .sidebar { display: none; }
body.is-login .main-wrap { margin-left: 0; }

/* ---- 侧边栏头部：品牌 + 折叠按钮 ---- */
.side-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid rgba(255,255,255,.06); min-height: 58px; }
.side-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: #f1f5f9; flex: 1; min-width: 0; }
.side-logo-img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 2px 8px rgba(0,0,0,.45); flex: none; }
.side-brand-text { font-weight: 700; font-size: 15px; letter-spacing: .3px; white-space: nowrap; overflow: hidden;
  color: #f5f5f5; }
.side-collapse-btn { background: none; border: none; color: #7c88a3; font-size: 17px; cursor: pointer; padding: 4px 6px; border-radius: 7px; flex: none; line-height: 1; }
.side-collapse-btn:hover { background: rgba(255,255,255,.08); color: #f1f5f9; }
body.side-collapsed .side-brand-text { display: none; }
body.side-collapsed .side-brand { display: none; }
body.side-collapsed .side-head { justify-content: center; padding: 14px 8px 12px; }

/* ---- 侧边栏导航：分组可折叠 ---- */
.side-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 10px; }
.side-nav::-webkit-scrollbar { width: 4px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 4px; }
.side-group { margin-bottom: 6px; }
.side-group-head {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: none; color: #858585; font-size: 11px; font-weight: 600;
  letter-spacing: 1.2px; padding: 8px 10px 6px; cursor: pointer; font-family: inherit; gap: 8px;
}
.side-group-head > span:first-child { min-width: 0; overflow-wrap: anywhere; text-align: left; }
.side-group-head .side-caret { font-size: 10px; flex: none; transition: transform .15s; }
.menu-list th:first-child, .menu-list td:first-child { min-width: 150px; }
.menu-list td[data-menu-group-label] { min-width: 140px; max-width: 220px; overflow-wrap: anywhere; }
.side-group.open .side-group-head .side-caret { transform: rotate(180deg); }
.side-group-body { display: none; flex-direction: column; gap: 2px; }
.side-group.open .side-group-body { display: flex; }
.side-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  color: #a1a1a1; text-decoration: none; font-size: 14px; white-space: nowrap; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left; font-family: inherit;
  position: relative; transition: background .12s, color .12s;
}
.side-item:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.side-item.active { background: #242424; color: #f5f5f5; font-weight: 600; }
.side-item.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px;
  background: #d4d4d4; }
.side-item:hover,.side-item:focus-visible { background: #181818; color: #fff; font-weight: 600; }
.side-item.active:hover,.side-item.active:focus-visible { background: #242424; color: #fff; }
.side-item .si-icon { width: 20px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.side-item .si-icon .line-icon { display: block; }
.side-item .si-label { overflow: hidden; text-overflow: ellipsis; }
/* 折叠态：只留图标，悬停靠 title 提示 */
body.side-collapsed .side-group-head { display: none; }
body.side-collapsed .side-group-body { display: flex !important; }
body.side-collapsed .side-item { justify-content: center; padding: 10px 0; }
body.side-collapsed .si-label { display: none; }
/* 折叠态悬浮提示：v2.9.4 改为 app.js 的 body 级 flyout（旧 ::after 方案被 .sidebar overflow:hidden 裁剪，已废弃） */
/* 侧边栏底部：当前用户 */
.side-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.06); font-size: 12.5px; color: #7c88a3; white-space: nowrap; overflow: hidden; }
.side-foot .sf-name { color: #e2e8f0; font-weight: 600; }
body.side-collapsed .side-foot { text-align: center; padding: 12px 4px; }

/* ---- 顶栏（内容区）：环境标识 + 用户区 ---- */
.topbar { background: rgba(255,255,255,.86); backdrop-filter: blur(12px) saturate(1.4); -webkit-backdrop-filter: blur(12px) saturate(1.4); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50;
  height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.user-chip { font-size: 13px; color: var(--text); background: var(--gray-light); border-radius: 999px; padding: 4px 12px; }
.user-link { font-size: 12.5px; color: var(--gray); text-decoration: none; }
.user-link:hover { color: var(--primary); }
.env-slot { display: flex; align-items: center; gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.top-actions { display: flex; align-items: center; gap: 6px; }
/* 顶栏快捷图标按钮（生成历史/下载记录） */
.top-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 9px; color: var(--text-2); text-decoration: none; position: relative; transition: background .12s, color .12s;
}
.top-icon-btn:hover { background: var(--gray-light); color: var(--primary); }
.top-icon-btn.active { background: var(--primary-light); color: var(--primary); }
@media (hover: hover) {
  .top-icon-btn:hover::after {
    content: attr(data-title); position: absolute; top: calc(100% + 6px); right: 0;
    background: #16203a; color: #f1f5f9; font-size: 12px; padding: 4px 10px; border-radius: 6px;
    white-space: nowrap; z-index: 210; pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,.2);
  }
}
/* 右上角账户模块：徽章 + 下拉卡片 */
.account-drop { position: relative; }
.account-badge {
  display: inline-flex; align-items: center; gap: 8px; background: none; border: none;
  cursor: pointer; font-family: inherit; padding: 4px 8px; border-radius: 999px; transition: background .12s;
}
.account-badge:hover { background: var(--gray-light); }
.account-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  box-shadow: 0 0 0 2px var(--primary-glow);
}
.account-name { font-size: 13.5px; color: var(--text); font-weight: 600; }
.account-caret { font-size: 10px; color: var(--gray); transition: transform .15s; }
.account-drop.open .account-caret { transform: rotate(180deg); }
.account-menu {
  display: none; position: absolute; top: calc(100% + 10px); right: 0; width: 250px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 8px; z-index: 220;
  animation: dropIn .14s ease;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.account-menu::before { content: ''; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.account-drop.open .account-menu { display: block; }
.account-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.account-card-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; flex: none;
}
.account-card-name { font-size: 15px; font-weight: 700; }
.account-card-role { font-size: 12px; color: var(--gray); }
.account-sep { height: 1px; background: var(--border); margin: 6px 8px; }
.account-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px;
  color: var(--text-2); text-decoration: none; font-size: 14px; background: none; border: none;
  cursor: pointer; text-align: left; font-family: inherit; transition: background .12s;
}
.account-item:hover { background: var(--gray-light); color: var(--text); }
.line-icon { vertical-align: middle; flex: none; }
/* ---- 下载记录页 ---- */
.dl-block { padding: 16px 18px; }
.dl-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.dl-title { font-size: 14.5px; font-weight: 600; }
.dl-id { color: var(--gray); font-weight: 400; margin-left: 6px; }
.dl-meta { font-size: 12.5px; color: var(--gray); display: flex; align-items: center; }
.dl-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.dl-thumb {
  position: relative; width: 120px; height: 120px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); display: block;
}
.dl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .15s; }
.dl-thumb:hover img { transform: scale(1.05); }
.dl-badge {
  position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 7px;
  background: rgba(15, 23, 42, .72); color: #fff; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.dl-thumb:hover .dl-badge { opacity: 1; }
/* ---- 角色管理：权限编辑 ---- */
.perm-group { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-bottom: 8px; }
.perm-group-title { font-size: 12px; color: var(--gray); font-weight: 600; min-width: 64px; }
.perm-item { font-size: 13.5px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.perm-chip { display: inline-block; font-size: 11.5px; background: var(--gray-light); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; margin: 1px 2px 1px 0; font-family: Menlo, Consolas, monospace; }
/* ---- 用量看板统计卡 ---- */
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-card { flex: 1; min-width: 150px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; text-align: center; }
.stat-num { font-size: 26px; font-weight: 700; color: var(--primary-dark); }
.stat-label { font-size: 12.5px; color: var(--gray); margin-top: 4px; }

.container { max-width: 1100px; width: 100%; margin: 0 auto; padding: 28px 24px 60px; flex: 1; }
.footer { text-align: center; color: #94a3b8; font-size: 12.5px; padding: 18px; border-top: 1px solid var(--border); background: #fff; }

/* ---- v2.9.1 系统级标签栏（每个模块/每块画布一个标签） ---- */
.tabbar { display: flex; align-items: flex-end; gap: 4px; padding: 10px 26px 0; background: var(--bg);
  border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; min-height: 0; }
.tabbar::-webkit-scrollbar { display: none; }
body.is-login .tabbar { display: none !important; }
.wtab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px 9px; border-radius: 11px 11px 0 0;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; border: 1px solid transparent; border-bottom: none;
  white-space: nowrap; max-width: 220px; min-width: 0; position: relative; flex: 0 1 auto; user-select: none;
  transition: background .12s, color .12s; }
.wtab:hover { background: rgba(99,102,241,.07); color: var(--text); }
.wtab.active { background: var(--card); color: var(--primary-dark); font-weight: 600; border-color: var(--border); }
.wtab.active::after { content: ''; position: absolute; left: 12px; right: 12px; top: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #6366f1, #4f46e5); }
.wtab .line-icon { color: var(--gray); flex: none; }
.wtab.active .line-icon { color: var(--primary); }
.wtab-label { overflow: hidden; text-overflow: ellipsis; }
.wtab-close { border: none; background: none; cursor: pointer; color: var(--gray); border-radius: 5px;
  width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none; }
.wtab-close:hover { background: rgba(220,38,38,.1); color: var(--red); }
/* 标签内容容器 */
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.loading { text-align: center; color: var(--gray); padding: 80px 0; opacity: 0; animation: loadingFade .18s ease .12s forwards; }
@keyframes loadingFade { to { opacity: 1; } }
.loading::before { content: ''; display: block; width: 26px; height: 26px; margin: 0 auto 14px; border-radius: 50%;
  border: 2.5px solid var(--primary-light); border-top-color: var(--primary); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 项目管理（v2.9：项目=无限画布） ---- */
.prj-head-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.prj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.prj-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; position: relative; }
.prj-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(99,102,241,.4); }
.prj-card::after { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, #818cf8, #6366f1, #a78bfa); opacity: 0; transition: opacity .18s; }
.prj-card:hover::after { opacity: 1; }
.prj-cover { aspect-ratio: 16/10; background: linear-gradient(135deg, #eef0f7, #e4e7f4); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.prj-cover img { width: 100%; height: 100%; object-fit: cover; }
.prj-cover .prj-cover-ico { color: #b1b8d8; }
.prj-badge-count { position: absolute; right: 10px; bottom: 10px; background: rgba(16,24,40,.72); color: #fff; font-size: 11.5px; border-radius: 999px; padding: 2px 10px; display: inline-flex; align-items: center; gap: 5px; backdrop-filter: blur(4px); }
.prj-body { padding: 14px 16px 15px; display: flex; flex-direction: column; gap: 3px; }
.prj-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.prj-name .line-icon { color: var(--primary); }
.prj-meta { font-size: 12.5px; color: var(--gray); display: flex; align-items: center; gap: 6px; }
.prj-acts { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.prj-acts .btn { flex: none; }
.prj-new { border-style: dashed; background: transparent; align-items: center; justify-content: center; min-height: 220px; color: var(--gray); box-shadow: none; }
.prj-new:hover { color: var(--primary); border-color: var(--primary); background: #f8f8ff; }
.prj-new .pn-ico { width: 52px; height: 52px; border-radius: 16px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }

/* ---- 通用 ---- */
h2.page-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; letter-spacing: -.2px; }
.page-desc { color: var(--text-2); font-size: 13.5px; margin-bottom: 24px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 26px; box-shadow: var(--shadow); margin-bottom: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: none; cursor: pointer;
  background: linear-gradient(180deg, #6366f1, #4f46e5); color: #fff; font-size: 14.5px; padding: 9px 22px; border-radius: 10px; font-family: inherit; font-weight: 500;
  box-shadow: 0 1px 2px rgba(16,24,40,.1), 0 2px 8px var(--primary-glow); transition: all .15s ease; }
.btn:hover { background: linear-gradient(180deg, #5458ee, #4338ca); transform: translateY(-1px); box-shadow: 0 4px 14px var(--primary-glow), 0 1px 3px rgba(16,24,40,.1); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { background: #b6bac4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary { background: #fff; color: var(--text-2); border: 1px solid var(--border); box-shadow: none; }
.btn.secondary:hover { background: var(--gray-light); border-color: #d3d6df; color: var(--text); box-shadow: none; }
.btn.danger { background: linear-gradient(180deg, #ef4444, #dc2626); box-shadow: 0 2px 8px rgba(220,38,38,.22); }
.btn.small { padding: 5px 14px; font-size: 13px; border-radius: 8px; }
.btn.green { background: linear-gradient(180deg, #10b981, #059669); box-shadow: 0 2px 8px rgba(5,150,105,.22); }
.btn.orange { background: linear-gradient(180deg, #f59e0b, #d97706); }

.badge { display: inline-block; border-radius: 999px; padding: 2.5px 12px; font-size: 12.5px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.badge.blue { background: var(--primary-light); color: var(--primary-dark); border-color: rgba(79,70,229,.14); }
.badge.green { background: var(--green-light); color: var(--green); border-color: rgba(5,150,105,.14); }
.badge.red { background: var(--red-light); color: var(--red); border-color: rgba(220,38,38,.14); }
.badge.orange { background: var(--orange-light); color: var(--orange); border-color: rgba(217,119,6,.16); }
.badge.gray { background: var(--gray-light); color: var(--gray); border-color: var(--border); }
.tag-model { display: inline-block; background: var(--gray-light); color: var(--gray); border-radius: 6px; padding: 0 8px; font-size: 11.5px; font-family: "SF Mono", Menlo, monospace; border: 1px solid var(--border); }
.notice { border-radius: 10px; padding: 12px 16px; font-size: 13.5px; }
.notice.warn { background: var(--orange-light); color: #92400e; border: 1px solid rgba(217,119,6,.2); }
.notice.info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid rgba(79,70,229,.16); }

/* ---- 首页 Skill 卡片 ---- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.skill-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease, border-color .18s; position: relative; overflow: hidden; }
.skill-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, #818cf8, #6366f1, #a78bfa); opacity: 0; transition: opacity .18s; }
.skill-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(99,102,241,.35); }
.skill-card:hover::before { opacity: 1; }
.skill-card.disabled { opacity: .55; }
.skill-card h3 { font-size: 17px; margin-bottom: 4px; }
.skill-card .skill-id { font-size: 12px; color: var(--gray); font-family: Menlo, monospace; margin-bottom: 10px; }
.skill-card .desc { font-size: 13.5px; color: var(--text-2); flex: 1; margin-bottom: 14px; }
.skill-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.skill-steps span { font-size: 12px; background: var(--gray-light); color: var(--text-2); padding: 2px 10px; border-radius: 999px; }
.skill-meta-row { display: flex; align-items: center; justify-content: space-between; }
.empty-state { text-align: center; padding: 70px 20px; color: var(--gray); }
.empty-state .big { font-size: 42px; margin-bottom: 12px; }
.empty-state .line-icon { color: #a5b4fc; }

/* ---- 表单 ---- */
.form-item { margin-bottom: 20px; }
.form-item label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.form-item .req { color: var(--red); margin-left: 3px; }
.form-item .help { font-size: 12.5px; color: var(--gray); margin-top: 5px; }
.form-item input[type=text], .form-item textarea, .form-item select {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 9px 13px;
  font-size: 14.5px; font-family: inherit; background: #fff; color: var(--text); transition: border-color .12s, box-shadow .12s;
}
.form-item textarea { min-height: 96px; resize: vertical; }
.form-item input:focus, .form-item textarea:focus, .form-item select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.form-item .count-hint { float: right; font-weight: 400; font-size: 12px; color: var(--gray); }

/* 上传组件 */
.uploader { border: 1.5px dashed #c9cdd8; border-radius: var(--radius); padding: 18px; text-align: center; color: var(--gray); cursor: pointer; transition: border-color .15s, background .15s; }
.uploader:hover, .uploader.drag { border-color: var(--primary); background: #f5f5ff; }
.uploader .up-icon { font-size: 26px; color: #a5b4fc; }
.up-preview { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.up-preview .thumb { position: relative; width: 92px; height: 92px; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); }
.up-preview .thumb img { width: 100%; height: 100%; object-fit: cover; }
.up-preview .thumb .rm { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1; }

.params-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---- 任务详情 ---- */
.task-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 4px; }
.task-head h2 { font-size: 20px; }
.task-sub { color: var(--gray); font-size: 12.5px; margin-bottom: 20px; font-family: Menlo, monospace; }

.steps-timeline { list-style: none; }
.steps-timeline li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.steps-timeline li:last-child { border-bottom: none; }
.step-icon { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; margin-top: 2px; background: var(--gray-light); color: var(--gray); }
.step-icon.done { background: var(--green-light); color: var(--green); }
.step-icon.running { background: var(--primary-light); color: var(--primary); animation: pulse 1.2s infinite; }
.step-icon.failed { background: var(--red-light); color: var(--red); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.step-body { flex: 1; }
.step-title { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-detail { font-size: 13px; color: var(--gray); margin-top: 3px; }
.step-detail .err { color: var(--red); }

/* 分析结论 */
.analysis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.analysis-item { background: var(--gray-light); border-radius: 9px; padding: 12px 16px; }
.analysis-item .k { font-size: 12.5px; color: var(--gray); margin-bottom: 3px; }
.analysis-item .v { font-size: 14px; }
.analysis-item ul { padding-left: 18px; }
.analysis-item li { font-size: 13.5px; }

/* 审核面板 */
.review-creative { border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.review-creative .rc-id { font-size: 12px; color: var(--gray); font-family: Menlo, monospace; margin-bottom: 10px; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.review-grid .full { grid-column: 1 / -1; }
.review-grid label { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 600; margin-bottom: 4px; }
.review-grid input, .review-grid textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 7px 11px; font-size: 14px; font-family: inherit; }
.review-grid textarea { min-height: 72px; resize: vertical; }
.review-actions { display: flex; gap: 12px; align-items: center; margin-top: 6px; flex-wrap: wrap; }

/* 产出画廊 */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.gallery .shot { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.gallery .shot img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: zoom-in; background: var(--gray-light); }
.gallery .shot-info { padding: 10px 14px; }
.gallery .shot-info .headline { font-weight: 600; font-size: 14px; }
.gallery .shot-info .subhead { font-size: 12.5px; color: var(--gray); margin-bottom: 6px; }
.gallery .shot-info .issues { font-size: 12.5px; color: var(--red); margin: 4px 0; }
.gallery .shot-info .dl { color: var(--primary); font-size: 13px; text-decoration: none; }

/* 表格 */
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; padding: 10px 14px; background: #f8f9fb; color: var(--text-2); font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--border); }
table.list td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); transition: background .1s; }
table.list tr:hover td { background: #f8f9fb; }

/* 管理页 */
.import-report { background: var(--gray-light); border-radius: 9px; padding: 14px 18px; margin-top: 12px; font-size: 13.5px; }
.import-report .ir-step { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.switch { position: relative; width: 40px; height: 22px; background: #cbd5e1; border-radius: 999px; cursor: pointer; transition: background .15s; border: none; }
.switch.on { background: var(--green); }
.switch::after { content: ''; position: absolute; top: 2.5px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on::after { left: 20px; }

.notice { border-radius: 10px; padding: 12px 18px; font-size: 13.5px; margin-bottom: 18px; }
.notice.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.notice.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.notice.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

.actions-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.mono { font-family: Menlo, Consolas, monospace; font-size: 12.5px; }

/* ---- 环境标识（测试/正式服） ---- */
.env-badge { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 10px; margin-left: 8px; vertical-align: 1px; }
.env-test { background: #fef3c7; color: #b45309; border: 1px solid #f59e0b; }
.env-prod { background: #dcfce7; color: #15803d; border: 1px solid #22c55e; }

/* ---- 登录与账户（多用户云部署） ---- */
.user-box { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-chip { font-size: 13px; color: var(--text); background: var(--gray-light); border-radius: 999px; padding: 4px 12px; }
.user-link { font-size: 12.5px; color: var(--gray); text-decoration: none; }
.user-link:hover { color: var(--primary); }
.login-wrap { display: flex; justify-content: center; padding-top: 8vh; }
.login-card { width: 350px; padding: 36px 34px; display: flex; flex-direction: column; gap: 12px; text-align: center; box-shadow: var(--shadow-lg); }
.login-logo-img { width: 62px; height: 62px; border-radius: 16px; object-fit: cover; margin: 0 auto; box-shadow: 0 0 0 4px var(--primary-glow), 0 4px 14px rgba(16,24,40,.15); }
.login-card h2 { margin: 0; font-size: 19px; }
.login-sub { color: var(--gray); font-size: 13px; margin: 0 0 8px; }
.login-card input { border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; font-size: 14.5px; font-family: inherit; transition: border-color .12s, box-shadow .12s; }
.login-card input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.login-err { color: var(--red); font-size: 13px; min-height: 18px; }
.login-card .btn { padding: 10px; font-size: 15px; }
.user-form { display: flex; gap: 8px; flex-wrap: wrap; }
.user-form input, .user-form select { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; font-family: inherit; min-width: 130px; }
.new-user-password-note { margin-top: 10px; color: var(--text-2); font-size: 13px; }
body.password-change-required .layout { pointer-events: none; }
.required-password-dialog { width: 440px; margin: auto; max-height: calc(100dvh - 32px); overflow: auto; background: var(--card); color: var(--text); }
.required-password-dialog label { display: block; margin: 16px 0 6px; font-size: 13px; font-weight: 600; }
.required-password-dialog input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); color: var(--text); font: inherit; font-size: 14px; }
.required-password-dialog input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.required-password-dialog p.required-password-hint { margin-top: 6px; font-size: 12px; }
.required-password-error { min-height: 22px; margin-top: 12px; color: var(--red); font-size: 13px; }
.required-password-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.required-password-actions .btn { font-size: 13px; }
.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-right: 4px; }

/* ---- 对话式创作（Codex 风格） ---- */
.cx-shell { display: grid; grid-template-columns: 232px 1fr; gap: 16px; height: calc(100vh - 184px); min-height: 500px; }
.cx-side { display: flex; flex-direction: column; padding: 12px !important; gap: 10px; overflow: hidden; }
.cx-new { width: 100%; }
.cx-sessions { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.cx-sitem { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: inherit; border: 1px solid transparent; }
.cx-sitem:hover { background: var(--bg); }
.cx-sitem.active { background: var(--primary-light); border-color: var(--primary); }
.cx-sprev { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-stime { font-size: 11px; color: var(--gray); }
.cx-main { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.cx-head { display: flex; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.cx-title { display: flex; align-items: center; gap: 9px; font-size: 15px; }
.cx-logo { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; letter-spacing: .5px; }
.cx-sub { color: var(--gray); font-size: 12px; font-weight: 400; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; background: var(--bg); }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg .bubble { max-width: 76%; padding: 10px 16px; border-radius: 14px; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.msg.user .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.cx-cardchip { font-size: 13px !important; background: var(--gray-light) !important; color: var(--text) !important; border: 1px dashed var(--border) !important; }
.chat-thumb { display: inline-block; width: 72px; height: 72px; object-fit: cover; border-radius: 8px; margin: 6px 4px 0 0; vertical-align: top; }
/* agent 消息：无气泡、全宽、贴左（Codex 风格） */
.msg.agent .a-body { max-width: 92%; font-size: 14.5px; word-break: break-word; }
.msg.agent .a-text p { margin: 0 0 6px; line-height: 1.65; }
.msg.agent .a-text p:last-child { margin-bottom: 0; }
.md-h { font-weight: 700; margin: 8px 0 4px; }
.md-ul { margin: 4px 0; padding-left: 20px; }
.md-ul li { margin: 2px 0; line-height: 1.6; }
.md-pre { background: #1e293b; color: #e2e8f0; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; overflow-x: auto; margin: 6px 0; font-family: Menlo, Consolas, monospace; white-space: pre; }
.msg.agent code { background: rgba(99,102,241,.12); color: #4338ca; border-radius: 4px; padding: 1px 5px; font-size: 13px; font-family: Menlo, Consolas, monospace; }
/* 流式光标与思考态 */
.cx-cursor { display: inline-block; width: 8px; height: 16px; background: var(--primary); margin-left: 2px; vertical-align: -2px; border-radius: 2px; animation: cxblink 1s steps(2) infinite; }
@keyframes cxblink { 50% { opacity: 0; } }
.cx-phase { display: inline-flex; align-items: center; gap: 8px; color: var(--gray); font-size: 13px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px; }
.cx-phase.mini { font-size: 11.5px; padding: 2px 10px; margin: 4px 0 2px; opacity: .85; }
.cx-dots::after { content: '…'; animation: cxdots 1.2s steps(4) infinite; }
@keyframes cxdots { 0% { content: ''; } 25% { content: '·'; } 50% { content: '··'; } 75% { content: '···'; } }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--primary-light); border-top-color: var(--primary); border-radius: 50%; animation: cxspin .8s linear infinite; }
@keyframes cxspin { to { transform: rotate(360deg); } }
/* 工具调用卡（tc-row） */
.tc-row { display: flex; align-items: center; gap: 8px; font-size: 13px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; margin: 4px 0; max-width: 480px; }
.tc-row .tc-ico { width: 16px; text-align: center; font-size: 12px; display: inline-flex; justify-content: center; }
.tc-row.ok .tc-ico { color: var(--green); font-weight: 700; }
.tc-row.fail { border-color: #fecaca; background: #fef2f2; }
.tc-row.fail .tc-ico { color: var(--red); font-weight: 700; }
.tc-row .tc-label { font-weight: 600; }
.tc-row .tc-detail { color: var(--gray); font-size: 11.5px; font-family: Menlo, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
/* 任务时间线卡片 */
.cx-task { margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: #fff; font-size: 13.5px; max-width: 560px; }
.cx-task.completed { border-color: #bbf7d0; }
.cx-task.failed { border-color: #fecaca; }
.cx-task.awaiting_review { border-color: #fde68a; }
.cxt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cxt-ico { font-size: 15px; }
.cxt-link { margin-left: auto; font-size: 12.5px; color: var(--primary); text-decoration: none; }
.cxt-link:hover { text-decoration: underline; }
.cxt-timeline { margin: 10px 0 2px; display: flex; flex-direction: column; gap: 6px; }
.tl-step { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--gray); }
.tl-step .tl-ico { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; border: 1.5px solid var(--border); background: #fff; flex: none; }
.tl-step.done { color: var(--text); }
.tl-step.done .tl-ico { border-color: var(--green); background: #f0fdf4; color: var(--green); font-weight: 700; }
.tl-step.running { color: var(--text); font-weight: 600; }
.tl-step.running .tl-ico { border-color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.tl-step.failed .tl-ico { border-color: var(--red); background: #fef2f2; color: var(--red); font-weight: 700; }
.tl-step .tl-dur { margin-left: auto; font-size: 11px; color: var(--gray); font-family: Menlo, Consolas, monospace; }
.cxt-plan { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.cxt-cr { display: flex; flex-direction: column; }
.cxt-cr b { font-size: 13.5px; }
.cxt-cr span { color: var(--gray); font-size: 12.5px; }
.cxt-review { margin-top: 10px; display: flex; gap: 8px; }
.cxt-fail { margin-top: 8px; color: var(--red); font-size: 12.5px; }
.ct-shots { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ct-shot { position: relative; }
.ct-shot img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; background: var(--gray-light); }
.ct-shot .badge { position: absolute; bottom: 3px; left: 3px; font-size: 10.5px; padding: 0 7px; }
.ct-shot.fail img { border-color: var(--red); }
/* 空状态 */
.cx-empty { margin: auto; text-align: center; color: var(--gray); line-height: 1.9; max-width: 460px; }
.cx-hello { font-size: 21px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.cx-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.cx-chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 7px 16px; font-size: 13px; cursor: pointer; font-family: inherit; transition: all .15s; }
.cx-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
/* 输入区 */
.chat-input-area { border-top: 1px solid var(--border); padding: 12px 16px; background: #fff; }
.chat-atts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chat-att { position: relative; }
.chat-att img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.chat-att button { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--red); color: #fff; border: none; cursor: pointer; font-size: 11px; line-height: 1; }
.chat-input-row { display: flex; gap: 10px; align-items: flex-end; }
.cx-att-btn { white-space: nowrap; }
.chat-input-row textarea { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 9px 13px; font-size: 14.5px; font-family: inherit; resize: none; max-height: 160px; line-height: 1.5; }
.chat-input-row textarea:focus { outline: 2px solid var(--primary-light); border-color: var(--primary); }
@media (max-width: 860px) { .cx-shell { grid-template-columns: 1fr; } .cx-side { display: none; } }

/* ---- 链路升级 v2：分镜确认 + 对比画廊 ---- */
.step-dur { font-size: 11.5px; color: var(--gray); background: var(--gray-light); border-radius: 5px; padding: 0 7px; }

/* 输入素材回显 */
.input-thumbs { margin-bottom: 12px; }
.input-thumbs .k { font-size: 12.5px; color: var(--gray); margin-bottom: 6px; }
.in-thumb { width: 76px; height: 76px; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); margin-right: 8px; cursor: zoom-in; background: var(--gray-light); }

/* 分镜卡 */
.storyboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.sb-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.sb-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.sb-no { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; font-size: 12px; border-radius: 6px; padding: 1px 9px; }
.sb-layout { flex: 1; font-size: 12px; color: var(--gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-mock { position: relative; background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 12px; gap: 6px; overflow: hidden; }
.m-chip { position: absolute; top: 8px; right: 8px; background: rgba(37, 99, 235, .92); color: #fff; font-size: 10.5px; border-radius: 999px; padding: 1px 9px; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-title { font-size: 17px; font-weight: 800; color: #0f172a; text-align: center; line-height: 1.3; letter-spacing: 1px; }
.m-product { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; width: 100%; }
.m-product img { max-height: 100%; max-width: 72%; object-fit: contain; border-radius: 6px; }
.m-sub { font-size: 12px; color: #475569; text-align: center; }
.sb-mock .ph { color: #94a3b8; font-size: 12px; }
.sb-fields { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.sb-fields label { font-size: 12px; color: var(--text-2); font-weight: 600; display: flex; justify-content: space-between; }
.sb-fields .cnt { font-weight: 400; color: var(--gray); }
.sb-fields input, .sb-fields textarea { width: 100%; border: 1px solid var(--border); border-radius: 7px; padding: 6px 9px; font-size: 13px; font-family: inherit; }
.sb-fields textarea { min-height: 60px; resize: vertical; }
.sb-fields input:focus, .sb-fields textarea:focus { outline: 2px solid var(--primary-light); border-color: var(--primary); }
.sb-fields details summary { font-size: 12px; color: var(--primary); cursor: pointer; user-select: none; }
.sb-fields details[disabled] summary { color: var(--gray); cursor: default; }
.review-bar { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.review-bar .spacer { flex: 1; }

/* 成图对比 */
.gallery-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.pair { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.pair.is-excluded { opacity: .55; }
.pair-img { position: relative; background: var(--gray-light); }
.pair-img img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.pair-module { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(17,24,39,.72); color: #fff;
  font-size: 11px; border-radius: 6px; padding: 2px 8px; }
/* v2.11.0 Skill 手动切换器 */
.skill-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.ss-label { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--gray); }
.ss-pill { display: inline-flex; align-items: center; border: 1px solid var(--border); background: var(--card);
  border-radius: 999px; padding: 5px 14px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  text-decoration: none; cursor: pointer; transition: all .15s; }
.ss-pill:hover { border-color: var(--primary); color: var(--primary); }
.ss-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; cursor: default; }
.fav-mark { position: absolute; top: 8px; left: 8px; color: #f59e0b; font-size: 20px; text-shadow: 0 1px 4px rgba(0,0,0,.35); }
.regen-overlay { position: absolute; inset: 0; background: rgba(15,23,42,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13.5px; gap: 6px; }
.regen-overlay .spin { display: inline-block; animation: pulse 1s infinite; }
.ex-overlay { position: absolute; inset: 0; background: rgba(220, 38, 38, .12); display: flex; align-items: flex-end; justify-content: center; color: var(--red); font-size: 12.5px; padding-bottom: 8px; font-weight: 600; }
.pair-info { padding: 10px 14px 12px; }
.pair-info .headline { font-weight: 700; font-size: 14.5px; }
.pair-info .subhead { font-size: 12.5px; color: var(--gray); margin-bottom: 5px; }
.pair-plan { font-size: 12px; color: var(--text-2); background: var(--gray-light); border-radius: 7px; padding: 5px 9px; margin-bottom: 6px; }
.meta-line { font-size: 11.5px; color: var(--gray); margin-top: 2px; }
.img-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.img-actions .mini, .mini { font-size: 12px; border: 1px solid var(--border); background: #fff; color: var(--text-2); border-radius: 7px; padding: 3px 10px; cursor: pointer; text-decoration: none; display: inline-block; font-family: inherit; }
.img-actions .mini:hover { background: var(--gray-light); }
.img-actions .mini.gold { background: #fffbeb; border-color: #fcd34d; color: #b45309; }
.img-actions .mini.danger { background: var(--red-light); border-color: #fca5a5; color: var(--red); }
.img-actions .mini:disabled { opacity: .5; cursor: not-allowed; }
.sb-head .mini.danger { font-size: 11.5px; padding: 2px 8px; }

/* 历史筛选 */
.hist-filter { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* 重生成对话框 */
.regen-dialog { background: #fff; border-radius: 14px; padding: 22px 26px; width: min(420px, 92vw); display: flex; flex-direction: column; gap: 6px; cursor: default; }
.regen-dialog h4 { font-size: 16px; margin-bottom: 2px; }
.regen-dialog .rd-tip { font-size: 12.5px; color: var(--gray); margin-bottom: 8px; }
.regen-dialog label { font-size: 12.5px; color: var(--text-2); font-weight: 600; margin-top: 6px; }
.regen-dialog input { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 14px; font-family: inherit; }
.regen-dialog input:focus { outline: 2px solid var(--primary-light); border-color: var(--primary); }
.regen-dialog .rd-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* 图片放大层 */
.lightbox { position: fixed; inset: 0; background: rgba(15,23,42,.82); display: flex; align-items: center; justify-content: center; z-index: 100; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 10px; }

@media (max-width: 640px) {
  .params-grid, .review-grid { grid-template-columns: 1fr; }
  .topbar-inner { padding: 0 14px; }
  .container { padding: 20px 14px 40px; }
}

/* ============ v2.10.0 工具页：买家秀&种草图 / 图片精修（PicSet 式） ============ */
.btn-block { width: 100%; justify-content: center; }
.tool-hero { text-align: center; padding: 26px 0 6px; }
.tool-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 16px; font-size: 13px; font-weight: 600; color: var(--text); box-shadow: var(--shadow); }
.tool-hero h1 { font-size: 26px; font-weight: 700; margin: 14px 0 8px; letter-spacing: .2px; }
.tool-hero p { color: var(--gray); font-size: 14px; max-width: 620px; margin: 0 auto; }

.tool-tabs { display: flex; gap: 10px; justify-content: center; margin: 18px 0 20px; }
.tt-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--card);
  border-radius: 999px; padding: 9px 22px; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all .15s; }
.tt-btn:hover { border-color: var(--primary); color: var(--primary); }
.tt-btn.active { background: var(--text); border-color: var(--text); color: #fff; }

.tool-layout { display: grid; grid-template-columns: 400px 1fr; gap: 18px; align-items: start; padding-bottom: 40px; }
@media (max-width: 980px) { .tool-layout { grid-template-columns: 1fr; } }
.tool-left, .tool-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* 上传/表单卡 */
.tcard { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.tcard-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tcard-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--primary-light); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tcard-tt { flex: 1; min-width: 0; }
.tcard-tt h3 { font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.tcard-tt p { font-size: 12.5px; color: var(--gray); line-height: 1.4; }
.tcard-count { font-size: 12.5px; color: var(--gray); font-variant-numeric: tabular-nums; flex: none; }
.tcard-drop { border: 1.6px dashed #d6d9e4; border-radius: 11px; padding: 18px 12px; text-align: center; cursor: pointer;
  color: var(--gray); transition: border-color .15s, background .15s; }
.tcard-drop:hover, .tcard-drop.drag { border-color: var(--primary); background: #fafaff; }
.tcard-drop .td-main { font-size: 13px; font-weight: 600; color: var(--text-2); margin-top: 6px; }
.tcard-drop .td-sub { font-size: 12px; color: var(--gray); margin-top: 2px; }
.tcard-drop.filled { padding-bottom: 10px; }
.tcard-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tcard-thumbs:empty { display: none; }
.tthumb { position: relative; width: 54px; height: 54px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.tthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tthumb .rm { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border: none; border-radius: 50%;
  background: rgba(17,24,39,.72); color: #fff; font-size: 11px; line-height: 16px; padding: 0; cursor: pointer; }

.tcard-form { display: flex; flex-direction: column; gap: 12px; }
.tcard-form textarea { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; font: inherit;
  font-size: 13.5px; resize: vertical; min-height: 64px; }
.tcard-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.tf-row { display: flex; flex-direction: column; gap: 5px; }
.tf-row label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.tf-row select { border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 13.5px; background: var(--card); }
.tf-row select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.tf-hint { font-size: 12px; color: var(--gray); }
.tool-price { font-size: 12.5px; line-height: 1.6; color: var(--gray); min-height: 20px; overflow-wrap: anywhere; }
.res-card.ba.loading { align-items: stretch; }
.res-card .res-wait { line-height: 1.6; padding: 0 12px; text-align: center; overflow-wrap: anywhere; }

/* 速度三档 */
.speed-seg { display: flex; gap: 8px; }
.ss-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--card); padding: 7px 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.ss-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.ss-btn:disabled { opacity: .55; cursor: not-allowed; }
.ss-soon { font-size: 10px; color: var(--orange); background: var(--orange-light); border-radius: 5px; padding: 1px 5px; font-weight: 600; }

/* 结果区 */
.res-head { padding-bottom: 12px; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.res-empty { grid-column: 1 / -1; text-align: center; color: #c3c8d4; padding: 60px 0; }
.res-empty p { margin-top: 10px; font-size: 13.5px; color: var(--gray); line-height: 1.7; }
.res-empty span { font-size: 12.5px; color: #a6adbd; }
.res-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; min-height: 200px; display: flex; flex-direction: column; }
.res-card img { width: 100%; display: block; cursor: zoom-in; }
.res-card.loading { align-items: center; justify-content: center; gap: 10px; }
.res-spin { width: 26px; height: 26px; border: 3px solid var(--primary-light); border-top-color: var(--primary);
  border-radius: 50%; animation: toolspin .9s linear infinite; }
@keyframes toolspin { to { transform: rotate(360deg); } }
.res-wait { font-size: 12.5px; color: var(--gray); }
.tres-acts { display: flex; justify-content: center; gap: 8px; padding: 9px; }
.tres-fail { padding: 22px 14px; text-align: center; color: var(--red); font-size: 12.5px; }
.tres-fail svg { margin-bottom: 6px; }
.res-card.done { min-height: 0; }

/* 精修前后对比 */
.res-card.ba { grid-column: 1 / -1; }
.ba-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--border); }
.ba-pair figure { margin: 0; background: var(--card); position: relative; min-height: 160px; display: flex; align-items: center; justify-content: center; }
.ba-pair img { width: 100%; height: auto; max-height: 420px; object-fit: contain; }
.ba-pair figcaption { position: absolute; top: 8px; left: 8px; background: rgba(17,24,39,.72); color: #fff; font-size: 11px;
  border-radius: 6px; padding: 2px 8px; }
@media (max-width: 640px) { .ba-pair { grid-template-columns: 1fr; } }

/* 灯箱（工具页） */
.tool-lightbox { position: fixed; inset: 0; background: rgba(15,23,42,.85); display: none; align-items: center;
  justify-content: center; z-index: 300; cursor: zoom-out; }
.tool-lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 10px; }

/* Project gallery and pinned workspace navigation */
.tabbar { position: sticky; top: 52px; z-index: 49; min-height: 48px; }
.wtab { flex: 0 0 auto; min-width: 100px; max-width: 210px; }
.projects-page { padding: 12px 0 100px; }
.project-heading { display:flex; align-items:center; gap:12px; margin-bottom:28px; }
.project-heading h2 { font-size:27px; font-weight:650; letter-spacing:-.8px; }
.project-type-heading { display:flex;align-items:center;gap:23px;flex:none; }
.project-type { border:0;background:transparent;cursor:pointer;font:inherit;letter-spacing:inherit;color:#a1a3ab;padding:4px 0;position:relative;transition:color .15s; }
.project-type.active { color:var(--text); }
.project-type:hover { color:var(--primary); }
.project-type:focus-visible { outline:2px solid var(--primary);outline-offset:6px;border-radius:3px; }
.project-type.active:after { content:'';position:absolute;height:3px;background:var(--primary);border-radius:3px;bottom:-6px;left:0;right:0; }
.project-icon { border:0; background:transparent; cursor:pointer; width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center; border-radius:9px; color:var(--text-2); }
.project-icon:hover,.project-icon[aria-pressed=true] { background:#e9e9ec; }
.project-total { color:var(--gray); font-size:12px; }
.project-filters { margin-left:auto; display:flex; gap:10px; }
.project-filters input,.project-filters select { border:1px solid var(--border); background:#fff; border-radius:9px; padding:7px 12px; font:inherit; font-size:13px; }
.project-filters #prjImportPSD { border:1px solid var(--border);background:#fff;border-radius:9px;padding:7px 14px;color:var(--primary);font:inherit;font-size:13px;white-space:nowrap;cursor:pointer; }
.project-filters #prjImportPSD:disabled { opacity:.55;cursor:wait; }
.project-gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:30px 20px; }
.project-tile { position:relative; min-width:0; }
.project-preview { aspect-ratio:16/9; width:100%; display:grid; border:1px solid #e5e5e7; border-radius:13px; overflow:hidden; background:#f5f5f5; padding:0; cursor:pointer; transition:box-shadow .15s; }
.project-preview:hover { box-shadow:0 4px 16px #00000010; }
.project-preview img { width:100%;height:100%;object-fit:cover;min-height:0;min-width:0; }
.collage-2 { grid-template-columns:1fr 1fr; gap:2px; }
.collage-3,.collage-4 { grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr;gap:2px; }
.collage-3 img:first-child { grid-row:span 2; }
.project-placeholder { align-self:center; justify-self:center; color:#c5c5cc; }
.project-create .project-preview { border-style:dashed; color:#737373; place-items:center; }
.project-info { display:flex; align-items:center; gap:5px; margin-top:9px; height:26px; }
.project-title { font-size:14px; font-weight:500; color:#303238; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
.project-create .project-title { margin-top:9px; }
.project-date { color:#92949a; font-size:12px; margin-top:2px; }
.project-more { width:25px;height:25px;font-size:20px; }
.project-check { position:absolute;top:10px;right:10px;width:19px;height:19px;accent-color:var(--primary);cursor:pointer; }
.project-tile.selected .project-preview { outline:2px solid var(--primary); outline-offset:2px; }
.project-batch { position:fixed; bottom:30px;left:calc(50% + var(--side-w)/2);transform:translateX(-50%);z-index:55;display:flex;align-items:center;gap:18px;background:white;border:1px solid var(--border);border-radius:16px;padding:13px 20px;box-shadow:var(--shadow-lg);font-size:13px; }
.project-batch[hidden] { display:none; }
.project-batch label { display:flex;align-items:center;gap:8px;white-space:nowrap; }
.project-batch button { background:none;border:0;cursor:pointer;font:inherit;white-space:nowrap; }
.project-batch button:disabled { color:#ccc;cursor:default; }
.project-pop { position:absolute;right:0;top:100%;background:white;box-shadow:var(--shadow-lg);border:1px solid var(--border);border-radius:10px;padding:5px;z-index:4;min-width:130px; }
.project-pop button { display:block;width:100%;text-align:left;border:0;background:none;padding:8px 12px;cursor:pointer; }
.project-pop button:hover { background:var(--gray-light); }
body.side-collapsed .project-batch { left:calc(50% + var(--side-w-min)/2); }
@media(min-width:1700px) { .projects-page { max-width:1650px; margin:auto; } .project-gallery { grid-template-columns:repeat(5,minmax(0,1fr)); } }
@media(max-width:700px) { .project-heading { flex-wrap:wrap; } .project-filters { width:100%;margin:0; } .project-filters input { min-width:0;flex:1; } .project-gallery { grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 12px; } .project-batch { left:50%;max-width:95vw;gap:10px; } }

.download-filters { display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-bottom:16px; }
.download-filters input[type=search],.download-filters select { border:1px solid var(--border);padding:8px 12px;border-radius:9px;background:white;font:inherit;font-size:13px; }
.download-filters .active { color:var(--primary);background:var(--primary-light); }
.download-filters label { font-size:13px; }
.download-gallery { display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:20px; }
.download-item { background:white;border:1px solid var(--border);border-radius:13px;overflow:hidden; }
.download-preview { display:flex;aspect-ratio:4/3;background:#f2f3f5;align-items:center;justify-content:center; }
.download-preview img { width:100%;height:100%;object-fit:contain; }
.download-file { color:#aaa; }
.download-info { padding:12px;display:flex;flex-direction:column;gap:4px; }
.download-info b { font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.download-info small { font-size:11px;color:var(--gray); }
.download-gallery > .empty-state { grid-column:1/-1; }

/* Preserve readable tab names; overflow is a menu, never squeezed labels. */
.tabbar { overflow:visible; padding:8px 16px 0; gap:8px; }
.wtab-list { display:flex;gap:4px;min-width:0;flex:1; }
.wtab { width:156px;min-width:156px;max-width:156px;box-sizing:border-box; }
.wtab-label { flex:1;min-width:0; }
.tabbar-actions { display:flex;gap:6px;align-items:center;padding-bottom:7px;flex:none; }
.tabs-more,.tabs-clear { border:0;background:transparent;color:var(--text-2);height:30px;padding:0 9px;border-radius:8px;cursor:pointer; }
.tabs-more:hover,.tabs-clear:hover { background:#e5e5ed; }
.tabs-overflow { position:relative; }
.tabs-dropdown { display:none;position:absolute;right:0;top:100%;width:300px;max-width:85vw;max-height:65vh;overflow:auto;padding:8px;background:white;border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow-lg); }
.tabs-overflow.open .tabs-dropdown,.tabs-overflow:focus-within .tabs-dropdown { display:block; }
.overflow-tab { display:flex;align-items:center;border-radius:7px;padding:4px; }
.overflow-tab:hover { background:#f3f3f7; }
.overflow-tab > button:first-child { display:flex;gap:9px;align-items:center;flex:1;min-width:0;white-space:normal;text-align:left;border:0;background:transparent;padding:6px;cursor:pointer;font:inherit;font-size:13px; }
@media(max-width:600px) { .tabbar { padding-left:8px;padding-right:8px; } }

.container:has(>.projects-page,>.tab-pane.active>.projects-page) { max-width:1750px; padding-left:40px;padding-right:40px; }

.fc-md .katex-display { overflow-x:auto;overflow-y:hidden;padding:8px 0; }
.fc-md .katex { font-size:1.12em; }

.fc-msg.assistant .fc-atts { justify-content:flex-start; }

/* Shared canvas-project and PS-engineering selection controls. */
.project-select-trigger{width:auto;gap:5px;padding:0 9px;font-size:12px;white-space:nowrap}
.project-operation-status{margin:-8px 0 20px;padding:10px 13px;background:#eef6f0;border:1px solid #dceade;border-radius:9px;font-size:13px;color:#3d6450;overflow-wrap:anywhere}
.project-operation-status.is-error{background:#fff7ee;border-color:#f2dec2;color:#8a5a22}
.project-operation-status[hidden]{display:none}
.projects-page[aria-busy=true] .project-gallery{opacity:.7}
.project-preview:focus-visible,.project-batch button:focus-visible{outline:2px solid var(--primary);outline-offset:3px}
.project-batch{max-width:calc(100vw - var(--side-w) - 32px);flex-wrap:wrap;justify-content:center}
.project-batch button:hover:not(:disabled){color:var(--primary)}
.project-batch #prjDelete{color:#c44444}
.project-confirm{border:1px solid var(--border);border-radius:16px;padding:24px;max-width:min(440px,calc(100vw - 32px));color:var(--text);box-shadow:var(--shadow-lg);font-family:inherit}
.project-confirm::backdrop{background:#10182866;backdrop-filter:blur(2px)}
.project-confirm h3{font-size:18px;margin:0 0 12px;font-weight:600}
.project-confirm p{font-size:14px;line-height:1.7;color:var(--text-2);overflow-wrap:anywhere;margin:0}
.project-confirm-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}
.project-confirm-actions button{border:1px solid var(--border);border-radius:9px;padding:9px 18px;background:white;font:inherit;cursor:pointer}
.project-confirm-actions [data-confirm]{background:#d34747;border-color:#d34747;color:white}
.project-confirm-actions button:focus-visible{outline:2px solid var(--primary);outline-offset:3px}
@media(max-width:700px){.project-batch{max-width:95vw}.project-heading h2{font-size:23px}.project-type-heading{gap:18px}.project-select-trigger{margin-left:auto}}
