/* ============================================================
   shell.css — 工作台壳（暗色软件工具风格）
   左侧：主菜单（AI视频/AI制图/发现灵感）+ 功能区（商品库/我的资产/我的作品）
   顶部：快捷创作入口（视频制作/爆款复刻/视频高清/制图）+ 积分/会员/设置/头像
   ============================================================ */

/* ================= 壳布局 ================= */
.shell { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }

/* ================= 顶栏（位于右侧主列顶部：快捷创作入口 + 积分/会员/设置/头像） ================= */
.shell-topbar {
  position: relative; z-index: var(--z-nav);
  flex: none;
  height: var(--shell-topbar-h);
  display: flex; align-items: center; gap: var(--sp-5);
  padding: 0 var(--sp-4) 0 var(--sp-5);
  background: rgba(12, 15, 22, 0.82);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .shell-topbar { background: rgba(255, 255, 255, 0.85); }

/* 顶部快捷创作入口：头部菜单 = 左侧主菜单的子页，按分区（data-group）显隐 */
.top-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
/* 视频分区只显示视频三子页；制图分区只显示制图组；作品分区只显示作品类型组 */
.top-nav[data-group="video"] > [data-group="image"],
.top-nav[data-group="video"] > [data-group="works"],
.top-nav[data-group="image"] > [data-group="video"],
.top-nav[data-group="image"] > [data-group="works"],
.top-nav[data-group="works"] > [data-group="video"],
.top-nav[data-group="works"] > [data-group="image"] { display: none !important; }
.top-nav a {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 15px;
  font-size: var(--fs-body); font-weight: 550; color: var(--text-secondary);
  border-radius: var(--r-sm); cursor: pointer;
  transition: all var(--dur-fast) ease;
}
.top-nav a:hover { color: var(--text-primary); background: var(--bg-hover); }
.top-nav a.is-active { color: var(--text-primary); background: var(--bg-active); }
.top-nav a.is-active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px;
  height: 2px; border-radius: 1px; background: var(--brand-grad);
}
.top-nav a svg { width: 15px; height: 15px; }
/* AI 视频分组：内容形态分类动态渲染的导航项容器（与制图下拉同级，共享分区显隐规则） */
.top-nav-forms { display: flex; align-items: center; gap: 2px; }
/* 后台上传的小图标：与内联 SVG 同尺寸，圆角裁切防白底图标突兀 */
.top-nav a .top-nav-ico { width: 15px; height: 15px; object-fit: contain; border-radius: 3px; }

/* 顶栏右侧：积分 / 会员 / 设置 / 头像（margin-left:auto 保证 top-nav 隐藏时仍靠右，不塌缩到 logo 旁） */
.top-right { display: flex; align-items: center; gap: var(--sp-3); flex: none; margin-left: auto; }

/* 积分徽章（hover 弹层） */
.coin-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.14), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--r-full);
  font-size: var(--fs-sm); font-weight: 650; color: var(--warning);
  cursor: pointer; transition: all var(--dur-fast) ease;
}
.coin-chip:hover { box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12); }
.coin-chip svg { width: 15px; height: 15px; }
.coin-chip .recharge {
  margin-left: 4px; padding: 2px 8px;
  font-size: 11px; font-weight: 600; color: #fff;
  background: var(--brand-grad); border-radius: var(--r-full);
}
.coin-pop {
  top: calc(100% + 8px); right: 0; min-width: 220px;
}
.coin-pop .row { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px; font-size: var(--fs-sm); color: var(--text-secondary); }
.coin-pop .row b { color: var(--text-primary); font-size: var(--fs-body); }
.coin-pop .btn { margin-top: var(--sp-2); height: 34px; width: 100%; }

/* 会员徽章 */
.vip-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px;
  background: linear-gradient(135deg, rgba(124, 124, 255, 0.16), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(124, 124, 255, 0.32);
  border-radius: var(--r-full);
  font-size: var(--fs-sm); font-weight: 650;
  background-image: linear-gradient(135deg, rgba(124,124,255,0.16), rgba(168,85,247,0.1)), var(--brand-grad);
  background-origin: border-box; background-clip: padding-box, border-box;
  /* 渐变底层透过半透明叠加层呈实心紫色，文字/图标固定白色（--text-primary 亮色下近黑，紫底上刺眼不协调） */
  color: #fff;
  cursor: pointer; transition: all var(--dur-fast) ease;
}
.vip-chip:hover { box-shadow: var(--glow-brand); }
.vip-chip svg { width: 14px; height: 14px; color: rgba(255, 255, 255, 0.92); }

/* 任务进行中角标 */
.task-dot {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  color: var(--text-secondary); background: var(--bg-surface); border: 1px solid var(--border);
  cursor: pointer; transition: all var(--dur-fast) ease;
}
.task-dot:hover { color: var(--brand-400); border-color: var(--brand-500); }
.task-dot svg { width: 16px; height: 16px; }
.task-dot .n {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; color: #fff;
  background: var(--brand-grad); border-radius: var(--r-full);
}
.task-dot.spin svg { animation: rot 1.2s linear infinite; color: var(--brand-400); }
@keyframes rot { to { transform: rotate(360deg); } }

/* 头像 */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm); font-weight: 700; cursor: pointer; flex: none;
  box-shadow: 0 0 0 2px var(--bg-page), 0 0 0 3.5px var(--border-strong);
}
.user-pop { top: calc(100% + 8px); right: 0; min-width: 200px; }
.user-pop .u-head { padding: 4px 6px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-pop .u-name { font-weight: 650; color: var(--text-primary); }
.user-pop .u-sub { font-size: var(--fs-caption); color: var(--text-tertiary); margin-top: 2px; }
.user-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 36px; padding: 0 8px;
  font-size: var(--fs-sm); color: var(--text-secondary);
  background: transparent; border: none; border-radius: var(--r-sm); cursor: pointer; text-align: left;
}
.user-pop button:hover { color: var(--text-primary); background: var(--bg-hover); }
.user-pop button svg { width: 15px; height: 15px; }

/* ================= 主体（侧栏 + 内容） ================= */
.shell-body { flex: 1; display: flex; min-height: 0; }

/* ---------- 侧栏（通顶：logo 位于侧栏头部，与右侧顶栏同高对齐） ---------- */
.shell-side {
  width: var(--shell-sidebar-w); flex: none;
  display: flex; flex-direction: column;
  padding: 0 var(--sp-3) var(--sp-4);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  transition: width var(--dur-base) var(--ease-out);
  overflow: hidden auto;
}
.shell-side .shell-logo {
  flex: none;
  height: var(--shell-topbar-h);
  margin: 0 calc(var(--sp-3) * -1) var(--sp-3);
  padding: 0 var(--sp-5);
  display: flex; align-items: center; gap: 9px;
  font-size: 16px; font-weight: 750; letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
}
.shell-logo img { width: 26px; height: 26px; }
.shell.is-mini .shell-side { width: var(--shell-sidebar-w-mini); }
.shell.is-mini .shell-logo { justify-content: center; padding: 0; }
.shell.is-mini .shell-logo span { display: none; }

.side-group { margin-bottom: var(--sp-6); }
.side-group-title {
  padding: 0 var(--sp-3); margin-bottom: var(--sp-2);
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.side-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  height: 46px; padding: 0 var(--sp-3); margin-bottom: 6px;
  font-size: var(--fs-body); font-weight: 520; color: var(--text-secondary);
  border: none; border-radius: var(--r-sm); background: transparent;
  cursor: pointer; text-align: left; width: 100%;
  transition: all var(--dur-fast) ease;
  white-space: nowrap;
}
.side-item:hover { color: var(--text-primary); background: var(--bg-hover); }
.side-item.is-active { color: var(--text-primary); background: var(--brand-soft); font-weight: 600; }
.side-item.is-active::before {
  content: ""; position: absolute; left: -12px; top: 50%; translate: 0 -50%;
  width: 3px; height: 20px; border-radius: 2px; background: var(--brand-grad);
}
.side-item svg { width: 18px; height: 18px; flex: none; color: var(--text-tertiary); transition: color var(--dur-fast) ease; }
.side-item:hover svg, .side-item.is-active svg { color: var(--brand-400); }
/* 右侧箭头（替代数字标）：hover/激活高亮并轻微右移，暗示「可进入」 */
.side-item .side-arrow {
  margin-left: auto; width: 14px; height: 14px; flex: none;
  color: var(--text-tertiary); opacity: 0.7;
  transition: color var(--dur-fast) ease, opacity var(--dur-fast) ease, translate var(--dur-fast) ease;
}
.side-item:hover .side-arrow { color: var(--brand-400); opacity: 1; translate: 2px 0; }
.side-item.is-active .side-arrow { color: var(--brand-400); opacity: 1; }

/* 折叠态：隐藏文字 */
.shell.is-mini .side-item span,
.shell.is-mini .side-group-title,
.shell.is-mini .side-item .side-arrow { display: none; }
.shell.is-mini .side-item { justify-content: center; padding: 0; gap: 0; }
.shell.is-mini .side-item.is-active::before { left: -6px; }

/* 侧栏底部：消息 / 主题切换 / 折叠 */
.side-footer { margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.side-foot-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--sp-3); }
.side-ico-btn {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  height: 42px; padding: 0 var(--sp-3);
  font-size: var(--fs-body); font-weight: 520; color: var(--text-secondary);
  background: transparent; border: none; border-radius: var(--r-sm);
  cursor: pointer; text-align: left; width: 100%;
  transition: all var(--dur-fast) ease;
  white-space: nowrap;
}
.side-ico-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.side-ico-btn svg { width: 18px; height: 18px; flex: none; color: var(--text-tertiary); transition: color var(--dur-fast) ease; }
.side-ico-btn:hover svg { color: var(--brand-400); }
.side-ico-btn .badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 10px; font-weight: 700; line-height: 18px; text-align: center; font-style: normal;
  color: #fff; background: var(--brand-grad); border-radius: var(--r-full);
}
/* 主题按钮：月亮/太阳随主题显隐 */
#btnTheme .ico-sun { display: none; }
#btnTheme .ico-moon { display: block; }
[data-theme="light"] #btnTheme .ico-sun { display: block; }
[data-theme="light"] #btnTheme .ico-moon { display: none; }
/* 折叠态 */
.shell.is-mini .side-ico-btn { justify-content: center; padding: 0; gap: 0; }
.shell.is-mini .side-ico-btn span, .shell.is-mini .side-ico-btn .badge { display: none; }
.side-collapse {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 38px;
  font-size: var(--fs-sm); color: var(--text-tertiary);
  background: transparent; border: 1px dashed var(--border-strong); border-radius: var(--r-sm);
  cursor: pointer; transition: all var(--dur-fast) ease;
}
.side-collapse:hover { color: var(--brand-400); border-color: var(--brand-500); }
.side-collapse svg { width: 15px; height: 15px; transition: transform var(--dur-base) var(--ease-out); }
.shell.is-mini .side-collapse svg { transform: rotate(180deg); }
.shell.is-mini .side-collapse span { display: none; }
.side-version {
  text-align: center; padding: 6px 0 2px;
  font-size: 10.5px; font-weight: 500; letter-spacing: .8px;
  color: var(--text-tertiary); font-variant-numeric: tabular-nums;
}
.shell.is-mini .side-version { display: none; }

/* ---------- 内容区 ---------- */
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view { flex: 1; overflow-y: auto; animation: viewIn var(--dur-base) var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 面板通用头 */
.view-pad { padding: var(--sp-6) var(--sp-6) var(--sp-8); }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.view-head h1 { font-size: 24px; font-weight: 750; letter-spacing: -0.01em; }
.view-head .sub { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-tertiary); }

/* 概览统计条 */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-6); }
.stat-cell { padding: var(--sp-4) var(--sp-5); }
.stat-cell .k { font-size: var(--fs-caption); color: var(--text-tertiary); margin-bottom: 6px; }
.stat-cell .v { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }
.stat-cell .v small { font-size: var(--fs-caption); font-weight: 500; color: var(--text-tertiary); margin-left: 4px; }
.stat-cell .trend { margin-top: 6px; font-size: var(--fs-caption); color: var(--success); }

/* ================= 质感升级（工作台按钮/选项已全局生效） ================= */

/* 响应式 */
@media (max-width: 1024px) {
  .shell-side { position: fixed; top: 0; bottom: 0; left: 0; z-index: calc(var(--z-nav) - 1); transform: translateX(-100%); transition: transform var(--dur-base) var(--ease-out); }
  .shell.side-open .shell-side { transform: none; box-shadow: var(--shadow-lg); }
  .top-nav a span { display: none; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}
