/* ============================================================
   doudoutownDrawingAids Web 版 · 像素风样式
   逻辑分辨率 1080x1920 竖屏，外层 #stage 等比缩放适配视口
   ============================================================ */

@font-face {
  font-family: 'Zpix';
  src: url('../fonts/zpix.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

/* 2026-11-28 防 iOS Safari 系统手势/文本选择：
   - 整站禁文本选择（user-select）——否则临摹时误长按/双击会把画框文字、
     按钮文字选成全选状态；
   - 禁长按系统菜单（-webkit-touch-callout）——否则长按图片/链接弹"拷贝/共享"；
   - 禁点击高亮闪烁（tap-highlight）。
   输入框/文本域保留可选中，避免无法编辑昵称/账号。 */
* {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
input, textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

html, body {
  width: 100%;
  height: 100%;
  background: #1a1a1f;
  overflow: hidden;
  touch-action: none;   /* 2026-11-28：整页禁浏览器手势缩放（此前 manipulation 允许双指捏合缩放） */
  font-family: 'Zpix', 'PingFang SC', 'Heiti SC', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

/* 视口缩放适配：保持 1080x1920 比例，整体居中 */
#stage {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 1080px;
  height: 1920px;
  transform-origin: center center;
  /* 方案A：缩放比例由 head 内联脚本按视口写入 --stage-scale，首帧即完整界面 */
  transform: translate(-50%, -50%) scale(var(--stage-scale, 1));
  background: #ffffff;
  touch-action: none;  /* 2026-11-27 v=bp：整页禁浏览器手势缩放（iOS 上 user-scalable=no 与仅冒泡监听均不足） */
}

/* 页面容器：七个全屏页，默认隐藏 */
.page {
  position: absolute;
  left: 0;
  top: 0;
  width: 1080px;
  height: 1920px;
  display: none;
  background: #ffffff;
}
.page.active { display: block; }

/* ---------- 通用文字 ---------- */
.page-title {
  position: absolute;
  left: 0;
  top: 30px;
  width: 1080px;
  height: 50px;
  font-size: 40px;
  color: #111;
  text-align: center;
  line-height: 50px;
}
/* 说明文字：统一位于大标题之下，更大更醒目（暗红加粗）；临摹页为两行，高度留两行避免遮挡 */
.tip {
  position: absolute;
  left: 0;
  top: 90px;
  width: 1080px;
  height: 80px;
  font-size: 34px;
  font-weight: bold;
  color: #b3261e;
  text-align: center;
  line-height: 40px;
}
/* 选色判断页：说明两行（含金币规则），行距 48px 不重叠、不与右侧按钮相遮 */
.color-tip {
  height: 96px;
  line-height: 48px;
}

.measure-tip {
  height: 80px;
  line-height: 40px;
}

/* ---------- 像素风按钮 ---------- */
.btn {
  position: absolute;
  font-family: 'Zpix', 'PingFang SC', sans-serif;
  background: #f2f2f4;
  color: #111;
  border: 4px solid #111;
  border-radius: 10px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  text-align: center;
  line-height: 1.25;
  padding: 0;
  transition: transform 0.05s, box-shadow 0.05s, background 0.1s;
}
.btn:hover { background: #e6eaf6; }
.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.85);
  background: #d9e0f5;
}

/* ---------- 首页 ---------- */
.coin-label {
  position: absolute;
  left: 100px;      /* 与按钮左侧对齐（home-btn left 100） */
  top: 240px;       /* 按钮区域（top 320）左上方 */
  width: 420px;
  height: 80px;
  font-size: 40px;
  font-weight: bold;
  color: #8a5a00;
  line-height: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.coin-icon {
  width: 64px;
  height: 64px;
}
.coin-count {
  font-size: 40px;
  font-weight: bold;
  color: #8a5a00;
  line-height: 80px;
}
#home-title {
  position: absolute;
  left: 0;
  top: 50px;
  width: 920px;
  height: 180px;
  font-size: 80px;
  color: #111;
  text-align: center;
  line-height: 180px;
}
#home-version {
  position: absolute;
  left: 670px;
  top: 60px;
  width: 140px;
  height: 50px;
  font-size: 40px;
  color: #888;
  line-height: 50px;
}
#home-icon {
  position: absolute;
  left: 750px;
  top: 60px;
  width: 240px;
  height: 240px;
  background: url('../assets/ui/home-icon.png') no-repeat center / cover;
  
  border-radius: 12px;
}

/* ---------- 练习进度大字（第几题/共几题） ---------- */
.progress-badge {
  position: absolute;
  right: 30px;
  top: 24px;
  width: 150px;
  height: 60px;
  background: #404047;
  border: 3px solid #1a1a1f;
  border-radius: 12px;
  color: #fff;
  font-size: 42px;
  font-weight: bold;
  text-align: center;
  line-height: 60px;
}
#home-slogan {
  position: absolute;
  left: 0;
  top: 255px;
  width: 1080px;
  height: 50px;
  font-size: 28px;
  color: #333;
  text-align: center;
  line-height: 50px;
}
#home-tail {
  position: absolute;
  left: 0;
  top: 1710px;
  width: 1080px;
  height: 50px;
  font-size: 28px;
  color: #333;
  text-align: center;
  line-height: 50px;
}
.home-btn {
  width: 420px;
  height: 300px;   /* v=ie：420→294 高度缩小30% */
  font-size: 40px;
  border-radius: 14px;
}
#home-btn-0 { left: 100px; top: 320px; }
#home-btn-1 { left: 560px; top: 320px; }
#home-btn-2 { left: 100px; top: 660px; }
#home-btn-3 { left: 560px; top: 1000px; }  /* v=ig：限时速写与每日任务对调 → 第 3 行右 */

/* ---------- 选关页 ---------- */
.level-btn {
  position: absolute;
  left: 260px;
  width: 560px;
  height: 110px;
  font-size: 30px;
}
.level-back-btn {
  position: absolute;
  left: 260px;
  width: 560px;
  height: 100px;
  font-size: 34px;
}
.mid-level-btn {
  position: absolute;
  left: 330px;
  width: 420px;
  height: 150px;
  font-size: 36px;
}
.mid-level-back-btn {
  position: absolute;
  left: 330px;
  width: 420px;
  height: 110px;
  font-size: 34px;
}

/* ---------- 临摹练习页 ---------- */
/* 参考图框 正方形 440x440（2026-11-27 用户澄清：3:4 仅指速写参考图，临摹改回正方形） */
/* 参考图面板（2026-11-28 v=bz 用户调整）：恢复正方形 440x440（学员对比例敏感），
   面板整体下移 52px（180→232）给框外上方按钮条腾位；
   "撤回/清空"按钮放到框外上方（top:-52 紧贴框上边框），不再覆盖画布 */
#ref-panel {
  position: absolute;
  left: 40px;
  top: 232px;
  width: 440px;
  height: 440px;
  background: #fff;
  border: 3px solid #000;
}
#ref-img {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 424px;
  height: 424px;
  object-fit: contain;
  background: #fff;
}
#ref-overlay {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 424px;
  height: 424px;
  pointer-events: none;
  display: none;
}
/* 参考图红色草稿层（v=bb）：覆盖参考图画 2px 红线，不参与比对/评分 */
#ref-sketch-canvas {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 424px;
  height: 424px;
  touch-action: none;
  cursor: crosshair;
}
/* 参考图清空按钮（v=by）：移出画布覆盖区，放在参考图框外上方贴框 */
.ref-sketch-clear {
  position: absolute;
  right: 6px;
  top: -52px;
  width: 104px;
  height: 52px;
  font-size: 24px;
  z-index: 6;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.85);
}
/* 参考图红线单笔撤回（v=by）：左上方，与右侧清空按钮对称；框外上方贴框 */
.ref-sketch-undo {
  position: absolute;
  left: 6px;
  top: -52px;
  width: 104px;
  height: 52px;
  font-size: 24px;
  z-index: 6;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.85);
}
.side-btn {
  position: absolute;
  left: 600px;
  width: 420px;
  height: 100px;
  font-size: 38px;
}
#practice-exit { top: 200px; }
#practice-compare { top: 350px; }
#practice-submit { top: 500px; }

.tool-btn {
  position: absolute;
  width: 84px;
  height: 84px;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid #595959;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  padding: 6px;
}
.tool-btn.selected {
  background: #b8d6ff;
  border: 3px solid #295cb8;
}
/* 工具条放回参考图下方原位（参考图恢复正方形后不重叠，2026-11-27） */
/* 2026-11-27 v=bp：视觉顺序改为 撤销→重做→橡皮→笔刷（HTML 顺序保持 brush/eraser/undo/redo，
   仅重排绝对定位 left；brush 仍默认选中） */
#tool-undo { left: 40px; top: 672px; }
#tool-redo { left: 132px; top: 672px; }
#tool-eraser { left: 224px; top: 672px; }
#tool-brush { left: 316px; top: 672px; }
.tool-btn img { width: 64px; height: 64px; display: block; }

#draw-canvas {
  position: absolute;
  left: 40px;
  top: 760px;
  width: 1000px;
  height: 1000px;
  background: #fff;
  border: 3px solid #000;
  touch-action: none;
  /* 2026-11-27 用户反馈白底画布上看不见系统 crosshair：自定义双色十字光标
     （黑色内芯+白色主体+黑描边，任何背景下都清晰；热点 12,12 十字中心） */
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path d='M7 0v14M0 7h14' stroke='%23ffffff' stroke-width='4'/><path d='M7 0v14M0 7h14' stroke='%23000000' stroke-width='2'/></svg>") 7 7, crosshair;
}

/* 打分检查层：提交后参考图红线叠加在学生练习上方（只读、不拦截触摸）
   2026-11-27 v=bo 修复：
   1) top 700 → 760：跟随 draw-canvas 在 v=bk/v=bl 的下移（此前漏改，红色参考图相对画框整体上移 60px）
   2) left/top/width/height 对齐 draw-canvas 内容区：draw-canvas 有 3px border 且全局 box-sizing:border-box，
      内容区实为 994x994、起点 (43,763)；本层必须与之完全重合，否则红线相对画框内沿偏移 3px 且缩放差 0.6% */
#ref-check-canvas {
  position: absolute;
  left: 43px;
  top: 763px;
  width: 994px;
  height: 994px;
  pointer-events: none;
  z-index: 5;
}

/* ---------- 找中点练习页 ---------- */
#mid-canvas {
  position: absolute;
  left: 40px;
  top: 400px;
  width: 1000px;
  height: 1000px;
  background: #fff;
  border: 3px solid #000;
  touch-action: none;
  /* 2026-11-27 用户反馈白底画布上看不见系统 crosshair：自定义双色十字光标
     （黑色内芯+白色主体+黑描边，任何背景下都清晰；热点 12,12 十字中心） */
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path d='M7 0v14M0 7h14' stroke='%23ffffff' stroke-width='4'/><path d='M7 0v14M0 7h14' stroke='%23000000' stroke-width='2'/></svg>") 7 7, crosshair;
}
#mid-exit { top: 140px; }
#mid-score { top: 270px; }

/* ---------- 选色判断页 ---------- */
#color-ref {
  position: absolute;
  left: 40px;
  top: 180px;
  width: 400px;
  height: 400px;
  background: #fff;
  border: 3px solid #000;
}
#color-exit { top: 210px; }
#color-score { top: 340px; }#hsl-canvas {
  position: absolute;
  left: 40px;
  top: 600px;
  width: 1000px;
  height: 330px;
  touch-action: none;
  cursor: pointer;
}
#color-display {
  position: absolute;
  left: 40px;
  top: 950px;
  width: 1000px;
  height: 970px;
  background: #fff;
  border: 3px solid #000;
}

/* ---------- 感官明暗练习（v=cp；v=cq 改用 HSL L 条） ---------- */
#value-ref {
  position: absolute;
  left: 40px;
  top: 180px;
  width: 400px;
  height: 400px;
  background: #fff;
  border: 3px solid #000;
}
#value-exit { top: 210px; }
#value-score { top: 340px; }
#value-slider-wrap {
  position: absolute;
  left: 40px;
  top: 600px;
  width: 1000px;
  height: 80px;
}
#value-lbar {
  display: block;
  width: 1000px;
  height: 80px;
  touch-action: none;
  cursor: pointer;
}
#value-label {
  position: absolute;
  left: 40px;
  top: 680px;
  width: 1000px;
  height: 70px;
  font-size: 46px;
  color: #c33;
  font-weight: bold;
  text-align: center;
  line-height: 70px;
}
#value-gray {
  position: absolute;
  left: 40px;
  top: 850px;
  width: 1000px;
  height: 970px;
  background: #fff;
  border: 3px solid #000;
}
#value-dialog .dialog-panel { top: 280px; min-height: 200px; }
#value-dialog .dialog-score { top: 320px; min-height: 200px; font-size: 42px; line-height: 1.6; }
#value-dialog .dialog-btn { top: 540px; width: 280px; height: 66px; left: 400px; font-size: 32px; }

/* ---------- 速写参考图页 ---------- */
#sketch-exit { top: 140px; }
#sketch-slider-wrap {
  position: absolute;
  left: 40px;
  top: 260px;
  width: 400px;
  height: 60px;
}
#sketch-value {
  position: absolute;
  left: 40px;
  top: 340px;
  width: 700px;
  height: 84px;
  font-size: 44px;
  color: #c33;
  font-weight: bold;
  text-align: left;
  line-height: 84px;
  white-space: nowrap;
}
#sketch-prev {
  position: absolute;
  left: 40px;
  top: 445px;
  width: 220px;
  height: 70px;
  font-size: 30px;
}
#sketch-next {
  position: absolute;
  left: 280px;
  top: 445px;
  width: 220px;
  height: 70px;
  font-size: 30px;
}
/* v=hb：速写缩放胶囊条（与村民画廊同款；v=hc 移到素材图框外右上角，紧贴图框上缘） */
#sketch-zoom-bar {
  position: absolute;
  left: 888px;
  top: 484px;
  z-index: 30;
}
#sketch-panel {
  position: absolute;
  left: 40px;
  top: 540px;
  width: 1000px;
  height: 1340px;
  background: #000;
  border: 3px solid #000;
  overflow: hidden;   /* 速写图放大时裁切（2026-11-27） */
  touch-action: none; /* 放大后拖动平移：禁止浏览器触摸滚动/缩放干扰（2026-11-27） */
}

/* ---------- 速写类型选择页 ---------- */
/* v=sk：8 个类型按钮高度 120px；top 由 app.js 动态计算（320 + i*180），不在此固定 */
.sketch-type-btn {
  position: absolute;
  left: 260px;
  width: 560px;
  height: 120px;
  font-size: 36px;
}
#sketch-img {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 984px;
  height: 1324px;
  object-fit: contain;
  background: #000;
}

/* ---------- 随便乱画（v=cs） ---------- */
/* 首页第 5 板块：随便乱画（第 3 行左）；v=ie 按钮高度统一 294 后重排到第 3 行左 */
#home-btn-4 { left: 100px; top: 1000px; }
/* 首页第 6 板块：接任务（v=ig 与限时速写对调：第 2 行右，第 3 行右留给限时速写） */
#home-btn-5 { left: 560px; top: 660px; }
/* 画笔/橡皮/撤销/重做：与临摹板块排列完全一致（v=ct） */
#free-tool-undo { left: 40px; top: 672px; }
#free-tool-redo { left: 132px; top: 672px; }
#free-tool-eraser { left: 224px; top: 672px; }
#free-tool-brush { left: 316px; top: 672px; }
/* 开画！右侧：退出/发布（右上方） */
#free-exit { top: 210px; }
#free-publish { top: 350px; }
/* 开画！画布（与临摹 #draw-canvas 位置一致）
   v=gz：画布外包一层蒙版容器——放大后画面不超出画框，超出部分被 overflow:hidden 裁切；
   画布在蒙版内容区（1000-3*2=994）内 transform 缩放/平移 */
#free-canvas-mask {
  position: absolute;
  left: 40px;
  top: 760px;
  width: 1000px;
  height: 1000px;
  background: #fff;
  border: 3px solid #000;
  overflow: hidden;
  touch-action: none;
  z-index: 2;
}
#free-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 994px;
  height: 994px;
  background: #fff;
  border: none;
  touch-action: none;
  /* 与临摹画布一致的双色十字光标 */
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path d='M7 0v14M0 7h14' stroke='%23ffffff' stroke-width='4'/><path d='M7 0v14M0 7h14' stroke='%23000000' stroke-width='2'/></svg>") 7 7, crosshair;
  /* v=cy：画布缩放（CSS transform 作用于画布元素，含已画图案；
     getBoundingClientRect 返回缩放后尺寸，DrawingCanvas._toLocal 坐标自动校正）；
     v=gz：transform-origin left top + translate 平移分量（画面中心/手指中心锚点缩放） */
  transform-origin: left top;
  transition: transform 0.08s ease-out;
}
/* v=cy：画布缩放按钮（画框外右上角，位于画布上方空白区） */
.free-zoom-bar {
  position: absolute;
  left: 888px;
  top: 700px;
  width: 152px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 2px solid #888;
  border-radius: 26px;
  z-index: 30;
  box-sizing: border-box;
  padding: 0 6px;
}
.free-zoom-btn {
  width: 42px;
  height: 42px;
  border: none;
  background: #f2f2f2;
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
  color: #333;
  cursor: pointer;
}
.free-zoom-btn:active { background: #ddd; }
.free-zoom-label {
  font-size: 22px;
  color: #333;
  min-width: 52px;
  text-align: center;
}
/* v=ia 村民画廊排序：瀑布流右上角「排序」文字+下拉菜单（时间/打赏，默认时间；打赏按 tip_count 降序）
   v=id 排序条改为独立 sticky 悬浮条：固定在 #free-gallery-scroll 顶部右上角（画框外、不随列表滚动）
   v=if 排序条移到作品瀑布流之外：#free-sort-bar 容器（scroll 上方独立区域），不与任何作品叠加，字号 26→30 */
.free-sort-bar-sticky {
  position: absolute;
  top: 640px;
  left: 0;
  width: 1080px;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 50px;
  padding: 0 40px 0 0;
}
.free-sort-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.free-sort-trigger {
  font-size: 30px;
  font-weight: bold;
  color: #8a5a00;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  white-space: nowrap;
  padding: 2px 4px;
}
.free-sort-trigger:hover { color: #5c3a00; }
.free-sort-menu {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 150px;
  background: #fff;
  border: 2px solid #111;
  border-radius: 8px;
  z-index: 60;
  display: none;
  padding: 6px;
}
.free-sort-menu.open { display: block; }
.free-sort-opt {
  display: block;
  width: 100%;
  padding: 10px 16px;
  font-size: 26px;
  text-align: left;
  background: #fff;
  color: #444;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  -webkit-user-select: none;
  user-select: none;
}
.free-sort-opt:hover { background: #f2efe4; }
.free-sort-opt.active {
  background: #8a5a00;
  color: #fff;
  font-weight: bold;
}
/* 开画！对话框（复用 bottom-panel/bottom-score/bottom-btn） */
#free-dialog .dialog-panel { top: 280px; min-height: 200px; }
#free-dialog .dialog-score { top: 320px; min-height: 200px; font-size: 42px; line-height: 1.6; white-space: pre-line; }
#free-dialog .dialog-btn { top: 540px; width: 280px; height: 66px; left: 400px; font-size: 32px; }
/* 村民画作列表（直接嵌入随便乱画页，v=cu 起不再有独立画廊页） */
#free-gallery-scroll {
  position: absolute;
  left: 0;
  top: 700px;
  width: 1080px;
  height: 1220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
#free-gallery-list { padding: 0 40px 20px 40px; }
.free-art {
  margin-bottom: 24px;
  border: 3px solid #111;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.free-art-head {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  font-size: 28px;
  background: #f2f2f4;
  border-bottom: 2px solid #111;
}
.free-art-nick { color: #8a5a00; font-weight: bold; }
/* v=hr 画廊等级徽章：紧贴用户名右侧（去 space-between 均分，昵称不再 margin-right:auto，时间改 margin-left:auto 推右） */
.free-art-lv {
  flex-shrink: 0; margin-left: 10px; padding: 2px 10px;
  font-size: 20px; line-height: 30px; color: #fff;
  background: linear-gradient(135deg, #c9a86a, #8a5a00);
  border-radius: 16px; font-weight: bold;
}
.free-art-time { color: #666; font-size: 24px; margin-left: auto; }
/* v=he 画廊头像：用户名左侧圆形小头像，缺失时默认头像兜底 */
.free-art-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #e8ddc8; margin-right: 14px; flex-shrink: 0; }
/* v=hg 管理员删除：画廊卡片右上角叉 + 排行榜行尾叉（仅管理员可见） */
.free-art-del {
  width: 40px; height: 40px; border: none; background: transparent;
  color: #b33; font-size: 34px; line-height: 40px; margin-left: 12px;
  cursor: pointer; flex-shrink: 0; padding: 0;
}
.lb-del {
  width: 52px; height: 52px; margin: 9px 16px 0 8px; flex-shrink: 0;
  border: 2px solid #b33; border-radius: 50%; background: #fff6f4;
  color: #b33; font-size: 28px; line-height: 48px; cursor: pointer; padding: 0;
}
#del-dialog .dialog-btn { top: 1710px; height: 66px; font-size: 32px; }
#del-dialog-ok { left: 230px; width: 280px; background: #b33; color: #fff; border-color: #700; }
#del-dialog-cancel { left: 570px; width: 280px; }
.free-art-img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}
/* v=cw：比心点赞条 */
.free-art-like {
  display: flex;
  justify-content: center;
  padding: 14px 0 16px 0;
  background: #faf7ef;
  border-top: 2px solid #111;
}
.free-art-heart {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 26px;
  color: #444;
  background: #fff;
  border: 2px solid #595959;
  border-radius: 34px;
  padding: 8px 30px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
/* v=ho：金币图标（icon-coin.png 64x64 显示 34px） */
.free-art-heart .heart-sym {
  width: 34px;
  height: 34px;
  display: block;
}
.free-art-heart .like-count {
  font-weight: bold;
  min-width: 36px;
  text-align: center;
  color: #8a5a00;
}
/* v=hk：已打赏状态——不可再点（一人一次不可撤销） */
.free-art-heart.tipped {
  border-color: #d4a017;
  color: #8a5a00;
  background: #fff8e1;
  cursor: default;
  opacity: 0.9;
}
.free-art-heart.tipped .heart-sym {
  color: #b8860b;
}
.free-art-heart.tipped .like-count {
  color: #8a5a00;
}
.free-art-heart[disabled] {
  pointer-events: none;
}
#free-gallery-more {
  text-align: center;
  font-size: 28px;
  color: #666;
  padding: 20px 0 40px 0;
}
#free-gallery-empty {
  text-align: center;
  font-size: 32px;
  color: #999;
  padding: 200px 40px 0 40px;
  line-height: 1.8;
}

/* ---------- 滑动条（像素风） ---------- */
/* ---------- 丈量练习（2026-11-26） ---------- */
#measure-exit { top: 150px; }
#measure-score { top: 270px; }
#measure-canvas {
  position: absolute;
  left: 40px;
  top: 440px;
  width: 1000px;
  height: 1000px;
  background: #fff;
  border: 3px solid #000;
}
#measure-slider-wrap {
  position: absolute;
  left: 40px;
  top: 1480px;
  width: 1000px;
  height: 60px;
}
#measure-value {
  position: absolute;
  left: 40px;
  top: 1560px;
  width: 1000px;
  height: 70px;
  font-size: 46px;
  color: #c33;
  font-weight: bold;
  text-align: center;
  line-height: 70px;
}
#measure-dialog .dialog-panel { top: 280px; min-height: 200px; }
#measure-dialog .dialog-score { top: 320px; min-height: 200px; font-size: 42px; line-height: 1.6; }
#measure-dialog .dialog-btn { top: 540px; width: 280px; height: 66px; left: 400px; font-size: 32px; }

/* ---------- 角度判断练习（2026-11-27） ---------- */
.angle-tip { font-size: 34px; }
#angle-exit { top: 150px; }
#angle-score { top: 270px; }
#angle-canvas {
  position: absolute;
  left: 40px;
  top: 440px;
  width: 1000px;
  height: 1000px;
  background: #fff;
  border: 3px solid #000;
}
#angle-slider-wrap {
  position: absolute;
  left: 40px;
  top: 1480px;
  width: 1000px;
  height: 60px;
}
#angle-value {
  position: absolute;
  left: 40px;
  top: 1560px;
  width: 1000px;
  height: 70px;
  font-size: 46px;
  color: #c33;
  font-weight: bold;
  text-align: center;
  line-height: 70px;
}
#angle-dialog .dialog-panel { top: 280px; min-height: 200px; }
#angle-dialog .dialog-score { top: 320px; min-height: 200px; font-size: 42px; line-height: 1.6; }
#angle-dialog .dialog-btn { top: 540px; width: 280px; height: 66px; left: 400px; font-size: 32px; }

input[type="range"] {
  width: 100%;
  height: 20px;
  margin: 18px 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  touch-action: none;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 14px;
  background: #ddd;
  border: 2px solid #111;
  border-radius: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 34px;
  height: 34px;
  margin-top: -12px;
  background: #f2f2f4;
  border: 3px solid #111;
  border-radius: 6px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
input[type="range"]:active::-webkit-slider-thumb { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(0,0,0,0.6); }
input[type="range"]::-moz-range-track {
  height: 14px;
  background: #ddd;
  border: 2px solid #111;
}
input[type="range"]::-moz-range-thumb {
  width: 34px;
  height: 34px;
  background: #f2f2f4;
  border: 3px solid #111;
  border-radius: 6px;
  cursor: pointer;
}

/* ---------- 对话框 ---------- */
.dialog-mask {
  position: absolute;
  left: 0;
  top: 0;
  width: 1080px;
  height: 1920px;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  z-index: 100;
}
.dialog-mask.active { display: block; }
.dialog-panel {
  position: absolute;
  width: 600px;
  height: 380px;
  background: #404047;
  border: 3px solid #1a1a1f;
  border-radius: 12px;
  left: 240px;
}
.dialog-score {
  position: absolute;
  left: 240px;
  width: 600px;
  height: 130px;
  font-size: 48px;
  color: #fff;
  text-align: center;
  line-height: 1.35;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: pre-line;
}
.dialog-btn {
  position: absolute;
  left: 340px;
  width: 400px;
  height: 110px;
  font-size: 38px;
}
.dialog-panel.top-panel { top: 780px; }
.dialog-panel.bottom-panel { top: 1500px; }
.dialog-score.top-score { top: 830px; }
.dialog-score.bottom-score { top: 1550px; }
.dialog-btn.top-btn { top: 990px; }
.dialog-btn.bottom-btn { top: 1710px; }

/* ---------- 临摹得分对话框（位于参考图下方、画布上方，盖画布顶部；
   参考图 3:4 变高后整体下移，2026-11-27）
   评分时画布上已叠加参考红线，上方参考图可被弹窗遮挡；
   高度由 JS fitDialog() 按文字行数自适应，默认 min-height。 */
#practice-dialog.dialog-mask { background: rgba(0, 0, 0, 0.12); }
.dialog-panel.practice-panel {
  top: 390px;
  width: 660px;
  min-height: 200px;
  left: 210px;
  border-radius: 12px;
}
.dialog-score.practice-score {
  top: 430px;
  width: 620px;
  min-height: 200px;
  left: 230px;
  font-size: 42px;
  line-height: 1.6;
}
.dialog-btn.practice-btn {
  top: 650px;
  width: 280px;
  height: 66px;
  left: 400px;
  font-size: 32px;
}

/* ---------- 找中点对话框（大面板靠上方，贴画布顶部，不遮主练习区） ---------- */
#mid-dialog .dialog-panel {
  top: 250px;
  min-height: 200px;
}
#mid-dialog .dialog-score {
  top: 290px;
  min-height: 200px;
  font-size: 42px;
  line-height: 1.6;
}
#mid-dialog .dialog-btn {
  top: 510px;
  width: 280px;
  height: 66px;
  left: 400px;
  font-size: 32px;
}

/* ---------- 选色对话框（大面板靠上方，盖住选色条，露出参考色与当前色） ---------- */
#color-dialog {
  background: rgba(0, 0, 0, 0.25);   /* 选色打分后需看清红箭头，遮罩减淡 */
}
#color-dialog .dialog-panel {
  top: 200px;
  min-height: 310px;
}
#color-dialog .dialog-score {
  top: 230px;
  min-height: 200px;
  font-size: 42px;
  line-height: 1.6;
}
#color-dialog .dialog-btn {
  top: 430px;
  width: 280px;
  height: 66px;
  left: 400px;
  font-size: 32px;
}



/* ---------- 图片读取加载条（2026-11-27） ---------- */
.img-loading {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.img-loading.active { display: flex; }
.img-loading.dark { background: rgba(0, 0, 0, 0.85); }
.img-loading-bar {
  position: relative;
  width: 62%;
  height: 20px;
  border: 3px solid #000;
  background: #fff;
  overflow: hidden;
}
.img-loading.dark .img-loading-bar { border-color: #fff; }
.img-loading-bar::after {
  content: '';
  position: absolute;
  left: -45%;
  top: 0;
  width: 45%;
  height: 100%;
  background: #4a90e2;
  animation: img-loading-slide 1.1s infinite linear;
}
@keyframes img-loading-slide {
  from { left: -45%; }
  to { left: 100%; }
}
.img-loading-text {
  margin-top: 16px;
  font-size: 28px;
  color: #333;
}
.img-loading.dark .img-loading-text { color: #fff; }

/* ---------- 首屏加载遮罩（方案B）：覆盖完整界面，加载完成前禁止交互 ---------- */
#boot-mask {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 31, 0.72);
  transition: opacity 0.3s;
}
#boot-mask.done {
  opacity: 0;
  pointer-events: none;
}
.boot-panel {
  width: 640px;
  max-width: 84vw;
  background: #f2f2f4;
  border: 4px solid #111;
  border-radius: 14px;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.85);
  padding: 48px 56px;
  text-align: center;
}
.boot-title {
  font-size: 48px;
  color: #111;
  margin-bottom: 12px;
}
.boot-slogan {
  font-size: 26px;
  color: #b3261e;
  margin-bottom: 36px;
}
.boot-bar {
  width: 100%;
  height: 32px;
  border: 4px solid #111;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.boot-bar-fill {
  width: 0%;
  height: 100%;
  background: #4a90d9;
  transition: width 0.25s;
}
.boot-text {
  margin-top: 18px;
  font-size: 24px;
  color: #333;
}

/* ---------- 首页底部：村民注册/登录 + 排行榜（v=bq 2026-11-28；v=bs 上移与上方按钮同 40px 间隔，版权沉底；v=cs 第 5 板块加入后下移；v=ie 按钮区变矮后上移到 1330，中间插入动向区） ---------- */
.home-sub-btn {
  position: absolute;
  width: 420px;
  height: 100px;
  font-size: 34px;
  top: 1340px;
  border-radius: 14px;
}
#home-register { left: 100px; }
#home-leaderboard { left: 560px; }

/* ---------- 首页村民动向区（v=ie：我的状态/排行榜与版权之间，展示最新 3 条动向；v=if 去掉标题只留框、高度 310→260；v=ig 左右与上方按钮对齐：left 100 / width 880） ---------- */
#home-activity {
  position: absolute;
  left: 100px;
  top: 1470px;
  width: 880px;
  height: 200px;
  background: #f7f3e8;
  border: 3px solid #d8cba8;
  border-radius: 16px;
  box-sizing: border-box;
  padding: 18px 24px;
}
#home-activity-list {
  font-size: 26px;
  line-height: 1.6;
  color: #333;
}
.activity-item {
  padding: 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-empty {
  color: #999;
  text-align: center;
  padding-top: 40px;
}

/* ---------- 村民注册 / 登录页 ---------- */
#account-tabs { position: absolute; left: 240px; top: 120px; width: 600px; height: 80px; }
.account-tab { position: absolute; width: 280px; height: 80px; font-size: 30px; }
#account-tab-login { left: 0; }
#account-tab-register { left: 320px; }
.account-tab.selected { background: #e8a33d; color: #fff; }
.account-form { position: absolute; left: 200px; top: 250px; width: 680px; }
.account-input {
  width: 680px; height: 90px; font-size: 32px; margin-bottom: 30px;
  padding: 0 20px; border: 3px solid #444; border-radius: 10px;
  font-family: 'Zpix', 'PingFang SC', 'Heiti SC', sans-serif;
  background: #fff;
}
.account-submit { width: 680px; height: 100px; font-size: 34px; }
#account-msg {
  position: absolute; left: 200px; top: 700px; width: 680px;
  font-size: 28px; text-align: center; color: #b33; line-height: 40px;
}

/* ---------- 排行榜页 ---------- */
#leaderboard-list {
  position: absolute; left: 60px; top: 120px; width: 960px; height: 1560px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.lb-row { display: flex; height: 70px; line-height: 70px; font-size: 28px; border-bottom: 2px solid #eee; }
.lb-rank { width: 110px; text-align: center; color: #8a5a00; font-weight: bold; }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* v=hj 排行榜等级徽章：昵称旁小号金色标签 */
.lb-lv {
  display: inline-block; margin-left: 10px; padding: 0 10px;
  font-size: 18px; line-height: 30px; color: #fff;
  background: linear-gradient(135deg, #c9a86a, #8a5a00);
  border-radius: 14px; font-weight: bold; vertical-align: middle;
}
.lb-days { width: 190px; text-align: right; color: #666; padding-right: 16px; font-size: 24px; white-space: nowrap; }
.lb-total { width: 220px; text-align: right; color: #8a5a00; padding-right: 20px; }
.lb-empty { padding: 40px 0; text-align: center; font-size: 30px; color: #888; }

/* ---------- 我的状态页 ---------- */
#status-panel { position: absolute; left: 140px; top: 180px; width: 800px; }
.status-row { height: 90px; line-height: 90px; font-size: 34px; border-bottom: 2px solid #eee; }
.status-row span { color: #8a5a00; font-weight: bold; }
/* v=he 我的状态头像：圆形 120px，上传前显示默认头像，上传后即时刷新 */
.status-avatar-row { display: flex; align-items: center; gap: 20px; padding: 24px 0; border-bottom: 2px solid #eee; }
.status-avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; background: #f0e8d8; border: 3px solid #c9a86a; flex-shrink: 0; }
.status-avatar-actions { display: flex; flex-direction: column; gap: 10px; }
.status-avatar-tip { font-size: 24px; color: #8a7a5a; }
.status-avatar-btn { position: static; width: 260px; height: 76px; font-size: 28px; }
/* v=cq 我的状态：返回在上、退出在下、两按钮同尺寸
   v=hp 我的状态：返回首页按钮下移 150px（top 900 → 1050）
   v=hq 我的状态：返回首页按钮再下移 50px（top 1050 → 1100） */
#status-back { position: absolute; left: 260px; top: 1100px; width: 560px; height: 100px; font-size: 34px; }
/* v=hf 我的状态：退出登录改为右下角小按钮（弱化样式，防误按） */
#status-logout { position: absolute; right: 40px; bottom: 40px; width: 200px; height: 64px; font-size: 26px; border: 2px solid #c9a0a0; color: #966; background: #faf6f4; box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25); }
/* v=bs 修改昵称：行内小按钮 + 内联编辑区（覆盖 .btn 的 absolute/flex，恢复行内流式） */
.status-edit-btn {
  position: static;
  display: inline-flex;
  width: 160px; height: 56px; font-size: 24px; line-height: 40px;
  vertical-align: middle; margin-left: 20px; border-radius: 10px; padding: 0;
}
#status-nickname-edit { margin-top: 20px; }
#status-nickname-edit .account-input { width: 680px; height: 80px; font-size: 30px; margin-bottom: 16px; }
#status-nickname-edit .btn { position: static; display: inline-flex; width: 200px; height: 80px; font-size: 30px; margin-right: 20px; }

/* v=hp：经验值获得轻提示（toast）——悬浮于对话框之上、自动消失 */
.exp-toast {
  position: absolute;
  left: 50%;
  /* v=hs 经验轻提示：移到对话框上方（原 top 360 会压住评分对话框内容区；
     各对话框面板 top 200(color)/250(mid)/280(其他)/390(practice)，90 全部在其上方）
     v=ib 经验轻提示：压缩高度（padding 22→14、font 34→30），底部约 160px，
     距最近的 color 面板（top 200）≥40px，全部板块均让开足够距离 */
  top: 90px;
  transform: translateX(-50%);
  min-width: 300px;
  max-width: 760px;
  padding: 14px 40px;
  background: rgba(60, 50, 30, 0.92);
  color: #ffe9a8;
  font-size: 30px;
  font-weight: bold;
  text-align: center;
  border-radius: 36px;
  border: 3px solid #d4a017;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  white-space: pre-line;
}
.exp-toast.show { opacity: 1; }

/* ---------- 今日任务（v=hv） ---------- */
#task-date { position: absolute; left: 0; top: 185px; width: 1080px; font-size: 28px; color: #7a6a3a; text-align: center; }
.task-card { position: absolute; left: 100px; width: 880px; height: 190px; background: rgba(60, 50, 30, 0.10); border-radius: 14px; }
.task-card-title { position: absolute; left: 30px; top: 22px; width: 820px; font-size: 38px; font-weight: bold; color: #3a2a10; }
.task-card-desc { position: absolute; left: 30px; top: 92px; width: 820px; font-size: 30px; color: #6a5a30; }
.task-start-btn { position: absolute; right: 28px; bottom: 22px; width: 250px; height: 80px; font-size: 28px; }
.task-start-btn.done { opacity: 0.65; }
.task-reward-text { position: absolute; left: 100px; top: 1010px; width: 880px; text-align: center; font-size: 40px; font-weight: bold; color: #b3261e; }
.task-claim-btn { position: absolute; left: 260px; top: 1160px; width: 560px; height: 120px; font-size: 36px; }
.task-claim-btn.done { opacity: 0.6; }
