﻿/* ========== 晨曦美甲 · 数字美甲工作室 ========== */
/* 基于Luna Atelier技术的纯CSS伪3D甲片渲染 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 素灰色调(Luna blank 素甲 #c3cacc 基调, 2026-10-26) */
  --bg-primary: #d3d7d9;
  --bg-secondary: #e3e6e8;
  --bg-card: #eceeef;
  --text-primary: #454b4e;
  --text-secondary: #7c8387;
  --text-muted: #a9b0b4;
  --border-color: rgba(255, 255, 255, 0.64);
  --shadow-color: rgba(70, 75, 78, 0.16);
  --accent-color: #8a9599;
  --accent-light: #b9c2c5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========== 加载动画 ========== */
.atelier-splash {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.atelier-splash.hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-logo {
  font-size: 48px;
  font-weight: 300;
  letter-spacing: 8px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.splash-subtitle {
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 40px;
}

.splash-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.splash-progress span {
  font-size: 13px;
  color: var(--text-secondary);
}

.splash-progress i {
  width: 120px;
  height: 2px;
  background: var(--accent-light);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.splash-progress i::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 60%;
  background: var(--accent-color);
  border-radius: 2px;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* ========== 主应用布局 ========== */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

/* ========== 顶部栏 ========== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-primary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.brand-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.brand-button:hover {
  transform: scale(1.05);
}

.brand-mark {
  font-size: 18px;
  font-weight: 500;
  color: var(--accent-color);
}

.project-title {
  text-align: center;
  flex: 1;
}

.atelier-wordmark {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.title-button {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 2px;
}

.history-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-button:hover {
  background: var(--accent-light);
}

.icon-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========== 工作室区域 ========== */
.studio {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.studio-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
}

.studio-step {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.studio-meta h2 {
  font-size: 22px;
  font-weight: 400;
  color: var(--text-primary);
}

/* ========== 视图切换 ========== */
.mode-switcher {
  display: flex;
  background: var(--bg-card);
  border-radius: 20px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.mode-button {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-button.active {
  background: var(--text-primary);
  color: var(--bg-card);
}

/* ========== 甲片舞台 ========== */
.stage-wrap {
  flex: 1;
  position: relative;
  /* 素灰舞台(Luna blank 素甲基调, 与白色素甲底图形成对比) */
  background: linear-gradient(160deg, #cfd4d6 0%, #c0c6c9 45%, #b4babe 100%);
  border-radius: 24px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.focus-hint {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.8);
  padding: 6px 16px;
  border-radius: 12px;
  z-index: 10;
}

.nail-stage {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  position: relative;
  perspective: 900px;
  transition: all 0.7s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.nail-stage.ten-mode {
  gap: 34px;
}

.hand {
  position: relative;
  width: 180px;
  height: 200px;
}

.hand-right {
  transform: scaleX(-1);
}

/* ========== 甲片基础（五层结构 - 基于Luna Atelier渲染技术） ========== */
.nail {
  --nail-color: transparent;
  --nail-texture: none;
  --texture-size: 100% 100%;
  --cat-angle: 25deg;
  --cat-x: 50%;
  --cat-y: 48%;
  --cat-width: 22%;
  --cat-glow: 0.72;
  --cat-opacity: 0;
  --hue-offset: 0deg;
  --saturation: 100%;
  --brightness: 100%;

  position: absolute;
  width: var(--nail-base-width, 38px);
  height: var(--nail-base-height, 78px);
  transform-origin: center bottom;
  border-radius: 0;
  /* 背景色 + 纹理图叠加：纹理图直接显示在背景色之上，被mask正确裁切 */
  background-color: var(--nail-color);
  background-image: var(--nail-texture, none);
  background-size: var(--texture-size, 100% 100%);
  background-position: center;
  background-repeat: no-repeat;
  /* PNG蒙版(Luna式)：RGB全白+alpha轮廓, 显式mask-mode:alpha */
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
  border: none;
  overflow: visible;
  cursor: pointer;
  transition: all 0.3s ease;
  will-change: transform;
  /* Luna外层投影: 跟随蒙版轮廓, 与背景柔和分离 */
  filter: drop-shadow(0 9px 12px rgba(81, 62, 56, 0.12));
}

.nail:hover {
  transform: scale(1.05);
  z-index: 10;
}

/* 容器高光层 - 已隐藏，由SVG提供形状 */
.nail::before {
  display: none;
}

/* 第2层：表面层（底胶面 · Luna Atelier 3D弧度精确参数） */
.nail-surface {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: inherit;
  clip-path: none;
  /* 背景已移至.nail元素（错误12修复方案：纹理图直接在.nail上显示） */
  background: transparent;
  /* 边缘高光 */
  border: 1px solid rgba(255, 255, 255, 0.64);
  /* 3D弧度：左上内高光 + 右下内阴影 + 外投影 */
  box-shadow:
    inset 7px 1px 12px rgba(255, 255, 255, 0.56),
    inset -5px -4px 12px rgba(75, 88, 91, 0.13),
    0 9px 20px rgba(69, 74, 75, 0.1);
  pointer-events: none;
  z-index: 1;
  /* 调色滤镜已移至.nail元素（错误12修复方案） */
  filter: none;
}

/* SVG甲型模板层 - 已隐藏，用mask代替 */
.nail-svg-img {
  display: none;
}

/* 表面高光层 - 已隐藏（见错误日志错误7：伪元素与SVG mask方案冲突，禁用） */
.nail-surface::before {
  display: none;
}

/* 永久高光层（Luna Atelier 弧面高光）：
   用真实DOM元素.gloss-layer实现，避免伪元素与SVG mask方案冲突（错误日志错误7），
   随.nail的mask一起被正确裁切 */
.gloss-layer {
  display: none !important;  /* 2026-10-26 用户要求全局关闭高光雾层 */
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg,
    rgba(255, 255, 255, 0.35), transparent 34%,
    rgba(255, 255, 255, 0.08) 68%, rgba(255, 255, 255, 0.18));`n  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 8;
}

/* 第5层：猫眼光带（Luna Atelier精确参数） */
.nail-surface::after {
  content: "";
  position: absolute;
  width: var(--cat-width);
  height: 150%;
  left: var(--cat-x);
  top: var(--cat-y);
  transform: translate(-50%, -50%) rotate(var(--cat-angle));
  /* 猫眼光带渐变：中间亮，带青色边缘（Luna Atelier精确参数） */
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    rgba(255, 255, 255, 0.85) 50%, /* 最亮的核心 */
    rgba(255, 255, 255, 0.15) 80%, /* 边缘 */
    transparent
  );
  filter: blur(2px);                 /* Luna精确参数：锐利光带 */
  mix-blend-mode: screen;            /* 屏幕混合模式，增强发光效果 */
  opacity: var(--cat-opacity, 0);
  transition: opacity 0.5s, width 0.3s;
  pointer-events: none;
  z-index: 7;
}

.nail[data-material="cat"] .nail-surface::after {
  opacity: 1;
}

/* 第4层：纹理层 - 已废弃，纹理图直接设置在.nail的background-image上（错误12修复方案） */
.texture-layer {
  display: none;
}

/* ========== 五层涂层：波点/法式/手绘/钻饰（Luna Atelier 图层技术） ========== */

/* SVG 图层容器共用：随甲型拉伸，viewBox 100×100 */
.dot-layer,
.french-layer,
.drawing-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

/* ② 波点层：弧面透视数据由 data-dot-curve-* 属性驱动 */
/* 默认顺序由 JS 设置 inline z-index(波点在法式之上, 可画在法式面上), CSS 仅为兜底 */
.dot-layer {
  z-index: 4;
}

.dot-layer .dot-main {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

.dot-layer .dot-main.dragging {
  cursor: grabbing;
}

.dot-layer .dot-main.selected {
  stroke: #ff5c93;
  stroke-width: 0.9;
  stroke-dasharray: 2.6 1.8;
}

/* ③ 法式层 */
.french-layer {
  z-index: 3;
}

/* ④ 手绘层：三段浮雕描边（阴影 + 主色 + 高光） */
.drawing-layer {
  z-index: 5;
}

.drawing-stroke-depth {
  stroke: #564b47;
  opacity: 0.17;
}

.drawing-stroke-main {
  opacity: 0.94;
  filter: drop-shadow(0.2px 0.35px 0.28px rgba(48, 35, 31, 0.18));
}

.drawing-stroke-gloss {
  stroke: rgba(255, 255, 255, 0.84);
  opacity: 0.42;
  mix-blend-mode: screen;
}

/* ⑤ 钻饰层：定位/旋转/缩放/落钻回弹动画 */
.nail-decoration {
  position: absolute;
  width: var(--decor-size, 34%);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(var(--rotation, 0deg));
  display: grid;
  place-items: center;
  z-index: 10;
  /* 无阴影(2026-10-30 用户要求全部钻饰无阴影) */
  animation: jewelDrop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes jewelDrop {
  from { opacity: 0; transform: translate(-50%, -70%) scale(0.3) rotate(-8deg); }
  to { opacity: 1; }
}

.nail-decoration .gem {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

/* CSS 手绘钻饰 */
.gem.crystal {
  clip-path: polygon(50% 0, 90% 24%, 100% 65%, 50% 100%, 0 65%, 10% 24%);
  background: linear-gradient(145deg, #fff, #bad2d7 35%, #fff 58%, #c6a6c7);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.gem.pearl {
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fff, #f6ede2 42%, #c9c0b8 100%);
  box-shadow: inset -2px -2px 5px rgba(120, 100, 90, 0.2);
}

.gem.moon {
  font-size: 22px;
  color: #d7c08b;
  text-shadow: 0 1px 2px #fff;
}

.gem.star {
  font-size: 22px;
  color: #e4d6bd;
  text-shadow: 0 1px 2px #8e7b68;
}

.gem.bow {
  font-size: 20px;
  color: #d6d0ca;
}

.gem.flower {
  font-size: 21px;
  filter: grayscale(0.25);
}

.gem.chain {
  width: 100%;
  height: 6px;
  border: 2px dotted #c7b37f;
  border-radius: 999px;
}

/* ========== 新甲型分类体系（5大类 × 5尺寸 × 5长度 = 125种） ========== */
/* 严格照抄 Luna Atelier 甲型参数 */

/* 基础尺寸变量（基于Luna椭圆/中尺寸） */
:root {
  --nail-base-width: 40px;
  --nail-base-height: 78px;
}

/* 5大甲型类 - 使用SVG mask，不再需要border-radius/clip-path */
/* 甲型形状完全由SVG mask控制 */

/* 4种长度（控制高度）- 匹配SVG拉伸比例 */
.nail.length-s  { height: var(--nail-base-height); }  /* 短：基准 */
.nail.length-m  { height: calc(var(--nail-base-height) * 1.20); }  /* 中：短的1.2倍 */
.nail.length-l  { height: calc(var(--nail-base-height) * 1.44); }  /* 长：中的1.2倍 */
.nail.length-xl { height: calc(var(--nail-base-height) * 1.728); } /* 超长：长的1.2倍 */

/* 圆形单独使用1.3倍拉伸比例 */
.nail.shape-round.length-m  { height: calc(var(--nail-base-height) * 1.30); }  /* 中：短的1.3倍 */
.nail.shape-round.length-l  { height: calc(var(--nail-base-height) * 1.69); }  /* 长：中的1.3倍 */
.nail.shape-round.length-xl { height: calc(var(--nail-base-height) * 2.197); } /* 超长：长的1.3倍 */

/* ========== 6种材质效果（基于Luna Atelier精确参数） ========== */

/* 1. 透色材质（jelly）- color-mix + backdrop-filter */
.nail[data-material="jelly"] .nail-surface {
  background: color-mix(in srgb, var(--nail-color) 68%, transparent);
  backdrop-filter: blur(5px);
}

/* 2. 珠光材质（pearl）- radial-gradient + linear-gradient 双层渐变 */
.nail[data-material="pearl"] .nail-surface {
  background:
    radial-gradient(circle at 25% 18%, rgba(255, 255, 255, 0.86), transparent 28%),
    linear-gradient(135deg, #e9dbd8, var(--nail-color) 45%, #c5d4d7 115%);
}

/* 3. 闪粉材质（glitter）- 多层radial-gradient模拟闪粉颗粒 */
.nail[data-material="glitter"] .nail-surface {
  background-color: var(--nail-color);
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(255, 218, 185, 0.8) 0 1.5px, transparent 2px),
    radial-gradient(circle, rgba(255, 200, 220, 0.7) 0 1px, transparent 1.5px);
  background-size: 8px 8px, 12px 12px, 16px 16px;
}

/* 4. 金属材质（metal）- 多段linear-gradient模拟金属反光 */
.nail[data-material="metal"] .nail-surface {
  background: linear-gradient(
    110deg,
    #807c7c,
    #f9f8f4 22%,
    #a6a0a0 44%,
    #faf4ec 64%,
    #797778
  );
}

/* 5. 猫眼材质（cat）- radial-gradient高光 + 基础色 */
.nail[data-material="cat"] .nail-surface {
  background:
    radial-gradient(circle at 70% 15%, rgba(255, 255, 255, 0.38), transparent 28%),
    var(--nail-color);
}

/* 6. 素甲材质（blank）- 半透明白色 + 自定义内阴影 */
.nail[data-material="blank"] .nail-surface {
  background: rgba(195, 202, 204, 0.76);
  box-shadow:
    inset 7px 1px 12px rgba(255, 255, 255, 0.56),
    inset -5px -4px 12px rgba(75, 88, 91, 0.13),
    0 9px 20px rgba(69, 74, 75, 0.1);
}

/* 7. 透明塑料材质（transparent-plastic）- 高透明度 + 光泽 + 折射 */
.nail[data-material="transparent-plastic"] .nail-surface {
  /* 高透明度，可以看到下面的SVG甲型轮廓 */
  background: color-mix(in srgb, var(--nail-color, #ffffff) 25%, transparent);
  /* 背景模糊模拟折射 */
  backdrop-filter: blur(2px);
  /* 表面光泽：多层高光模拟塑料反光 */
  box-shadow:
    inset 8px 2px 15px rgba(255, 255, 255, 0.7),      /* 左上强高光 */
    inset -6px -5px 14px rgba(100, 110, 120, 0.15),    /* 右下弱阴影 */
    inset 0 -3px 8px rgba(255, 255, 255, 0.3),          /* 底部边缘高光 */
    0 6px 16px rgba(80, 90, 100, 0.12);                 /* 外投影 */
  /* 边缘高光 */
  border: 1.5px solid rgba(255, 255, 255, 0.8);
}

/* 透明塑料材质的额外高光层 */
.nail[data-material="transparent-plastic"] .nail-surface::before {
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.6) 0%,
    transparent 25%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 75%,
    rgba(255, 255, 255, 0.3) 100%
  );
  opacity: 0.9;
}

/* 8. 真实照片材质（photo）- 高清实拍纹理完美附着任意甲型 */
.nail[data-material="photo"] {
  /* 照片材质使用cover确保完美覆盖，不缩小不变形 */
  --texture-size: cover;
  /* 底色设为透明，让照片纹理完全显示 */
  background-color: transparent !important;
}

.nail[data-material="photo"] .nail-surface {
  /* 保持3D弧度效果，但降低高光强度以保留照片真实感 */
  box-shadow:
    inset 5px 1px 10px rgba(255, 255, 255, 0.35),
    inset -4px -3px 10px rgba(75, 88, 91, 0.1),
    0 9px 20px rgba(69, 74, 75, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* 照片材质的高光层：降低透明度，避免覆盖照片细节 */
.nail[data-material="photo"] .gloss-layer {
  opacity: 0.5;
}

/* 照片材质禁用猫眼光带 */
.nail[data-material="photo"] .nail-surface::after {
  opacity: 0 !important;
}

/* 9. 宝石质感材质（gem）- 高清生成，通透透亮，适配任意甲型 */
.nail[data-material="gem"] {
  --texture-size: 115% 115%;
  background-position: center center !important;
  background-color: transparent !important;
}

.nail[data-material="gem"] .nail-surface {
  box-shadow:
    inset 6px 1px 14px rgba(255, 255, 255, 0.45),
    inset -5px -4px 14px rgba(0, 0, 0, 0.2),
    0 9px 24px rgba(69, 74, 75, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.nail[data-material="gem"] .gloss-layer {
  opacity: 0.6;
  background: linear-gradient(125deg,
    rgba(255, 255, 255, 0.5), transparent 30%,
    rgba(255, 255, 255, 0.1) 60%, rgba(255, 255, 255, 0.25));
}

.nail[data-material="gem"] .nail-surface::after {
  opacity: 0 !important;
}

/* ========== 猫眼预设效果 ========== */
/* 玻璃珠反光(2026-11-01): 抑制 CSS 光带, 由 WebGL 层接管 */
.nail[data-cat-preset="glass"] .nail-surface::after { opacity: 0 !important; }
.nail[data-cat-preset="diagonal"] { --cat-angle: 45deg; }
.nail[data-cat-preset="wide"] { --cat-width: 55%; --cat-glow: 0.9; }
.nail[data-cat-preset="circle"] {
  --cat-width: 60%;
  --cat-x: 50%;
  --cat-y: 50%;
}
.nail[data-cat-preset="circle"] .nail-surface::after {
  border-radius: 50%;
  height: 60%;
  background: radial-gradient(circle, rgba(255,255,255,calc(0.85 * var(--cat-glow))) 0%, rgba(255,255,255,calc(0.3 * var(--cat-glow))) 50%, transparent 70%);
}
.nail[data-cat-preset="focus"] {
  --cat-width: 30%;
  --cat-glow: 1;
}
.nail[data-cat-preset="french"] {
  --cat-y: 80%;
  --cat-width: 70%;
}
.nail[data-cat-preset="cross"] .nail-surface::after {
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,calc(0.6 * var(--cat-glow))) 50%, transparent),
    linear-gradient(0deg, transparent, rgba(255,255,255,calc(0.6 * var(--cat-glow))) 50%, transparent);
  width: 80%;
  height: 80%;
}

/* ========== 十指甲片排列 ========== */
.hand-left .nail:nth-child(1),
.hand-right .nail:nth-child(5) {
  left: -2%;
  top: 75px;
  transform: rotate(-54deg) scale(1.08);
}

.hand-left .nail:nth-child(2),
.hand-right .nail:nth-child(4) {
  left: 22%;
  top: 38px;
  transform: rotate(-21deg) scale(0.92);
}

.hand-left .nail:nth-child(3),
.hand-right .nail:nth-child(3) {
  left: 44%;
  top: 18px;
  transform: rotate(-4deg);
}

.hand-left .nail:nth-child(4),
.hand-right .nail:nth-child(2) {
  left: 64%;
  top: 36px;
  transform: rotate(14deg) scale(0.88);
}

.hand-left .nail:nth-child(5),
.hand-right .nail:nth-child(1) {
  left: 74%;
  top: 73px;
  transform: rotate(29deg) scale(0.68);
}

/* ========== 单甲模式(2026-10-30: 经点击甲片进入, 视图切换器仅五指/十指) ========== */
/* 单甲聚焦: 取消右手容器水平镜像, 聚焦甲(无论左右手)始终正向显示 */
.nail-stage.single-mode .hand-right {
  transform: none !important;
}

/* 两手容器铺满整个舞台, 聚焦甲 left/top 50% 即舞台正中心
   (否则左手甲居中在左半区、右手甲居中在右半区 = 靠左/靠右) */
.nail-stage.single-mode .hand-left,
.nail-stage.single-mode .hand-right {
  position: absolute !important;
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
}

/* 非聚焦甲片完全隐藏(干净的单甲视图,不再堆叠在聚焦甲内部)
   !important: 覆盖手部布局等任何规则;animation/transition:none 防止入场动画填充覆盖 */
.nail-stage.single-mode .nail {
  opacity: 0 !important;
  filter: none !important;
  pointer-events: none;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) scale(0.5) !important;
  animation: none !important;
  transition: none !important;
}

.nail-stage.single-mode .nail.focused {
  opacity: 1 !important;
  filter: drop-shadow(0 9px 12px rgba(81, 62, 56, 0.12)) !important;
  pointer-events: auto;
  width: 150px !important;
  height: 300px !important;
  transform-origin: center center !important;
  /* 滚轮/双指缩放: --focus-scale 由 JS 控制,范围 0.5~3 */
  transform: translate(-50%, -50%) scale(var(--focus-scale, 1)) !important;
  animation: none !important;
  /* 关闭过渡: 防止尺寸/透明度渐变动画造成"半透明"观感与缩放回弹延迟 */
  transition: none !important;
  z-index: 20;
}

.nail-stage.single-mode .nail.focused .nail-surface {
  border: none;  /* 放大后白色描边会变成刺眼的白色直线附边 */
  /* 注意: 不能带向下偏移的外阴影(0 30px 70px) —— 会被甲片蒙版裁切后
     在甲面内部下方形成"甲中小甲片"的深色假影 */
  box-shadow:
    inset 20px 3px 30px rgba(255, 255, 255, 0.52),
    inset -12px -8px 25px rgba(99, 68, 62, 0.14);
}

/* ========== 五指模式 ========== */
/* 2026-10-30: 未显示的手 display:none 完全移出布局 ——
   ① 显示手(左手)独占整行并居中(不再被挤到左半区)
   ② 隐藏手的甲片 rect 归零, 3D 钻饰层不再渲染"幽灵模型" */
.nail-stage.five-mode .hand-right {
  display: none !important;
}

.nail-stage.five-mode .hand-left {
  width: 100%;
}

/* ========== 材料盘 ========== */
.material-dock {
  background: var(--bg-card);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.dock-drag-zone {
  display: flex;
  justify-content: center;
  padding: 12px 0 8px;
}

.dock-handle {
  width: 40px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  opacity: 0.3;
}

.dock-tabs {
  display: flex;
  padding: 0 16px;
  gap: 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.dock-tab {
  flex: 1;
  padding: 12px 8px;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.dock-tab span {
  font-size: 16px;
}

.dock-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-color);
}

.dock-content {
  padding: 16px;
  min-height: 200px;
}

.tool-panel {
  display: none;
}

.tool-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
}

.panel-heading span {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.panel-heading h2 {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
}

.catalog-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* ========== 横向滚动 ========== */
.horizontal-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-light) transparent;
}

.horizontal-scroll::-webkit-scrollbar {
  height: 4px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
  background: var(--accent-light);
  border-radius: 2px;
}

/* ========== 甲型列表（新三级选择） ========== */
#shape-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shape-section-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

.shape-option-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;      /* 全部版型一次展示,无滚动条 */
  overflow: visible;
  padding-bottom: 4px;
}

/* 甲型面板返回分类按钮 */
.shape-back-btn {
  display: block;
  width: 100%;
  padding: 6px 10px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(127,116,110,.15));
  background: rgba(255,255,255,.55);
  color: var(--text-secondary, #827770);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}
.shape-back-btn:hover {
  background: rgba(255,255,255,.9);
  color: var(--text-primary, #493f3c);
}

.shape-option {
  flex: 0 0 auto;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 60px;
}

.shape-option:hover {
  border-color: var(--accent-light);
  transform: translateY(-2px);
}

.shape-option.active {
  border-color: var(--accent-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 500;
}

.shape-option .shape-preview {
  width: 24px;
  height: 48px;
  background: linear-gradient(135deg, #c3cacc, #9aa4a8);
  box-shadow: inset 2px 1px 4px rgba(255,255,255,0.5), inset -1px -1px 4px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: all 0.2s ease;
}

/* 方形甲照片蒙版预览(尺寸随版型比例) */
.shape-option .shape-preview.fangxing-preview {
  width: auto;
  min-width: 20px;
  max-width: 44px;
  height: 48px;
  aspect-ratio: var(--mask-ratio, 0.4);
  background: #c3cacc;
  box-shadow: inset 2px 1px 4px rgba(255,255,255,0.5), inset -1px -1px 4px rgba(0,0,0,0.1);
}

.shape-option-meta {
  font-size: 8px;
  color: var(--text-muted, #a09189);
  margin-top: 1px;
}

/* 甲型预览形状（仅预览小图，与舞台甲片的SVG mask方案无关——错误日志错误3仅针对.nail） */
.shape-option .shape-preview.shape-squoval { border-radius: 18% 18% 22% 22% / 10% 10% 14% 14%; }
.shape-option .shape-preview.shape-coffin { border-radius: 12% 12% 30% 30% / 5% 5% 10% 10%; clip-path: polygon(20% 0, 80% 0, 95% 85%, 90% 100%, 10% 100%, 5% 85%); }
.shape-option .shape-preview.shape-round { border-radius: 45% 45% 40% 40% / 35% 35% 18% 18%; }
.shape-option .shape-preview.shape-oval { border-radius: 50% 50% 42% 42% / 40% 40% 15% 15%; }
.shape-option .shape-preview.shape-almond { border-radius: 50% 50% 42% 42% / 60% 60% 12% 12%; clip-path: polygon(50% 0, 80% 25%, 95% 70%, 90% 100%, 10% 100%, 5% 70%, 20% 25%); }

.shape-option-name {
  font-size: 11px;
  text-align: center;
}

.size-option,
.length-option {
  min-width: 48px;
  padding: 10px 12px;
  font-weight: 600;
}

.shape-current-info {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-top: 4px;
}

/* 兼容旧样式 */
.shape-item {
  flex: 0 0 auto;
  width: 70px;
  padding: 12px 8px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.shape-item:hover {
  border-color: var(--accent-light);
}

.shape-item.active {
  border-color: var(--accent-color);
  background: var(--bg-card);
}

.shape-preview {
  width: 30px;
  height: 60px;
  background: linear-gradient(135deg, #c3cacc, #9aa4a8);
  border-radius: inherit;
  box-shadow: inset 3px 1px 6px rgba(255,255,255,0.5), inset -2px -2px 6px rgba(0,0,0,0.1);
}

.shape-name {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
}

.shape-item.active .shape-name {
  color: var(--text-primary);
  font-weight: 500;
}

/* ========== 颜色筛选 ========== */
.material-filter {
  margin-bottom: 16px;
}

.filter-btn {
  flex: 0 0 auto;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--accent-light);
}

.filter-btn.active {
  background: var(--text-primary);
  color: var(--bg-card);
  border-color: var(--text-primary);
}

/* ========== 颜色列表 ========== */
.swatch-item {
  flex: 0 0 auto;
  width: 60px;
  padding: 10px 6px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.swatch-item:hover {
  border-color: var(--accent-light);
  transform: translateY(-2px);
}

.swatch-item.active {
  border-color: var(--accent-color);
  background: var(--bg-card);
}

.swatch-color {
  position: relative;
  isolation: isolate;
  width: 40px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 3px rgba(255,255,255,0.3);
  overflow: hidden;
}

/* 真实纹理色卡(差距1):预览小图贴在色块上,所见即所得 */
.swatch-color img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  pointer-events: none;
}

.swatch-name {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}

.swatch-item.active .swatch-name {
  color: var(--text-primary);
  font-weight: 500;
}

/* ========== 猫眼预设 ========== */
.cat-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.cat-preset {
  flex: 0 0 calc(33.333% - 6px);
  padding: 10px 8px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 2px solid transparent;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-preset:hover {
  border-color: var(--accent-light);
}

.cat-preset.active {
  border-color: var(--accent-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 500;
}

/* ========== 滑块控件 ========== */
.cat-sliders,
.adjust-sliders {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cat-sliders label,
.adjust-sliders label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.cat-sliders label span,
.adjust-sliders label span {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cat-sliders output,
.adjust-sliders output {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 8px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--accent-light);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* ========== 五层涂层面板控件（波点/法式/手绘/钻饰） ========== */
.layer-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.layer-controls .control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.layer-controls .control-row > span:first-child {
  min-width: 68px;
}

.layer-controls .control-row input[type="range"] {
  flex: 1;
  min-width: 120px;
}

.layer-controls .control-row output {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 8px;
}

.layer-controls input[type="color"] {
  width: 44px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--accent-light);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
}

.layer-controls input[type="color"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

/* 面板标题栏内的开关标签（覆盖 .panel-heading span 的标题样式） */
.panel-heading .switch-row,
.panel-heading .switch-row span {
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-secondary);
  display: inline;
  margin-bottom: 0;
}

.switch-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-color);
  cursor: pointer;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.layer-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ========== 调色预览 ========== */
.color-preview-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 16px;
  margin-bottom: 20px;
}

#color-preview-nail {
  position: relative;
  flex: 0 0 auto;
  /* 调色预览专用椭圆甲面（ID限定，不影响舞台甲片的SVG mask方案） */
  border-radius: 50% 50% 42% 42% / 40% 40% 15% 15%;
  background: transparent;
  overflow: hidden;
}

.color-info {
  flex: 1;
}

.color-info strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.color-info small {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ========== 按钮 ========== */
.secondary-action {
  padding: 10px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-action:hover {
  background: var(--accent-light);
  color: var(--text-primary);
}

.adjust-actions {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

/* ========== 底部栏 ========== */
.dock-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.autosave {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.autosave i {
  width: 8px;
  height: 8px;
  background: #4caf50;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.finish-button {
  padding: 12px 24px;
  background: var(--text-primary);
  color: var(--bg-card);
  border: none;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.finish-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========== 清空按钮 ========== */
.canvas-clear-button {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
}

.canvas-clear-button:hover {
  background: #ff6b6b;
  color: white;
  border-color: #ff6b6b;
}

.back-to-set {
  position: absolute;
  bottom: 16px;
  left: 16px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 10;
}

.hidden {
  display: none !important;
}

/* ========== 提示消息 ========== */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: var(--bg-card);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ========== 响应式 ========== */
@media (max-width: 480px) {
  .app-shell {
    max-width: 100%;
  }
  
  .hand {
    width: 150px;
    height: 180px;
  }
  
  .nail-stage.ten-mode {
    gap: 20px;
  }
}

/* ========== 登录弹窗 ========== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(69, 55, 49, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50000;
  animation: fadeIn 0.3s ease;
}

.login-modal {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 32px;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-header h2 {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.login-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.login-field input {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  outline: none;
  transition: all 0.2s ease;
}

.login-field input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(139, 124, 117, 0.1);
}

.login-error {
  color: #e74c3c;
  font-size: 12px;
  text-align: center;
  padding: 8px;
  background: rgba(231, 76, 60, 0.1);
  border-radius: 8px;
}

.login-button {
  padding: 14px;
  background: var(--text-primary);
  color: var(--bg-card);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-button:active {
  transform: translateY(0);
}

/* ========== 管理员状态栏 ========== */
.admin-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #625652, #8d7e79);
  color: white;
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 40000;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.admin-status {
  font-weight: 500;
  letter-spacing: 0.05em;
}

.admin-logout {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-logout:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 管理员模式下页面顶部留出空间 */
body.admin-mode .app-shell {
  padding-top: 36px;
}

/* ========== 甲型编辑按钮 ========== */
.shape-edit-button {
  display: none;
  padding: 6px 12px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}

body.admin-mode .shape-edit-button {
  display: inline-block;
}

.shape-edit-button:hover {
  background: #766963;
  transform: translateY(-1px);
}

/* ========== 甲型编辑弹窗 ========== */
.shape-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(69, 55, 49, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60000;
  animation: fadeIn 0.3s ease;
}

.shape-editor-modal {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 28px;
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

.shape-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.shape-editor-header h3 {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.shape-editor-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.shape-editor-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.shape-editor-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  outline: none;
  margin-bottom: 20px;
  cursor: pointer;
}

.shape-editor-select:focus {
  border-color: var(--accent-color);
}

.shape-editor-section {
  margin-bottom: 20px;
}

.shape-editor-section h4 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.shape-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.shape-editor-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shape-editor-field label {
  font-size: 11px;
  color: var(--text-muted);
}

.shape-editor-field input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  outline: none;
  transition: all 0.2s ease;
}

.shape-editor-field input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(139, 124, 117, 0.1);
}

.shape-editor-clip-path {
  grid-column: 1 / -1;
}

.shape-editor-clip-path textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  outline: none;
  resize: vertical;
  min-height: 60px;
  font-family: monospace;
}

.shape-editor-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.shape-editor-save {
  flex: 1;
  padding: 12px;
  background: var(--text-primary);
  color: var(--bg-card);
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shape-editor-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.shape-editor-reset {
  padding: 12px 20px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shape-editor-reset:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.shape-editor-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 20px;
  min-height: 120px;
}

.shape-editor-preview .nail {
  position: relative;
  transform: none !important;
  left: auto !important;
  top: auto !important;
}

/* 管理员登录按钮 */
.admin-login-btn {
  padding: 6px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-login-btn:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

body.admin-mode .admin-login-btn {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* ========== 注册切换 ========== */
.auth-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-link {
  background: none;
  border: none;
  color: var(--accent-color);
  font-size: 13px;
  cursor: pointer;
  padding: 0 4px;
  text-decoration: underline;
}

.auth-link:hover {
  color: #625652;
}

/* ========== 底部导航栏 ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 30000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  padding: 6px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 12px;
}

.nav-item .nav-icon {
  font-size: 20px;
  opacity: 0.5;
  transition: all 0.2s ease;
}

.nav-item .nav-label {
  font-size: 11px;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.nav-item.active .nav-icon {
  opacity: 1;
  transform: scale(1.1);
}

.nav-item.active .nav-label {
  color: var(--accent-color);
  font-weight: 500;
}

.nav-item:hover {
  background: var(--bg-secondary);
}

/* 页面内容底部留出导航栏空间 */
.app-shell {
  padding-bottom: 70px;
}

/* ========== 作品页/我的页 空状态 ========== */
.empty-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 20px;
}

.empty-page-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.empty-page-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-page-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 300px;
  line-height: 1.6;
}

/* 页面切换 */
.page-content {
  display: none;
}

.page-content.active {
  display: block;
}

/* ========== 滑块编辑样式 ========== */
.slider-field {
  margin-bottom: 14px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.slider-label span {
  font-size: 12px;
  color: var(--text-secondary);
}

.slider-value {
  font-weight: 500;
  color: var(--accent-color) !important;
  font-size: 12px;
  min-width: 40px;
  text-align: right;
}

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

.editor-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent-color) 0%, var(--accent-color) var(--slider-progress, 50%), var(--border-color) var(--slider-progress, 50%), var(--border-color) 100%);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.editor-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--accent-color);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.editor-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.editor-slider::-webkit-slider-thumb:active {
  transform: scale(1.1);
}

.editor-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--accent-color);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.editor-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* ========== 裁切路径可视化编辑器 ========== */
.clip-path-visual-editor {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.clip-canvas-container {
  flex-shrink: 0;
  width: 160px;
}

.clip-path-svg {
  width: 160px;
  height: 240px;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  cursor: crosshair;
}

.clip-canvas-hint {
  font-size: 11px;
  color: #999;
  text-align: center;
  margin-top: 6px;
}

.clip-path-fields {
  flex: 1;
  min-width: 0;
}

.clip-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.clip-preset-btn {
  padding: 5px 12px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.clip-preset-btn:hover {
  border-color: #ff6b9d;
  color: #ff6b9d;
  background: #fff5f8;
}

.clip-control-point {
  fill: #ff6b9d;
  stroke: #fff;
  stroke-width: 2;
  cursor: grab;
  transition: r 0.15s;
}

.clip-control-point:hover {
  r: 8;
}

.clip-control-point.dragging {
  cursor: grabbing;
  r: 9;
  fill: #ff4081;
}

/* ========== 形状参数调节 ========== */
.shape-param-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid #eee;
  margin-top: 8px;
}

.toggle-btn {
  padding: 6px 16px;
  font-size: 12px;
  border: 1px solid #ff6b9d;
  border-radius: 6px;
  background: #fff;
  color: #ff6b9d;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn:hover {
  background: #ff6b9d;
  color: #fff;
}

.toggle-btn.active {
  background: #ff6b9d;
  color: #fff;
}

/* ========== 杏仁甲样式 ========== */
/* 杏仁甲形状完全由SVG mask控制，不再需要border-radius/clip-path */

/* ========== 底胶·自定义(生图智能体窗口) ========== */
.custom-gel-panel {
  padding: 10px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 14px;
}
.custom-gel-title { font-size: 11px; color: #7f746e; margin-bottom: 8px; }
.custom-gel-title small { color: #a09189; margin-left: 4px; }
.custom-gel-panel textarea {
  width: 100%; height: 74px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.9); background: rgba(255,255,255,.7);
  font-size: 11px; font-family: inherit; outline: none; resize: vertical;
}
.custom-gel-actions { display: flex; gap: 8px; margin-top: 8px; }
.custom-gel-actions button {
  flex: 1; padding: 9px 12px; border-radius: 999px; border: none; cursor: pointer;
  background: #9a7770; color: #fff; font-size: 11px;
}
.custom-gel-actions button:disabled { opacity: .45; cursor: not-allowed; }
.custom-gel-result { margin-top: 10px; text-align: center; }
.custom-gel-result img {
  width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px;
  background: #fff; border: 1px dashed #d8cfc7; display: none;
}
.custom-gel-result img[src] { display: block; }
.custom-gel-status { font-size: 9px; color: #a09189; margin-top: 6px; line-height: 1.5; }

/* 管理栏 API 按钮 */
.admin-api-btn {
  padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.2); color: #fff; font-size: 10px; cursor: pointer;
}
.admin-api-btn:hover { background: rgba(255,255,255,.35); }

/* ========== 短圆底胶面板 ========== */
.duanyuan-family-head {
  grid-column: 1 / -1;
  font-size: 10px;
  color: #7f746e;
  margin: 8px 0 2px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(127,116,110,.15);
}

/* ========== 纯材质显示(选择底胶后只显示底胶材质) ==========
   Luna式: 上色后保留白描边+内阴影三件套+外投影, 边缘4~5px亮度渐变 */
.nail.material-only {
  filter: drop-shadow(0 9px 12px rgba(81, 62, 56, 0.12)) !important;
}
.nail.material-only .nail-surface {
  border: none !important;  /* 移除白描边: 底胶铺满甲片无白缝(2026-10-30) */
  box-shadow:
    inset 7px 1px 11px rgba(255, 255, 255, 0.46),
    inset -6px -4px 13px rgba(99, 68, 62, 0.13),
    0 9px 20px rgba(81, 62, 56, 0.12) !important;
}
.nail.material-only .gloss-layer {
  display: none !important;
}

/* ========== 纯材质显示(加强版: 覆盖所有材质表面层) ========== */
.nail.material-only[data-material] .nail-surface {
  background: transparent !important;
  background-image: none !important;
  background-color: transparent !important;
  backdrop-filter: none !important;
  border: none !important;  /* 移除白描边: 底胶铺满甲片无白缝(2026-10-30) */
  box-shadow:
    inset 7px 1px 11px rgba(255, 255, 255, 0.46),
    inset -6px -4px 13px rgba(99, 68, 62, 0.13),
    0 9px 20px rgba(81, 62, 56, 0.12) !important;
}
.nail.material-only .nail-surface::before {
  display: none !important;
}

/* ========== ① 底胶色卡无边框 ========== */
.swatch-color {
  border: none !important;
  box-shadow: none !important;
  border-radius: 12px !important;
}

/* ========== ② 十指两排排列(上左手/下右手,大拇指同侧) ========== */
.nail-stage.ten-mode {
  flex-direction: column !important;
  gap: 14px !important;
  min-height: 440px;
}
.nail-stage.ten-mode .hand {
  transform: scale(0.82);
}
.nail-stage.ten-mode .hand-right {
  transform: scaleX(-1) scale(0.82);  /* 镜像保持大拇指同侧 */
}

/* 底胶空状态提示 */
.swatch-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 11px;
  color: #a09189;
  padding: 28px 10px;
  line-height: 1.8;
}

/* ========== 甲片全部竖直排列(十指/五指),大拇指同侧 ========== */
.nail-stage.ten-mode .hand,
.nail-stage.five-mode .hand-left {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  width: 100%;
  height: auto;
  transform: none;
}
.nail-stage.ten-mode .nail,
.nail-stage.five-mode .nail {
  position: relative !important;
  left: 0 !important;
  top: 0 !important;
  transform: none !important;
}
/* 右手行反序(小指→拇指),拇指与左手同侧(左侧) */
.nail-stage.ten-mode .hand-right {
  flex-direction: row-reverse;
  transform: none;
}
.nail-stage.ten-mode .hand-left,
.nail-stage.ten-mode .hand-right {
  transform: none;
}
.nail-stage.ten-mode {
  min-height: 260px;
}

/* ========== 预览色卡椭圆外形 ========== */
.swatch-color {
  border-radius: 50% !important;
}

/* ========== 凝胶层(底胶): 位于素甲背景之上、表面涂层(波点/法式/手绘/高光)之下 ========== */
.gel-layer {
  position: absolute;
  inset: 0;
  z-index: 0;  /* 素甲是nail背景(无需盖), 表面层z-index:1, 底胶必须让波点/法式可见 */
  display: none;
  pointer-events: none;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: inherit;
}

/* ========== 素甲: 全部渲染层关闭,甲片完全透明(2026-10-26) ========== */
.nail[data-material="transparent-plastic"] .nail-surface,
.nail[data-material="blank"] .nail-surface {
  background: transparent !important;
  backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}
.nail[data-material="transparent-plastic"] .nail-surface::before,
.nail[data-material="blank"] .nail-surface::before {
  display: none !important;
}
.nail[data-material="transparent-plastic"] .nail-surface::after,
.nail[data-material="blank"] .nail-surface::after {
  display: none !important;
  opacity: 0 !important;
}
/* 注意: 必须仅对"未选底胶"(无material-only)生效,否则会阻止短圆底胶纹理层显示 */
.nail[data-material="transparent-plastic"]:not(.material-only) .gel-layer,
.nail[data-material="blank"]:not(.material-only) .gel-layer {
  display: none !important;
}
.nail[data-material="transparent-plastic"]:not(.material-only) .gloss-layer,
.nail[data-material="blank"]:not(.material-only) .gloss-layer {
  display: none !important;
}

/* ===== 自定义蒙版画布(底胶-自定义) ===== */
.panel-heading-right { display: flex; align-items: center; gap: 8px; }
.custom-canvas-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: linear-gradient(135deg, #f3c6d3, #e8b4b8);
  color: #5a323e; font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; line-height: 1;
}
.custom-canvas-btn:active { transform: scale(.96); }
.canvas-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(18,20,26,.97);
  display: none; flex-direction: column;
  padding: 14px; box-sizing: border-box; color: #fff;
}
.canvas-overlay.open { display: flex; }
.canvas-overlay-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2px 2px 12px;
}
.canvas-title span { font-size: 11px; letter-spacing: .14em; color: #e8b4b8; }
.canvas-title h2 { font-size: 17px; margin: 3px 0 1px; }
.canvas-title small { font-size: 11px; color: rgba(255,255,255,.55); }
.canvas-close-btn {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  border: none; background: rgba(255,255,255,.12); color: #fff;
  font-size: 15px; cursor: pointer;
}
.canvas-stage {
  position: relative; flex: 1; min-height: 0;
  border-radius: 14px; overflow: hidden;
  background-color: rgba(255,255,255,.05);
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.05) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.05) 75%),
    linear-gradient(45deg, rgba(255,255,255,.05) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.05) 75%);
  background-size: 26px 26px; background-position: 0 0, 13px 13px;
  touch-action: none;
}
#custom-nail-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.canvas-hint {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: rgba(255,255,255,.4); white-space: nowrap; pointer-events: none;
}
.canvas-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 2px 2px;
}
.canvas-tool-group { display: flex; align-items: center; gap: 6px; }
.canvas-tool-btn, .canvas-action-btn {
  min-width: 40px; height: 38px; padding: 0 12px;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08); color: #fff;
  font-size: 13px; cursor: pointer;
}
.canvas-tool-btn.active { background: #e8b4b8; color: #4a2733; border-color: #e8b4b8; }
.canvas-color {
  width: 30px; height: 30px; border-radius: 50%; padding: 0;
  border: 2px solid rgba(255,255,255,.3); cursor: pointer;
}
.canvas-color.active { border-color: #fff; box-shadow: 0 0 0 2px #e8b4b8; }
.canvas-color-picker {
  width: 30px; height: 30px; border-radius: 50%; padding: 0;
  border: 2px solid rgba(255,255,255,.3); cursor: pointer; background: none;
}
.canvas-size { gap: 8px; font-size: 12px; color: rgba(255,255,255,.75); }
.canvas-size input[type=range] { width: 92px; accent-color: #e8b4b8; }
.canvas-size output { min-width: 22px; text-align: center; font-weight: 600; }
.canvas-actions { margin-left: auto; }
.canvas-apply-btn {
  height: 38px; padding: 0 16px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #e8b4b8, #d98aa0); color: #4a2733;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.canvas-apply-btn:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 480px) {
  .canvas-toolbar { gap: 8px; }
  .canvas-size input[type=range] { width: 64px; }
  .canvas-colors { order: 2; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .canvas-actions { margin-left: 0; }
  .custom-canvas-btn span { display: none; }
}

/* ========== 五指视图v2: 上方对齐 + 指尖微微内弧(2026-10-28) ========== */
.nail-stage.five-mode .hand-left,
.nail-stage.five-mode .hand-right {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;   /* 上方(指尖)对齐, 原底部对齐 */
  gap: 12px;
  width: 100%;
  height: auto;
}
.nail-stage.five-mode .hand-right {
  flex-direction: row-reverse;   /* 右手反序, 拇指与左手同侧 */
}
.nail-stage.five-mode .nail[data-finger="thumb"] { transform: translateY(1px) !important; }
.nail-stage.five-mode .nail[data-finger="index"] { transform: translateY(5px) !important; }
.nail-stage.five-mode .nail[data-finger="middle"] { transform: translateY(7px) !important; }
.nail-stage.five-mode .nail[data-finger="ring"]  { transform: translateY(4px) !important; }
.nail-stage.five-mode .nail[data-finger="pinky"] { transform: translateY(1px) !important; }
/* ========== AI生图工作流面板(2026-10-28) ========== */
.ai-wf-row { margin-bottom: 10px; }
.ai-wf-label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.ai-wf-preview { margin-top: 6px; }
.ai-wf-preview img { max-width: 120px; max-height: 120px; border-radius: 10px; border: 1px solid var(--border-color);
  background-image: conic-gradient(#d9d9d9 25%, #ffffff 0 50%, #d9d9d9 0 75%, #ffffff 0);
  background-size: 12px 12px; }
.ai-wf-styles { display: flex; gap: 6px; flex-wrap: wrap; }
#ai-wf-ref { font-size: 12px; }

/* AI生图入口chip高亮 */
.filter-btn.ai-wf-entry { color: #454b4e; border: 1px solid #8a9599; background: linear-gradient(135deg, #eceeef, #c3cacc); font-weight: 500; }

/* ========== AI 生成 3D 钻饰(Tripo 文生3D/图生3D) ========== */
.decor-ai-wrap { margin-bottom: 12px; }
.decor-ai-panel .decor-ai-modes { display: flex; gap: 6px; margin-bottom: 8px; }
.decor-ai-panel .decor-ai-mode { padding: 5px 14px; font-size: 11px; }
.decor-ai-panel .decor-ai-mode.active { background: #9a7770; color: #fff; border-color: #9a7770; }
.decor-ai-panel .decor-ai-mode-box { margin-bottom: 8px; }
.decor-ai-panel #decor-ai-ref { font-size: 12px; }
.decor-ai-params { display: flex; gap: 14px; margin-top: 8px; }
.decor-ai-name-row { margin-top: 8px; }
#decor-ai-name {
  width: 100%; padding: 6px 10px; font-size: 11px; outline: none; box-sizing: border-box;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.75); color: #5d544f;
}
#decor-ai-name::placeholder { color: #b0a69f; }
.decor-ai-label { font-size: 10px; color: #7f746e; display: flex; align-items: center; gap: 5px; }
.decor-ai-label select {
  font-size: 11px; padding: 4px 6px; border-radius: 8px; outline: none;
  border: 1px solid rgba(255,255,255,.9); background: rgba(255,255,255,.7); color: #5d544f;
}
/* 钻饰预览卡(底胶式卡片: AI 生成最新在前) + 模糊搜索栏 */
.decor-search-wrap { flex: 1; min-width: 0; }
#decor-search {
  width: 100%; padding: 6px 10px; font-size: 11px; outline: none;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.75); color: #5d544f;
}
#decor-search::placeholder { color: #b0a69f; }
.decor-card-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.decor-card {
  flex: 0 0 auto; width: 64px; padding: 6px 6px 5px;
  background: var(--bg-secondary); border-radius: 12px;
  border: 2px solid transparent; cursor: pointer; transition: all 0.2s ease;
}
.decor-card:hover { border-color: var(--accent-light); transform: translateY(-2px); }
.decor-card-thumb {
  width: 100%; height: 46px; border-radius: 8px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: 22px; color: #9a7770;
  border: 1px solid rgba(255,255,255,.9);
}
.decor-card-thumb img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.decor-card-name {
  font-size: 9px; color: var(--text-secondary); text-align: center;
  margin-top: 4px; line-height: 1.2; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.decor-empty-hint { font-size: 10px; color: #a09189; padding: 8px 2px; }

/* ========== 钻饰选中(点选虚线环; 2026-10-31: 第三层工具栏弹出覆盖, 滑块编辑) ========== */
.nail-decoration.selected::after {
  content: ""; position: absolute; inset: -6px;
  border: 2px dashed rgba(154, 119, 112, .9); border-radius: 50%;
  pointer-events: none;
}
.decor-edit-panel {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  color: #fff;
}
.decor-chip-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
  font-size: 13px; color: #454b4e;
}
.decor-chip-head button {
  border: none; background: #d9dde0; color: #5d6367;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 14px; line-height: 1; cursor: pointer;
}
.decor-chip-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: #5d6367;
}
.decor-chip-row input[type="range"] {
  flex: 1; min-width: 0; height: 22px;
  accent-color: #9a7770; cursor: pointer;
}
.decor-chip-row output {
  min-width: 40px; text-align: right;
  font-size: 11px; color: #454b4e; font-weight: 600;
}
#decor-del-btn {
  margin-top: 6px; border: none; border-radius: 999px;
  background: #d98f8f; color: #fff;
  padding: 9px 16px; font-size: 13px; cursor: pointer;
}
#decor-del-btn:active { background: #c97a7a; }

/* ========== 图层顺序调节栏(2026-10-29) ========== */
.layer-order-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
}
.layer-order-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border: 1px solid var(--border-color, #e3dcd7);
  border-radius: 10px;
  background: var(--panel-bg, #fbf8f4);
  transition: transform 0.12s ease;
  touch-action: none;           /* 2026-10-31: 手动拖拽排序(pointer 事件, 手机可用) */
  cursor: grab;
  position: relative;
  z-index: 1;
}
.layer-order-row.dragging {
  opacity: 0.88;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  transition: none;              /* 拖拽行跟手, 不平滑 */
  z-index: 10;
  cursor: grabbing;
}
.layer-order-handle {
  cursor: grab;
  color: #a09189;
  font-size: 15px;
  line-height: 1;
  user-select: none;
}
.layer-order-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary, #4a3b36);
  font-weight: 500;
}
.layer-order-badge {
  font-size: 10px;
  color: #a09189;
}

/* ===== 3D 甲片层(2026-11-10 晨曦 3D 化): 3D 就位后隐藏 2D 甲片内容, 由 3D 完全接管 ===== */
.nail-shape3d-canvas {
  touch-action: none;
  cursor: grab;
}
.nail-shape3d-canvas.is-dragging {
  cursor: grabbing;
}
.nail.is-shape3d {
  background-color: rgba(255, 255, 255, 0.01) !important;
  background-image: none !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  filter: none !important;
}
.nail.is-shape3d > * {
  visibility: hidden !important;
}

/* ===== 2026-11-10: 十指/五指状态下隐藏所有工具栏, 单甲编辑时才显示 ===== */
body.hide-tools .material-dock {
  display: none !important;
}

/* ===== 2026-11-10 种草式首页(大画幅照片 + 三悬浮按钮 + 底部导航) ===== */
#page-design {
  display: flex !important;
  flex-direction: column;
  height: 100vh;
  background: #FFFFFF;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 10px;
}
.home-brand-title {
  font-size: 21px;
  font-weight: 700;
  color: #3d3a38;
  letter-spacing: 0.02em;
}
.home-brand-sub {
  font-size: 12px;
  color: #a89f9a;
  margin-top: 2px;
}
.home-start-btn {
  border: none;
  background: linear-gradient(135deg, #f2b8c6, #e79ab0);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(231, 154, 176, 0.35);
}

.home-main {
  flex: 1;
  min-height: 0;
  position: relative;
}

.home-stack {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 100px;
  bottom: 100px;
}
/* 底卡(第二张预加载): 左右各小10px, 下方长出10px, 置于照片下方 */
.home-card-under {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  bottom: -10px;
  background: #EDEDED;
  border-radius: 20px;
  z-index: 0;
}
.home-card {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(120, 96, 90, 0.16);
  background: #D9D9D9;
  z-index: 1;
}
.home-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.home-card-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(30,20,18,0.42) 100%);
  pointer-events: none;
}
.home-card-meta {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.home-card-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.65);
  backdrop-filter: blur(4px);
  letter-spacing: 0.06em;
}
.home-card-name {
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

.home-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  z-index: 2;
}
.act-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(110, 90, 84, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.act-btn:hover { transform: translateY(-3px); }
.act-btn:active { transform: scale(0.94); }
.act-btn svg { width: 30px; height: 30px; }
.act-dislike { color: #8d99a6; }
.act-borrow {
  width: 64px; height: 64px;
  color: #5aa8a0;
}
.act-borrow svg { width: 30px; height: 30px; }
.home-card { touch-action: none; will-change: transform, opacity; user-select: none; }
.act-like { color: #e8708f; }
.act-like svg { width: 39px; height: 39px; }

.home-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  height: 62px;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  padding: 0 8px calc(8px + env(safe-area-inset-bottom, 0px));
  box-sizing: content-box;
}
#page-design, #page-mine {
  padding-bottom: 70px;
  box-sizing: border-box;
}
.nav-item {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555555;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0;
}
.nav-item.active {
  color: #000000;
  font-size: 21px;
  font-weight: 700;
}
.nav-item:hover {
  color: #FFFFFF;
  font-size: 21px;
  background: #FFFFFF;
}
.nav-item:focus,
.nav-item:focus-visible {
  outline: none;
  background: #FFFFFF;
}


/* ===== 2026-11-10 工作台退出键 + 草稿确认层 ===== */
.exit-designer-btn {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 1200;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: #6d6663;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(80, 60, 55, 0.2);
  transition: transform 0.15s ease;
}
.exit-designer-btn:hover { transform: scale(1.06); }
.exit-designer-btn svg { width: 22px; height: 22px; }

.draft-confirm-mask {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(30, 22, 20, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.draft-confirm-mask.show { display: flex; }
.draft-confirm {
  background: #fff;
  border-radius: 18px;
  padding: 24px 26px 20px;
  width: min(320px, 84vw);
  text-align: center;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
.draft-confirm-title { font-size: 16px; font-weight: 700; color: #3d3a38; }
.draft-confirm-sub { font-size: 12px; color: #a89f9a; margin-top: 6px; }
.draft-confirm-actions { display: flex; gap: 10px; margin-top: 18px; }
.dc-btn {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 9px 0;
  font-size: 13px;
  cursor: pointer;
}
.dc-cancel { background: #f1ecea; color: #6d6663; }
.dc-discard { background: #fdeaea; color: #c0605c; }
.dc-save { background: linear-gradient(135deg, #f2b8c6, #e79ab0); color: #fff; font-weight: 600; }

/* ===== 2026-11-10 首页图标动画 ===== */
/* 操作按钮: 按压回弹 */
@keyframes btn-pop {
  0% { transform: scale(1); }
  35% { transform: scale(0.88); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.act-btn.popping { animation: btn-pop 0.32s ease; }

/* 喜欢/不喜欢: 滑动联动高亮(由 home.js 按拖动方向添加 .active) */
.act-btn { transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease; }
.act-like.active {
  transform: scale(1.22);
  color: #fff;
  background: #e8708f;
  box-shadow: 0 10px 26px rgba(232, 112, 143, 0.45);
}
.act-like.active svg { fill: #fff; }
.act-dislike.active {
  transform: scale(1.22);
  color: #fff;
  background: #8d99a6;
  box-shadow: 0 10px 26px rgba(141, 153, 166, 0.45);
}
.act-borrow:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 10px 24px rgba(90, 168, 160, 0.35);
}

/* 导航 tab: 纯文字, 选中放大一号 */
.nav-item { transition: color 0.15s ease, font-size 0.15s ease; }
.nav-item:not(.active):hover { color: #3d3d3d; }


/* ===== 2026-11-11 不喜欢按钮: 点击后颜色从中心扩散至全圆, x 变白 ===== */
.act-btn { position: relative; overflow: hidden; }
.act-spread {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #C4C4C4;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 0;
}
.act-dislike svg { position: relative; z-index: 2; }
.act-dislike g { fill: #C4C4C4; transition: fill 0.05s ease; }

@keyframes dislike-spread {
  0% { transform: translate(-50%, -50%) scale(0); }
  100% { transform: translate(-50%, -50%) scale(5.2); }
}
.act-dislike.spreading .act-spread {
  animation: dislike-spread 0.1s ease forwards;
}
.act-dislike.spreading g { fill: #ffffff; }


/* ===== 2026-11-11 借鉴(+)按钮: 同款扩散动画, + 变白 ===== */
.act-borrow svg { position: relative; z-index: 2; }
.act-borrow g { fill: #555555; transition: fill 0.05s ease; }
.act-borrow .act-spread { background: #555555; }
@keyframes borrow-spread {
  0% { transform: translate(-50%, -50%) scale(0); }
  100% { transform: translate(-50%, -50%) scale(5.2); }
}
.act-borrow.spreading .act-spread {
  animation: borrow-spread 0.1s ease forwards;
}
.act-borrow.spreading g { fill: #ffffff; }


/* ===== 2026-11-11 喜欢(爱心)按钮: 同款扩散动画, 爱心变白 ===== */
.act-like svg { position: relative; z-index: 2; }
.act-like path { fill: #e8708f; transition: fill 0.05s ease; }
.act-like .act-spread { background: #e8708f; }
@keyframes like-spread {
  0% { transform: translate(-50%, -50%) scale(0); }
  100% { transform: translate(-50%, -50%) scale(5.2); }
}
.act-like.spreading .act-spread {
  animation: like-spread 0.1s ease forwards;
}
.act-like.spreading path { fill: #ffffff; }


/* ===== 2026-11-11 首页导航图标(图片) ===== */
.nav-icon-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* ===== 2026-11-11 我的页面 ===== */
#page-mine {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #FFFFFF;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
.mine-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px 22px 18px;
}
.mine-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #F1EFEE;
  color: #9a9390;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mine-avatar svg { width: 30px; height: 30px; }
.mine-info { flex: 1; min-width: 0; }
.mine-name { font-size: 18px; font-weight: 700; color: #2d2a28; }
.mine-sub { font-size: 12px; color: #a89f9a; margin-top: 3px; }
.mine-login-btn {
  border: 1px solid #e79ab0;
  color: #e79ab0;
  background: #fff;
  border-radius: 999px;
  font-size: 12px;
  padding: 7px 16px;
  cursor: pointer;
}
.mine-main { flex: 1; overflow-y: auto; padding: 6px 22px 20px; }
.mine-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFF7FA;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.mine-card-title { font-size: 15px; font-weight: 700; color: #3d3a38; }
.mine-card-sub { font-size: 12px; color: #a89f9a; margin-top: 3px; }
.mine-card-btn {
  border: none;
  background: linear-gradient(135deg, #f2b8c6, #e79ab0);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
}
.mine-section { margin-bottom: 20px; }
.mine-section-title { font-size: 14px; font-weight: 700; color: #3d3a38; margin-bottom: 10px; }
.mine-empty { font-size: 12px; color: #b6afab; background: #F7F6F5; border-radius: 12px; padding: 18px 14px; text-align: center; }
