/* ============================================================================
 * 本草智研 v16 · Botanical Precision Design System & Multi-Branch Workbench Portal
 * 设计系统规范：色彩令牌、排版阶梯、8px 网格间距、卡片微动效、五大独立走向页
 * 彻底告别“上下堆叠划来划去”的滚屏疲劳，同时 100% 兼容 v1~v15 全部能力。
 * ============================================================================ */

:root {
  --ds-bg: #f6f5ef;
  --ds-surface: #ffffff;
  --ds-surface-soft: #f9faf7;
  --ds-ink: #0f2420;
  --ds-ink-2: #3b524c;
  --ds-muted: #667b75;
  --ds-line: rgba(15, 92, 84, 0.11);
  --ds-line-strong: rgba(15, 92, 84, 0.22);
  --ds-primary: #072f29;
  --ds-primary-2: #0f5c54;
  --ds-emerald: #10b981;
  --ds-gold: #c9922c;
  --ds-gold-soft: rgba(201, 146, 44, 0.12);
  --ds-radius-lg: 20px;
  --ds-radius-xl: 26px;
  --ds-shadow-1: 0 2px 10px rgba(7, 47, 41, 0.04), 0 1px 2px rgba(7, 47, 41, 0.03);
  --ds-shadow-2: 0 12px 32px -10px rgba(7, 47, 41, 0.10), 0 2px 6px rgba(7, 47, 41, 0.04);
  --ds-shadow-3: 0 24px 56px -16px rgba(7, 47, 41, 0.18);
  --ds-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 路由视图编排：让每一页只做一件事，零冗余堆叠 ---------- */
body[data-v16-mode="portal"] #leftSidebar {
  display: none !important;
}
body[data-v16-mode="portal"] #leftSidebar + div,
body[data-v16-mode="portal"] > div.lg\:pl-72 {
  padding-left: 0 !important;
}
body[data-v16-mode="portal"] #rightVisualDock,
body[data-v16-mode="portal"] #stepperZoneBar,
body[data-v16-mode="portal"] #resumeProgressBanner,
body[data-v16-mode="portal"] #mobStepBar,
body[data-v16-mode="portal"] #btnOpenLeftMobile,
body[data-v16-mode="portal"] #btnToggleVisualDock {
  display: none !important;
}
body[data-v16-mode="portal"] .studio-layout-grid {
  display: block !important;
}
body[data-v16-mode="portal"] #studioMainCol {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

/* 在非 AI 走向页中，隐藏原本永远霸占顶部的 AI 巨型命令栏，释放 300px+ 首屏空间 */
body[data-v16-route="home"] #qwenCommandBar,
body[data-v16-route="home"] #aiPlanShowcase,
body[data-v16-route="bank"] #qwenCommandBar,
body[data-v16-route="bank"] #aiPlanShowcase,
body[data-v16-route="diy"] #qwenCommandBar,
body[data-v16-route="diy"] #aiPlanShowcase,
body[data-v16-route="workflow"] #qwenCommandBar,
body[data-v16-route="hub"] #qwenCommandBar {
  display: none !important;
}
/* 但在 workflow 中如果刚由 AI 生成方案并主动展开了 aiPlanShowcase，允许保留查看 */
body[data-v16-route="home"] .wpanel,
body[data-v16-route="bank"] .wpanel,
body[data-v16-route="ai"] .wpanel {
  display: none !important;
}

/* 在纯净 6 步工坊中，收起旧版 Step 1 重复的双重 Hero 堆叠与冗余工具条，一屏直达核心内容 */
body[data-v16-route="workflow"] #welcomePortalHero,
body[data-v16-route="workflow"] #v15Mini,
body[data-v16-route="workflow"] #v16WorkflowBar,
body[data-v16-route="workflow"] #wpanel-1 > div:first-of-type {
  display: none !important;
}

/* 顶栏去噪：在首页/题库/AI/DIY 走向页中，隐藏冗余的 PORTAL/总览首页 文字标签（当前激活导航胶囊已标明页面） */
body[data-v16-mode="portal"] #headerStepTag,
body[data-v16-mode="portal"] #headerTitle {
  display: none !important;
}

/* 彻底消除导航栏下方丑陋的 Windows 横向滚动条，并紧凑单排排布 */
#workspaceZoneBar {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  padding: 4px !important;
  gap: 3px !important;
  border-radius: 15px !important;
}
#workspaceZoneBar::-webkit-scrollbar {
  display: none !important;
  height: 0 !important;
}
#workspaceZoneBar .zone-tab,
#workspaceZoneBar .v16-route-tab {
  padding: 6px 11px !important;
  font-size: 0.79rem !important;
  border-radius: 10px !important;
  gap: 5px !important;
}
#workspaceZoneBar .v15-new-badge {
  display: none !important;
}

/* 顶栏右侧工具按钮：告别五颜六色彩虹拼凑，统一高级磨砂玻璃质感 */
header button#btnOpenCmdPalette,
header button#btnOpenCompareTop,
header button#btnOpenQwenCfgTop,
header button#btnToggleVisualDock,
header button#btnFontScale,
header button#btnToggleDarkLab,
header button#btnOpenFeedbackTop,
header button#btnResetTopic {
  background: rgba(255, 255, 255, 0.85) !important;
  background-image: none !important;
  border: 1px solid rgba(15, 92, 84, 0.14) !important;
  color: #1f3c36 !important;
  box-shadow: 0 1px 2px rgba(7, 47, 41, 0.04) !important;
  height: 32px;
  border-radius: 10px !important;
  font-weight: 700 !important;
  transition: all 0.18s var(--ds-ease) !important;
}
header button#btnOpenCmdPalette:hover,
header button#btnOpenCompareTop:hover,
header button#btnOpenQwenCfgTop:hover,
header button#btnToggleVisualDock:hover,
header button#btnFontScale:hover,
header button#btnToggleDarkLab:hover,
header button#btnOpenFeedbackTop:hover,
header button#btnResetTopic:hover {
  background: #ffffff !important;
  border-color: rgba(15, 92, 84, 0.42) !important;
  color: #062923 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -4px rgba(7, 47, 41, 0.16) !important;
}
/* 顶栏已有独立「AI 设计」主导航页，精简重复的「智能助手」按钮仅作为轻量服务状态图标按钮 */
header button#btnOpenQwenCfgTop {
  border-color: rgba(201, 146, 44, 0.32) !important;
}

/* Step 1 药材卡片统一整齐质感与标题截断 */
#step1HerbCards .pick-card {
  min-height: 122px;
  border-color: rgba(15, 92, 84, 0.12) !important;
  box-shadow: 0 1px 3px rgba(7, 47, 41, 0.03);
  transition: transform 0.18s var(--ds-ease), box-shadow 0.18s var(--ds-ease), border-color 0.18s ease !important;
}
#step1HerbCards .pick-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 92, 84, 0.36) !important;
  box-shadow: 0 8px 20px -8px rgba(7, 47, 41, 0.14);
}
#step1HerbCards .pick-card .text-base {
  font-size: 0.94rem !important;
  line-height: 1.35 !important;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 独立走向页容器动画 */
.v16-page {
  animation: v16Enter 0.34s var(--ds-ease) both;
}
.v16-page.hidden {
  display: none !important;
}
@keyframes v16Enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 顶栏导航系统精炼美化 ---------- */
.v16-brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border-radius: 13px;
  background: rgba(7, 47, 41, 0.05);
  border: 1px solid var(--ds-line);
  color: var(--ds-primary);
  font-weight: 850;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s var(--ds-ease);
  white-space: nowrap;
}
.v16-brand-btn:hover {
  background: rgba(15, 92, 84, 0.11);
  border-color: var(--ds-line-strong);
}
.v16-brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: linear-gradient(135deg, #062923, #0f6b5d);
  color: #f4d38c;
  display: inline-grid;
  place-items: center;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(7, 47, 41, 0.2);
}

.v16-route-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 11px;
  font-size: 0.8rem;
  font-weight: 750;
  color: var(--ds-ink-2);
  background: transparent;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s var(--ds-ease);
}
.v16-route-tab:hover {
  background: rgba(15, 92, 84, 0.07);
  color: var(--ds-primary);
}
.v16-route-tab.active {
  background: linear-gradient(135deg, #072f29, #0f5c54);
  color: #ffffff !important;
  box-shadow: 0 8px 18px -6px rgba(7, 47, 41, 0.36);
}
.v16-route-pill {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(15, 92, 84, 0.1);
  color: var(--ds-primary-2);
}
.v16-route-tab.active .v16-route-pill {
  background: rgba(255, 255, 255, 0.18);
  color: #fef3c7;
}

/* 工作台内简洁上下文面包屑条（替代笨重堆叠） */
.v16-wf-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--ds-line);
  box-shadow: var(--ds-shadow-1);
}
.v16-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--ds-muted);
  flex-wrap: wrap;
}
.v16-crumb button {
  color: var(--ds-primary-2);
  font-weight: 750;
  cursor: pointer;
  background: transparent;
}
.v16-crumb button:hover { text-decoration: underline; }
.v16-crumb strong { color: var(--ds-ink); font-weight: 850; }
.v16-wf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.v16-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 11px;
  font-size: 0.76rem;
  font-weight: 750;
  border: 1px solid var(--ds-line);
  background: var(--ds-surface-soft);
  color: var(--ds-ink);
  cursor: pointer;
  transition: all 0.18s var(--ds-ease);
}
.v16-chip-btn:hover {
  border-color: var(--ds-primary-2);
  background: rgba(15, 92, 84, 0.06);
  color: var(--ds-primary);
}
.v16-chip-btn.gold {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: rgba(201, 146, 44, 0.35);
  color: #78350f;
}

/* ============================================================================
 * 1. 完整落地页模板 (HOME PORTAL): Hero + 三大走向网格 + 特性 Bento + CTA + 页脚
 * ============================================================================ */
.v16-home-wrap {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-bottom: 12px;
}

/* Hero 主视觉区 */
.v16-hero {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: clamp(26px, 3.6vw, 48px);
  color: #ffffff;
  background:
    radial-gradient(circle at 86% 12%, rgba(212, 155, 47, 0.24), transparent 36%),
    radial-gradient(circle at 14% 92%, rgba(16, 185, 129, 0.22), transparent 42%),
    linear-gradient(128deg, #041d19 0%, #07332c 52%, #0e594f 100%);
  box-shadow: var(--ds-shadow-3);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.v16-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom right, rgba(0,0,0,0.45), transparent 72%);
  pointer-events: none;
}
.v16-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 28px;
  align-items: center;
}
.v16-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.76rem;
  font-weight: 750;
  color: #d1fae5;
  letter-spacing: 0.02em;
}
.v16-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.22);
}
.v16-hero h2 {
  margin: 16px 0 12px;
  font-size: clamp(1.8rem, 3.1vw, 2.7rem);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: #ffffff;
}
.v16-hero h2 em {
  font-style: normal;
  background: linear-gradient(90deg, #fde68a, #6ee7b7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.v16-hero-desc {
  margin: 0;
  max-width: 600px;
  font-size: 0.94rem;
  line-height: 1.72;
  color: rgba(226, 245, 239, 0.86);
}
.v16-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.v16-btn-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 15px;
  background: linear-gradient(135deg, #f5cb6c, #d99b26);
  color: #05211d;
  font-size: 0.9rem;
  font-weight: 850;
  border: none;
  cursor: pointer;
  box-shadow: 0 12px 28px -8px rgba(217, 155, 38, 0.55);
  transition: transform 0.2s var(--ds-ease), box-shadow 0.2s var(--ds-ease);
}
.v16-btn-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -8px rgba(217, 155, 38, 0.7);
}
.v16-btn-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 750;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s var(--ds-ease);
}
.v16-btn-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.19);
  transform: translateY(-2px);
}
.v16-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.v16-hero-stat strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}
.v16-hero-stat span {
  font-size: 0.76rem;
  color: rgba(209, 250, 229, 0.76);
}

/* Hero 右侧：当前工作台实时续接预览卡 */
.v16-hero-card {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 24px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.v16-hero-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.v16-hero-card-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.v16-hero-card-title {
  font-size: 1.15rem;
  font-weight: 850;
  color: #ffffff;
  margin: 0;
}
.v16-hero-card-sub {
  font-size: 0.8rem;
  color: rgba(226, 245, 239, 0.8);
  line-height: 1.55;
  margin: 0;
}
.v16-hero-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.v16-hero-mini-cell {
  background: rgba(4, 29, 25, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px;
}
.v16-hero-mini-cell span {
  display: block;
  font-size: 0.7rem;
  color: rgba(209, 250, 229, 0.72);
}
.v16-hero-mini-cell strong {
  display: block;
  margin-top: 3px;
  font-size: 0.88rem;
  font-weight: 850;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v16-hero-card-btns {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.v16-hero-resume-btn {
  padding: 11px 14px;
  border-radius: 13px;
  background: #ffffff;
  color: #062923;
  font-size: 0.84rem;
  font-weight: 850;
  border: none;
  cursor: pointer;
  transition: transform 0.18s var(--ds-ease), background 0.18s ease;
}
.v16-hero-resume-btn:hover { background: #ecfdf5; transform: translateY(-1px); }
.v16-hero-pulse-btn {
  padding: 11px 13px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fde68a;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}
.v16-hero-pulse-btn:hover { background: rgba(255, 255, 255, 0.2); }

/* 区块标题规范 */
.v16-sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.v16-sec-kicker {
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ds-gold);
}
.v16-sec-head h3 {
  margin: 4px 0 0;
  font-size: 1.42rem;
  font-weight: 900;
  color: var(--ds-ink);
  letter-spacing: -0.02em;
}
.v16-sec-head p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ds-muted);
}

/* 三大核心走向分支卡片网格 */
.v16-branch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.v16-branch-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  border-radius: 24px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-line);
  box-shadow: var(--ds-shadow-1);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.26s var(--ds-ease), box-shadow 0.26s var(--ds-ease), border-color 0.26s ease;
}
.v16-branch-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--branch-accent, #0f5c54);
}
.v16-branch-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--ds-shadow-2);
  border-color: var(--branch-accent, #0f5c54);
}
.v16-branch-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: var(--branch-bg, #ecfdf5);
  border: 1px solid var(--branch-border, rgba(15, 92, 84, 0.16));
}
.v16-branch-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.v16-branch-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--branch-bg, #ecfdf5);
  color: var(--branch-accent, #0f5c54);
}
.v16-branch-card h4 {
  margin: 14px 0 6px;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--ds-ink);
}
.v16-branch-card p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--ds-muted);
}
.v16-branch-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.v16-branch-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ds-ink-2);
  font-weight: 600;
}
.v16-branch-list li::before {
  content: '✓';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 900;
  background: var(--branch-bg, #ecfdf5);
  color: var(--branch-accent, #0f5c54);
  flex: none;
}
.v16-branch-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--ds-line);
  font-size: 0.84rem;
  font-weight: 850;
  color: var(--branch-accent, #0f5c54);
}
.v16-branch-card:hover .v16-branch-arrow {
  transform: translateX(4px);
}
.v16-branch-arrow {
  transition: transform 0.2s var(--ds-ease);
}

/* 特性展示 Bento Grid */
.v16-bento-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.v16-bento-card {
  padding: 20px;
  border-radius: 20px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-line);
  box-shadow: var(--ds-shadow-1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.22s var(--ds-ease);
}
.v16-bento-card:hover {
  transform: translateY(-3px);
  border-color: var(--ds-line-strong);
  box-shadow: var(--ds-shadow-2);
}
.v16-bento-icon {
  font-size: 22px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--ds-surface-soft);
  border: 1px solid var(--ds-line);
  display: grid;
  place-items: center;
}
.v16-bento-card h5 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 850;
  color: var(--ds-ink);
}
.v16-bento-card p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--ds-muted);
  flex: 1;
}
.v16-bento-link {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ds-primary-2);
}

/* 首页底部行动号召 CTA 横幅 */
.v16-cta-banner {
  border-radius: 26px;
  padding: 28px 32px;
  background: linear-gradient(115deg, #eef7f3 0%, #fbf7eb 100%);
  border: 1px solid rgba(15, 92, 84, 0.16);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.v16-cta-banner h4 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--ds-ink);
}
.v16-cta-banner p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ds-muted);
}
.v16-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================================================
 * 2. 题库走向页 (BANK DIRECTORY PAGE)
 * ============================================================================ */
.v16-subhero {
  border-radius: 24px;
  padding: 24px 28px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-line);
  box-shadow: var(--ds-shadow-1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.v16-subhero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.v16-subhero h2 {
  margin: 4px 0 4px;
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--ds-ink);
  letter-spacing: -0.02em;
}
.v16-subhero p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ds-muted);
}
.v16-bank-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.v16-search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.v16-search-wrap input {
  width: 100%;
  padding: 11px 16px 11px 40px;
  border-radius: 14px;
  background: var(--ds-surface-soft);
  border: 1px solid var(--ds-line-strong);
  font-size: 0.86rem;
  color: var(--ds-ink);
  transition: all 0.2s ease;
}
.v16-search-wrap input:focus {
  background: var(--ds-surface);
  border-color: var(--ds-primary-2);
  box-shadow: 0 0 0 4px rgba(15, 92, 84, 0.1);
  outline: none;
}
.v16-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ds-muted);
  font-size: 15px;
  pointer-events: none;
}
.v16-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.v16-filter-pill {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--ds-line);
  background: var(--ds-surface-soft);
  color: var(--ds-ink-2);
  cursor: pointer;
  transition: all 0.18s ease;
}
.v16-filter-pill:hover {
  border-color: var(--ds-primary-2);
  color: var(--ds-primary);
}
.v16-filter-pill.active {
  background: var(--ds-primary);
  border-color: var(--ds-primary);
  color: #ffffff;
}

.v16-bank-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 20px;
  align-items: start;
}
.v16-bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 12px;
}
.v16-topic-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  background: var(--ds-surface);
  border: 1.5px solid var(--ds-line);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s var(--ds-ease);
}
.v16-topic-card:hover {
  transform: translateY(-2px);
  border-color: var(--ds-primary-2);
  box-shadow: var(--ds-shadow-2);
}
.v16-topic-card.selected {
  border-color: var(--ds-primary-2);
  background: linear-gradient(155deg, #f2fbf7 0%, #ffffff 100%);
  box-shadow: 0 0 0 3px rgba(15, 92, 84, 0.12);
}
.v16-topic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.v16-topic-herb {
  font-size: 1rem;
  font-weight: 900;
  color: var(--ds-ink);
}
.v16-topic-cat {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
  background: rgba(15, 92, 84, 0.08);
  color: var(--ds-primary-2);
  white-space: nowrap;
}
.v16-topic-comp {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ds-ink-2);
}
.v16-topic-note {
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--ds-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.v16-topic-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px dashed var(--ds-line);
  font-size: 0.74rem;
  color: var(--ds-muted);
}

/* 右侧固定药材档案预览卡 */
.v16-bank-preview {
  position: sticky;
  top: 88px;
  border-radius: 22px;
  padding: 22px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-line-strong);
  box-shadow: var(--ds-shadow-2);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.v16-preview-block {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--ds-surface-soft);
  border: 1px solid var(--ds-line);
}
.v16-preview-block label {
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  color: var(--ds-primary-2);
  margin-bottom: 4px;
}
.v16-preview-block p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.62;
  color: var(--ds-ink-2);
}
.v16-preview-layman {
  background: linear-gradient(135deg, #fffbeb, #fef9e7);
  border-color: rgba(201, 146, 44, 0.35);
}
.v16-preview-layman label { color: #92400e; }
.v16-preview-layman p { color: #78350f; }

/* ============================================================================
 * 3. AI 设计走向页 (AI STUDIO PAGE) & 4. DIY 走向页 (DIY HUB PAGE)
 * ============================================================================ */
.v16-seg-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(15, 92, 84, 0.06);
  border: 1px solid var(--ds-line);
}
.v16-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ds-ink-2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ds-ease);
}
.v16-seg-btn:hover { color: var(--ds-primary); background: rgba(255, 255, 255, 0.6); }
.v16-seg-btn.active {
  background: var(--ds-surface);
  color: var(--ds-primary);
  box-shadow: 0 4px 12px rgba(7, 47, 41, 0.1);
}

.v16-ai-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.v16-ai-tpl {
  padding: 15px 16px;
  border-radius: 16px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-line);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s var(--ds-ease);
}
.v16-ai-tpl:hover {
  transform: translateY(-2px);
  border-color: var(--ds-primary-2);
  box-shadow: var(--ds-shadow-1);
}
.v16-ai-tpl span {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 92, 84, 0.08);
  color: var(--ds-primary-2);
}
.v16-ai-tpl strong {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--ds-ink);
}
.v16-ai-tpl p {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--ds-muted);
}

.v16-diy-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.v16-tool-card {
  padding: 20px;
  border-radius: 20px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  transition: all 0.22s var(--ds-ease);
}
.v16-tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--ds-primary-2);
  box-shadow: var(--ds-shadow-2);
}
.v16-tool-card h4 { margin: 4px 0 0; font-size: 0.96rem; font-weight: 850; color: var(--ds-ink); }
.v16-tool-card p { margin: 0; font-size: 0.8rem; line-height: 1.6; color: var(--ds-muted); flex: 1; }
.v16-tool-card span.v16-tool-go { font-size: 0.78rem; font-weight: 800; color: var(--ds-primary-2); margin-top: 4px; }

/* ---------- 精致多栏落地页页脚 ---------- */
.v16-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 24px;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--ds-line);
}
.v16-footer-col h6 {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 850;
  color: var(--ds-ink);
  letter-spacing: 0.03em;
}
.v16-footer-links {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.v16-footer-links button,
.v16-footer-links a {
  text-align: left;
  font-size: 0.8rem;
  color: var(--ds-muted);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease;
}
.v16-footer-links button:hover,
.v16-footer-links a:hover {
  color: var(--ds-primary-2);
}

/* ---------- 深色护眼模式 (Dark Lab) 完整适配 ---------- */
body.dark-lab {
  --ds-bg: #071916;
  --ds-surface: #0d2621;
  --ds-surface-soft: #102f29;
  --ds-ink: #e6f4ef;
  --ds-ink-2: #bfd8d0;
  --ds-muted: #8fb0a5;
  --ds-line: rgba(52, 211, 153, 0.16);
  --ds-line-strong: rgba(52, 211, 153, 0.30);
  --ds-primary: #10b981;
  --ds-primary-2: #34d399;
}
body.dark-lab .v16-brand-btn {
  background: rgba(16, 185, 129, 0.12);
  color: #e6f4ef;
}
body.dark-lab .v16-wf-bar {
  background: rgba(13, 38, 33, 0.92);
}
body.dark-lab .v16-topic-card.selected {
  background: linear-gradient(155deg, rgba(16, 185, 129, 0.16), #0d2621);
}
body.dark-lab .v16-cta-banner {
  background: linear-gradient(115deg, #0d2c26, #1f2419);
}
body.dark-lab .v16-preview-layman {
  background: rgba(201, 146, 44, 0.14);
}
body.dark-lab .v16-preview-layman label { color: #fcd34d; }
body.dark-lab .v16-preview-layman p { color: #fef3c7; }
body.dark-lab .v16-seg-btn.active {
  background: #143d34;
  color: #ffffff;
}
body.dark-lab .v16-filter-pill.active {
  background: #10b981;
  color: #041d19;
}

/* ---------- 修复全局横向溢出、悬浮球防遮挡与深色护眼高对比度 ---------- */
#studioMainCol,
.studio-layout-grid {
  min-width: 0;
  max-width: 100%;
}
#v16WorkflowBar {
  padding: 9px 14px;
  gap: 8px;
}
#quickAssistFab {
  bottom: 78px !important;
  right: 20px !important;
  z-index: 35 !important;
}

/* 深色护眼模式下：顶栏工具按钮、Step 1 筛选栏与药材档案卡高对比度修复 */
body.dark-lab header button#btnOpenCmdPalette,
body.dark-lab header button#btnOpenCompareTop,
body.dark-lab header button#btnOpenQwenCfgTop,
body.dark-lab header button#btnToggleVisualDock,
body.dark-lab header button#btnFontScale,
body.dark-lab header button#btnToggleDarkLab,
body.dark-lab header button#btnOpenFeedbackTop,
body.dark-lab header button#btnResetTopic {
  background: rgba(16, 47, 41, 0.92) !important;
  background-image: none !important;
  border-color: rgba(52, 211, 153, 0.28) !important;
  color: #e6f4ef !important;
}
body.dark-lab header button#btnOpenCompareTop:hover,
body.dark-lab header button#btnOpenQwenCfgTop:hover,
body.dark-lab header button#btnToggleVisualDock:hover,
body.dark-lab header button#btnFontScale:hover,
body.dark-lab header button#btnOpenCmdPalette:hover,
body.dark-lab header button#btnToggleDarkLab:hover {
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: rgba(52, 211, 153, 0.5) !important;
  color: #ffffff !important;
}
body.dark-lab #step1TabBar {
  background: rgba(10, 32, 28, 0.92) !important;
  border-color: rgba(52, 211, 153, 0.2) !important;
}
body.dark-lab #step1TabBar button {
  color: #a7c7bd !important;
}
body.dark-lab #step1TabBar button.bg-\[\#0a3630\] {
  background: #10b981 !important;
  color: #041d19 !important;
}
body.dark-lab #step1CatPills button {
  background: rgba(16, 47, 41, 0.85) !important;
  border-color: rgba(52, 211, 153, 0.22) !important;
  color: #cde6de !important;
}
body.dark-lab #step1CatPills button.bg-teal-700 {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #041d19 !important;
}
body.dark-lab #step1HerbCards .pick-card {
  background: #0d2621 !important;
  border-color: rgba(52, 211, 153, 0.2) !important;
}
body.dark-lab #step1HerbCards .pick-card .bg-slate-100,
body.dark-lab #step1HerbCards .pick-card .bg-teal-50 {
  background: rgba(52, 211, 153, 0.14) !important;
  color: #a7f3d0 !important;
}
body.dark-lab #step1HerbCards .pick-card .text-\[\#0f5c54\],
body.dark-lab #wpanel-1 .text-\[\#0f5c54\] {
  color: #5eead4 !important;
}
body.dark-lab #wpanel-1 .bg-\[\#f7f7f4\] {
  background: rgba(16, 47, 41, 0.72) !important;
  border: 1px solid rgba(52, 211, 153, 0.15);
}
body.dark-lab #s1CatBadge {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #a7f3d0 !important;
}
body.dark-lab #s1LimitBadge {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fde68a !important;
}
body.dark-lab #s1LaymanBox {
  background: rgba(201, 146, 44, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
body.dark-lab #s1LaymanBox .text-amber-900,
body.dark-lab #s1LaymanBox .text-amber-950 {
  color: #fef3c7 !important;
}
body.dark-lab .v16-chip-btn {
  background: rgba(16, 47, 41, 0.9);
  border-color: rgba(52, 211, 153, 0.24);
  color: #e6f4ef;
}
body.dark-lab .v16-chip-btn.gold {
  background: rgba(201, 146, 44, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde68a;
}
body.dark-lab #dockBtnGoHub {
  background: rgba(201, 146, 44, 0.18) !important;
  border-color: rgba(245, 158, 11, 0.38) !important;
  color: #fde68a !important;
}
body.dark-lab #dockBtnCompare {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(52, 211, 153, 0.36) !important;
  color: #a7f3d0 !important;
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 1080px) {
  .v16-hero-grid { grid-template-columns: 1fr; }
  .v16-branch-grid { grid-template-columns: 1fr; }
  .v16-bento-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v16-bank-layout { grid-template-columns: 1fr; }
  .v16-bank-preview { position: static; }
  .v16-ai-template-grid, .v16-diy-tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v16-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .v16-hero { padding: 22px 18px; border-radius: 22px; }
  .v16-bento-grid, .v16-ai-template-grid, .v16-diy-tools-grid, .v16-footer-grid { grid-template-columns: 1fr; }
  .v16-cta-banner { padding: 20px; }
  .v16-subhero { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .v16-page, .v16-branch-card, .v16-bento-card, .v16-topic-card { animation: none !important; transition: none !important; }
}
