/* =========================================================================
   手串定制页 —— 视觉与布局覆盖层
   -------------------------------------------------------------------------
   原则：只调整视觉与布局，不触碰任何业务逻辑（不改 JS 业务代码、
   不改接口、不改数据结构、不新增状态）。
   特异性策略：全部加 #app-page / #design-page 前缀，配合必要的 !important，
   稳定压过 Tailwind 的原子类。

   本文件必须排在 COPMQcrDgarjssBa.css 之后加载。
   ========================================================================= */

:root {
  --primary: #30180A;
  --primary-light: #8A4A2C;
  --primary-soft: #F5EDE9;

  --bg: #FAF8F6;
  --panel-bg: #F7F4F1;
  --surface: #FFFFFF;

  --border: #E6DFD8;

  --text-primary: #1E1A17;
  --text-secondary: #7B716C;
  --text-tertiary: #A59B95;

  --lavender: #D8D0E3;
  --lavender-soft: #F2EEF8;

  /* 浮层统一规格 */
  --float-bg: rgba(255, 255, 255, 0.76);
  --float-bd: rgba(48, 24, 10, 0.07);
  --float-sh: 0 4px 16px rgba(48, 24, 10, 0.05);
}

/* 页面本身不滚动：手串设计台是一屏应用，滚动只发生在 Bottom Sheet 内部 */
html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

#root,
#root > div {
  height: 100%;
}

/* ============================ 沉浸式背景 ============================
   背景图挂在「页面根」上，从顶部导航栏之下一直延伸到底部面板之后。
   这样就不会出现「白 header + 背景图 + 灰底 sheet」的三段式割裂。 */

#app-page,
#app-page > div {
  background: var(--bg);
}

#app-page > div {
  background-image: url("./crystal-bg.jpg");
  background-size: cover;
  background-position: center 32%;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ============================ 顶部导航栏 ============================
   透明暖白 + backdrop blur，让背景图在它后面保持连续 */

#app-page .sim-topbar {
  flex: 0 0 auto;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  position: relative;
  z-index: 30;
  background: rgba(250, 248, 246, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(48, 24, 10, 0.05);
}

#app-page .sim-topbar .sim-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

#app-page .sim-icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-primary);
  padding: 0;
}

#app-page .sim-icon-btn:active {
  background: rgba(48, 24, 10, 0.06);
}

#app-page .sim-icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ==================== 左右两张信息卡（同一套浮层） ====================
   两卡同顶、同边距、同圆角、同底色、同描边、同阴影；靠 align-items:stretch
   保证高度与文字基线一致。 */

#app-page .absolute.top-0.right-2 {
  position: absolute !important;
  top: 56px !important;
  left: 12px !important;
  right: 12px !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: space-between !important;
  gap: 10px !important;
  z-index: 25 !important;
  pointer-events: none !important; /* 两卡之间的空白不挡手串拖拽 */
}

#app-page .absolute.top-0.right-2 > * {
  pointer-events: auto !important;
}

#app-page .absolute.top-0.right-2 > div:first-child,
#app-page .absolute.top-0.right-2 > button:last-child {
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  min-height: 54px !important;
  min-width: 0 !important;
  padding: 8px 12px !important;
  background: var(--float-bg) !important;
  border: 1px solid var(--float-bd) !important;
  border-radius: 14px !important;
  box-shadow: var(--float-sh) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

#app-page .absolute.top-0.right-2 > div:first-child {
  align-items: flex-start !important;
  text-align: left !important;
  flex: 0 1 auto !important;
}

#app-page .absolute.top-0.right-2 > button:last-child {
  align-items: flex-end !important;
  text-align: right !important;
  flex: 0 0 auto !important;
  height: auto !important;
  padding: 8px 14px !important;
}

/* 左卡第一行：珠子数量不足 */
#app-page .absolute.top-0.right-2 > div:first-child > button {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  height: auto !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
  line-height: 1.3 !important;
}

#app-page .absolute.top-0.right-2 > div:first-child > button svg {
  width: 14px !important;
  height: 14px !important;
  color: var(--primary) !important;
  flex: 0 0 auto;
}

#app-page .absolute.top-0.right-2 > div:first-child > button span {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
}

/* 左卡第二行：提示语。
   注意要把「气泡外壳」和「气泡内层」一起去掉 ——
   只处理外层的话，内层那层圆角白底会留下来，就成了「胶囊套胶囊」。 */
#app-page .absolute.top-0.right-2 > div:first-child > div.absolute {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  z-index: auto !important;
}

#app-page .absolute.top-0.right-2 > div:first-child > div.absolute > div {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  color: var(--text-secondary) !important;
  white-space: normal !important;
}

/* 气泡小尖角 */
#app-page .absolute.top-0.right-2 > div:first-child > div.absolute > div > span {
  display: none !important;
}

/* 右卡：第一行静态标签 + 第二行动态金额（金额节点保持原样，只是补一个 ¥） */
#app-page .absolute.top-0.right-2 > button:last-child > div {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  align-items: baseline !important;
  gap: 2px !important;
  width: 100% !important;
}

#app-page .absolute.top-0.right-2 > button:last-child > div::before {
  content: "总价格";
  flex: 0 0 100% !important;
  text-align: right !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
  color: var(--text-secondary) !important;
}

/* 原「总价格:」与「元」两段文字隐藏，避免和伪元素重复 */
#app-page .absolute.top-0.right-2 > button:last-child > div > span:first-child,
#app-page .absolute.top-0.right-2 > button:last-child > div > span:nth-child(3) {
  display: none !important;
}

#app-page .absolute.top-0.right-2 > button:last-child > div > span:nth-child(2) {
  font-size: 19px !important;
  font-weight: 600 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.01em !important;
  color: var(--primary) !important;
}

#app-page .absolute.top-0.right-2 > button:last-child > div > span:nth-child(2)::before {
  content: "¥";
  font-size: 13px !important;
  font-weight: 500 !important;
  margin-right: 1px !important;
}

/* ============================ 设计台 ============================
   预览区铺满整个设计台，底部面板**浮在它上面**（而不是把它挤小）。 */

#design-page {
  position: relative !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: hidden !important;
  /* Bottom Sheet 当前高度：预览区可视高度、悬浮元素位置都由它推导 */
  --sim-sheet-h: 40vh;
}

/* 预览区：铺满设计台，背景透明，让根节点的背景图连续透出 */
#design-page > div:first-child {
  position: absolute !important;
  inset: 0 !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* canvas 承载容器：只占「未被面板覆盖」的那块区域。
   这样 3D 内容自然居中于可视区，且 canvas / 交互层 / 辅助层共用同一个
   定位容器 —— 不会再出现各层中心不一致的问题。
   大小只由容器尺寸决定，没有任何 transform: scale。 */
#design-page #scene-container {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: var(--sim-sheet-h) !important;
  width: auto !important;
  height: auto !important;
  background: transparent !important;
  overflow: hidden !important;
  transition: bottom 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ============================ 底部 Bottom Sheet ============================ */

#design-page > div:last-child {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: var(--sim-sheet-h) !important;
  display: flex !important;
  flex-direction: column !important;
  background: rgba(250, 248, 246, 0.86) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  border: 0 !important;
  border-top: 1px solid rgba(48, 24, 10, 0.06) !important;
  border-radius: 20px 20px 0 0 !important;
  box-shadow: 0 -10px 30px rgba(48, 24, 10, 0.05) !important;
  transition: height 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: height;
}

/* 拖动中关掉过渡，让面板跟手 */
#design-page.sim-dragging > div:last-child,
#design-page.sim-dragging #scene-container {
  transition: none !important;
}

/* 把手：真实 DOM（伪元素收不到指针事件），供拖拽与点击切换档位 */
#design-page .sim-sheet-handle {
  flex: 0 0 auto;
  height: 20px;
  display: grid;
  place-items: center;
  padding-top: 3px;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#design-page .sim-sheet-handle > span {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #D6CCC4;
  transition: background 0.15s ease;
}

#design-page .sim-sheet-handle:active {
  cursor: grabbing;
}

#design-page .sim-sheet-handle:active > span {
  background: #BDB0A6;
}

/* ==================== 面板内部：搜索框 / 分类 / 网格 ==================== */

/* 搜索行：整行一个搜索框（左边的筛选开关保留，功能没动） */
#design-page .h-10.items-center {
  flex: 0 0 auto !important;
  height: auto !important;
  border-bottom: 0 !important;
  padding: 2px 12px 6px !important;
  gap: 8px !important;
}

#design-page .h-10.items-center > div:first-child {
  margin: 0 !important;
  flex: 0 0 auto !important;
  height: 30px !important;
}

#design-page .h-10.items-center > div:last-child {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  gap: 8px !important;
}

/* 搜索：撑满整行，做成正常输入框的样子 */
#design-page .h-10.items-center .bg-\[\#F3F3F3\] {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  justify-content: flex-start !important;
  gap: 7px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 999px !important;
  box-shadow: 0 2px 8px rgba(48, 24, 10, 0.03) !important;
  overflow: hidden !important;
}

#design-page .h-10.items-center .bg-\[\#F3F3F3\] svg {
  width: 16px !important;
  height: 16px !important;
  color: var(--text-tertiary) !important;
  flex: 0 0 auto;
}

#design-page .h-10.items-center .bg-\[\#F3F3F3\] span {
  color: var(--text-tertiary) !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}

/* 占位文字补成「搜索珠子」。原节点文本是「搜索」，用伪元素续上后两个字，
   不修改 React 管理的文本节点，避免打断它的更新。 */
#design-page .h-10.items-center .bg-\[\#F3F3F3\] span::after {
  content: "珠子";
}

/* 分类：横向滚动 tabs */
#design-page .max-h-\[85\%\] {
  flex: 1 1 auto !important;
  flex-direction: column !important;
  max-height: none !important;
  min-height: 0 !important;
}

#design-page .min-w-\[64px\] {
  flex: 0 0 auto !important;
  flex-direction: row !important;
  height: auto !important;
  min-width: 0 !important;
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 6px 14px 10px !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#design-page .min-w-\[64px\]::-webkit-scrollbar {
  display: none;
}

#design-page .min-w-\[64px\] > div {
  overflow: visible !important;
}

#design-page .min-w-\[64px\] ul {
  flex-direction: row !important;
  gap: 8px !important;
  min-width: 0 !important;
}

/* 用 data-sim-tab 而不是 id：有些 tab（「正在使用」「兑换券」）没有 id */
#design-page li[data-sim-tab] {
  flex: 0 0 auto !important;
  padding: 7px 14px !important;
  border-radius: 999px !important;
  background: transparent !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  min-width: 0 !important;
  min-height: 0 !important;
  gap: 4px !important;
}

#design-page li[data-sim-tab] > span.absolute {
  display: none !important; /* 去掉原来的左侧竖条与底部横线 */
}

#design-page li[data-sim-tab] span {
  color: var(--text-secondary) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  white-space: nowrap !important;
}

#design-page li[data-sim-tab] span.font-medium {
  font-weight: 500 !important;
}

/* 选中态：淡底 + 主色字，不要过重 */
#design-page li[data-sim-tab][class*="text-black"] {
  background: var(--primary-soft) !important;
}

#design-page li[data-sim-tab][class*="text-black"] span {
  color: var(--primary) !important;
  font-weight: 500 !important;
}

#design-page li[data-sim-tab][class*="text-black"] img {
  filter: none;
}

#design-page li[data-sim-tab] img {
  width: 16px !important;
  height: 16px !important;
}

/* 网格：面板内部滚动，底部留出 CTA 的空间 */
/* 网格区：只保留**一个**滚动容器。
   面板内部原本是「外层 overflow-y-auto」+「内层滚动阴影包装 overflow-y-auto」
   两层嵌套，滚动落点不确定（实测外层 scrollHeight 恒等于 clientHeight，
   结果就是滚不动）。这里把内层收成普通块，滚动统一交给外层。 */
#design-page .max-h-\[85\%\] > div:last-child {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px !important;   /* 只留呼吸位；给 CTA 让位改由下面那条规则负责 */
  overscroll-behavior: contain;
}

/* ★ 底部 CTA 是绝对定位浮在面板上的，之前靠网格的 padding-bottom(74px) 躲它，
   但实测 68px 的按钮带还是把最后一张卡盖住了 16px（滚到底也看不全）。
   改成让面板正文自己留出等高的内边距，正文在 CTA 上方就结束，
   根上不存在遮挡关系。68px = 按钮 48 + 上 8 + 下 12。 */
#design-page > div:last-child > div.flex-1 {
  box-sizing: border-box !important;
  padding-bottom: 68px !important;
}

#design-page .max-h-\[85\%\] > div:last-child > div {
  overflow: visible !important;
  height: auto !important;
  min-height: 0 !important;
}

/* 搜索行左边那个筛选开关：原本是深色，放在浅色搜索框旁边太重，调轻一点 */
#design-page .h-10.items-center > div:first-child span.bg-default-200 {
  background: rgba(48, 24, 10, 0.12) !important;
}

#design-page .h-10.items-center > div:first-child label[data-selected="true"] span.bg-default-200,
#design-page .h-10.items-center > div:first-child label[aria-checked="true"] span.bg-default-200 {
  background: var(--primary) !important;
}

#design-page .h-10.items-center > div:first-child svg {
  width: 14px !important;
  height: 14px !important;
  color: var(--text-secondary) !important;
}

#design-page .grid.grid-cols-3 {
  gap: 8px !important;
  padding: 0 12px 12px !important;
  margin-bottom: 0 !important;
}

/* ============================ 珠子卡片 ============================ */

/* 卡片内边距：原来下边距 16px（+1px 边框）在价格行下面堆出 17px 空白，
   实测卡片 140px 高、文字行只有 20px，显得很松。收到 8px，上下更均衡。 */
#design-page [data-sim-bead] {
  position: relative !important;
  background: var(--surface) !important;
  border: 1px solid rgba(230, 223, 216, 0.65) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 4px rgba(48, 24, 10, 0.03) !important;
  padding: 10px 6px 8px !important;
  min-width: 0 !important;
  overflow: hidden !important;
  transition: border-color 0.15s ease, background 0.15s ease;
}

#design-page [data-sim-bead] img {
  width: 55px !important;
  height: 55px !important;
  border-radius: 10px !important;
  margin-bottom: 7px !important;
}

/* 名称：卡片里最突出的一层 */
#design-page [data-sim-bead] span[style*="font-size"] {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
}

/* 规格：弱化 */
#design-page [data-sim-bead] i {
  font-style: normal !important;
  font-size: 11px !important;
  color: var(--text-tertiary) !important;
}

/* 价格：稍强调 */
#design-page [data-sim-bead] b {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--primary) !important;
}

/* 右下角 “+”：纯 CSS 伪元素，点击穿透到卡片本身，不新增事件 */
#design-page [data-sim-bead]::after {
  content: "+";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
}

#design-page [data-sim-bead]:active {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
}

/* 原卡片底部那个空的浮层，用不到 */
#design-page [data-sim-bead] > div.absolute.bottom-0 {
  display: none !important;
}

#design-page .heroui-ripple {
  display: none !important;
}

/* 最近点过的那张卡的视觉记忆（真实被选中的状态在业务层，DOM 里拿不到） */
#design-page [data-sim-bead].sim-active {
  border: 1px solid var(--primary) !important;
  background: var(--primary-soft) !important;
}

/* ==================== 底部唯一主按钮：完成设计 → ==================== */

/* CTA 行原本是 absolute bottom-full（浮在面板上方），改成贴在面板底部内侧 */
#design-page .absolute.bottom-full {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: auto !important;
  bottom: 0 !important;
  display: block !important;
  max-height: none !important;
  padding: 0 !important;
  z-index: 40;
  background: linear-gradient(
    to top,
    rgba(250, 248, 246, 0.97) 62%,
    rgba(250, 248, 246, 0)
  );
  pointer-events: none;
}

#design-page .absolute.bottom-full > div {
  pointer-events: auto;
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 左侧那组（原「功能」入口，UI 上已隐藏） */
#design-page .absolute.bottom-full > div:first-child {
  display: none !important;
}

#design-page .absolute.bottom-full > div:last-child {
  width: 100% !important;
  display: block !important;
}

#finishDesignButton {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: calc(100% - 24px) !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  height: 48px !important;
  margin: 8px 12px 12px !important;
  border-radius: 999px !important;
  background: var(--primary) !important;
  border: 0 !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  box-shadow: 0 6px 18px rgba(48, 24, 10, 0.16) !important;
}

#finishDesignButton * {
  color: #ffffff !important;
}

#finishDesignButton:disabled {
  opacity: 0.45 !important;
  box-shadow: none !important;
}

/* 去掉购物车图标，只保留文字 + 尾部箭头 */
#finishDesignButton svg {
  display: none !important;
}

#finishDesignButton::after {
  content: "";
  width: 15px;
  height: 15px;
  margin-left: 7px;
  flex: 0 0 auto;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M13 6l6 6-6 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* ============================ 字体系统 ============================
   靠**字族分工 + 字重 + 字距**拉开层级，不靠加装饰。

   三条轨道：
     · --font-serif  只给页面标题，全页唯一衬线元素
     · --font-ui     中文 UI：正文 / 分类 / 按钮 / 商品名 / 说明
     · --font-num    数字与英文：价格 / 金额 / 规格里的 mm

   字体来源：
     · 标题沿用原有系统衬线栈（这块用户明确要求不动）
     · 中文 UI 走系统栈（HarmonyOS Sans SC / MiSans / PingFang SC / Noto Sans SC / 雅黑）
       —— 不打包中文字体：一套 CJK 字体动辄 5~10MB，移动端首屏代价太大，
          而这些字体在目标设备上本来就是系统自带的，栈里点名即可命中。
     · 数字/英文自托管 Inter（3 个字重共 72KB，见下方 @font-face），
       这样数字的字形、宽度、等宽特性完全可控，不受各平台默认西文字体影响。
       自托管而非引 CDN：部署包保持自包含，离线可用、国内也不会被墙。 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/inter-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN",
                "Songti SC", "STSong", "SimSun", "宋体", Georgia, "Times New Roman", serif;
  /* 全页字体分三条轨道，最多三套（其中标题那套保持不变）：
       --font-serif  标题专用（值不动，见下方 .sim-title 规则）
       --font-ui     中文 UI：正文 / 分类 / 按钮 / 商品名称 / 说明
       --font-num    数字与英文：价格 / 金额 / 规格里的 mm
     项目本身零 Web 字体（无 @font-face、仓库里也没有字体文件），
     所以全部走系统字体栈，**不新增任何字体资源**。

     中文 UI：项目原本的 --font-sans 就是这个用途，直接沿用同一个 token
     并把它的值升级成更精致的优先级，不另起一套并行命名。 */
  --font-ui: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Noto Sans SC",
             "Microsoft YaHei", "微软雅黑", "Source Han Sans SC", "Hiragino Sans GB",
             sans-serif;
  --font-sans: var(--font-ui);

  /* 数字 / 英文。刻意不用项目里已有的 --font-mono：
     等宽字体（Consolas / Courier New）会让价格显得很“技术”，和珠宝调性相反。 */
  --font-num: "Inter", "SF Pro Display", "SF Pro Text", system-ui, -apple-system,
              "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --text-muted: #9C938D;   /* 未选中分类 / 搜索占位 */
  --spec-text: #9A918B;    /* 商品规格，三级信息 */
}

/* 中文 UI 字体统一到一处。
   用 `#app-page *` 是为了盖掉业务 CSS 里零散写死的 `-apple-system, ...` 栈，
   避免出现「大部分元素一套字体、个别元素另一套」。
   标题那条规则带 !important，不受影响。
   数字轨道用更高特异性的选择器单独覆盖（见下）。 */
#app-page,
#app-page * {
  font-family: var(--font-ui);
}

#app-page {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-ui);
}

/* ---- 标题：全页唯一的衬线元素 ---- */
#app-page .sim-topbar .sim-title {
  font-family: var(--font-serif) !important;
  font-weight: 500 !important;
  font-size: 17px !important;
  /* 宋体笔画细，字距放宽一点更透气；padding-left 用来抵消末字右侧
     多出的那半个字距，让文字保持视觉居中 */
  letter-spacing: 0.12em !important;
  padding-left: 0.12em !important;
  color: var(--text-primary) !important;
}

/* ---- 数字：等宽（tabular numerals）----
   金额位数变化时不会左右抖动，列表里也能对齐。 */
#app-page .absolute.top-0.right-2 > button:last-child > div > span:nth-child(2),
#design-page [data-sim-bead] b {
  font-family: var(--font-num) !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

#app-page .absolute.top-0.right-2 > button:last-child > div > span:nth-child(2)::before {
  font-family: var(--font-num) !important;
  letter-spacing: 0 !important;
}

/* ================= 排版层级（本段是全页字体的权威声明） =================
   越靠后的规则越生效，前面组件段里同名的旧值会被这里覆盖。
   层级：名称 > 价格 > 规格；两行信息不同权重；数字走 --font-num。 */

/* ---- 1. 商品名称：13px / 500 / 主文字色。精致但不粗壮，不要 600 以上 ---- */
#design-page [data-sim-bead] span[style*="font-size"] {
  font-family: var(--font-ui) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #1E1A17 !important;
  letter-spacing: 0.01em !important;
}

/* ---- 2. 商品规格（6mm / 10mm）：三级信息，走数字轨道 ----
   400 + 更灰的色 + 略松字距，必须明显弱于名称和价格 */
#design-page [data-sim-bead] i {
  font-family: var(--font-num) !important;
  font-style: normal !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  color: var(--spec-text) !important;
  letter-spacing: 0.04em !important;
}

/* ---- 3. 商品价格：12px / 600 / 品牌色 / 等宽数字 ----
   数字干净紧凑，不做成巨大电商价格 */
#design-page [data-sim-bead] b {
  font-family: var(--font-num) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--primary) !important;
  letter-spacing: 0 !important;
}

/* ---- 4. 分类 tabs：未选中 400 + 更淡的灰；选中 600 + 主色 ----
   不做「全部粗体」。这里必须覆盖 span.font-medium（那个类给所有 tab 都上了 500）。 */
#design-page li[data-sim-tab] span,
#design-page li[data-sim-tab] span.font-medium {
  font-family: var(--font-ui) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: var(--text-muted) !important;
  letter-spacing: 0.02em !important;
}

#design-page li[data-sim-tab][class*="text-black"] span {
  color: var(--primary) !important;
  font-weight: 600 !important;
}

/* ---- 5. 左上状态卡：两行必须不同权重 ---- */

/* 第一行「珠子数量不足」 */
#app-page .absolute.top-0.right-2 > div:first-child > button span {
  font-family: var(--font-ui) !important;
  font-size: 13px !important;
  font-weight: 550 !important;
  color: #1E1A17 !important;
  letter-spacing: 0.02em !important;
}

/* 第二行「再加些珠子…」 */
#app-page .absolute.top-0.right-2 > div:first-child > div.absolute > div {
  font-family: var(--font-ui) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  letter-spacing: 0.02em !important;
  color: var(--text-secondary) !important;
}

/* ---- 6. 右上总价：标签退后，数字当主角 ---- */

/* 标签「总价格」 */
#app-page .absolute.top-0.right-2 > button:last-child > div::before {
  font-family: var(--font-ui) !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  color: var(--text-secondary) !important;
  letter-spacing: 0.02em !important;
}

/* 金额「¥117.5」 */
#app-page .absolute.top-0.right-2 > button:last-child > div > span:nth-child(2) {
  font-size: 19px !important;
  font-weight: 600 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.01em !important;
  color: var(--primary) !important;
}

/* ---- 7. 搜索框：13px / 400，占位更淡，保持轻盈 ---- */
#design-page .h-10.items-center .bg-\[\#F3F3F3\] span {
  font-family: var(--font-ui) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: var(--text-muted) !important;
  letter-spacing: 0.02em !important;
}

/* ---- 8. 主按钮「完成设计」：现代无衬线（不是标题的宋体）----
   15px / 600 / 0.04em，靠字重立焦点，不靠把字距拉得很开 */
#finishDesignButton {
  font-family: var(--font-ui) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  color: #ffffff !important;
}
