/* 家庭日历 · 待办 —— v2 M1：登录 + 三页（日历/待办/设置） */

:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #2c3345;
  --muted: #8a93a6;
  --line: #e6eaf2;
  --primary: #3788d8;
  --danger: #d9534f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* iPad 大字（REQ-090）：整体 zoom 等比放大 50%，由设置页「显示」节开关（body.ipad-large）；
   zoom 不改媒体查询视口，平板竖屏下有效版心变窄属预期，溢出问题实测后单独补规则 */
body.ipad-large { zoom: 1.5; }

/* REQ-090 追加（2026-10-14）：大字模式溢出硬限制，两类根因——
   ① FullCalendar 用读到的像素宽直接写回布局宽度，zoom 环境下内容宽=容器×1.5 且滚动容器
      overflow-x:hidden 不可滚（iPad 820 超宽 378px、桌面 1280 超 608px），故日历容器 zoom
      归一到 1 倍（日历不参与放大，其余 UI 仍放大；日历内按钮热区 44px 为布局值不受影响）；
   ② dialog 的 88vh/92vw 等视口单位被 zoom 二次放大（88vh 等效 132vh）失去约束，
      日程弹窗上下被裁（iPad 26px/桌面 128px），统一"预除 1.5"使视觉值精确等效原约束。 */
body.ipad-large #calendar { zoom: calc(1 / 1.5); }
body.ipad-large dialog {
  width: min(420px, calc(92vw / 1.5));
  max-height: calc(88vh / 1.5);
}
body.ipad-large #todoDialog { width: min(480px, calc(94vw / 1.5)); }
body.ipad-large #confirmDialog { width: min(340px, calc(90vw / 1.5)); }
body.ipad-large .auth-card { width: min(360px, calc(94vw / 1.5)); }

/* ---------- 登录 / 初始化 ---------- */
.auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.auth-card { width: min(360px, 94vw); padding: 24px; }
.auth-card h1 { margin: 0 0 14px; font-size: 1.25rem; text-align: center; }
.error { color: var(--danger); font-size: 0.85rem; margin: 10px 0 0; }
.error.hidden { display: none; }

/* ---------- 顶栏与导航（REQ-053：去应用名，日历/待办 + 用户胶囊 + 更多菜单） ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
#mainNav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
#mainNav a {
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}
#mainNav a.active { background: var(--primary); color: #fff; }
.top-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--text); /* 动作按钮比导航链接更醒目（REQ-060） */
}
.top-icon:hover { background: #eef2f8; }
.top-icon.on { background: #eaf3fc; color: var(--primary); }
@media (max-width: 640px) {
  .top-icon { width: 42px; height: 42px; }
}

.user-pill {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.9rem;
  white-space: nowrap;
  margin-left: auto; /* REQ-057 追加：显示名与更多靠右，日历/待办靠左 */
  max-width: 40vw; /* 超长显示名省略号截断，防顶栏溢出（REQ-065） */
}
#meName { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 430px) {
  /* 小手机进一步收窄显示名胶囊，保 #mainNav 单行不横向溢出（REQ-080 三端自查发现，全站受益） */
  .user-pill { max-width: 26vw; }
}
.more-wrap { position: relative; }
#moreBtn {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--muted);
  background: none;
  border: none;
}
#moreBtn.on, #moreBtn:hover { background: #eef2f8; color: var(--text); }
#moreBtn.on { color: var(--primary); }
.more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 132px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 5px;
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.more-menu a,
.more-menu button {
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  white-space: nowrap;
  text-align: left;
  border: none;
  background: none;
  width: 100%;
}
.more-menu a:hover, .more-menu button:hover { background: #f1f3f7; }
.more-menu a.current { background: #eaf3fc; color: var(--primary); }
.more-sep { border: none; border-top: 1px solid var(--line); margin: 5px 0; }

/* ---------- 卡片与通用 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.card h2 { margin: 0 0 10px; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.tip { color: var(--muted); font-size: 0.8rem; margin: 8px 0 0; }
.badge {
  font-size: 0.7rem;
  background: #f0f4ff;
  color: var(--primary);
  border: 1px solid #d6e3ff;
  border-radius: 999px;
  padding: 2px 8px;
}
.page { padding: 10px; }
.page.hidden { display: none; }
.hidden { display: none !important; } /* PIT-015 两度踩坑后根治 */

/* ---------- 去卡片分节（REQ-053 混合式：清单页无盒，节标题小灰字 + 发丝线） ---------- */
.flat-sec { padding: 2px 0 6px; }
.flat-sec + .flat-sec {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 12px;
}
.sec-cap {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* 日历页保留轻面板（格子信息密，需要边界），内边距略收紧 */

label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; margin-bottom: 10px; }
input, select {
  font: inherit;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
button {
  font: inherit;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.danger { background: #fff; border-color: var(--danger); color: var(--danger); }
button.ghost { border-color: transparent; color: var(--muted); }
button:hover { filter: brightness(0.96); }
button.full { width: 100%; }


.row { display: flex; gap: 10px; }
.row label { flex: 1; }
.row.btns { align-items: center; margin-top: 6px; }
.row.btns .spacer { flex: 1; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- 日历页 ---------- */
.wrap { display: flex; gap: 14px; align-items: flex-start; }
.cal-card { flex: 1 1 620px; min-width: 0; }
aside { flex: 0 0 320px; }
@media (max-width: 860px) { .wrap { flex-direction: column; } aside { flex: auto; width: 100%; } }

/* ---------- 待办页 ---------- */
.inline-label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.85rem;  flex-direction: row; }
.chk input { width: auto; }
.todo-group h3 {
  margin: 12px 0 4px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.todo-group h3.overdue { color: var(--danger); }
#todoGroups ul { list-style: none; margin: 0; padding: 0; }
#todoGroups { font-size: var(--todo-font-size, 15px); } /* REQ-060：设置页可调 */
#todoGroups li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 1em;
}
#todoGroups .tt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#todoGroups .tt.done { text-decoration: line-through; color: var(--muted); }
#todoGroups .meta { color: var(--muted); font-size: 0.87em; white-space: nowrap; }
#todoGroups .x { border: none; padding: 2px 6px; color: var(--muted); }
#todoGroups .x:hover { color: var(--danger); }
.empty-tip { color: var(--muted); font-size: 0.9rem; text-align: center; padding: 24px 0; }

/* ---------- 页脚版本号（REQ-050：缓存版本戳的可见面，全局显示） ---------- */
.version-foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  padding: 10px 14px 16px;
  user-select: none;
}

/* ---------- 回收站 / 已清除（REQ-044） ---------- */
.trash-list { list-style: none; margin: 0; padding: 0; }
.trash-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  flex-wrap: wrap; /* 手机窄屏：删除信息与按钮自动换行 */
}
.trash-list li:last-child { border-bottom: none; }
.trash-list .tt { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; }
.trash-list .meta { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.trash-list .delinfo { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.trash-list .rowbtns { display: flex; gap: 6px; margin-left: auto; }
.trash-list .rowbtns button { font-size: 0.8rem; padding: 3px 10px; }

/* ---------- 设置页 ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  align-items: stretch;
  /* 不限宽、不居中：与日历/待办页同用通栏左缘，避免"设置页缩进"的错位感 */
}
.settings-grid .wide { grid-column: 1 / -1; }
.settings-grid .card { display: flex; flex-direction: column; }
.settings-grid form { display: flex; flex-direction: column; flex: 1; }
.settings-grid form > button { margin-top: auto; align-self: flex-start; } /* 底部对齐 */
@media (max-width: 680px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* ---------- 颜色选择组件（REQ-024：预设色板 + 色相环手动取色，RGB/HSL/HEX 同页） ---------- */
.swatches { display: block; } /* 组件容器，由 renderSwatches 填充 */
.cc-label { font-size: 0.78rem; color: var(--muted); margin: 8px 0 6px; }
.cc-label:first-child { margin-top: 0; }

.cc-preset {
  display: flex;
  flex-wrap: wrap;      /* REQ-039：按容器宽度自动换行 */
  gap: 10px;
  margin-bottom: 4px;
}
.cc-preset .swatch {
  width: 44px;          /* 固定尺寸，随宽度自动换行而非拉伸 */
  height: 44px;
  flex: none;
}
.swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  padding: 0;
}
.swatch:hover { transform: scale(1.1); }
.swatch.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text);
}
.cc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  padding: 6px 12px;
}
.cc-chip {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #3788d8;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.cc-panel {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  max-width: min(510px, 100%); /* REQ-076：放大 50%（原 340px）且不超页宽 */
}
/* 色环尺寸可缩放（REQ-076：270px 上限，窄屏自动收窄）；画布内部 180px 由 CSS 拉伸，
   指针与拖拽坐标按渲染尺寸动态计算（见 app.js pick/applyState），此处改尺寸无需动 JS */
.cc-wheelwrap { position: relative; width: min(270px, 100%); aspect-ratio: 1 / 1; margin: 0 auto; }
.cc-wheelwrap canvas { width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.cc-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.cc-light,
.cc-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  margin: 12px 0 4px;
  cursor: pointer;
}
.cc-row input[type="range"] { margin: 0; }
.cc-light::-webkit-slider-thumb,
.cc-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--text);
  cursor: pointer;
}
.cc-tabs { display: flex; gap: 4px; margin: 10px 0 8px; }
.cc-tabs button { flex: 1; padding: 5px; font-size: 0.78rem; border-radius: 6px; }
.cc-tabs button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.cc-mode { display: none; gap: 6px; }
.cc-mode.on { display: flex; flex-direction: column; gap: 8px; }
.cc-mode input {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 0.85rem;
}
.cc-mode input[type="number"]::-webkit-outer-spin-button,
.cc-mode input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

/* 通道行（REQ-076）：字母标签 + 滑杆 + 数字框；R/G/B/H 静态渐变，S/L 由 JS 动态渐变 */
.cc-row { display: flex; align-items: center; gap: 8px; }
.cc-row > span { flex: none; width: 1.1em; font-size: 0.72rem; color: var(--muted); text-align: center; }
.cc-row input[type="number"] { flex: none; width: 3.8em; }
.cc-row [data-r="r"] { background: linear-gradient(to right, #000, #f00); }
.cc-row [data-r="g"] { background: linear-gradient(to right, #000, #0f0); }
.cc-row [data-r="b"] { background: linear-gradient(to right, #000, #00f); }
.cc-row [data-r="h"] { background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }

/* 新建成员表单：两列等宽栅格（手机单列）；颜色块与输入框同格权重。
   选择器带 form 以提升特异度，压过上方 .settings-grid form 的 flex 布局 */
form.member-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
  align-items: start;
}
form.member-form .row.btns { grid-column: 1 / -1; margin-top: 6px; }
@media (max-width: 680px) {
  form.member-form { grid-template-columns: 1fr; }
}
.admin-list { list-style: none; margin: 12px 0 0; padding: 0; }
.admin-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.admin-list li:last-child { border-bottom: none; }
.admin-list .info { flex: 1; min-width: 160px; }
.admin-list .uname { color: var(--muted); font-size: 0.8rem; }
.admin-list .ops { display: flex; gap: 6px; }
.admin-list .ops button { padding: 4px 10px; font-size: 0.8rem; }

/* ---------- 对话框 ---------- */
dialog {
  border: none;
  border-radius: 12px;
  padding: 18px;
  width: min(420px, 92vw);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  max-height: 88vh;
  overflow: auto;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
dialog h2 { margin: 0 0 12px; font-size: 1.05rem; }
.facet {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px 12px 0;
  margin-bottom: 10px;
}
.facet-title { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }
label.chk { flex-direction: row; align-items: center; gap: 6px; }
label.chk input { width: auto; }

/* ---------- FullCalendar 微调 ---------- */
.fc { font-size: 0.86rem; }
.fc .fc-toolbar-title { font-size: 1.05rem; }
.fc .fc-button { font-size: 0.82rem; }
.fc-event.fc-event-done { opacity: 0.5; }
.fc-event.fc-event-done .fc-event-title { text-decoration: line-through; }

/* ========== 设置页设计变体（REQ-022：同配色、异布局） ========== */
.design-links { font-size: .82rem; color: var(--muted); margin-bottom: 12px; }
.design-links a { color: var(--primary); }

.sd-switch { font-size: .82rem; color: var(--muted); margin-bottom: 12px; }
.sd-switch a { color: var(--primary); text-decoration: none; }
.sd-switch a.on { font-weight: 700; text-decoration: underline; }

/* ---- A1 侧栏分节式（GitHub/Linear 范式） ---- */
.sd1 { display: flex; gap: 18px; align-items: flex-start; }
.sd1-menu { display: flex; flex-direction: column; gap: 4px; width: 190px; flex: none; }
.sd1-menu button { text-align: left; border: none; background: none; padding: 9px 12px; border-radius: 8px; color: var(--muted); font-size: .92rem; }
.sd1-menu button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 600; }
.sd1-pane { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.sd1-pane h3 { margin: 0 0 12px; font-size: 1rem; }
.sd1-row { display: flex; align-items: flex-start; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sd1-row > span { width: 90px; flex: none; color: var(--muted); font-size: .88rem; padding-top: 8px; }
.sd1-cell { flex: 1; }
.sd1-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.sd1-addrow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sd1-addrow input { flex: 1 1 120px; min-width: 0; }
.sd1-addrow input[type=color] { flex: none; width: 40px; height: 36px; padding: 2px; }
.sd1 .swatches { max-width: 280px; }
.sd1 .swatch { border-radius: 8px; }
.sd1-list { list-style: none; margin: 0; padding: 0; }
.sd1-list li { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.sd1-list li:last-child { border-bottom: none; }
.sd1-list .uname { color: var(--muted); font-size: .8rem; flex: 1; }
.sd1-list .ops button { padding: 4px 10px; font-size: .8rem; }
@media (max-width: 760px) {
  .sd1 { flex-direction: column; }
  .sd1-menu { width: 100%; flex-direction: row; overflow-x: auto; }
  .sd1-menu button { white-space: nowrap; }
}

/* ---- A2 居中分组清单式（Apple 设置范式） ---- */
.sd2 { /* REQ-038：全宽流体，与其他页一致 */ }
.sd2-cap { margin: 16px 0 6px; font-size: .78rem; color: var(--muted); letter-spacing: .06em; }
/* REQ-053 去卡片：设置页分组去掉白盒/阴影，行直接贴页面；内边距同步归零 */
.sd2 .sd2-card { background: transparent; border-radius: 0; box-shadow: none; overflow: visible; }
.sd2 .sd2-row, .sd2 .sd2-list li, .sd2 .sd2-foot, .sd2 .sd2-add { padding-left: 0; padding-right: 0; }
.sd2 .sd2-add { border-top: 1px dashed var(--line); }
.sd2 .tag-add-row { padding-left: 0; padding-right: 0; }
.sd2-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.sd2-row.col { flex-direction: column; align-items: stretch; }
.sd2-row.col > span { margin-bottom: 6px; }
.sd2-inline { border: none; background: none; text-align: right; font: inherit; color: var(--primary); max-width: 220px; }
.sd2-inline:focus { outline: none; border-bottom: 1px dashed var(--line); }
.sd2-foot { display: flex; justify-content: flex-end; padding: 10px 14px; }

.sd2-list { list-style: none; margin: 0; padding: 0; }
.sd2-list li { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.sd2-list li:last-child { border-bottom: none; }
.sd2-list .uname { color: var(--muted); font-size: .8rem; flex: 1; }
.sd2-list .ops button { padding: 4px 10px; font-size: .8rem; border: none; background: none; color: var(--primary); }
.sd2-list li { position: relative; } /* 行内更多菜单的锚点（REQ-063） */
.row-menu {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 96px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  padding: 4px;
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.row-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 12px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.85rem;
  border-radius: 5px;
  white-space: nowrap;
}
.row-menu button:hover { background: #f1f3f7; }
.row-menu .del { color: var(--danger); }
.sd2-list .ops .del { color: var(--danger); }
.sd2-add { padding: 12px 14px; border-top: 1px dashed var(--line); }
.sd2-addgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.sd2-addgrid input[type=color] { width: 100%; height: 36px; padding: 2px; }

/* ---- A3 Bento 工作台式 ---- */
.sd3 { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
.sd3-hero { text-align: center; padding: 24px 18px; }
.sd3-disc { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 2rem; }
.sd3-hero h3 { margin: 0 0 2px; }
.sd3-uname { color: var(--muted); font-size: .82rem; margin: 0 0 16px; }
.sd3-hero .swatches { text-align: left; }
.sd3-sec { padding: 16px; }
.sd3-sec h3 { margin: 0 0 10px; font-size: 1rem; }
.sd3-members { grid-column: 2; padding: 16px; }
.sd3-members h3 { margin: 0 0 10px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.sd3-chip { font-size: .75rem; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.sd3-list { list-style: none; margin: 0 0 12px; padding: 0; }
.sd3-list li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: .94rem; }
.sd3-list li:last-child { border-bottom: none; }
.sd3-list .uname { color: var(--muted); font-size: .82rem; flex: 1; }
.sd3-list .ops button { padding: 4px 10px; font-size: .8rem; }
.sd3-addgrid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr auto; gap: 8px; }
.sd3-addgrid input { min-width: 0; }
.sd3-addgrid input[type=color] { width: 40px; height: 36px; padding: 2px; }
@media (max-width: 860px) {
  .sd3 { grid-template-columns: 1fr; }
  .sd3-members { grid-column: auto; }
  .sd3-addgrid { grid-template-columns: 1fr 1fr; }
}

/* ========== REQ-023：全局 Toast + 确认弹窗 + A2 行内保存 ========== */
#toastBox {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 9px 22px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .35s ease, transform .35s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-ok { background: #57b85f; }
.toast-err { background: var(--danger); }

#confirmDialog { width: min(340px, 90vw); }
#confirmDialog p { margin: 0 0 16px; font-size: 0.95rem; line-height: 1.5; }

/* A2 修改显示名：一行式（标签 | 带边框输入 | 保存） */
.sd2-row.name-row { gap: 10px; }
.sd2-row.name-row .sd2-label { flex: none; font-size: 0.9rem; color: var(--text); }
.sd2-bordered {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  flex: 1;
  min-width: 0;      /* 允许收缩，手机窄屏不挤出同排按钮（REQ-032） */
  max-width: none;   /* REQ-040：自适应填满剩余宽度 */
  font: inherit;
  background: #fff;
  color: var(--text);
}
.sd2-bordered:focus { outline: none; border-color: var(--primary); }
button.sm {
  padding: 7px 16px;
  font-size: 0.85rem;
  flex: none;        /* 手机窄屏不被压缩换行（REQ-032） */
  white-space: nowrap;
}

/* A2 行标签字体统一（REQ-025）：与"修改显示名"同规格；颜色行头部 = 标签左 + 保存右 */
.sd2-rowhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sd2-rowhead span { font-size: 0.9rem; color: var(--text); }

/* ========== REQ-026：安全区缩进 + 成员区一行布局 ========== */
.sd2-card > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px 0;
  font-size: 0.9rem;
  color: var(--text);
}
.sd2-card > label:last-of-type { margin-bottom: 6px; }

.sd2-add > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px 0;
  font-size: 0.9rem;
  color: var(--text);
  border-bottom: none;
}
.sd2-add .sd2-foot { padding-top: 12px; }
.sd2-add .sd2-row.col { padding: 11px 0; border-bottom: none; }

/* REQ-028：取色组件动作行（自定义颜色按钮 + 外部动作按钮同行） */
.cc-actions { display: flex; align-items: center; gap: 10px; }

/* REQ-030：取色组件动作行按钮推到最右，与卡片内其他保存/修改密码按钮右缘对齐 */
.cc-actions button:last-child { margin-left: auto; }

/* ========== REQ-033：事项成员胶囊多选 ========== */
.member-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}
.member-chip.on { border-color: var(--primary); background: #eaf3fc; }
.dots { display: inline-flex; gap: 3px; flex: none; }

/* ========== REQ-036：待办页双模块 + 新增行 + 日程展开 ========== */
.addbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.addbar .grow { flex: 1 1 200px; min-width: 0; }
  background: #eaf3fc;
  border-color: var(--primary);
  color: var(--primary);
}
.sched-panel {
  margin-top: 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

/* REQ-036 追加：显示已完成 推到工具栏最右 */

/* ========== REQ-037：成员拖拽排序 ========== */
.sd2-list li[draggable="true"] { cursor: grab; }
.sd2-list li.drag-over { box-shadow: inset 0 2px 0 var(--primary); }

/* REQ-042：对话框分区开关复选框 */
.facet .facet-chk {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}
.facet .facet-chk input { width: auto; }

/* ========== REQ-045~048：事项标签（多选胶囊 / 最近使用排序 / 待办筛选） ========== */
.tip-inline { color: var(--muted); font-size: 0.75rem; font-weight: normal; }

/* 事项对话框：标签行 = 已有胶囊（多选）+ 新建输入框 */
.tag-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.tag-line .member-chips { flex: 1 1 100%; }
#evTagInput { flex: 1 1 140px; min-width: 0; }

/* 标签胶囊：灰系（区别于成员胶囊的彩色头像），选中加深 */
.tag-chip { background: #f1f3f7; }
.tag-chip.on { background: #d7dce6; border-color: #aeb6c6; }
.tag-chip.new { border-style: dashed; } /* 本次新建，保存事项时才落库 */

/* 待办条目上的 #标签 徽章 */
.tagbox { display: inline-flex; gap: 4px; flex-wrap: wrap; flex: none; }
.tag-badge {
  display: inline-block;
  background: #eef1f6;
  color: var(--muted);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 0.72rem;
  white-space: nowrap;
}

/* 待办页搜索栏（REQ-059：关键词+筛选成员+已完成+标签，顶栏🔍开合） */
.todo-search {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2px;
}
.todo-search .grow { flex: 1 1 160px; min-width: 0; }

/* 待办页标签筛选行（搜索栏内，多选胶囊，REQ-048/059） */
.tag-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0 0;
  width: 100%;
}
.tag-filter .tf-label { color: var(--muted); font-size: 0.85rem; flex: none; }
.tag-filter .tag-chip { padding: 2px 10px; font-size: 0.78rem; }
.tag-filter .tf-clear { border: none; background: none; color: var(--muted); font-size: 0.78rem; padding: 2px 6px; }
.tag-filter .tf-clear:hover { color: var(--danger); }

/* 设置页：标签管理 */
.tag-add-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px 2px; }
.tag-add-row label { display: flex; align-items: center; gap: 8px; flex: 1 1 200px; font-size: 0.9rem; }
.tag-add-row input { flex: 1; min-width: 0; }
.tag-empty { color: var(--muted); font-size: 0.85rem; padding: 6px 0; list-style: none; }
.tag-edit-input { max-width: 180px; }

/* ========== REQ-049：完成记录（事项对话框内，大页面不展示） ========== */
.done-logs { margin: 8px 0 2px; }
.done-logs .dl-head { font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.done-logs ul { list-style: none; margin: 0; padding: 0; max-height: 132px; overflow-y: auto; }
.done-logs li {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 2px 0;
  border-bottom: 1px dashed var(--line);
}
.done-logs li:last-child { border-bottom: none; }

/* ========== REQ-059：新增待办弹窗 ========== */
#todoDialog { width: min(480px, 94vw); }
#todoDialog .addbar { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
#todoDialog .sched-panel { border-top: 1px dashed var(--line); padding-top: 8px; }

/* ========== REQ-060：待办字体大小设置 ========== */
.font-size-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.font-size-opts button {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}
.font-size-opts button.on { border-color: var(--primary); background: #eaf3fc; color: var(--primary); }

/* ========== REQ-061：弹窗标题行关闭叉 + 备注多行 ========== */
.dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dlg-head h2 { margin: 0; }
.dlg-x {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  padding: 2px 6px;
}
.dlg-x:hover { color: var(--danger); }
#evNote { resize: none; min-height: 3em; max-height: 5.2em; overflow-y: auto; }

/* ========== REQ-064：窄屏悬浮新增按钮（中间偏下，方便手机拇指点击） ========== */
.fab-add {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(55, 136, 216, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}
.fab-add:active { transform: translateX(-50%) scale(0.94); }
@media (max-width: 640px) {
  #page-calendar,
  #page-todos { padding-bottom: 84px; } /* 列表末条不被悬浮按钮遮挡 */
}

/* ========== REQ-065：窄屏日历工具栏两行排布（日期换行，箭头/今天/日周月不动） ========== */
@media (max-width: 700px) {
  .fc-toolbar { flex-wrap: wrap; row-gap: 4px; }
  .fc-toolbar-chunk:nth-child(2) { /* 日期标题整行放到第二行并居中 */
    order: 3;
    flex: 0 0 100%;
    justify-content: center;
    text-align: center; /* 块元素居中须用 text-align（REQ-067） */
  }
}

/* ========== REQ-067：日历表头四行（日期/周几/英文周几/日文周几） ========== */
.day-head { line-height: 1.25; padding: 2px 0; }
.day-head .dh-date { font-size: 1em; }
.day-head .dh-zh { font-size: 0.85em; }
.day-head .dh-en, .day-head .dh-ja { font-size: 0.72em; color: var(--muted); }

/* ========== REQ-094/095：日历底色方案（月/周/三日视图均生效） ==========
   周末列 #eef2f8；其余日格纯白，压掉透出的页面灰底（--bg #f4f6fa，REQ-094 时"周末与底色区别不大"的根因）；
   表头行整行与周末列同色；今天=绿 30%（REQ-095 追加 v20261103.4：初版为主题蓝 30%，用户尝试改绿，低饱和度观感与蓝版一致）。
   今天格须由 JS 排除 fct 类：.fct-*（两级类）优先级高于 FullCalendar 的 .fc-day-today（一级类）规则，
   不排除会把今日色盖掉。 */
.fc { --fc-today-bg-color: rgba(76,175,80,0.3); } /* REQ-095：今天=低饱和绿（默认淡黄 rgba(255,220,40,.15) 已废） */
.fc .fct-cell { background-color: #fff; } /* REQ-095：非周末日格纯白 */
.fc .fct-weekend { background-color: #eef2f8; } /* REQ-094：周末列浅灰蓝 */
.fc .fc-col-header-cell { background-color: #eef2f8; } /* REQ-095：表头行=周末列同色 */

/* ========== REQ-078：任务页（儿童周期任务积分系统） ========== */
/* 日历叠加开关（默认关；REQ-091 沉底：边距改上） */
.cal-mission-toggle {
  flex-direction: row; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--muted); margin: 8px 0 0;
}
.cal-mission-toggle input { width: auto; }

/* ========== REQ-091：日历下方切换行（翻页/今天 + 三日/日/周/月，自 FullCalendar 顶栏移至日历下方） ========== */
.cal-view-switch {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 8px; margin: 10px 0 0; /* 窄屏一行放不下自动折两行（导航一组/视图一组），仍居中 */
}
.vs-nav, .vs-views { display: flex; align-items: center; gap: 8px; }
.cal-view-switch button {
  min-width: 64px; min-height: 44px; /* 触屏热区 ≥44px（REQ-085 M2） */
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
}
.vs-nav button { min-width: 44px; padding: 6px 10px; }
.vs-nav button svg { display: block; }
.cal-view-switch button.on { border-color: var(--primary); background: #eaf3fc; color: var(--primary); font-weight: 600; }
.cal-view-switch button:disabled { opacity: 0.45; cursor: default; }
.cal-view-switch button:disabled:hover { filter: none; }

/* 积分卡片：本人高亮置前，其余按成员顺序，不排名 */
.ms-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.ms-card {
  flex: 1 1 130px; min-width: 118px; max-width: 230px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  background: var(--card);
}
.ms-card.mine { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.ms-card-name { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.ms-card-num { font-size: 1.45rem; font-weight: 700; margin-top: 4px; }
.ms-card-week { font-size: 0.76rem; color: #57b85f; }

/* 任务行：标题 + 周期/积分徽章 + 成员状态芯片 */
/* REQ-080：扁平按钮流（每「任务×成员」一枚按钮） */
.ms-flat { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; }
.ms-title { font-size: 1rem; font-weight: 600; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ms-badges { display: inline-flex; gap: 6px; align-items: center; flex: none; flex-wrap: wrap; }
.ms-period, .ms-pts, .ms-appr, .ms-off {
  font-size: 0.72rem; border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.ms-period { color: var(--muted); background: #f1f3f7; }
.ms-pts { color: #8a6100; background: #fff4d6; }
.ms-appr { color: var(--primary); background: #eaf3fc; }
.ms-off { color: var(--muted); background: #f1f3f7; }
.ms-note { color: var(--muted); font-size: 0.8rem; margin-top: 2px; overflow-wrap: anywhere; }
.ms-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  font-size: 0.85rem; background: #fff; color: var(--text);
}
button.ms-chip { cursor: pointer; }
button.ms-chip.todo { border-style: dashed; border-color: var(--primary); color: var(--primary); background: #f7fbff; }
.ms-chip.ok { border-color: #cde8cf; background: #f2faf3; color: #2f7a35; }
.ms-chip.pending { border-color: #f2d9a4; background: #fdf6e4; color: #8a6100; }
.ms-chip.skip { border-color: var(--line); background: #f1f3f7; color: var(--muted); }
.ms-fire { font-size: 0.76rem; }
.ms-mini { border: none; background: none; color: var(--muted); padding: 2px 6px; font-size: 0.85rem; }
.ms-mini:hover { color: var(--danger); }
/* REQ-079：已批准打卡胶囊可点击撤销，悬停给"危险操作"预示 */
button.ms-chip-done { cursor: pointer; }
button.ms-chip-done:hover { border-color: #e0b4b4; background: #fdf3f3; }
/* REQ-083：跳过待确认胶囊 + 任务操作弹窗 */
.ms-chip.req { border-color: #b9c6f2; background: #eef2fd; color: #3b5bcc; }
.ms-act-status { font-weight: 600; margin: 2px 0; }
.ms-act-info { color: var(--muted); font-size: 0.85rem; margin: 0 0 12px; overflow-wrap: anywhere; }
.ms-act-wait { color: var(--muted); font-size: 0.85rem; margin: 0 0 8px; }
.ms-act-btns { display: flex; flex-direction: column; gap: 8px; }
.ms-act-btns button { width: 100%; }

/* 积分流水 */
.ms-ledger { list-style: none; margin: 0; padding: 0; }
.ms-ledger li {
  display: flex; align-items: center; gap: 8px; padding: 7px 2px;
  border-bottom: 1px solid var(--line); font-size: 0.85rem;
}
.ms-ledger li:last-child { border-bottom: none; }
.ms-l-time { color: var(--muted); font-size: 0.76rem; flex: none; }
.ms-l-name { flex: none; }
.ms-l-delta { color: #57b85f; font-weight: 600; flex: none; }
.ms-l-reason { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 审批队列（管理员） */
.ms-appr-head { font-size: 0.8rem; color: var(--muted); margin: 4px 0 2px; }
.ms-appr-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px dashed var(--line); flex-wrap: wrap; font-size: 0.88rem;
}
.ms-appr-row .rowbtns { display: flex; gap: 6px; margin-left: auto; }

/* 任务管理列表（管理员） */
.ms-admin { list-style: none; margin: 6px 0 0; padding: 0; }
.ms-admin li {
  display: flex; align-items: center; gap: 8px; padding: 8px 2px;
  border-bottom: 1px solid var(--line); font-size: 0.9rem; flex-wrap: wrap;
}
.ms-admin li:last-child { border-bottom: none; }
.ms-admin .ms-title { font-size: 0.92rem; font-weight: 500; flex: 1 1 120px; }
.ms-admin .rowbtns { display: flex; gap: 6px; margin-left: auto; }
.ms-admin .rowbtns button { font-size: 0.8rem; padding: 3px 10px; }

/* ========== REQ-085 M1：≤640 窄屏日历降级（首开日视图见 app.js initialView） ========== */
@media (max-width: 640px) {
  /* REQ-067/068 三语表头的窄屏降级：隐藏英文/日文行，留"日期+周几"，7 列不再叠字；桌面/平板三语不变 */
  .day-head .dh-en, .day-head .dh-ja { display: none; }
  /* 周视图事件条：列宽 ~50px 时时间必截断，隐藏之；标题单行省略，消除"裁半" */
  .fc-timeGridWeek-view .fc-event-time { display: none; }
  .fc-timeGridWeek-view .fc-event-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ========== REQ-085 M2：触屏（pointer: coarse）最小触控热区 44×44，桌面鼠标端不膨胀 ========== */
@media (pointer: coarse) {
  .fc .fc-button { min-height: 44px; padding: 8px 12px; } /* 日/周/月、今天、前后翻页 */
  .ms-admin .rowbtns button, .ms-appr-row .rowbtns button, .trash-list .rowbtns button,
  .admin-list .ops button, .sd1-list .ops button, .sd2-list .ops button, .sd3-list .ops button {
    padding: 10px 14px; min-height: 44px; /* 任务/审批/回收站/成员与标签行内按钮 */
  }
  #todoGroups .x { padding: 10px 12px; min-width: 44px; min-height: 44px; } /* 待办行 ✕：纯热区扩大（无边框背景） */
  #todoGroups input[type="checkbox"] { width: 22px; height: 22px; }
}

/* ========== REQ-085 L3：设置页"新标签名"行改横排左对齐 ========== */
/* 全局 label 为纵排（文字在上），叠加 .tag-add-row label 的 align-items:center 使文字居中悬浮——回归横排行内模式 */
.tag-add-row label { flex-direction: row; align-items: center; margin-bottom: 0; }

/* ========== REQ-085 L5：手机端顶栏导航禁折行 + 宽度预算收紧 ========== */
/* 日历/待办/任务页顶栏有 ＋/🔍 按钮（REQ-059）挤窄导航，两字链接被折成竖排（REQ-085 L5 核实为意外形态） */
#mainNav a { white-space: nowrap; }
@media (max-width: 640px) {
  #mainNav a { padding: 6px 10px; font-size: 0.88rem; } /* 禁折行后需腾出预算，防横向溢出 */
  #moreBtn { padding: 6px 8px; }
}
@media (max-width: 430px) {
  .user-pill { max-width: 22vw; } /* REQ-080 定的 26vw 在禁折行后预算不足，再让一步（名字省略号截断，REQ-065 机制） */
}

/* ========== REQ-088 打卡页特效（庆祝分层：日常轻、里程碑重） ========== */
/* 装饰性动画全部收在 no-preference 媒体查询内：reduced-motion 用户零动画；
   JS 侧（fx.js）同步跳过音效/confetti/飘字/滚动。特效层均 pointer-events:none。 */

@media (prefers-reduced-motion: no-preference) {

  /* -- 待审批胶囊呼吸微光（区别于得分，提示"等待中"） -- */
  @keyframes fx-breathe {
    0%, 100% { box-shadow: 0 0 0 0 rgba(242, 217, 164, 0); }
    50% { box-shadow: 0 0 0 6px rgba(242, 217, 164, 0.55); }
  }
  button.ms-chip.pending { animation: fx-breathe 2.4s ease-in-out infinite; }

  /* -- 打卡成功瞬间：胶囊弹跳 + 变绿（渲染刷新前的过渡态） -- */
  @keyframes fx-pop {
    0% { transform: scale(1); }
    35% { transform: scale(1.25); }
    65% { transform: scale(0.95); }
    100% { transform: scale(1); }
  }
  .ms-chip.fx-done-pop {
    animation: fx-pop 0.5s ease;
    border-color: #cde8cf; background: #f2faf3; color: #2f7a35;
  }

  /* -- 积分卡数字滚动时弹一下 -- */
  .ms-card.fx-pulse { animation: fx-pop 0.55s ease; }
  /* -- 离线补偿：卡片金色微光闪一次 -- */
  @keyframes fx-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 184, 61, 0); }
    40% { box-shadow: 0 0 0 5px rgba(245, 184, 61, 0.45); }
  }
  .ms-card.fx-glow { animation: fx-glow 1.3s ease; }

  /* -- 积分入场 stagger：进页面依次浮现（一次性） -- */
  @keyframes fx-card-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
  .ms-cards.fx-enter .ms-card { animation: fx-card-in 0.45s both; }
  .ms-cards.fx-enter .ms-card:nth-child(1) { animation-delay: 0.02s; }
  .ms-cards.fx-enter .ms-card:nth-child(2) { animation-delay: 0.09s; }
  .ms-cards.fx-enter .ms-card:nth-child(3) { animation-delay: 0.16s; }
  .ms-cards.fx-enter .ms-card:nth-child(4) { animation-delay: 0.23s; }
  .ms-cards.fx-enter .ms-card:nth-child(5) { animation-delay: 0.30s; }
  .ms-cards.fx-enter .ms-card:nth-child(6) { animation-delay: 0.37s; }
  .ms-cards.fx-enter .ms-card:nth-child(7) { animation-delay: 0.44s; }
  .ms-cards.fx-enter .ms-card:nth-child(8) { animation-delay: 0.51s; }

  /* -- +N 分飘字（fx.js 从胶囊位置飞向积分卡） -- */
  .fx-fly {
    position: fixed; z-index: 2000; pointer-events: none;
    font-size: 2.2rem; font-weight: 800; color: #f5a623;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.18), 0 0 16px rgba(255, 217, 122, 0.85);
    transform: translate(-50%, -50%);
  }

  /* -- 里程碑 / 全清横幅 -- */
  @keyframes fx-banner-in {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    55% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }
  @keyframes fx-banner-out {
    to { opacity: 0; transform: translate(-50%, -58%) scale(0.96); }
  }
  .fx-banner {
    position: fixed; z-index: 2001; pointer-events: none;
    left: 50%; top: 38%;
    background: rgba(44, 51, 69, 0.88); color: #fff;
    border-radius: 20px; padding: 18px 36px;
    text-align: center; white-space: nowrap;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    animation: fx-banner-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both,
               fx-banner-out 0.4s ease 2s forwards;
  }
  .fx-banner-line { font-size: 2.2rem; font-weight: 800; }
  .fx-banner-sub { font-size: 1.4rem; font-weight: 600; opacity: 0.92; margin-top: 6px; }
  .fx-banner-main .fx-num, .fx-banner-sub .fx-num { display: inline-block; color: #ffd97a; }
  @keyframes fx-num-bounce {
    0% { transform: scale(0.3); }
    60% { transform: scale(1.45); }
    100% { transform: scale(1); }
  }
  .fx-num { animation: fx-num-bounce 0.6s cubic-bezier(0.2, 2, 0.4, 1) both; }
  /* 横幅里的火焰摇曳 */
  @keyframes fx-flame-wave {
    from { transform: scale(1) rotate(-5deg); }
    to { transform: scale(1.18) rotate(5deg); }
  }
  .fx-flame { display: inline-block; animation: fx-flame-wave 0.45s ease-in-out infinite alternate; }

  /* -- 离线补偿：+X 从卡片浮起飘散 -- */
  .ms-card { position: relative; } /* fx-card-plus 定位锚点 */
  @keyframes fx-plus-float {
    0% { opacity: 0; transform: translateY(6px) scale(0.7); }
    25% { opacity: 1; transform: translateY(0) scale(1.1); }
    100% { opacity: 0; transform: translateY(-30px) scale(1); }
  }
  .fx-card-plus {
    position: absolute; top: -8px; right: 10px; pointer-events: none;
    font-size: 1.8rem; font-weight: 800; color: #f5a623;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    animation: fx-plus-float 1.3s ease-out both;
  }

  /* -- 手机档（≤640px）：激进档在窄屏回落，防 nowrap 横幅撑破 360px 屏 -- */
  @media (max-width: 640px) {
    .fx-fly { font-size: 1.6rem; }
    /* REQ-090：大字模式下 vw 被 zoom 二次放大，预除 1.5 使视觉宽不超屏 */
    .fx-banner { padding: 12px 20px; max-width: 92vw; }
    body.ipad-large .fx-banner { max-width: calc(92vw / 1.5); }
    .fx-banner-line { font-size: 1.6rem; }
    .fx-banner-sub { font-size: 1.15rem; }
    .fx-card-plus { font-size: 1.5rem; }
  }

  /* -- 静音按钮触控热区（REQ-085 M2 ≥44px 惯例） -- */
  #fxMuteBtn { min-width: 44px; min-height: 36px; padding: 5px 10px; font-size: 1rem; }

} /* end prefers-reduced-motion: no-preference */
