/* =========================================================================
   「我的」页（src/ui/me.js）
   沿用「暖纸书房」主题：米纸底 / 青墨绿 / 琥珀金
   ========================================================================= */
.camp.me {
  height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #FAF6EF; padding: 16px 14px 92px;   /* 底部留出 Tab 栏高度 */
  box-sizing: border-box;
}
.me-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.me-avatar {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font-size: 28px; background: #fff; border: 1px solid #EDE0C8;
  box-shadow: 0 4px 12px rgba(100, 70, 40, .08);
}
.me-nick { font-size: 17px; font-weight: 800; color: #1A1A1A; }
.me-sub { margin-top: 3px; font-size: 12.5px; color: #8A8073; }

.me-body { display: flex; flex-direction: column; gap: 12px; }
.me-card {
  background: #fff; border: 1px solid #EDE0C8; border-radius: 14px; padding: 14px;
  box-shadow: 0 6px 16px rgba(100, 70, 40, .05);
}
.me-card-h {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 800; color: #3A6B5C; letter-spacing: .02em;
  margin-bottom: 10px;
}
.me-card-n { font-size: 12px; font-weight: 700; color: #A8842C; }

/* 身份 / 立项（项目名是全书所有案例与练习题的主角，必须显眼） */
.me-proj-name { font-size: 16px; font-weight: 800; color: #1A1A1A; }
.me-proj-idea { margin-top: 4px; font-size: 12.5px; line-height: 1.7; color: #6B6152; }
.me-proj-none { font-size: 13px; line-height: 1.75; color: #8A8073; }
.me-mini-btn {
  margin-top: 10px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  color: #3A6B5C; background: #F4F9F3; border: 1px solid #C9D9C6;
}
.me-mini-btn:active { transform: translateY(1px); }

/* 「做过的决策」列表 / 「本书进度」条 / 「收获」四宫格 的样式已随这三块内容一起删除
   （2026-10-11）：进度与记忆信息归「进度」页，决策与收获列表实测长期为空、无人回看。
   对应 DOM 类名 me-dl* / me-empty / me-more / me-prog* / me-next* / me-stats / me-st*
   在项目里已无任何引用。 */

/* 设置（低频，压在最底部） */
.me-set-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; font-size: 13px; color: #6B6152;
  border-bottom: 1px dashed #EFE9DE;
}
.me-set-row:last-child { border-bottom: 0; }
.me-set-row b { color: #1A1A1A; }
/* 开关（音效 / 火焰边框）：沿用 set-get 风格的拨片 */
.me-set-toggle { padding: 11px 0; }
.me-toggle {
  position: relative; width: 46px; height: 26px; border-radius: 999px;
  border: 1px solid #D8CDB6; background: #EDE6D8; cursor: pointer;
  padding: 0; flex: 0 0 auto; transition: background .18s, border-color .18s;
}
.me-toggle i {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .18s ease;
}
.me-toggle.on { background: #3A6B5C; border-color: #3A6B5C; }
.me-toggle.on i { transform: translateX(20px); }

/* 火焰详细参数面板（位于「🔥 火焰边框」开关下方） */
.me-fire-block {
  position: relative;
  margin: 6px 0 2px; padding: 8px 10px;
  background: #FAF3E7; border: 1px solid #EFE6D6; border-radius: 10px;
  transition: opacity .18s;
}
.me-fire-block.me-fire-disabled { opacity: .45; pointer-events: none; filter: grayscale(.4); }

/* 工具区（刷全书 / 存档 / 内测 / 清记录 / 重置）：一行一个动作，
   名称 + 一句人话说明；破坏性动作标红——设置里最怕"点错才后悔"。 */
.me-tools { display: flex; flex-direction: column; gap: 8px; }
.me-tool {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 10px 12px; text-align: left; cursor: pointer;
  font-family: inherit; color: #4A4238;
  background: #FBF6EC; border: 1px solid #EFE6D6; border-radius: 12px;
  transition: background .15s, border-color .15s;
}
.me-tool:hover { background: #F7EFE0; border-color: #E3D6BE; }
.me-tool:active { transform: translateY(1px); }
.me-tool.on { background: #EDF5F1; border-color: #BFD8CE; }
.me-tool.danger .me-tool-label { color: #9A5A2B; }
/* 破坏性动作的"上膛"态：第一次点变成「再点一次，确认执行」，2.6s 内不点自动撤回。
   不用原生 confirm —— 内嵌预览 / 部分 webview 会把它直接吞掉，点了等于没点。 */
.me-tool.armed { background: #FBEDE4; border-color: #D9A441; box-shadow: 0 0 0 2px rgba(217, 164, 65, .16); }
.me-tool.armed .me-tool-label { color: #8A4A12; }
.me-tool.armed .me-tool-tip { color: #9A5A2B; }
.me-tool-ico { font-size: 16px; line-height: 1.4; flex: 0 0 auto; }
.me-tool-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.me-tool-label { font-size: 13px; font-weight: 800; }
.me-tool-tip { font-size: 11.5px; line-height: 1.6; color: #8A8073; }
.me-fp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0; font-size: 12.5px; color: #6B6152;
}
.me-fp-row label { flex: 0 0 58px; color: #857A68; }
.me-fp-row input[type=range] { flex: 1; accent-color: #E0822A; min-width: 0; }
.me-fp-val { flex: 0 0 36px; text-align: right; color: #B5631E; font-variant-numeric: tabular-nums; }
.me-fp-sel {
  flex: 1; padding: 4px 6px; font-size: 12.5px; color: #4A4334;
  border: 1px solid #D8CDB6; border-radius: 7px; background: #fff; font-family: inherit;
}
.me-fp-reset {
  margin-top: 8px; width: 100%; padding: 6px; font-size: 12.5px;
  color: #8a6a3a; background: #f3e7d2; border: 1px solid #e3d4ba;
  border-radius: 7px; cursor: pointer; font-family: inherit;
}
.me-fp-reset:hover { background: #ecdcc1; }

/* 四个 Tab 在小屏会挤：统一的收缩规则在 battle.css 的 .tab 里（图标变小、字号降一档），
   这里不再单独给某个 Tab 改字号，以免和其它三个不一致。 */

/* ===== 书岛原型浮层（我的 → 设置 → 书岛） =====
   独立 iframe 整屏覆盖，和 app 的 DOM/CSS 完全隔离。
   关闭按钮放左上角：右上角是游戏里的时钟、右下角是操作提示、左下角是商店按钮。 */
body.island-open { overflow: hidden; }

#island-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background: #0b1020;
}
#island-overlay.show { display: block; }

#island-overlay iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #f2eeb0;
}

#island-overlay .island-exit {
  position: absolute;
  /* 落在游戏顶栏下方：顶栏是金币/藏书 + 时钟，左上角会被金币挡住 */
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  right: calc(env(safe-area-inset-right, 0px) + 10px);
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .72);
  /* 不用 backdrop-filter：它要在一张每帧都在变的画布上做实时模糊，
     安卓上这个 36px 的小圆能让整页合成变慢；半透明深底看起来一样。 */
  background: rgba(46, 40, 36, .42);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  z-index: 2;
  transition: transform .12s;
}
#island-overlay .island-exit:active { transform: scale(.9); }

/* 书岛假横屏时（整页旋转 90°），左上角会被商店侧板占住，
   关闭按钮挪到物理右下角 —— 旋转后正好是画面右上角的空区。
   状态由 iframe postMessage('island-landscape'/'island-portrait') 同步。 */
#island-overlay.landscape .island-exit {
  top: auto;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
}
