/* ============================================ */
/* GLM: 手串DIY设计器——浅色轻奢主题全局样式          */
/* GLM: batch-09 新增旋转预览 + 放大预览 + 周长超限警告样式 */
/* ============================================ */

/* GLM: 全局变量——颜色、字体、间�?*/
:root {
  --bg-primary: #f7f5fb;        /* GLM: batch-37 冷调微紫白替代米黄 */
  --bg-card: #ffffff;
  --bg-card-hover: #f3ece4;
  --border-color: #ece7f3;      /* GLM: batch-37 紫灰细边替代暖灰 */
  --text-primary: #2b2b2b;
  --text-secondary: #6d5d52;
  --text-muted: #a3907f;
  --accent-purple: #8b5cf6;     /* GLM: batch-37 品牌紫升级鲜明紫 */
  --accent-gold: #f0b878;
  --accent-success: #2e7d32;
  --accent-danger: #c62828;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 20px rgba(139,92,246,0.10); /* GLM: batch-37 阴影参考色同步品牌紫 */
  --shadow-glow: 0 0 30px rgba(139,92,246,0.18);   /* GLM: batch-37 阴影参考色同步品牌紫 */
  --font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --transition: all 0.25s ease;
  /* GLM: batch-18a 浅色轻奢新增变量 */
  --bg-secondary: #f5f0ea;
  --bg-tertiary: #ede6db;
  --border-subtle: #e8ddd4;
  --text-tertiary: #a3907f;
  --accent: #8b5cf6;            /* GLM: batch-37 品牌紫升级 */
  --accent-secondary: #818cf8;
  --danger: #c62828;
  --site-max-width: 1200px;
  --site-padding: 20px;
  /* GLM: batch-37 品牌渐变 + 玻璃拟态变量 */
  --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  --shadow-lift: 0 12px 40px rgba(99,102,241,0.14), 0 2px 10px rgba(99,102,241,0.08);
  --glass-bg: rgba(255,255,255,0.72);
}

/* GLM: 全局重置 */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ========== 滚动条美�?========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ========== Header ========== */
.header {
  /* GLM: batch-18a 浅色渐变 header */
  background: linear-gradient(135deg, #ffffff 0%, #faf5ef 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* GLM: 渐变标题文字——紫→金水晶质感 */
.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}

.header-nav {
  display: flex;
  gap: 20px;
  margin-left: 32px;
}

.header-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  transition: var(--transition);
  position: relative;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--accent-purple);
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-purple);
  transition: var(--transition);
}

.header-nav a:hover::after,
.header-nav a.active::after {
  width: 100%;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cart-icon {
  position: relative;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.3rem;
  transition: var(--transition);
  /* GLM: batch-66 SVG 购物袋图标对齐 */
  display: inline-flex;
  align-items: center;
}

.cart-icon:hover {
  color: var(--accent-gold);
}

.cart-icon .cart-svg {
  display: block;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--accent-danger);
  color: #fff;
  font-size: 0.65rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* GLM: batch-22 语言切换器（深色主题 header，如 diy/gallery 页） */
/* GLM: batch-66 语言切换器重设计——分段圆角胶囊（去斜杠分隔），明暗主题自适应 */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  background: rgba(127, 127, 127, 0.10);
  border-radius: 999px;
  padding: 3px;
}
.lang-btn {
  padding: 3px 11px;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-family);
  border-radius: 999px;
  transition: var(--transition);
  line-height: 1.4;
}
.lang-btn:hover { opacity: 1; }
.lang-btn.active {
  background: #fff;
  color: #5b4a72;
  opacity: 1;
  box-shadow: 0 1px 4px rgba(80, 60, 110, 0.28);
}
.lang-divider { display: none; } /* GLM: batch-66 去掉「中/EN」的斜杠 */
html.dark .lang-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: none;
}

/* ========== 主布局：三?========== */
.main-layout {
  display: flex;
  flex: 1;
  gap: 0;
  padding: 0;
  height: calc(100vh - 60px - 50px);
  overflow: hidden;
}

/* GLM: 左侧材料�?*/
.panel-left {
  width: 256px;
  min-width: 240px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  overflow: hidden;
}

/* GLM: 中间预览�?*/
.panel-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 12px; /* GLM: batch-53 画布最大化——压缩内边距，预览区尽量让给画布 */
  position: relative;
  overflow: hidden;
  /* GLM: batch-34 舞台化——氛围渐变背景（浅色米白→淡紫粉仿抖音舞台） */
  background: radial-gradient(120% 120% at 50% 20%, #ffffff 0%, #f6f2ec 45%, #efe6f5 100%);
}
/* GLM: batch-34 dark 舞台背景——深蓝紫渐变 */
html.dark .panel-center {
  background: radial-gradient(120% 120% at 50% 20%, #1b1e2b 0%, #141624 55%, #1d1530 100%);
}

/* GLM: 右侧参数面板 */
.panel-right {
  width: 272px;
  min-width: 260px;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  overflow-y: auto;
}

/* ========== 材料�?========== */
.category-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.category-tab {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  font-family: var(--font-family);
}

.category-tab:hover {
  color: var(--text-primary);
  background: rgba(155,123,184,0.05);
}

.category-tab.active {
  color: var(--accent-purple);
}

.category-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60%;
  height: 2px;
  background: var(--accent-purple);
}

.material-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-content: start;
}

/* GLM: 材质子分类筛选横条（横向滚动chip列表�?*/
.material-filter {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-color);
}

/* GLM: batch-11 材料搜索�?*/
.material-search {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font-family);
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
  margin-bottom: 4px;
}

.material-search:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.material-search::placeholder {
  color: var(--text-tertiary);
}

/* GLM: batch-11 搜索无结果空提示 */
.search-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.material-filter::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.filter-chip:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.filter-chip.active {
  background: var(--accent-purple);
  color: #fff;
  border-color: var(--accent-purple);
  font-weight: 600;
}

/* GLM: 材料卡片 */
/* GLM: batch-34 材质卡精致化——圆角14px + 柔和阴影 + 白底 */
.material-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease; /* GLM: batch-34 过渡统一 0.2s */
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  box-shadow: 0 2px 10px rgba(80,60,40,0.08);
  position: relative; /* GLM: batch-17 信息按钮定位 */
  overflow: visible;
}

/* GLM: batch-34 hover 上浮 + 阴影加深 */
.material-card:hover {
  border-color: var(--accent-purple);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(80,60,40,0.14), 0 2px 8px rgba(155,123,184,0.10);
}

/* GLM: batch-34 选中态：紫描边 + 浅紫底 + 名称变紫 */
.material-card.selected {
  border: 2px solid #8b5cf6;
  background: rgba(139,92,246,0.08);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}
.material-card.selected .mat-name {
  color: #8b5cf6;
  font-weight: 600;
}

.material-card:active {
  transform: scale(0.97);
}

.material-card .thumb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 8px;
  display: block;
}

.material-card .mat-name {
  font-size: 0.78rem;
  color: var(--text-primary);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* GLM: batch-34 价格小徽标样式——紫色浅底圆角小标 */
.material-card .mat-price {
  font-size: 0.72rem;
  color: #8b5cf6;
  font-weight: 600;
  background: rgba(139,92,246,0.10);
  border-radius: 8px;
  padding: 1px 8px;
  display: inline-block;
  margin-top: 2px;
}

/* GLM: 配饰/吊坠规格标注�?*/
.material-card .mat-spec {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 2px 0 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* GLM: batch-17 材料卡片信息按钮 */
.mat-info-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(155,123,184,0.15);
  color: var(--accent-purple);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 2;
  line-height: 1;
}

.material-card:hover .mat-info-btn {
  opacity: 1;
}

.mat-info-btn:hover {
  background: rgba(155,123,184,0.35);
}

/* GLM: batch-17 材料大图预览Canvas */
.mat-preview-canvas {
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(155,123,184,0.10);
  max-width: 100%;
  height: auto;
}

/* GLM: batch-17 材料大图预览信息�?*/
.mat-preview-info {
  text-align: left;
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.mat-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(128,128,128,0.1);
}

.mat-preview-row:last-child {
  border-bottom: none;
}

.mat-preview-label {
  color: var(--text-muted);
  font-weight: 500;
}

/* ========== 预览�?========== */
.preview-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
}

/* GLM: batch-05 预览区托盘背景——深色径向渐�?+ 中央圆形高光 */
.preview-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  height: 85%;
  border-radius: 50%;
  /* GLM: batch-18a 浅色托盘——米白底+中央淡紫高光 */
  background: radial-gradient(ellipse at center, rgba(155,123,184,0.06) 0%, rgba(155,123,184,0.02) 60%, transparent 100%);
  border: 1px solid rgba(155,123,184,0.12);
  pointer-events: none;
  z-index: 0;
}

#previewCanvas {
  border-radius: 20px; /* GLM: batch-34 canvas 浮起圆角 */
  max-width: 100%;
  max-height: calc(100% - 16px); /* GLM: batch-53 画布最大化 (原-60px) */
  /* GLM: batch-51 禁止选择/原生拖放——页面残留文本选中会让画布拖拽变成浏览器拖放，
     mousemove 全部被吞（珠子拖不动的元凶之一） */
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  /* GLM: batch-18a 浅色画布?*/
  background: radial-gradient(ellipse at center, #faf5ef 0%, #f5ede0 100%);
  /* GLM: batch-34 canvas 浮起投影——立体桌面感 */
  box-shadow: 0 18px 50px rgba(90,60,40,0.18), 0 4px 14px rgba(90,60,40,0.10);
  position: relative;
  z-index: 1;
}
/* GLM: batch-34 dark canvas 投影——深色浮起 */
html.dark #previewCanvas {
  box-shadow: 0 18px 50px rgba(0,0,0,0.45), 0 4px 14px rgba(0,0,0,0.30);
}

/* GLM: batch-05 预览区悬�?tooltip 浮层 */
.preview-tooltip {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  /* GLM: batch-18a 浅色tooltip半透明�?*/
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--accent-purple);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}

.preview-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  text-align: center;
  opacity: 0.7;
}

/* ============================================ */
/* GLM: batch-10 点选替换提示浮层样�?               */
/* ============================================ */

.replace-hint {
  position: absolute;
  top: 56px; /* GLM: batch-53 infoBar 悬浮后下移避让 */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.72rem;
  color: var(--accent-purple);
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
  animation: replaceHintFadeIn 0.3s ease;
}

@keyframes replaceHintFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* GLM: batch-08 预览区drop高亮（拖拽材料卡进入时） */
.preview-container.drop-target::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(155,123,184,0.6);
  box-shadow: 0 0 30px rgba(155,123,184,0.2), inset 0 0 30px rgba(155,123,184,0.08);
  pointer-events: none;
  z-index: 2;
  animation: dropPulse 1.2s ease-in-out infinite;
}

@keyframes dropPulse {
  0%, 100% { border-color: rgba(155,123,184,0.4); box-shadow: 0 0 20px rgba(155,123,184,0.12); }
  50% { border-color: rgba(155,123,184,0.8); box-shadow: 0 0 40px rgba(155,123,184,0.3); }
}

/* GLM: batch-08 "松手添加"提示（预览区内底部居中） */
.drop-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  /* GLM: batch-18a 浅色提示背景+紫色文字 */
  background: rgba(155,123,184,0.12);
  border: 1px solid rgba(155,123,184,0.35);
  color: #7b5ea7;
  font-size: 0.82rem;
  padding: 5px 16px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  letter-spacing: 1px;
}

.preview-container.drop-target .drop-hint {
  opacity: 1;
}

/* GLM: batch-70 拖出删除提示浮层（拖拽越过删除阈值时显示） */
.detach-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  display: none;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(178, 46, 46, 0.9);
  border: 1px solid rgba(255, 150, 150, 0.7);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
#previewCanvas.is-detaching {
  cursor: no-drop;
}

/* GLM: batch-71 三步引导条（量手围 → 拖珠子 → 开始制作） */
.guide-steps {
  width: 100%;
  margin-bottom: 8px;
  padding: 7px 12px;
  box-sizing: border-box;
  border-radius: 10px;
  background: rgba(155, 123, 184, 0.07);
  border: 1px solid rgba(155, 123, 184, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.guide-steps .gs-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.guide-steps .gs-dot {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary, #6b6478);
  background: rgba(155, 123, 184, 0.12);
  border: 1px solid rgba(155, 123, 184, 0.3);
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}
.guide-steps .gs-label {
  font-size: 0.78rem;
  color: var(--text-secondary, #6b6478);
  transition: color 0.25s;
}
.guide-steps .gs-item.done .gs-dot {
  background: linear-gradient(135deg, #c9a9e0, #9b7bb8);
  border-color: transparent;
  color: #fff;
}
.guide-steps .gs-item.done .gs-label { color: var(--text-primary, #2b2b2b); }
.guide-steps .gs-item.active .gs-dot {
  border-color: #9b7bb8;
  box-shadow: 0 0 0 3px rgba(155, 123, 184, 0.16);
  color: #7b5ea7;
}
.guide-steps .gs-item.active .gs-label { color: #7b5ea7; font-weight: 700; }
.guide-steps .gs-line {
  display: block;
  width: 34px;
  height: 1px;
  margin: 0 10px;
  background: rgba(155, 123, 184, 0.25);
  transition: background 0.25s;
}
.guide-steps .gs-line.done { background: #9b7bb8; }

/* GLM: batch-71 选中珠子快捷操作条 */
.sel-bar {
  width: 100%;
  margin-top: 6px;
  padding: 7px 12px;
  box-sizing: border-box;
  border-radius: 10px;
  background: rgba(155, 123, 184, 0.12);
  border: 1px solid rgba(155, 123, 184, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sel-bar .sb-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #7b5ea7;
  margin-right: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sel-bar .sb-btn {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  color: var(--text-primary, #2b2b2b);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(155, 123, 184, 0.35);
  cursor: pointer;
  white-space: nowrap;
}
.sel-bar .sb-btn:hover { background: #fff; }
.sel-bar .sb-btn.danger {
  color: #c9302c;
  border-color: rgba(217, 83, 79, 0.45);
  background: rgba(217, 83, 79, 0.1);
}

/* GLM: batch-70 手围松紧实时提示条 */
.fit-bar {
  width: 100%;
  margin-top: 8px;
  padding: 8px 14px;
  box-sizing: border-box;
  border-radius: 10px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  background: rgba(155, 123, 184, 0.08);
  border-left: 4px solid rgba(155, 123, 184, 0.35);
  font-size: 0.82rem;
}
.fit-bar .fit-text {
  font-weight: 700;
  color: var(--text-primary, #2f2a3a);
  flex-shrink: 0;
}
.fit-bar .fit-tip {
  color: var(--text-secondary, #6b6478);
}
.fit-bar[data-level="ok"] { border-left-color: #4caf7d; background: rgba(76, 175, 125, 0.1); }
.fit-bar[data-level="ok"] .fit-text { color: #3d9268; }
.fit-bar[data-level="warn"] { border-left-color: #e0a53a; background: rgba(224, 165, 58, 0.12); }
.fit-bar[data-level="warn"] .fit-text { color: #c98d21; }
.fit-bar[data-level="bad"] { border-left-color: #d9534f; background: rgba(217, 83, 79, 0.12); }
.fit-bar[data-level="bad"] .fit-text { color: #c9302c; }

/* GLM: batch-70 制作过程字幕 + 进度条 */
.making-caption {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 25;
  min-width: 240px;
  max-width: 90%;
  padding: 8px 18px 10px;
  border-radius: 12px;
  background: rgba(28, 24, 38, 0.82);
  border: 1px solid rgba(226, 178, 92, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}
.making-caption .mc-text {
  color: #f0d9a3;
  font-size: 0.82rem;
  white-space: nowrap;
}
.making-caption .mc-bar {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
.making-caption .mc-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, #d9a83a, #f0d9a3);
  transition: width 0.1s linear;
}

/* GLM: batch-70 制作过程播放器 */
.making-player {
  width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  box-sizing: border-box;
  border-radius: 10px;
  background: rgba(155, 123, 184, 0.08);
  border: 1px solid rgba(155, 123, 184, 0.22);
  display: flex;
  align-items: center;
  gap: 10px;
}
.making-player .mp-btn {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(155, 123, 184, 0.35);
  background: rgba(155, 123, 184, 0.1);
  color: var(--text-primary, #2f2a3a);
  font-size: 0.8rem;
  cursor: pointer;
}
.making-player .mp-btn:hover { background: rgba(155, 123, 184, 0.2); }
.making-player .mp-btn.disabled { opacity: 0.4; cursor: default; }
.making-player .mp-speed-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.making-player .mp-label {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b6478);
}
.making-player .mp-speed { display: flex; gap: 5px; }
.making-player .mp-sp {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(155, 123, 184, 0.3);
  background: transparent;
  color: var(--text-secondary, #6b6478);
  font-size: 0.75rem;
  cursor: pointer;
}
.making-player .mp-sp.active {
  background: linear-gradient(135deg, #b79ad6, #9b7bb8);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

/* GLM: batch-08 拖拽跟随浮层 */
.drag-bead {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translate(-50%, -50%);
  /* GLM: batch-18a 浅色拖拽阴影 */
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.15));
}

.drag-bead.show {
  display: flex;
}

.drag-bead-canvas {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

/* GLM: batch-18a 浅色拖拽标签 */
.drag-bead-label {
  background: rgba(255,255,255,0.92);
  color: #2b2b2b;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid rgba(155,123,184,0.3);
}

/* GLM: batch-08 body拖拽状�?*/
body.dragging {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

body.dragging .panel-left .material-grid {
  overflow: hidden;
}

body.dragging .material-card {
  touch-action: none;
}

/* GLM: batch-07 预览�?自由摆放"标签（左上角�?*/
.free-placement-badge {
  position: absolute;
  top: 56px; /* GLM: batch-53 infoBar 悬浮后下移避让 */
  left: 20px;
  z-index: 5;
  background: rgba(155,123,184,0.15);
  border: 1px solid rgba(155,123,184,0.35);
  /* GLM: batch-18a 浅色自由摆放徽标文字 */
  color: #7b5ea7;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.5px;
}
/* GLM: batch-32 顶部信息条（WRIST GUIDE + 商品卡头） */
.design-info-bar {
  /* GLM: batch-53 悬浮化——脱离文档流，把整块高度让给画布 */
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  white-space: nowrap;
  max-width: calc(100% - 24px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm, 10px);
  padding: 8px 14px;
  font-size: 0.81rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 6px;
}
.design-info-bar .di-left {
  font-weight: 500;
  white-space: nowrap;
}
.design-info-bar .di-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  white-space: nowrap;
}
.design-info-bar .di-label {
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--accent-purple, #9b7bb8);
  font-size: 0.72rem;
}
/* GLM: batch-34 工具栏视觉分组——主/次按钮分层 */
.toolbar {
  display: flex;
  gap: 4px;              /* GLM: batch-53 压缩高度给画布让位 */
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.toolbar-btn {
  padding: 5px 10px;   /* GLM: batch-53 压缩高度给画布让位 */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease; /* GLM: batch-34 过渡统一 0.2s */
  font-family: var(--font-family);
  white-space: nowrap;
}

/* GLM: batch-34 次级按钮：透明底 + 浅灰描边弱化 */
.toolbar-btn:hover:not(:disabled) {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: rgba(155,123,184,0.08);
  transform: translateY(-1px);
}

/* GLM: batch-34 主操作按钮：浅紫底强化 */
.toolbar-btn-primary {
  background: rgba(139,92,246,0.08);
  border-color: rgba(139,92,246,0.30);
  color: #8b5cf6;
  font-weight: 600;
}
.toolbar-btn-primary:hover:not(:disabled) {
  background: rgba(139,92,246,0.16);
  border-color: #8b5cf6;
  color: #7c3aed;
  transform: translateY(-1px);
}
/* GLM: batch-34 工具栏主次分隔——主按钮组前留空 */
.toolbar-divider {
  width: 1px;
  background: var(--border-color);
  margin: 0 4px;
  align-self: stretch;
}

.toolbar-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.toolbar-btn.danger:hover:not(:disabled) {
  border-color: var(--accent-danger);
  color: var(--accent-danger);
  background: rgba(239,68,68,0.08);
}

/* ============================================ */
/* GLM: batch-34 暗色主题适配——卡片/工具栏/画布 */
/* ============================================ */
html.dark .material-card {
  background: rgba(40,36,56,0.85);
  border-color: rgba(200,180,140,0.12);
  box-shadow: 0 2px 10px rgba(0,0,0,0.30);
}
html.dark .material-card:hover {
  border-color: rgba(139,92,246,0.5);
  box-shadow: 0 8px 24px rgba(0,0,0,0.40), 0 2px 8px rgba(139,92,246,0.15);
}
html.dark .material-card .mat-name {
  color: rgba(220,210,200,0.9);
}
html.dark .material-card .mat-price {
  background: rgba(139,92,246,0.18);
}
html.dark .toolbar {
  background: rgba(40,36,56,0.75);
  border-color: rgba(200,180,140,0.12);
}
html.dark .toolbar-btn {
  background: rgba(30,27,44,0.7);
  border-color: rgba(200,180,140,0.12);
  color: rgba(210,200,190,0.8);
}
html.dark .toolbar-btn:hover:not(:disabled) {
  background: rgba(139,92,246,0.12);
  border-color: rgba(139,92,246,0.4);
  color: #a78bfa;
}
html.dark .toolbar-btn-primary {
  background: rgba(139,92,246,0.14);
  border-color: rgba(139,92,246,0.35);
  color: #a78bfa;
}
html.dark .toolbar-btn-primary:hover:not(:disabled) {
  background: rgba(139,92,246,0.22);
  border-color: #8b5cf6;
}
html.dark .toolbar-divider {
  background: rgba(200,180,140,0.15);
}
html.dark .panel-left,
html.dark .panel-right {
  background: rgba(30,27,44,0.9);
  border-color: rgba(200,180,140,0.10);
}
html.dark .material-grid {
  background: transparent;
}
html.dark .category-tabs {
  border-color: rgba(200,180,140,0.10);
}
html.dark .category-tab {
  color: rgba(200,190,170,0.7);
}
html.dark .category-tab.active {
  color: #a78bfa;
}
html.dark .category-tab.active::after {
  background: #a78bfa;
}
html.dark .design-info-bar {
  background: rgba(40, 36, 56, 0.75);
  border-color: rgba(200, 180, 140, 0.12);
  color: rgba(210, 200, 190, 0.85);
}
html.dark .design-info-bar .di-label {
  color: rgba(200, 180, 220, 0.75);
}

/* ========== 参数面板 ========== */
.panel-right-inner {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* GLM: batch-36 桌面端折叠头隐藏 */
.m-collapse-summary { display:none; list-style:none; }

.section-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

/* GLM: 手围滑杆 */
.wrist-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wrist-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border-color);
  outline: none;
}

.wrist-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-purple);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(155,123,184,0.4);
  transition: var(--transition);
}

.wrist-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.wrist-input {
  width: 60px;
  padding: 6px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-align: center;
  font-size: 0.9rem;
  font-family: var(--font-family);
}

.wrist-input:focus {
  border-color: var(--accent-purple);
  outline: none;
}

/* GLM: 佩戴方式切换（整�?半圈 toggle�?*/
.wear-mode-toggle {
  display: flex;
  gap: 8px;
}

.wear-mode-btn {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-family);
  text-align: center;
}

.wear-mode-btn:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.wear-mode-btn.active {
  background: linear-gradient(135deg, rgba(155,123,184,0.15), rgba(240,184,120,0.1));
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  box-shadow: 0 0 16px rgba(155,123,184,0.08);
}

/* GLM: batch-25 自由模式切换按钮栏 */
.mode-toggle {
  /* GLM: batch-53 尝试悬浮后与工具栏第二行重叠，恢复流内（画布高度由 toolbar 实际占位决定） */
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 6px 0 0;
}

.mode-toggle .wear-mode-btn {
  flex: 0 0 auto;
  padding: 8px 20px;
  font-size: 0.85rem;
}

/* GLM: batch-25 收拢成串按钮 */
.btn-collapse {
  padding: 8px 18px;
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(240,184,120,0.12), rgba(240,184,120,0.04));
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-family);
}

.btn-collapse:hover {
  background: linear-gradient(135deg, rgba(240,184,120,0.2), rgba(240,184,120,0.08));
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(240,184,120,0.12);
}

/* GLM: 半圈模式提示文字 */
.half-wrap-hint {
  font-size: 0.78rem;
  color: var(--accent-gold);
  text-align: center;
  padding: 4px 0 10px;
  font-style: italic;
  opacity: 0.8;
}

/* GLM: 三张数据卡片 */
.stat-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: rgba(155,123,184,0.2);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.stat-value.price {
  color: var(--accent-success);
}

/* GLM: 已选材料清�?*/
.selected-list {
  flex: 1;
  overflow-y: auto;
  max-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  transition: var(--transition);
}

.selected-item:hover {
  border-color: rgba(155,123,184,0.2);
}

.selected-item .item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.selected-item .item-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.selected-item .item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.selected-item .item-qty {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: 4px;
}

.selected-item .item-subtotal {
  color: var(--accent-gold);
  font-weight: 600;
  margin: 0 8px;
  white-space: nowrap;
}

.selected-item .item-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
  transition: var(--transition);
  line-height: 1;
}

.selected-item .item-del:hover {
  color: var(--accent-danger);
}

/* GLM: 去结算按�?*/
.btn-checkout {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-success), #1e8a3e);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-family);
  letter-spacing: 0.5px;
}

.btn-checkout:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(52,211,153,0.3);
}

.btn-checkout:active {
  transform: scale(0.98);
}

/* ========== 模态框 ========== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  max-width: 520px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  /* GLM: batch-18a 浅色弹窗阴影 */
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.checkout-summary .cs-item {
  text-align: center;
  padding: 10px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}

.checkout-summary .cs-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}

.checkout-summary .cs-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.checkout-summary .cs-value.price {
  color: var(--accent-success);
}

.checkout-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 8px 0;
}

.checkout-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
}

.checkout-table td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(232,221,212,0.6);
}

.checkout-table .col-price,
.checkout-table .col-qty,
.checkout-table .col-subtotal {
  text-align: right;
}

.checkout-table .row-total td {
  font-weight: 700;
  color: var(--accent-gold);
  border-bottom: none;
  padding-top: 10px;
  font-size: 0.9rem;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.modal-actions button {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-family);
  border: none;
}

.btn-submit-order {
  background: linear-gradient(135deg, var(--accent-purple), #7b5ea7);
  color: #fff;
}

.btn-submit-order:hover {
  box-shadow: 0 4px 20px rgba(155,123,184,0.35);
  transform: translateY(-1px);
}

.btn-continue {
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color) !important;
}

.btn-continue:hover {
  border-color: var(--accent-purple) !important;
  color: var(--accent-purple);
}

/* ========== 材料预览浮层（长按弹出） ========== */
.preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 900;
  align-items: center;
  justify-content: center;
}

.preview-overlay.show {
  display: flex;
}

.preview-popup {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  max-width: 300px;
  width: 90%;
  /* GLM: batch-18a 浅色预览浮层阴影 */
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.preview-popup canvas {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: block;
}

.preview-popup .pv-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.preview-popup .pv-spec {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.preview-popup .pv-price {
  font-size: 1.1rem;
  color: var(--accent-gold);
  font-weight: 700;
}

/* ========== Footer ========== */
.footer {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  background: var(--bg-card);
  flex-shrink: 0;
}

/* ========== Toast 提示 ========== */
/* GLM: batch-18a 浅色Toast——白底深�?品牌紫左边条 */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-purple);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  color: var(--text-primary);
  font-size: 0.9rem;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(155,123,184,0.12);
}

.toast.show {
  opacity: 1;
}

/* ============================================ */
/* GLM: 首页 �?Hero区、浮动珠子、卖点卡、精选材�? */
/* ============================================ */

/* GLM: Hero�?*/
.hero {
  position: relative;
  padding: 80px 24px 60px;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 30% 40%, rgba(155,123,184,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 60%, rgba(240,184,120,0.06) 0%, transparent 50%),
              var(--bg-primary);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-title {
  font-size: 2.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  line-height: 1.3;
  max-width: 700px;
  position: relative;
  z-index: 2;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 32px;
  line-height: 1.7;
  position: relative;
  z-index: 2;
}

/* GLM: CTA按钮 */
.hero-cta {
  display: inline-block;
  padding: 14px 40px;
  background: linear-gradient(135deg, var(--accent-gold), #e0a050);
  color: #1a1922;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  z-index: 2;
  font-family: var(--font-family);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(240,184,120,0.35);
}

/* GLM: Hero区浮动珠�?*/
.hero-beads {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.floating-bead {
  position: absolute;
  border-radius: 50%;
  animation: floatBead linear infinite;
  opacity: 0.35;
}

@keyframes floatBead {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  25% { transform: translate(20px, -30px) scale(1.08); opacity: 0.45; }
  50% { transform: translate(-10px, -50px) scale(0.95); opacity: 0.35; }
  75% { transform: translate(15px, -20px) scale(1.05); opacity: 0.4; }
}

/* GLM: 通用区块标题 */
.section-title-home {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 32px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* GLM: 卖点三卡�?*/
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 60px 24px;
  max-width: 1000px;
  width: 100%; /* GLM: 阻止flex收缩为fit-content，确保网格多�?*/
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: var(--transition);
}

.feature-card:hover {
  border-color: rgba(155,123,184,0.25);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
  display: block;
}

.feature-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* GLM: 热门材料�?*/
.hot-materials {
  padding: 40px 24px 60px;
  max-width: 1000px;
  width: 100%; /* GLM: 阻止flex收缩为fit-content，确保网格多�?*/
  margin: 0 auto;
}

.hot-materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}

.hot-mat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.hot-mat-card:hover {
  border-color: var(--accent-purple);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.hot-mat-card canvas {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: block;
}

.hot-mat-name {
  font-size: 0.8rem;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-mat-price {
  font-size: 0.85rem;
  color: var(--accent-gold);
  font-weight: 600;
}

/* GLM: 首页成品预览 */
.home-gallery {
  padding: 40px 24px 60px;
  max-width: 1000px;
  width: 100%; /* GLM: 阻止flex收缩为fit-content，确保网格多�?*/
  margin: 0 auto;
}

.home-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.gallery-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  transition: var(--transition);
}

.gallery-preview-card:hover {
  border-color: rgba(155,123,184,0.2);
  transform: translateY(-2px);
}

.gallery-preview-canvas {
  width: 100%;
  max-width: 180px;
  border-radius: var(--radius-md);
  margin: 0 auto 10px;
  display: block;
}

.gallery-preview-name {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.gallery-preview-price {
  font-size: 0.9rem;
  color: var(--accent-gold);
  font-weight: 600;
}

/* GLM: 首页底部CTA */
.bottom-cta {
  text-align: center;
  padding: 60px 24px;
  background: radial-gradient(ellipse at center, rgba(155,123,184,0.06) 0%, transparent 70%);
}

.bottom-cta .hero-cta {
  font-size: 1.2rem;
  padding: 16px 48px;
}

/* ============================================ */
/* GLM: 成品展示页样�?                         */
/* ============================================ */

.gallery-page {
  padding: 40px 24px 60px;
  max-width: 1100px;
  width: 100%; /* GLM: 阻止flex收缩为fit-content，确保网格多�?*/
  margin: 0 auto;
  flex: 1;
}

.gallery-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 36px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
}

.gallery-card:hover {
  border-color: rgba(155,123,184,0.2);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.gallery-card-canvas {
  width: 100%;
  max-width: 240px;
  border-radius: var(--radius-md);
  margin: 0 auto 14px;
  display: block;
}

.gallery-card-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.gallery-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.gallery-card-price {
  font-size: 1.1rem;
  color: var(--accent-gold);
  font-weight: 700;
  margin-bottom: 14px;
}

.gallery-card-btn {
  padding: 10px 28px;
  background: linear-gradient(135deg, var(--accent-purple), #7b5ea7);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-family);
}

.gallery-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(155,123,184,0.3);
}

.gallery-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 60px;
  font-size: 1rem;
}

/* ============================================ */
/* GLM: 保存设计/恢复设计按钮                   */
/* ============================================ */

.save-load-btns {
  display: flex;
  gap: 8px;
}

.btn-save, .btn-load {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-family);
  background: var(--bg-primary);
}

.btn-save {
  color: var(--accent-purple);
}

.btn-save:hover {
  border-color: var(--accent-purple);
  background: rgba(155,123,184,0.08);
}

.btn-load {
  color: var(--accent-gold);
}

.btn-load:hover {
  border-color: var(--accent-gold);
  background: rgba(240,184,120,0.08);
}

/* GLM: batch-11 分享设计按钮 */
.btn-share {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--accent-success);
}

.btn-share:hover {
  border-color: var(--accent-success);
  background: rgba(52, 211, 153, 0.08);
}

/* GLM: 保存记录列表（恢�?modal 内） */
.save-record-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.save-record-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.save-record-item:hover {
  border-color: var(--accent-purple);
  background: var(--bg-card-hover);
}

.save-record-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.save-record-time {
  font-size: 0.82rem;
  color: var(--text-primary);
}

.save-record-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.save-record-load-btn {
  padding: 6px 16px;
  background: var(--accent-purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-family);
}

.save-record-load-btn:hover {
  background: #7b5ea7;
}

/* ========== 响应式：首页/成品�?========== */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .features {
    grid-template-columns: 1fr;
    padding: 40px 16px;
  }

  .home-gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hot-materials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .checkout-summary {
    grid-template-columns: 1fr;
  }
}

/* ========== 响应式：<900px 堆叠布局 ========== */
@media (max-width: 900px) {
  .main-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .panel-left,
  .panel-center,
  .panel-right {
    width: 100%;
    min-width: unset;
    border: none;
    border-bottom: 1px solid var(--border-color);
  }

  .panel-left {
    max-height: 300px;
  }

  .panel-center {
    min-height: 400px;
  }

  .panel-right {
    max-height: none;
    overflow: visible;
  }

  .header-nav {
    display: none;
  }
}

/* GLM: batch-06 diy页桌面端限高——panel-center自适应(flex:1) + 预览区拉�?*/
@media (min-width: 901px) {
  body.diy-page {
    height: 100vh;
    overflow: hidden;
  }
  body.diy-page .main-layout,
  body.diy-page .panel-left,
  body.diy-page .panel-center,
  body.diy-page .panel-right,
  body.diy-page .material-grid {
    min-height: 0;
  }
  /* GLM: batch-06 panel-center自适应放大—�?280px�?00px，大屏拉伸至1100px */
  body.diy-page .panel-center {
    flex: 1 1 auto;
    min-width: 520px;
    max-width: 1100px;
  }
}

/* ============================================================
   GLM: batch-36 移动端 H5 化（≤767px 全屏设计器）
   ============================================================ */
@media (max-width: 767px) {
  /* GLM: batch-36 画布置顶 flex order 重排 */
  .main-layout {
    display: flex;
    flex-direction: column;
  }
  .panel-center {
    order: 1;
    min-height: 66vh; /* GLM: batch-36 扩大画布（resizeCanvas maxH=containerH-80，需≥410得canvas≥330） */
    padding: 12px 8px; /* GLM: batch-36 减少内边距扩大画布 */
  }
  .panel-left {
    order: 2;
  }
  .panel-right {
    order: 3;
  }

  /* GLM: batch-36 扩大画布可用空间 */
  .preview-container {
    width: 100%;
    max-width: 100%;
  }
  .design-info-bar {
    /* GLM: batch-53 移动端回退流内布局（悬浮会遮挡小屏画布） */
    position: static;
    transform: none;
    margin-bottom: 6px;
    max-width: none;
    padding: 2px 4px;
    font-size: 0.65rem;
  }
  .mode-toggle {
    padding: 2px 0;
    gap: 4px;
    font-size: 0.75rem;
  }
  .panel-center > .toolbar {
    padding: 4px 4px;
    gap: 4px;
  }

  /* GLM: batch-36 材料区横滑压缩 */
  .panel-left {
    max-height: 172px;
  }
  .material-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px;
    min-width: 0;      /* GLM: batch-36-fix flex子项允许收缩到容器宽 */
    width: 100%;       /* GLM: batch-36-fix 强制容器宽=父级宽 */
  }
  .material-card {
    min-width: 104px;
    max-width: 104px;
    flex: 0 0 auto;
  }

  /* GLM: batch-36 工具栏横滑紧凑 */
  .toolbar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    min-width: 0;      /* GLM: batch-36-fix flex子项允许收缩到容器宽 */
    width: 100%;       /* GLM: batch-36-fix 强制容器宽=父级宽 */
    max-width: 100%;   /* GLM: batch-36-fix 防止任何祖先撑宽 */
  }
  .toolbar-btn {
    flex: 0 0 auto;
    font-size: 12px;
    padding: 6px 9px;
    white-space: nowrap;
  }
  .toolbar-divider {
    display: none;
  }

  /* GLM: batch-36 参数折叠头显示（移动端） */
  .m-collapse-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
  }
  .m-collapse {
    border-bottom: 1px solid var(--border-color);
  }

  /* GLM: batch-36 暗色适配 */
  html.dark .m-collapse-summary {
    border-bottom-color: var(--border-color);
  }
}

/* ============================================ */
/* GLM: batch-09 放大预览全屏遮罩样式             */
/* ============================================ */

.zoom-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1500;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: default;
}

.zoom-overlay.show {
  display: flex;
}

.zoom-close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 1510;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1.4rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: var(--font-family);
}

.zoom-close:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
  transform: scale(1.08);
}

.zoom-stage {
  transform-origin: center center;
  transition: none;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-stage:active {
  cursor: grabbing;
}

.zoom-canvas {
  display: block;
  border-radius: var(--radius-lg);
  /* GLM: batch-18a 浅色放大画布�?*/
  box-shadow: 0 0 80px rgba(155,123,184,0.10);
  background: radial-gradient(ellipse at center, #faf5ef 0%, #f5ede0 100%);
}

/* ============================================ */
/* GLM: batch-09 周长超限警告条样�?              */
/* ============================================ */

.size-warning {
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.35);
  border-left: 4px solid #ffc107;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.76rem;
  color: #ffc107;
  line-height: 1.5;
  margin-bottom: 4px;
  animation: warnFadeIn 0.35s ease;
}

@keyframes warnFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* GLM: batch-42 3D 预览容器——堆叠在 Canvas 上方 */
/* GLM: batch-44 入场动画——淡入 + 缩放过渡 */
#threeContainer {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 20px;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.9) translateY(14px);
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.25, 1);
  pointer-events: none;
}
#threeContainer.three-show {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
#threeContainer canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 20px;
}

/* GLM: batch-42 3D 预览按钮激活态 */
.toolbar-btn.mode3d {
  background: rgba(139, 92, 246, 0.14);
  border-color: #8b5cf6;
  color: #8b5cf6;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}
/* GLM: batch-09 旋转预览按钮旋转中样式 */
.toolbar-btn.rotating {
  background: rgba(155,123,184,0.12);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  animation: rotatePulse 1s ease-in-out infinite;
}
/* GLM: batch-32 拆解标注按钮选中态 */
.toolbar-btn.annotating {
  background: rgba(155,123,184,0.12);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

@keyframes rotatePulse {
  0%, 100% { box-shadow: 0 0 0 rgba(155,123,184,0); }
  50% { box-shadow: 0 0 12px rgba(155,123,184,0.3); }
}

/* GLM: batch-30 底座风格选择弹窗卡片样式 */
.tray-grid {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 8px 0;
}

.tray-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  transition: var(--transition);
  min-width: 110px;
}

.tray-card:hover {
  border-color: var(--accent-purple);
  background: rgba(155,123,184,0.06);
}

.tray-card.selected {
  border-color: var(--accent-purple);
  background: rgba(155,123,184,0.10);
  box-shadow: 0 0 8px rgba(155,123,184,0.18);
}

.tray-mini {
  border-radius: 50%;
  display: block;
}

.tray-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.tray-card.selected .tray-name {
  color: var(--accent-purple);
  font-weight: 600;
}

/* ============================================================
   GLM: batch-13 设计灵感首页（ASTRIS对标：Design Inspiration�?
   ============================================================ */
.home-inspirations {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 48px var(--site-padding) 32px;
}

.inspiration-grid-home {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .inspiration-grid-home {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .inspiration-grid-home {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

.home-insp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.home-insp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(155,123,184,0.18);
  border-color: var(--accent);
}

.home-insp-card canvas {
  border-radius: 50%;
  background: rgba(155,123,184,0.04);
}

.home-insp-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.home-insp-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.home-insp-meta {
  display: flex;
  gap: 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ============================================================
   GLM: batch-13 灵感弹窗（diy.html内）
   ============================================================ */
.inspiration-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 8px 0;
}

@media (max-width: 700px) {
  .inspiration-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

.inspiration-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  cursor: default;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.inspiration-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 22px rgba(155,123,184,0.16);
  border-color: var(--accent);
}

.inspiration-thumb {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(155,123,184,0.04);
  margin: 0 auto 8px;
}

.inspiration-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.inspiration-desc {
  font-size: 0.73rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.inspiration-meta {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.inspiration-apply-btn {
  width: 100%;
  padding: 7px 0;
  background: linear-gradient(135deg, var(--accent), #a06cd5);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.inspiration-apply-btn:hover {
  opacity: 0.88;
}

/* ============================================================
   GLM: batch-13 设计码弹�?
   ============================================================ */
.code-display {
  margin-bottom: 16px;
  text-align: center;
}

.code-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.code-value {
  display: inline-block;
  background: rgba(155,123,184,0.12);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 18px;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 1px;
  word-break: break-all;
  margin-bottom: 10px;
}

.btn-code-copy {
  padding: 6px 16px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-code-copy:hover {
  background: var(--accent);
  color: #fff;
}

.code-hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 16px 0;
}

.code-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.code-input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-code-open {
  width: 100%;
  padding: 10px 0;
  background: linear-gradient(135deg, var(--accent), #a06cd5);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-code-open:hover {
  opacity: 0.88;
}

.code-error {
  text-align: center;
  font-size: 0.82rem;
  color: #c62828;
  margin-top: 8px;
}

/* ============================================================
   GLM: batch-14 信用卡校准弹窗（Credit Card calibration�?
   ============================================================ */
.btn-calib {
  padding: 8px 16px;
  background: var(--bg-tertiary);
  color: var(--accent);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-calib:hover {
  background: rgba(0,195,181,0.12);
  border-color: var(--accent);
}

.calib-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.84rem;
  margin-bottom: 14px;
  line-height: 1.5;
}

.calib-card-area {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.calib-card-canvas {
  border-radius: 6px;
  background: var(--bg-secondary);
  max-width: 100%;
  height: auto;
}

.calib-tape-area {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  margin-bottom: 14px;
}

.calib-tape-canvas {
  border-radius: 4px;
  background: #f5f0e8;
  max-width: 100%;
  height: auto;
}

.calib-slider-row,
.calib-wrist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.calib-slider {
  flex: 1;
  accent-color: var(--accent);
}

.calib-slider-val {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 600;
  min-width: 70px;
  text-align: center;
}

.calib-scale-hint {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  min-width: 60px;
  text-align: center;
}

/* ============================================================
   GLM: batch-18b 身高体重估算弹窗样式
   ============================================================ */
.est-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.est-label {
  font-size: 0.82rem;
  color: var(--text-primary);
  min-width: 48px;
  font-weight: 500;
}

.est-gender-group {
  display: flex;
  gap: 8px;
  flex: 1;
}

.est-gender-btn {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.est-gender-btn:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.est-gender-btn.active {
  background: rgba(155,123,184,0.12);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  font-weight: 600;
}

.est-preview {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-purple);
  padding: 14px 0 8px;
  margin-top: 4px;
  border-top: 1px dashed var(--border-color);
}

.est-preview span {
  font-size: 1.4rem;
}

.est-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.76rem;
  margin: 6px 0 10px;
  line-height: 1.4;
}

/* ============================================================
   GLM: batch-13-fix 命名弹窗（分享到画廊，替代原生prompt�?
   ============================================================ */
.gallery-name-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.92rem;
  box-sizing: border-box;
  margin-bottom: 6px;
}

.gallery-name-input:focus {
  outline: none;
  border-color: var(--accent);
}

.gallery-name-error {
  text-align: center;
  font-size: 0.78rem;
  color: #c62828;
  margin-bottom: 6px;
}

/* GLM: batch-13-fix 命名弹窗取消按钮（与btn-continue配套，次级按钮） */
.btn-cancel {
  padding: 10px 20px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-cancel:hover {
  background: var(--danger);
  color: #fff;
}

/* ============================================================
   GLM: batch-13 画廊广场（Gallery Square�?
   ============================================================ */
.gallery-page {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 40px var(--site-padding) 60px;
  min-height: 60vh;
}

.gallery-page-title {
  font-size: 1.6rem;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 8px;
  font-weight: 700;
}

.gallery-page-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 32px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

@media (max-width: 1000px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 750px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

.gallery-square-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.gallery-square-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 26px rgba(155,123,184,0.16);
  border-color: var(--accent);
}

.gallery-card-canvas {
  width: 100%;
  height: auto;
  background: rgba(155,123,184,0.03);
  display: block;
}

.gallery-card-info {
  padding: 12px 14px 10px;
}

.gallery-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card-desc {
  font-size: 0.73rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.gallery-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gallery-card-btn {
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: opacity 0.15s;
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

.gallery-card-btn:hover {
  opacity: 0.85;
}

.gallery-card-btn.clone {
  background: linear-gradient(135deg, var(--accent), #a06cd5);
  color: #fff;
}

.gallery-card-btn.withdraw {
  background: var(--bg-tertiary);
  color: var(--danger);
  border: 1px solid var(--danger);
  flex: 0 0 auto;
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0;
  font-size: 0.92rem;
}

/* ============================================================
   GLM: batch-15 第二条手链折扣卡（ASTRIS对标：Create a 2nd Bracelet�?
   ============================================================ */
.discount-card {
  background: linear-gradient(135deg, rgba(212,175,55,0.08), rgba(255,215,0,0.05));
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}

.discount-card:hover {
  border-color: rgba(212,175,55,0.6);
  background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(255,215,0,0.08));
}

.discount-card.checked {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(255,215,0,0.1));
  box-shadow: 0 0 12px rgba(212,175,55,0.15);
}

.discount-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(212,175,55,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: all 0.2s;
}

.discount-card.checked .discount-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.discount-text {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.discount-text strong {
  color: #d4af37;
  font-size: 1.05rem;
}

.discount-text .discount-save {
  color: var(--accent);
  font-size: 0.78rem;
  margin-left: 4px;
}

/* ============================================================
   GLM: batch-15 定制礼盒区（ASTRIS对标：Custom luxury designer box�?
   ============================================================ */
.gift-box-card {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}

.gift-box-card:hover {
  border-color: var(--accent-secondary);
}

.gift-box-card.checked {
  border-color: var(--accent-secondary);
  background: rgba(129,140,248,0.06);
}

.gift-box-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(129,140,248,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: all 0.2s;
}

.gift-box-card.checked .gift-box-check {
  background: #818cf8;
  border-color: #818cf8;
  color: #fff;
}

.gift-box-text {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.gift-box-detail {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

.gift-box-card.checked .gift-box-detail {
  display: flex;
}

.gift-box-name-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 0.85rem;
  box-sizing: border-box;
}

.gift-box-name-input:focus {
  outline: none;
  border-color: #818cf8;
}

.gift-box-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(129,140,248,0.06);
  border-radius: 8px;
  border: 1px solid rgba(129,140,248,0.15);
}

.gift-box-icon {
  width: 48px;
  height: 40px;
  background: linear-gradient(135deg, #c8a45c, #b8962e);
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gift-box-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, transparent, #d4af37, #d4af37, transparent);
}

.gift-box-icon::after {
  content: '🎀';
  font-size: 1.2rem;
  z-index: 1;
  filter: drop-shadow(0 1px 2px rgba(155,123,184,0.08));
}

.gift-box-preview-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.gift-box-preview-text .to-name {
  color: #d4af37;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ============================================================
   GLM: batch-15 服务承诺信任条（ASTRIS对标：Trust badges�?
   ============================================================ */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
  padding: 10px 12px;
  margin-top: 12px;
  background: rgba(245,240,235,0.8);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.trust-item .trust-icon {
  font-size: 0.85rem;
}

/* GLM: 首页服务承诺区块 */
.home-trust {
  max-width: var(--site-max-width);
  margin: 48px auto 0;
  padding: 0 20px;
}

.home-trust-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.home-trust-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.home-trust-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(155,123,184,0.08);
}

.home-trust-card .trust-card-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.home-trust-card .trust-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.home-trust-card .trust-card-desc {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* GLM: diy页面参数面板信任条（紧凑版） */
.trust-bar-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: center;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: rgba(245,240,235,0.7);
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.trust-bar-panel .trust-item {
  font-size: 0.7rem;
}

/* GLM: 结算明细中折�?礼盒行样�?*/
.checkout-row-discount {
  color: var(--accent);
  font-size: 0.85rem;
}

.checkout-row-giftbox {
  color: #818cf8;
  font-size: 0.85rem;
}

/* ============================================================
   GLM: batch-18c 阶梯定价选择器
   ============================================================ */
.tier-selector {
  display: flex;
  gap: 10px;
  margin: 14px 0 8px;
}

.tier-btn {
  flex: 1;
  padding: 12px 8px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.tier-btn:hover {
  border-color: var(--accent-purple);
}

.tier-btn.active {
  border-color: var(--accent-purple);
  background: rgba(155,123,184,0.10);
  box-shadow: 0 0 12px rgba(155,123,184,0.12);
}

.tier-btn .tier-price {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-purple);
  margin-top: 4px;
}

.tier-btn .tier-save {
  display: block;
  font-size: 0.72rem;
  color: var(--accent-gold);
  margin-top: 2px;
}

.tier-btn .tier-qty {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ============================================================
   GLM: batch-18c 购物车弹窗样式
   ============================================================ */
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.cart-item-price {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-purple);
  white-space: nowrap;
}

.cart-item-actions {
  display: flex;
  gap: 6px;
}

.cart-item-del {
  padding: 4px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--accent-danger);
  cursor: pointer;
  font-size: 0.78rem;
  transition: var(--transition);
}

.cart-item-del:hover {
  background: rgba(198,40,40,0.08);
  border-color: var(--accent-danger);
}

.cart-item-buy {
  padding: 4px 10px;
  border: 1px solid var(--accent-purple);
  border-radius: var(--radius-sm);
  background: rgba(155,123,184,0.10);
  color: var(--accent-purple);
  cursor: pointer;
  font-size: 0.78rem;
  transition: var(--transition);
}

.cart-item-buy:hover {
  background: var(--accent-purple);
  color: #fff;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 6px;
  border-top: 2px solid var(--accent-purple);
  margin-top: 6px;
}

.cart-total-label {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 600;
}

.cart-total-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-purple);
}

.cart-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-size: 0.9rem;
}

/* ============================================================
   GLM: batch-15 移动端适配
   ============================================================ */
@media (max-width: 768px) {
  .home-trust-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 420px) {
  .home-trust-cards {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .home-trust-card {
    padding: 12px 8px;
  }

  .trust-bar {
    gap: 6px 8px;
    padding: 8px 6px;
  }

  .trust-item {
    font-size: 0.7rem;
  }

  .discount-card,
  .gift-box-card {
    padding: 10px 10px;
  }

  /* GLM: batch-18c 购物车移动端 */
  .cart-item {
    flex-wrap: wrap;
    gap: 6px;
  }

  .cart-item-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .cart-total-price {
    font-size: 1rem;
  }

  /* GLM: batch-18c 阶梯选择器移动端——三栏改为竖排 */
  .tier-selector {
    flex-direction: column;
    gap: 6px;
  }

  .tier-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
  }

  .tier-btn .tier-price {
    margin-top: 0;
  }
}

/* ============================================================
   GLM: batch-16 首页ASTRIS浅色轻奢风格（home-astris命名空间�?
   白底/衬线标题/大图留白，不影响diy/gallery深色主题
   ============================================================ */

/* GLM: batch-16 首页全局覆盖——白底浅色系 */
body.home-astris {
  background: #ffffff;
  color: #1a1a2e;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

/* GLM: batch-16 通用节标�?*/
.ha-section-header {
  text-align: center;
  margin-bottom: 28px;
}

.ha-section-title {
  font-family: 'Georgia', 'Times New Roman', 'Songti SC', 'SimSun', serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.ha-section-desc {
  font-size: 0.92rem;
  color: #6b7280;
  max-width: 520px;
  margin: 0 auto;
}

/* ============================================================
   GLM: batch-16 Header（浅色导航，白底+下阴影）
   ============================================================ */
.ha-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #eee;
  padding: 0 20px;
}

.ha-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 20px;
}

.ha-brand {
  font-family: 'Georgia', 'Times New Roman', 'Songti SC', 'SimSun', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a2e;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.ha-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.ha-nav a {
  font-size: 0.82rem;
  color: #4b5563;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.ha-nav a:hover {
  color: #1a1a2e;
  background: #f3f4f6;
}

.ha-nav-active {
  color: #1a1a2e !important;
  font-weight: 600;
}

.ha-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.ha-cart-icon {
  color: #4b5563;
  cursor: pointer;
  position: relative;
  /* GLM: batch-66 SVG 购物袋图标对齐 */
  display: inline-flex;
  align-items: center;
  transition: color 0.2s;
}

.ha-cart-icon:hover {
  color: #7c5c9c;
}

.ha-cart-icon .cart-svg {
  display: block;
}

.ha-cart-icon .cart-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  background: #dc2626;
  color: #fff;
  font-size: 0.68rem;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* GLM: batch-22 语言切换器（ASTRIS 浅色主题 header，如 index/my-designs 页） */
.ha-header-actions .lang-switch {
  border: 1px solid #d1d5db;
}
.ha-header-actions .lang-btn { color: #6b7280; }
.ha-header-actions .lang-btn:hover { color: #1a1a2e; }
.ha-header-actions .lang-btn.active {
  background: #1a1a2e;
  color: #fff;
}
.ha-header-actions .lang-divider { color: #9ca3af; }

.ha-cta-btn {
  display: inline-block;
  padding: 8px 20px;
  background: #1a1a2e;
  color: #fff !important;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
}

.ha-cta-btn:hover {
  background: #2d2d44;
  transform: translateY(-1px);
}

/* ============================================================
   GLM: batch-16 Hero区（白底大图，双栏布局�?
   ============================================================ */
.ha-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 50px 20px 40px;
}

.ha-hero-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  min-height: 440px;
}

.ha-hero-text {
  flex: 1 1 45%;
}

.ha-hero-title {
  font-family: 'Georgia', 'Times New Roman', 'Songti SC', 'SimSun', serif;
  font-size: 3rem;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.ha-hero-sub {
  font-size: 1.1rem;
  color: #6b7280;
  margin-bottom: 28px;
  line-height: 1.6;
}

.ha-hero-btns {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.ha-hero-btn-primary {
  display: inline-block;
  padding: 13px 30px;
  background: #1a1a2e;
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
}

.ha-hero-btn-primary:hover {
  background: #2d2d44;
  transform: translateY(-2px);
}

.ha-hero-btn-secondary {
  display: inline-block;
  padding: 13px 30px;
  background: transparent;
  color: #1a1a2e;
  text-decoration: none;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}

.ha-hero-btn-secondary:hover {
  border-color: #1a1a2e;
  background: #f9fafb;
}

.ha-hero-image {
  flex: 1 1 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ha-hero-main-img {
  width: 100%;
  max-width: 440px;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.08);
}

.ha-hero-sub-img {
  position: absolute;
  bottom: -10px;
  right: -10px;
  width: 140px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(155,123,184,0.08);
  border: 3px solid #fff;
}

/* ============================================================
   GLM: batch-16 信任数字条（浅灰背景横幅�?
   ============================================================ */
.ha-trust-bar {
  display: flex;
  justify-content: center;
  gap: 50px;
  padding: 32px 20px;
  background: #f7f7f8;
  flex-wrap: wrap;
}

.ha-trust-item {
  text-align: center;
  min-width: 150px;
}

.ha-trust-num {
  font-family: 'Georgia', 'Times New Roman', 'Songti SC', 'SimSun', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: 0.5px;
}

.ha-trust-num span {
  color: #818cf8;
  font-size: 1.6rem;
}

.ha-trust-label {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 4px;
}

/* ============================================================
   GLM: batch-16 Design Guide 视频�?
   ============================================================ */
.ha-design-guide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 20px;
}

.ha-video-poster {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  transition: transform 0.2s;
}

.ha-video-poster:hover {
  transform: scale(1.01);
}

.ha-video-poster img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.ha-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background: rgba(26,26,46,0.75);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  transition: background 0.2s, transform 0.2s;
}

.ha-video-poster:hover .ha-play-btn {
  background: rgba(26,26,46,0.9);
  transform: translate(-50%, -50%) scale(1.08);
}

/* ============================================================
   GLM: batch-16 三大卖点卡片网格
   ============================================================ */
.ha-selling-points {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 56px;
}

.ha-sp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.ha-sp-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
}

.ha-sp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.ha-sp-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f9fafb;
}

.ha-sp-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.ha-sp-card:hover .ha-sp-img-wrap img {
  transform: scale(1.04);
}

.ha-sp-info {
  padding: 18px 16px 20px;
}

.ha-sp-title {
  font-family: 'Georgia', 'Times New Roman', 'Songti SC', 'SimSun', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.ha-sp-en {
  font-size: 0.78rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.ha-sp-desc {
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.5;
}

/* ============================================================
   GLM: batch-16 Design Inspiration 网格�?款成品图，ASTRIS对标�?
   ============================================================ */
.ha-inspiration {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 56px;
}

.ha-insp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.ha-insp-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
}

.ha-insp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.ha-insp-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fafafa;
}

.ha-insp-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.ha-insp-card:hover .ha-insp-img-wrap img {
  transform: scale(1.05);
}

.ha-insp-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #dc2626;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.3px;
}

.ha-insp-info {
  padding: 14px;
}

.ha-insp-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ha-insp-price {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.ha-insp-original {
  font-size: 0.78rem;
  color: #9ca3af;
  text-decoration: line-through;
}

.ha-insp-current {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a2e;
}

.ha-insp-views {
  font-size: 0.73rem;
  color: #9ca3af;
}

/* ============================================================
   GLM: batch-16 View All Reviews
   ============================================================ */
.ha-reviews {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 48px;
  text-align: center;
}

.ha-reviews-link {
  display: inline-block;
  font-family: 'Georgia', 'Times New Roman', 'Songti SC', 'SimSun', serif;
  font-size: 1rem;
  color: #1a1a2e;
  text-decoration: none;
  border-bottom: 1.5px solid #1a1a2e;
  padding-bottom: 3px;
  transition: opacity 0.2s;
  letter-spacing: 0.5px;
}

.ha-reviews-link:hover {
  opacity: 0.65;
}

/* ============================================================
   GLM: batch-16 Footer（四列深色底白字�?
   ============================================================ */
.ha-footer {
  background: #1a1a2e;
  color: #d1d5db;
  padding: 48px 20px 0;
}

.ha-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  padding-bottom: 32px;
}

.ha-footer-col h4 {
  font-family: 'Georgia', 'Times New Roman', 'Songti SC', 'SimSun', serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

.ha-footer-col a {
  display: block;
  font-size: 0.8rem;
  color: #9ca3af;
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.ha-footer-col a:hover {
  color: #fff;
}

.ha-footer-brand p {
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.6;
  margin-top: 4px;
}

.ha-footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding: 18px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.76rem;
  color: #6b7280;
}

/* ============================================================
   GLM: batch-16 移动端响应式
   ============================================================ */
@media (max-width: 900px) {
  .ha-hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }

  .ha-hero-title {
    font-size: 2.2rem;
  }

  .ha-hero-btns {
    justify-content: center;
  }

  .ha-hero-image {
    order: -1;
  }

  .ha-hero-main-img {
    max-width: 300px;
  }

  .ha-hero-sub-img {
    width: 100px;
    right: 0;
    bottom: -8px;
  }

  .ha-trust-bar {
    gap: 28px;
    padding: 24px 16px;
  }

  .ha-trust-num {
    font-size: 1.8rem;
  }

  .ha-sp-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ha-insp-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .ha-footer-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .ha-nav {
    display: none;
  }
}

@media (max-width: 420px) {
  .ha-hero {
    padding: 30px 14px 24px;
  }

  .ha-hero-title {
    font-size: 1.7rem;
  }

  .ha-hero-sub {
    font-size: 0.92rem;
  }

  .ha-hero-btns {
    flex-direction: column;
    gap: 10px;
  }

  .ha-hero-btn-primary,
  .ha-hero-btn-secondary {
    width: 100%;
    text-align: center;
  }

  .ha-hero-main-img {
    max-width: 240px;
  }

  .ha-hero-sub-img {
    width: 80px;
  }

  .ha-trust-bar {
    gap: 20px;
    padding: 20px 12px;
  }

  .ha-trust-num {
    font-size: 1.5rem;
  }

  .ha-trust-label {
    font-size: 0.75rem;
  }

  .ha-section-title {
    font-size: 1.3rem;
  }

  .ha-insp-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .ha-insp-info {
    padding: 10px;
  }

  .ha-insp-name {
    font-size: 0.8rem;
  }

  .ha-insp-current {
    font-size: 0.82rem;
  }

  .ha-footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .ha-header-inner {
    gap: 12px;
  }

  .ha-brand {
    font-size: 1.05rem;
  }

  .ha-cta-btn {
    padding: 7px 14px;
    font-size: 0.78rem;
  }
}

/* ============================================================
   GLM: batch-18d 离开未保存确认弹窗（对标 ASTRIS leaveDialog）
   ============================================================ */
.leave-dialog {
  max-width: 380px;
  padding: 32px 28px;
  text-align: center;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.leave-dialog .modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 10px;
}

.leave-dialog .modal-desc {
  font-size: 0.95rem;
  color: #6b7c8e;
  margin-bottom: 24px;
  line-height: 1.5;
}

.leave-dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-stay {
  padding: 10px 32px;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1.5px solid #d0d8e0;
  background: #fff;
  color: #5a6b7c;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-stay:hover {
  background: #f5f7fa;
  border-color: #b0bcc8;
}

.btn-leave {
  padding: 10px 32px;
  font-size: 0.95rem;
  border-radius: 8px;
  border: none;
  background: #e74c3c;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-leave:hover {
  background: #c0392b;
}

/* ============================================================
   GLM: batch-18d My Designs 我的设计页样式（浅色 ASTRIS）
   ============================================================ */
.md-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  min-height: 70vh;
}

.md-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.md-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
}

.md-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 10px;
  background: #e8ecf1;
  color: #5a6b7c;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 600;
}

.md-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.md-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #eef1f5;
}

.md-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.md-card-name {
  font-size: 1.08rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.md-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.md-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: #7b8ea0;
  background: #f6f8fb;
  padding: 4px 10px;
  border-radius: 6px;
}

.md-card-code {
  font-size: 0.78rem;
  color: #a0b0c0;
  font-family: 'Courier New', monospace;
  margin-bottom: 10px;
  word-break: break-all;
}

.md-card-price {
  font-size: 1.12rem;
  font-weight: 700;
  color: #e67e22;
  margin-bottom: 14px;
}

.md-card-actions {
  display: flex;
  gap: 8px;
}

.md-btn {
  padding: 6px 16px;
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid #d0d8e0;
  background: #fff;
  color: #5a6b7c;
  cursor: pointer;
  transition: all 0.15s;
}

.md-btn:hover {
  background: #f5f7fa;
}

.md-btn-danger {
  border-color: #f5c6cb;
  color: #e74c3c;
}

.md-btn-danger:hover {
  background: #fdf2f3;
}

.md-card-downgraded {
  font-size: 0.75rem;
  color: #e67e22;
  margin-bottom: 8px;
}

/* 空状态 */
.md-empty {
  text-align: center;
  padding: 60px 20px;
  color: #8a9bae;
}

.md-empty-icon {
  font-size: 3rem;
  margin-bottom: 14px;
}

.md-empty p {
  font-size: 0.98rem;
  margin-bottom: 20px;
}

.md-empty-btn {
  display: inline-block;
  padding: 10px 28px;
  background: #3498db;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.md-empty-btn:hover {
  background: #2d85c4;
}

/* 移动端 */
@media (max-width: 600px) {
  .md-page {
    padding: 20px 12px 40px;
  }
  .md-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .md-card {
    padding: 14px;
  }
  .md-card-name {
    font-size: 0.95rem;
  }
  .md-card-meta {
    gap: 4px;
  }
  .md-meta-item {
    font-size: 0.72rem;
    padding: 3px 7px;
  }
  .md-card-actions {
    flex-wrap: wrap;
  }
  .leave-dialog {
    max-width: 300px;
    padding: 24px 18px;
    margin: 12px;
  }
}

/* ============================================================
   GLM: batch-37 全站高级感视觉 V2 — 品牌色升级 + 玻璃拟态 + 精致化
   ============================================================ */

/* ---------- B. 玻璃拟态三栏 + 导航 ---------- */
/* GLM: batch-37-fix 三栏留白（padding:0 gap:0 恢复画布=656；玻璃圆角+阴影自呼吸） */
.main-layout {
  padding: 0;
  gap: 0;
}

/* GLM: batch-37 玻璃拟态面板 — 半透明磨砂 + 圆角 + 阴影 */
.panel-left,
.panel-center,
.panel-right {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(90,80,140,0.08);
}

/* GLM: batch-37 顶部导航玻璃底 */
.header {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, rgba(139,92,246,0.25), transparent) 1;
}

/* GLM: batch-37-fix 品牌渐变文字（.site-title=diy/gallery; .ha-brand=index/my-designs） */
.site-title,
.ha-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

/* ---------- C. 结算按钮高级化 ---------- */
/* GLM: batch-37 结算按钮品牌渐变紫替代绿色 */
.btn-checkout {
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(139,92,246,0.30);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(139,92,246,0.40);
}

.btn-checkout:active {
  transform: scale(0.98);
}

/* ---------- D. 信息条 + 右栏小节精致化 ---------- */
/* GLM: batch-37 信息条胶囊化 */
.design-info-bar {
  background: rgba(139,92,246,0.08);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.8rem;
}

.design-info-bar .di-label {
  color: var(--accent);
}

/* GLM: batch-37 小节标题深紫 + 字距 */
.section-title {
  letter-spacing: 0.04em;
  color: #5b21b6;
}

/* GLM: batch-37 stat-card 圆角 + 玻璃底 + hover 微上浮 */
.stat-card {
  background: rgba(255,255,255,0.7);
  border-radius: 14px;
  border-color: rgba(139,92,246,0.08);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139,92,246,0.10);
}

/* GLM: batch-37 信任条浅紫底胶囊 */
.trust-bar-panel {
  background: rgba(139,92,246,0.06);
  border-radius: 12px;
  border: 1px solid rgba(139,92,246,0.08);
}

/* GLM: batch-37 通用信任条浅紫底 */
.trust-bar {
  background: rgba(139,92,246,0.05);
  border-radius: 12px;
  border: 1px solid rgba(139,92,246,0.08);
}

/* ---------- E. 材质卡 V2 ---------- */
/* GLM: batch-37 材质卡 hover 光影升级 */
.material-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(139,92,246,0.18), 0 2px 8px rgba(139,92,246,0.08);
}

/* GLM: batch-37 材质卡照片区圆形描边 */
.material-card .thumb {
  border: 2px solid rgba(139,92,246,0.15);
}

/* GLM: batch-37 材质网格间距增大 */
.material-grid {
  gap: 12px;
}

/* ---------- F. 首页 Hero 轻升级 ---------- */
/* GLM: batch-37 Hero 柔光渐变背景 */
.hero {
  background: radial-gradient(800px 400px at 20% 30%, rgba(139,92,246,0.10), transparent),
              radial-gradient(600px 300px at 80% 70%, rgba(99,102,241,0.08), transparent),
              var(--bg-primary);
}

/* GLM: batch-37 Hero 主按钮品牌渐变 */
.hero-cta {
  background: var(--gradient-primary);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(139,92,246,0.30);
}

.hero-cta:hover {
  box-shadow: 0 12px 28px rgba(139,92,246,0.40);
}

/* GLM: batch-37 首页新版 Hero 主按钮品牌渐变 */
.ha-hero-btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(139,92,246,0.30);
  border: none;
}

.ha-hero-btn-primary:hover {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  box-shadow: 0 12px 28px rgba(139,92,246,0.40);
}

/* GLM: batch-37 统计数字渐变文字 */
.ha-trust-num {
  font-weight: 800;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ha-trust-num span {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* GLM: batch-37 首页 Hero 柔光背景 */
.ha-hero {
  background: radial-gradient(600px 300px at 30% 20%, rgba(139,92,246,0.08), transparent),
              radial-gradient(500px 250px at 70% 80%, rgba(99,102,241,0.06), transparent);
}

/* GLM: batch-37 首页信任条品牌色适配 */
.ha-trust-bar {
  background: rgba(139,92,246,0.04);
}

/* ============================================================
   GLM: batch-37 暗色主题同步适配
   ============================================================ */

/* GLM: batch-37 暗色玻璃底 */
html.dark .panel-left,
html.dark .panel-center,
html.dark .panel-right {
  background: rgba(30,32,48,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

/* GLM: batch-37 暗色导航玻璃底 */
html.dark .header {
  background: rgba(30,32,48,0.8);
  border-image: linear-gradient(90deg, transparent, rgba(139,92,246,0.20), transparent) 1;
}

/* GLM: batch-37 暗色信息条胶囊 */
html.dark .design-info-bar {
  background: rgba(139,92,246,0.10);
  color: rgba(210,200,190,0.85);
}

html.dark .design-info-bar .di-label {
  color: #a78bfa;
}

/* GLM: batch-37 暗色小节标题 */
html.dark .section-title {
  color: #a78bfa;
}

/* GLM: batch-37 暗色 stat-card 玻璃底 */
html.dark .stat-card {
  background: rgba(40,36,56,0.7);
  border-color: rgba(255,255,255,0.06);
}

html.dark .stat-card:hover {
  box-shadow: 0 6px 16px rgba(139,92,246,0.15);
}

/* GLM: batch-37 暗色信任条 */
html.dark .trust-bar-panel {
  background: rgba(139,92,246,0.08);
  border-color: rgba(255,255,255,0.05);
}

html.dark .trust-bar {
  background: rgba(139,92,246,0.06);
  border-color: rgba(255,255,255,0.05);
}

/* GLM: batch-37 暗色材质卡描边 */
html.dark .material-card .thumb {
  border-color: rgba(139,92,246,0.25);
}

/* GLM: batch-37 暗色材料网格 */
html.dark .material-grid {
  background: transparent;
}

/* GLM: batch-37 暗色首页 Hero */
html.dark .hero {
  background: radial-gradient(800px 400px at 20% 30%, rgba(139,92,246,0.08), transparent),
              radial-gradient(600px 300px at 80% 70%, rgba(99,102,241,0.06), transparent),
              var(--bg-primary);
}

html.dark .ha-hero {
  background: radial-gradient(600px 300px at 30% 20%, rgba(139,92,246,0.06), transparent),
              radial-gradient(500px 250px at 70% 80%, rgba(99,102,241,0.04), transparent);
}

html.dark .ha-trust-bar {
  background: rgba(139,92,246,0.06);
}

/* GLM: batch-37 暗色面板保留现有 batch-34 覆盖（最小介入） */

/* ==========================================================
   GLM: batch-33 甄选好物 · 商品网格（数据源 sc_product 18 件）
   ========================================================== */
.ha-products {
  padding: 56px 40px 60px;
  background: #fff;
}

.ha-prod-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.ha-prod-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s, box-shadow 0.25s;
}

.ha-prod-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.ha-prod-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fafafa;
}

.ha-prod-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s, opacity 0.25s;
}

.ha-prod-card:hover .ha-prod-img {
  transform: scale(1.05);
}

/* GLM: 销量徽标 */
.ha-prod-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

/* GLM: 有视频素材的角标 */
.ha-prod-video {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
}

/* GLM: 缩略图条——悬停切换主图 */
.ha-prod-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 10px 0;
}

.ha-prod-thumb {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #fafafa;
  flex: 0 0 auto;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s, border-color 0.2s;
}

.ha-prod-thumb:hover,
.ha-prod-thumb.active {
  opacity: 1;
  border-color: #9b7bb8;
}

.ha-prod-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ha-prod-info {
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.ha-prod-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.ha-prod-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ha-prod-tag {
  font-size: 0.66rem;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 4px;
  padding: 2px 6px;
}

.ha-prod-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
}

.ha-prod-price-from {
  font-size: 0.7rem;
  color: #9ca3af;
}

.ha-prod-price-now {
  font-size: 1.02rem;
  font-weight: 700;
  color: #b91c1c;
}

.ha-prod-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #6b7280;
}

.ha-prod-cta {
  margin-top: 2px;
  font-size: 0.75rem;
  color: #7c5c9c;
  font-weight: 600;
}

@media (max-width: 1024px) {
  .ha-prod-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .ha-products {
    padding: 36px 16px 40px;
  }
  .ha-prod-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .ha-prod-name {
    font-size: 0.8rem;
    min-height: 2.6em;
  }
  .ha-prod-price-now {
    font-size: 0.92rem;
  }
  .ha-prod-thumbs {
    padding: 6px 8px 0;
  }
  .ha-prod-thumb {
    width: 28px;
    height: 28px;
  }
}

/* GLM: batch-35 Design Guide 真视频（原为海报+toast占位） */
.ha-guide-video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0f172a;
}

/* GLM: batch-35 hero 主图改用方图实拍，固定比例防高度跳动 */
.ha-hero-main-img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

html.dark .ha-guide-video {
  background: rgba(255, 255, 255, 0.04);
}

/* GLM: batch-33 暗色适配 */
html.dark .ha-products {
  background: var(--bg-primary, #16141f);
}
html.dark .ha-prod-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark .ha-prod-img-wrap {
  background: rgba(255, 255, 255, 0.03);
}
html.dark .ha-prod-name {
  color: #f3f4f6;
}
html.dark .ha-prod-tag {
  background: rgba(255, 255, 255, 0.06);
  color: #9ca3af;
}
html.dark .ha-prod-cta {
  color: #c4a7e0;
}

/* ==========================================================
   GLM: batch-34 商品详情页（product.html）
   ========================================================== */
.pd-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 40px 64px;
}

.pd-crumb {
  display: inline-block;
  font-size: 0.85rem;
  color: #6b7280;
  text-decoration: none;
  margin-bottom: 20px;
}

.pd-crumb:hover {
  color: #7c5c9c;
}

.pd-top {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 40px;
  align-items: start;
}

/* ====== 左：图集 ====== */
.pd-main-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: #fafafa;
  border: 1px solid #e5e7eb;
}

.pd-main-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pd-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
}

.pd-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.pd-thumb {
  width: 78px;
  height: 78px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  cursor: pointer;
  background: #fafafa;
  transition: border-color 0.2s;
}

.pd-thumb:hover,
.pd-thumb.active {
  border-color: #9b7bb8;
}

.pd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pd-video-wrap {
  margin-top: 22px;
}

.pd-video-wrap video {
  width: 100%;
  border-radius: 12px;
  background: #111827;
}

/* ====== 右：信息 ====== */
.pd-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.4;
  margin: 0 0 4px;
}

.pd-subtitle {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 12px;
}

.pd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.pd-tag {
  font-size: 0.72rem;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 4px 10px;
}

.pd-price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid #f0f0f3;
  border-bottom: 1px solid #f0f0f3;
}

.pd-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: #b91c1c;
}

.pd-price-hint {
  font-size: 0.8rem;
  color: #9ca3af;
}

.pd-stats {
  display: flex;
  gap: 28px;
  padding: 16px 0;
}

.pd-stat-num {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
}

.pd-stat-label {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-top: 2px;
}

.pd-meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
  padding: 14px 0;
}

.pd-meta-row {
  display: flex;
  gap: 8px;
  font-size: 0.8rem;
}

.pd-meta-key {
  color: #9ca3af;
  flex: 0 0 auto;
}

.pd-meta-val {
  color: #374151;
}

.pd-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.pd-btn-primary,
.pd-btn-secondary {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pd-btn-primary {
  background: linear-gradient(135deg, #9b7bb8, #7c5c9c);
  color: #fff;
}

.pd-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(124, 92, 156, 0.28);
}

.pd-btn-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.pd-btn-secondary:hover {
  border-color: #9b7bb8;
  color: #7c5c9c;
}

/* ====== 下方区块 ====== */
.pd-section {
  margin-top: 44px;
}

.pd-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 14px;
  padding-left: 10px;
  border-left: 3px solid #9b7bb8;
}

.pd-block-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 8px;
}

.pd-sku-table {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.pd-sku-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 11px 16px;
  font-size: 0.82rem;
  border-bottom: 1px solid #f0f0f3;
}

.pd-sku-row:last-child {
  border-bottom: none;
}

.pd-sku-head {
  background: #fafafa;
  font-weight: 700;
  color: #6b7280;
}

.pd-sku-name {
  color: #374151;
}

.pd-sku-price {
  color: #b91c1c;
  font-weight: 700;
}

.pd-sku-stock {
  color: #6b7280;
}

.pd-attr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: #f0f0f3;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.pd-attr-item {
  display: flex;
  gap: 12px;
  padding: 11px 16px;
  background: #fff;
  font-size: 0.82rem;
}

.pd-attr-key {
  color: #9ca3af;
  flex: 0 0 40%;
}

.pd-attr-val {
  color: #374151;
  flex: 1;
  word-break: break-word;
}

.pd-review-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pd-review-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.84rem;
  color: #374151;
  line-height: 1.6;
}

.pd-empty-text {
  font-size: 0.84rem;
  color: #9ca3af;
}

.pd-empty {
  text-align: center;
  padding: 80px 20px;
}

.pd-empty p {
  color: #6b7280;
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .pd-main {
    padding: 20px 16px 48px;
  }
  .pd-top {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .pd-title {
    font-size: 1.25rem;
  }
  .pd-stats {
    gap: 18px;
  }
  .pd-meta-list,
  .pd-attr-grid {
    grid-template-columns: 1fr;
  }
  .pd-thumb {
    width: 60px;
    height: 60px;
  }
}

/* GLM: batch-34 暗色适配 */
html.dark .pd-title,
html.dark .pd-stat-num,
html.dark .pd-section-title {
  color: #f3f4f6;
}
html.dark .pd-main-img,
html.dark .pd-sku-table,
html.dark .pd-review-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark .pd-attr-item {
  background: rgba(255, 255, 255, 0.02);
}
html.dark .pd-attr-grid {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark .pd-tag {
  background: rgba(255, 255, 255, 0.06);
  color: #9ca3af;
}
html.dark .pd-meta-val,
html.dark .pd-sku-name,
html.dark .pd-attr-val,
html.dark .pd-review-card {
  color: #d1d5db;
}
html.dark .pd-btn-secondary {
  background: transparent;
  color: #d1d5db;
  border-color: rgba(255, 255, 255, 0.12);
}
html.dark .pd-price-row {
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark .pd-sku-row {
  border-color: rgba(255, 255, 255, 0.06);
}

/* ============================================================
   GLM: batch-63 商城化——甄选好物卡片 加购/立即购买按钮 + 商城购物车/收银台弹窗
   ============================================================ */

/* GLM: 卡片底部按钮区（替代原「查看详情→」纯文字 CTA） */
.ha-prod-btns {
  display: flex;
  gap: 8px;
  padding: 10px 12px 14px;
}

.ha-prod-btn-cart,
.ha-prod-btn-buy {
  flex: 1;
  height: 34px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, filter 0.15s;
  white-space: nowrap;
}

.ha-prod-btn-cart {
  background: #fff;
  color: #7c5c9c;
  border: 1px solid #c9b3de;
}

.ha-prod-btn-cart:hover {
  background: #f5f0fa;
  border-color: #9b7bb8;
}

.ha-prod-btn-buy {
  background: linear-gradient(135deg, #9b7bb8, #7c5c9c);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(124, 92, 156, 0.28);
}

.ha-prod-btn-buy:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.ha-prod-btn-cart:active,
.ha-prod-btn-buy:active {
  transform: scale(0.97);
}

/* GLM: batch-65 画廊卡片商品实拍图（替代预置灵感卡的 Canvas 黑底渲染） */
.gallery-card-photo {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin: 0 auto 14px;
  display: block;
  background: rgba(155, 123, 184, 0.05);
}

html.dark .gallery-card-photo {
  background: rgba(255, 255, 255, 0.04);
}

/* GLM: batch-64 商品区下沉到画廊之后，与画廊区拉开间距 */
.gallery-shop {
  padding-top: 8px;
}

/* GLM: 商城购物车弹窗条目 */
.mall-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0eaf6;
}

.mall-item:last-of-type {
  border-bottom: none;
}

.mall-item-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #f5f2f8;
  flex: 0 0 auto;
}

.mall-item-img-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.mall-item-info {
  flex: 1;
  min-width: 0;
}

.mall-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a1a2e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mall-item-meta {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-top: 2px;
}

.mall-item-price {
  font-weight: 700;
  color: #b91c1c;
  font-size: 0.85rem;
  white-space: nowrap;
}

.mall-item-del {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0.55;
  padding: 4px;
  transition: opacity 0.15s;
}

.mall-item-del:hover {
  opacity: 1;
}

.mall-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1a1a2e;
}

.mall-total-price {
  color: #b91c1c;
  font-size: 1.05rem;
}

/* GLM: 商城收银台明细表 */
.mall-checkout-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.mall-checkout-table th,
.mall-checkout-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #f0eaf6;
  text-align: left;
}

.mall-checkout-table th {
  font-size: 0.7rem;
  color: #9ca3af;
  font-weight: 600;
}

.mall-checkout-table .col-price,
.mall-checkout-table .col-subtotal {
  text-align: right;
  white-space: nowrap;
}

.mall-checkout-table .col-qty {
  text-align: center;
  width: 52px;
}

.mall-checkout-table .row-total td {
  border-bottom: none;
  font-weight: 700;
  color: #1a1a2e;
  font-size: 0.88rem;
}

.mall-checkout-table .row-total .col-subtotal {
  color: #b91c1c;
  font-size: 1rem;
}

/* GLM: 收银台服务承诺条 */
.mall-trust {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.mall-trust span {
  font-size: 0.66rem;
  color: #6b7280;
  background: #f5f2f8;
  border-radius: 999px;
  padding: 3px 9px;
}

/* GLM: batch-63 暗色适配（gallery/diy 暗色主题） */
html.dark .mall-item-name,
html.dark .mall-total {
  color: #f3f4f6;
}
html.dark .mall-item,
html.dark .mall-checkout-table th,
html.dark .mall-checkout-table td {
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark .mall-trust span,
html.dark .mall-item-img {
  background: rgba(255, 255, 255, 0.06);
}
html.dark .ha-prod-btn-cart {
  background: transparent;
  color: #c9b3de;
  border-color: rgba(201, 179, 222, 0.4);
}
html.dark .ha-prod-btn-cart:hover {
  background: rgba(155, 123, 184, 0.12);
}
