:root {
  --salmon: #E87A90;
  --salmon-deep: #C95F77;
  --mint: #3FA58C;
  --ink: #3B3B3B;
  --paper: #FBF7F0;
  --card: #FFFFFF;
  --line: #EDE4D8;
  --muted: #8A8078;
  --shadow: 0 8px 30px rgba(200, 150, 140, 0.16);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

/* ---------- 顶部 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(251, 247, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot {
  width: 34px; height: 34px; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #F6B8C6 0%, transparent 60%),
    radial-gradient(circle at 70% 70%, #A8DCCB 0%, transparent 60%),
    var(--salmon);
  box-shadow: inset -2px -3px 6px rgba(0,0,0,0.08);
}
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: 0.5px; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.lock-btn {
  border: 1px solid var(--salmon); color: var(--salmon-deep);
  background: #fff; padding: 7px 14px; border-radius: 20px;
  font-size: 13px; cursor: pointer;
}
.lock-btn.unlocked { background: var(--salmon); color: #fff; border-color: var(--salmon); }

/* ---------- 日期条 ---------- */
.daybar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #FFF6F2, #F4FBF7);
}
.day-info { display: flex; align-items: center; gap: 10px; }
.day-badge {
  background: var(--salmon); color: #fff; font-size: 12px;
  padding: 3px 10px; border-radius: 12px; font-weight: 500;
}
#painterInfo { font-size: 14px; font-weight: 500; }
.day-sub { font-size: 12px; color: var(--muted); }

/* ---------- 画布区 ---------- */
#main { position: relative; padding: 14px 12px 10px; }
#canvas {
  display: block; margin: 0 auto; border-radius: 10px;
  box-shadow: var(--shadow);
  touch-action: pan-y;
}
#main.browsing #canvas { cursor: default; }
#main.drawing { padding: 0; }
#main.drawing #canvas { border-radius: 0; box-shadow: none; touch-action: none; }
.empty-hint {
  position: absolute; inset: auto 16px 28px; text-align: center;
  color: var(--muted); font-size: 13px;
  background: rgba(255,255,255,0.85); padding: 8px 0; border-radius: 8px;
}
/* 小地图：作画模式右下角的整卷缩略导航 */
#minimap {
  position: fixed; right: 10px; bottom: 168px; z-index: 40;
  width: 84px; height: 233px;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(60,40,35,0.28);
  border: 2px solid rgba(255,255,255,0.9);
  background: #fff;
  touch-action: none;
  transition: bottom .18s ease, opacity .18s ease;
}
/* 手机端：缩小 + 略透明（bottom 由 JS 按底部工具栏实际高度动态设置，避免遮挡粗细/画笔按钮） */
body:not(.device-desktop) #minimap {
  width: 62px; height: 172px;
  opacity: 0.92;
}
#minimap[hidden] { display: none !important; }

/* ---------- 底部工具条(作画模式, 窄屏/手机) ---------- */
.drawbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(200,150,140,0.12);
}
/* 任何布局下 hidden 都必须生效(desktop 分支的 display:flex 会覆盖默认 hidden) */
.drawbar[hidden] { display: none !important; }
.tool-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tool-row:last-child { margin-bottom: 0; }

/* ---------- 宽屏(桌面 / 横屏平板): 工具条移到右侧, 画布全高 ---------- */
/* 由「设备模式」驱动: 用户选择电脑, 或自动检测到宽屏时, body 会带上 .device-desktop */
body.device-desktop #main.drawing { padding-right: 200px; }
body.device-desktop .drawbar {
  left: auto; right: 0; top: 58px; bottom: 0;
  width: 200px;
  border-top: none; border-left: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center;
  gap: 18px; padding: 12px 14px;
}
body.device-desktop .drawbar .tool-row { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 0; }
body.device-desktop .drawbar .tool-group { justify-content: center; }
body.device-desktop .drawbar .swatches { flex-wrap: wrap; justify-content: center; }
body.device-desktop .drawbar .sizes { display: flex; justify-content: center; }
body.device-desktop .drawbar .action-row { gap: 8px; }
body.device-desktop .drawbar .act-btn { width: 100%; text-align: center; }
body.device-desktop #minimap { right: 216px; bottom: 24px; }
/* 快捷键提示: 仅桌面模式显示 */
.shortcut-hint { display: none; }
body.device-desktop .shortcut-hint {
  display: block; text-align: center;
  font-size: 10px; line-height: 1.7; color: #B5AAA0;
  border-top: 1px dashed var(--line); padding-top: 10px;
}

/* ---------- 设备选择弹窗 ---------- */
.device-card { max-width: 380px; }
.device-sub { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.device-options { display: flex; flex-direction: column; gap: 10px; }
.device-opt {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); background: #fff;
  border-radius: 14px; padding: 12px 14px;
  font-size: 14px; cursor: pointer; text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.device-opt .d-ico { font-size: 22px; }
.device-opt b { color: var(--ink); font-size: 14px; }
.device-opt small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
@media (pointer: fine) {
  .device-opt:hover { border-color: var(--salmon); background: #FFF6F2; }
}
.device-opt:active { border-color: var(--salmon); background: #FFF6F2; }
.device-auto {
  width: 100%; margin-top: 14px;
  border: none; background: none; color: var(--salmon-deep);
  font-size: 13px; cursor: pointer; padding: 6px 0;
}
.device-auto:active { opacity: 0.7; }

/* ---------- 页脚设备切换入口 ---------- */
.foot-device {
  border: 1px solid var(--line); background: #fff;
  color: var(--muted); font-size: 11px;
  padding: 4px 14px; border-radius: 14px;
  cursor: pointer; margin-bottom: 10px;
  transition: color 0.15s, border-color 0.15s;
}
@media (pointer: fine) { .foot-device:hover { color: var(--salmon-deep); border-color: var(--salmon); } }

/* ---------- 桌面 hover 反馈(仅精确指针, 触摸屏不触发) ---------- */
@media (pointer: fine) {
  .lock-btn:hover { background: var(--salmon); color: #fff; }
  .tool-btn:hover, .size-btn:hover, .act-btn:hover { border-color: var(--mint); color: var(--mint); }
  .act-btn.primary:hover { background: var(--salmon-deep); color: #fff; }
  .swatch:hover { transform: scale(1.2); }
}
.tool-group { display: flex; gap: 6px; }
.tool-btn, .size-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  width: 40px; height: 40px; border-radius: 10px;
  font-size: 16px; cursor: pointer;
}
.tool-btn.active { background: var(--mint); border-color: var(--mint); color: #fff; }
.swatches { display: flex; gap: 7px; }
.swatch {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}
.swatch.active { box-shadow: 0 0 0 2px var(--ink); }

/* 色轮入口：小彩虹圆钮 */
.swatch.wheel {
  background: conic-gradient(#f66, #fc6, #ff9, #9f9, #6cf, #96f, #f66);
}
.swatch.wheel.active { box-shadow: 0 0 0 2px var(--ink); }

/* 双环取色器 */
.wheel-card { text-align: center; }
.wheel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.wheel-head h2 { font-size: 17px; margin-bottom: 0; }
/* 旧色 → 新色 对比 */
.cmp { display: flex; align-items: center; gap: 6px; }
.cmp-item { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.cmp-chip {
  display: block; width: 36px; height: 22px; border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  background: #fff;
}
.cmp-item em {
  font-style: normal; font-size: 9px; letter-spacing: 1px;
  color: var(--muted); line-height: 1;
}
.cmp-arrow { font-size: 12px; color: #C9BEB2; transform: translateY(-7px); }
#wheelCanvas {
  margin: 6px auto 4px; border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
  touch-action: none; cursor: crosshair;
  max-width: 100%;
}
.size-btn { width: auto; padding: 0 8px; font-size: 11px; height: 30px; min-width: 36px; }
.size-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.sizes { display: flex; flex-wrap: wrap; gap: 4px; }
/* 手机端：粗细分段独占一行并均分（色板行空间不够，避免 5 档被压成两行错位） */
body:not(.device-desktop) .tool-row { flex-wrap: wrap; }
body:not(.device-desktop) .sizes { flex-basis: 100%; justify-content: stretch; margin-top: 8px; gap: 6px; }
body:not(.device-desktop) .sizes .size-btn { flex: 1 1 0; min-width: 0; font-size: 12px; height: 32px; }
.brush-group { display: flex; gap: 6px; flex-wrap: wrap; }
.brush-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 0 12px; height: 32px; border-radius: 16px;
  font-size: 12px; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.brush-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.act-btn {
  border: 1px solid var(--line); background: #fff;
  padding: 8px 14px; border-radius: 18px; font-size: 13px; cursor: pointer;
}
.act-btn.primary { background: var(--salmon); border-color: var(--salmon); color: #fff; font-weight: 500; }

/* ---------- 解锁弹窗 ---------- */
.lock-modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(60, 40, 35, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.lock-modal[hidden] { display: none !important; }
.lock-card [hidden] { display: none !important; }
.lock-card {
  background: #fff; border-radius: 18px; padding: 26px 22px 20px;
  width: 100%; max-width: 340px; text-align: center;
  box-shadow: var(--shadow);
}
.lock-card h2 { font-size: 18px; margin-bottom: 6px; }
.lock-card p { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.lock-card p b { color: var(--salmon-deep); }
#codeInput {
  width: 100%; text-align: center; font-size: 26px; letter-spacing: 10px;
  padding: 12px 0; border: 1px solid var(--line); border-radius: 12px;
  outline: none; margin-bottom: 6px;
}
#codeInput:focus { border-color: var(--salmon); }
#nameInput {
  width: 100%; text-align: center; font-size: 20px; letter-spacing: 2px;
  padding: 12px 0; border: 1px solid var(--line); border-radius: 12px;
  outline: none; margin-bottom: 6px;
}
#nameInput:focus { border-color: var(--salmon); }
.lock-err { color: #C0392B; font-size: 12px; margin-bottom: 8px; }
.lock-btns { display: flex; gap: 10px; margin-top: 10px; }
.lock-btns button {
  flex: 1; padding: 11px 0; border-radius: 12px; font-size: 14px; cursor: pointer;
}
.lock-cancel { border: 1px solid var(--line); background: #fff; }
.lock-ok { border: none; background: var(--salmon); color: #fff; font-weight: 500; }
.lock-tip { font-size: 11px; color: #B5AAA0; margin-top: 14px; margin-bottom: 0; }
.tip-text { white-space: pre-wrap; line-height: 1.7; font-size: 14px; color: #444; margin: 6px 0 18px; max-height: 52vh; overflow: auto; }

/* ---------- 页脚 ---------- */
.foot {
  text-align: center; padding: 18px 16px 26px;
  color: #B5AAA0; font-size: 12px; letter-spacing: 1px;
}
body.drawing .foot, body.drawing .daybar { display: none; }

/* 管理员快捷入口（选择页页脚，小鱼隐形入口） */
.admin-entry {
  background: none; border: none; cursor: pointer;
  color: #B5AAA0; font-size: 0; line-height: 0;
  opacity: .38; padding: 2px 10px; margin-bottom: 6px;
  display: inline-block;
  transition: opacity .2s;
}
.admin-entry:hover, .admin-entry:active { opacity: .9; }

/* 提示条 */
.toast {
  position: fixed; left: 50%; top: 60px; transform: translateX(-50%);
  background: rgba(40,40,40,0.88); color: #fff;
  padding: 9px 18px; border-radius: 20px; font-size: 13px; z-index: 60;
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 房间列表页 ---------- */
.room-list-page { min-height: 100vh; }
.room-list-page[hidden], #canvasPage[hidden] { display: none !important; }
.room-list-body { max-width: 480px; margin: 0 auto; padding: 24px 16px; }
.room-list-title { font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 16px; }
.room-cards { display: flex; flex-direction: column; gap: 12px; }
.room-card {
  display: block; text-decoration: none;
  background: #fff; border-radius: 14px; padding: 18px 20px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  transition: transform 0.15s, border-color 0.15s;
}
.room-card:active { transform: scale(0.98); border-color: var(--salmon); }
@media (pointer: fine) { .room-card:hover { border-color: var(--salmon); transform: translateY(-2px); } }
.room-card-name { font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.room-card-status { font-size: 13px; }
.room-card-status.room-active { color: var(--mint); }
.room-card-status.room-pending { color: #B8860B; }
.room-card-status.room-idle { color: var(--muted); }
.room-list-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 40px 0; }

/* 双模块入口切换 */
.module-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 20px;
}
/* 项目选择页状态：两张大卡片居中竖排 */
.module-switch.picker-mode {
  grid-template-columns: 1fr;
  max-width: 400px;
  margin: 6vh auto 0;
  gap: 16px;
}
.module-switch.picker-mode .module-card {
  padding: 24px 20px;
  border-radius: 20px;
  justify-content: flex-start;
}
.module-switch.picker-mode .module-ico { font-size: 32px; }
.module-switch.picker-mode .module-txt b { font-size: 18px; margin-bottom: 4px; }
.module-switch.picker-mode .module-txt small { font-size: 13px; }
.module-card {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 14px; padding: 14px;
  text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s;
}
.module-card:active { transform: scale(0.98); }
@media (pointer: fine) { .module-card:hover { border-color: var(--salmon); transform: translateY(-2px); } }
.module-card.active { border-color: var(--salmon); background: linear-gradient(135deg, #FFF6F2, #F4FBF7); }
.module-ico { font-size: 24px; }
.module-txt { min-width: 0; }
.module-txt b { display: block; font-size: 15px; margin-bottom: 2px; }
.module-txt small { color: var(--muted); font-size: 11px; }

/* 返回房间列表按钮 */
.foot-back {
  border: 1px solid var(--line); background: #fff;
  color: var(--muted); font-size: 11px;
  padding: 4px 14px; border-radius: 14px;
  cursor: pointer; margin-bottom: 10px; margin-left: 8px;
  transition: color 0.15s, border-color 0.15s;
}
/* 房间列表页：返回选择页按钮 */
.back-picker {
  border: 1px solid var(--line); background: #fff;
  color: var(--muted); font-size: 12px;
  padding: 5px 14px; border-radius: 14px;
  cursor: pointer; margin: 2px 0 14px;
  transition: color 0.15s, border-color 0.15s;
}
.back-picker:active { transform: scale(0.98); }
@media (pointer: fine) { .foot-back:hover { color: var(--salmon-deep); border-color: var(--salmon); } }

/* ============================================================
   21天绘画营（朋友圈式每日打卡）
   ============================================================ */
.camp-list-page { min-height: 100vh; }
.camp-list-page[hidden], #feedPage[hidden] { display: none !important; }

.back-home {
  text-decoration: none; color: var(--muted); font-size: 13px;
  border: 1px solid var(--line); background: #fff;
  padding: 6px 14px; border-radius: 16px;
  transition: color 0.15s, border-color 0.15s;
}
@media (pointer: fine) { .back-home:hover { color: var(--salmon-deep); border-color: var(--salmon); } }

/* 营信息条 */
.campbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #F4FBF7, #FFF6F2);
}
.camp-info { display: flex; align-items: center; gap: 10px; }
.camp-info .day-badge { background: var(--mint); }
#campProgress { font-size: 12px; color: var(--muted); }

/* feed 主体 */
.feed-body { max-width: 600px; margin: 0 auto; padding: 16px 16px 8px; }

/* 发布框 */
.composer {
  background: #fff; border-radius: 16px; padding: 14px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  margin-bottom: 18px;
}
.composer-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.composer-row:last-child { margin-bottom: 0; }
.composer input[type="text"] {
  flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; outline: none;
}
.composer textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; resize: none; outline: none; box-sizing: border-box;
  margin-bottom: 8px; line-height: 1.6;
}
.composer input:focus, .composer textarea:focus { border-color: var(--mint); }
.composer-name {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
  padding: 5px 12px; font-size: 13px; color: var(--ink);
}
.composer-name .name-ico { font-size: 14px; }
.composer-name #myNameLabel { font-weight: 600; }
.composer-name button {
  border: none; background: none; color: var(--muted);
  font-size: 12px; cursor: pointer; padding: 0 2px;
}
@media (pointer: fine) { .composer-name button:hover { color: var(--salmon-deep); } }
.img-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 7px 14px; border-radius: 18px; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
@media (pointer: fine) { .img-btn:hover { border-color: var(--mint); color: var(--mint); } }
.post-btn {
  margin-left: auto; border: none; background: var(--salmon); color: #fff;
  padding: 8px 22px; border-radius: 18px; font-size: 14px; font-weight: 500; cursor: pointer;
}
.post-btn:disabled { opacity: 0.6; }
.img-preview { position: relative; display: inline-flex; }
.img-preview[hidden] { display: none; }
.img-preview img {
  height: 44px; width: auto; border-radius: 8px;
  border: 1px solid var(--line); display: block;
}
.img-preview button {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  border: none; background: rgba(60,40,35,0.7); color: #fff;
  font-size: 11px; line-height: 1; cursor: pointer;
}

/* 帖子卡片 */
.feed { display: flex; flex-direction: column; gap: 14px; }
.post {
  background: #fff; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.post-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
}
.post-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #F6B8C6, #A8DCCB);
  color: #fff; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.post-avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 发布框头像圆钮 */
.avatar-btn {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px dashed #D8CFC2; padding: 0; cursor: pointer;
  background: linear-gradient(135deg, #F6B8C6, #A8DCCB);
  color: #fff; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; transition: border-color .2s;
}
.avatar-btn.has-img { border: none; }
.avatar-btn.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (pointer: fine) { .avatar-btn:hover { border-color: var(--mint); } }
/* 评论里的小头像 */
.comment { display: flex; align-items: flex-start; }
.comment-av {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  margin: 3px 5px 0 0; overflow: hidden;
  background: linear-gradient(135deg, #F6B8C6, #A8DCCB);
  color: #fff; font-size: 10px; font-weight: 600; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center;
}
.comment-av.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-meta { min-width: 0; }
.post-author { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-day {
  font-size: 11px; background: var(--mint); color: #fff;
  padding: 2px 8px; border-radius: 10px; font-weight: 400;
}
.post-time { font-size: 11px; color: var(--muted); margin-top: 2px; }
.post-img { position: relative; cursor: zoom-in; }
.post-img img { width: 100%; display: block; max-height: 60vh; object-fit: contain; background: #FDFBF6; }
.post-text {
  padding: 10px 14px 4px; font-size: 14px; line-height: 1.7; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
}
.post-comments {
  margin: 8px 14px 0; padding: 8px 10px; border-radius: 10px;
  background: #FAF6F0; font-size: 13px;
}
.post-comments[hidden] { display: none; }
.comment { padding: 4px 0; line-height: 1.6; }
.comment b { color: var(--salmon-deep); font-weight: 600; margin-right: 6px; }
.comment span { color: var(--ink); word-break: break-word; }
.post-actions { padding: 8px 14px 10px; }
.comment-btn {
  border: none; background: none; color: var(--muted);
  font-size: 13px; cursor: pointer; padding: 4px 2px;
}
@media (pointer: fine) { .comment-btn:hover { color: var(--salmon-deep); } }
.comment-box { display: flex; gap: 8px; padding: 0 14px 12px; }
.comment-box[hidden] { display: none; }
.comment-box input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 18px;
  font-size: 13px; outline: none;
}
.comment-box input:focus { border-color: var(--mint); }
.comment-box button {
  border: none; background: var(--mint); color: #fff;
  padding: 6px 16px; border-radius: 18px; font-size: 13px; cursor: pointer;
}

/* 图片放大 */
.lightbox {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(20, 15, 12, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.lightbox button {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.2); color: #fff;
  font-size: 18px; cursor: pointer;
}

/* ============ 启动页（工作室 logo 入口） ============ */
.splash {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash-bg {
  position: absolute; inset: 0; z-index: -2;
  background: url('/images/cover.jpg') center center / cover no-repeat;
  filter: saturate(0.95);
}
.splash-overlay {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(160deg, rgba(255,253,249,0.82) 0%, rgba(255,250,246,0.72) 45%, rgba(254,246,239,0.68) 100%);
  backdrop-filter: blur(0.6px);
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { text-align: center; padding: 32px; animation: splash-in 0.7s ease; z-index: 1; }
@keyframes splash-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.splash-logo {
  position: relative;
  width: 170px; height: 170px; margin: 0 auto 22px;
  display: flex; align-items: center; justify-content: center;
}
.splash-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(150, 120, 100, 0.18));
}
@media (max-width: 380px) {
  .splash-logo { width: 140px; height: 140px; }
  .splash-title { font-size: 28px; letter-spacing: 10px; text-indent: 10px; }
  .splash-line { font-size: 14px; margin: 16px auto 26px; }
  .splash-btn { padding: 13px 38px; font-size: 15px; }
}
.splash-title {
  margin: 0; font-size: 32px; font-weight: 600;
  letter-spacing: 12px; text-indent: 12px; color: #3B3B3B;
}
.splash-sub {
  margin: 8px 0 0; font-size: 12px; letter-spacing: 6px; text-indent: 6px;
  color: var(--muted); text-transform: uppercase;
}
.splash-line {
  margin: 20px auto 34px; font-size: 15px; color: var(--salmon-deep);
  letter-spacing: 1px;
}
.splash-btn {
  display: inline-block; border: none; cursor: pointer;
  background: linear-gradient(135deg, #E87A90, #E8855A);
  color: #fff; font-size: 17px; letter-spacing: 2px;
  padding: 15px 46px; border-radius: 40px;
  box-shadow: 0 10px 26px rgba(232, 122, 144, 0.42);
  transition: transform 0.15s, box-shadow 0.15s;
}
@media (pointer: fine) { .splash-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(232, 122, 144, 0.5); } }
.splash-btn:active { transform: scale(0.97); }
.splash-hint {
  margin: 26px 0 0; font-size: 12px; color: var(--muted);
  letter-spacing: 2px;
}

/* ============================================================
   幸运饼干（小鱼干徽章 / 奖励弹窗 / 饼干收藏）
   ============================================================ */
.fish-badge {
  border: 1px solid #F2D3C8; background: #FFF6F2; color: #B25A3B;
  font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 20px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(232, 122, 144, 0.12);
  transition: transform 0.15s;
}
.fish-badge:active { transform: scale(0.95); }
.topbar .fish-badge { margin-left: 8px; }

/* 奖励卡片 */
.reward-card { padding-top: 34px; overflow: hidden; }
.reward-card h2 { font-size: 20px; color: var(--salmon-deep); }
.reward-card .reward-tip { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.reward-card .lock-ok { margin-top: 14px; width: 100%; padding: 11px 0; border-radius: 12px; }

/* 小鱼干掉落 */
.fish-anim { height: 64px; position: relative; }
.fish-drop {
  font-size: 46px; display: inline-block;
  animation: fishFall 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 6px 10px rgba(232, 122, 144, 0.35));
}
@keyframes fishFall {
  0% { transform: translateY(-70px) rotate(-18deg); opacity: 0; }
  55% { transform: translateY(6px) rotate(6deg); opacity: 1; }
  75% { transform: translateY(-4px) rotate(-3deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

/* 漂流瓶（替换原来的 emoji 幸运饼干容器） */
.cookie-wrap { margin: 6px 0 4px; }
.fortune-cookie {
  width: 84px; height: 84px; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center;
  animation: cookieWobble 2.6s ease-in-out infinite;
  filter: drop-shadow(0 10px 16px rgba(95, 167, 176, 0.30));
  transition: transform 0.2s;
}
.fortune-cookie svg { width: 84px; height: 84px; display: block; }
.fortune-cookie:active { transform: scale(0.94); }
.fortune-cookie.cracked {
  animation: cookieCrack 0.5s ease forwards;
  filter: grayscale(0.45) drop-shadow(0 4px 8px rgba(63, 143, 146, 0.3));
}
@keyframes cookieWobble {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(5deg); }
}
@keyframes cookieCrack {
  0% { transform: rotate(0) scale(1); }
  30% { transform: rotate(-12deg) scale(1.12); }
  60% { transform: rotate(9deg) scale(1.05); }
  100% { transform: rotate(0) scale(1); opacity: 0.45; }
}
.reward-hint { font-size: 12px; color: #B5AAA0; margin-top: 6px; letter-spacing: 1px; }

/* 饼干内容 */
.cookie-reveal { margin-top: 14px; animation: fadeUp 0.45s ease; }
.cookie-art {
  width: 128px; height: 128px; margin: 0 auto 10px;
  background: linear-gradient(145deg, #FFF9F0, #FDF1E7);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1px dashed #EBCFB0;
}
.cookie-art svg { width: 100px; height: 100px; }
.cookie-text { font-size: 14px; color: var(--ink); line-height: 1.7; padding: 0 6px; }
.cookie-text.big {
  font-size: 16px; font-weight: 500; color: var(--salmon-deep);
  padding: 14px 12px; background: #FFF6F2; border-radius: 14px;
  border: 1px dashed #F2D3C8;
}
.reward-total { margin-top: 12px; font-size: 12px; color: var(--muted); }
.reward-total b { color: var(--salmon-deep); font-size: 14px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* 我的饼干收藏 */
.mycookies-card { max-width: 380px; max-height: 82vh; display: flex; flex-direction: column; }
.mycookies-card h2 { font-size: 18px; color: var(--salmon-deep); }
.mycookies-card .lock-ok { width: 100%; padding: 11px 0; border-radius: 12px; margin-top: 12px; }
.ck-list {
  flex: 1; overflow-y: auto; text-align: left;
  display: flex; flex-direction: column; gap: 10px;
  padding: 4px 2px; margin-top: 4px;
}
.ck-item {
  background: #FFFDF9; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px;
}
.ck-art svg { width: 56px; height: 56px; display: block; margin-bottom: 6px; }
.ck-text { font-size: 13px; color: var(--ink); line-height: 1.6; }
.ck-date { margin-top: 6px; font-size: 11px; color: #B5AAA0; }
.ck-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 18px 6px; line-height: 1.8; }

/* ============================================================
   小鱼加载 · 苗绣斗鱼 (BUILD 2026-09-04-16)
   ============================================================ */
.fish-loading {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(251, 247, 240, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
  transition: opacity .35s ease;
}
.fish-loading.hide { opacity: 0; pointer-events: none; }
.fish-loading svg.fish-stage { width: 280px; height: 184px; display: block; }
.fish-loading .fish-text {
  margin-top: 14px; font-size: 15px; color: var(--ink); letter-spacing: 1px;
  font-weight: 500;
}
.fish-loading .fish-sub {
  margin-top: 6px; font-size: 12px; color: var(--muted); letter-spacing: 0.5px;
}
.fish-loading .fish-actions {
  margin-top: 18px;
}
.fish-loading .fish-actions button {
  background: var(--salmon); color: #fff; border: 0;
  padding: 8px 18px; border-radius: 18px; font-size: 13px; cursor: pointer;
}
.fish-loading .fish-actions button:hover { background: var(--salmon-deep); }

/* 鱼身体呼吸 */
@keyframes fishBreath {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.96); }
}
.fish-body { animation: fishBreath 3.2s ease-in-out infinite; transform-origin: 200px 170px; }

/* 尾鳍整体摆动 */
@keyframes fishTailSway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(5deg); }
}
.fish-tail { animation: fishTailSway 2.5s ease-in-out infinite; transform-origin: 286px 172px; }

/* 五缕彩条各自错位飘 */
@keyframes fishStrand {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(6deg); }
}
.fish-t1 { animation: fishStrand 2.0s ease-in-out infinite; transform-origin: 286px 164px; }
.fish-t2 { animation: fishStrand 2.3s ease-in-out infinite .15s; transform-origin: 286px 168px; }
.fish-t3 { animation: fishStrand 2.6s ease-in-out infinite .3s; transform-origin: 286px 172px; }
.fish-t4 { animation: fishStrand 2.1s ease-in-out infinite .1s; transform-origin: 286px 176px; }
.fish-t5 { animation: fishStrand 2.5s ease-in-out infinite .2s; transform-origin: 286px 180px; }

/* 背鳍 / 臀鳍轻飘 */
@keyframes fishFin {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(4deg); }
}
.fish-dorsal { animation: fishFin 2.2s ease-in-out infinite; transform-origin: 195px 110px; }
.fish-anal { animation: fishFin 2.4s ease-in-out infinite .2s; transform-origin: 250px 250px; }

/* 气泡 */
@keyframes fishBubble {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  15% { opacity: .9; }
  100% { transform: translate(var(--bx, 30px), -120px) scale(1.1); opacity: 0; }
}
.fish-bubbles circle { animation: fishBubble 4.5s ease-in infinite; }
.fish-bubbles circle:nth-child(1) { --bx: -10px; animation-delay: 0s; }
.fish-bubbles circle:nth-child(2) { --bx: 20px; animation-delay: .8s; }
.fish-bubbles circle:nth-child(3) { --bx: -30px; animation-delay: 1.6s; }
.fish-bubbles circle:nth-child(4) { --bx: 40px; animation-delay: 2.4s; }
.fish-bubbles circle:nth-child(5) { --bx: -15px; animation-delay: 3.2s; }


/* ---------- v20.16b 首次作画引导：告诉你「现在拖动是挪画面，画要点画笔」 ---------- */
.draw-guide {
  position: absolute; left: 12px; bottom: 100%; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff; font-size: 12.5px; line-height: 1.5;
  padding: 9px 8px 9px 13px; border-radius: 12px;
  box-shadow: 0 6px 18px rgba(90, 42, 56, 0.22);
  max-width: min(80vw, 340px); z-index: 3;
  animation: guideIn 0.26s ease-out;
}
.draw-guide b { font-size: 14px; }
.draw-guide::after {
  content: ""; position: absolute; top: 100%; left: 28px;
  border: 6px solid transparent; border-top-color: var(--ink);
}
.draw-guide[hidden] { display: none !important; }
.guide-x {
  background: none; border: none; color: rgba(255, 255, 255, 0.65);
  font-size: 17px; line-height: 1; cursor: pointer; padding: 0 3px;
}
@keyframes guideIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* 画笔按钮呼吸光圈，提示「从这里开始画」 */
@keyframes toolPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(126, 196, 178, 0.55); }
  50% { box-shadow: 0 0 0 9px rgba(126, 196, 178, 0); }
}
.tool-btn.pulse { animation: toolPulse 1.7s ease-out infinite; border-color: var(--mint); }
/* 桌面版：工具条在右侧竖排，气泡改挂左侧 */
body.device-desktop .draw-guide {
  left: auto; right: 100%; bottom: auto; top: 6px;
  margin: 0 10px 0 0; max-width: 180px;
}
body.device-desktop .draw-guide::after {
  top: 16px; left: 100%;
  border-top-color: transparent; border-left-color: var(--ink);
}
