/* =========================================================
 * style.css — 基本样式与版面
 * 颜色、玻璃效果的变数在 theme.css
 * ========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: .3px;
  color: var(--ink);
  background: var(--bgbase);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent-dark); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, b, strong, .btn, .tag, .chip, .nav a, .eyebrow { font-weight: 500; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
p { margin: .4em 0; }
[hidden] { display: none !important; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sp { flex: 1; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 10px; }

/* ---------- 背景 ---------- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60vmax 50vmax at 0% 0%, var(--bg1), transparent 60%),
    radial-gradient(60vmax 50vmax at 100% 0%, var(--bg2), transparent 60%),
    radial-gradient(60vmax 50vmax at 100% 100%, var(--bg3), transparent 60%),
    radial-gradient(60vmax 50vmax at 0% 100%, var(--bg4), transparent 60%),
    var(--bgbase);
}
.bg-tile {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("assets/bg-tile.png") repeat; background-size: 220px; opacity: .5;
}

/* ---------- 版面 ---------- */
.app { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 18px 14px 90px; display: flex; flex-direction: column; gap: 14px;
  background: var(--glass); border-right: 1px solid var(--glass-edge);
  backdrop-filter: blur(22px) saturate(1.35); -webkit-backdrop-filter: blur(22px) saturate(1.35);
}
.main { padding: 16px 28px 120px; min-width: 0; max-width: 1080px; width: 100%; }
.mobile-only { display: none !important; }

.team-only {}
.plan-only { display: none !important; }
body.space-me .team-only { display: none !important; }
body.space-me .plan-only { display: block !important; }
body.space-me .nav.plan-only { display: flex !important; }
body.space-me .plan-pills { display: none !important; }

/* 团队／个人切换 */
.space-switch {
  display: flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: var(--glass-hi); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-sm);
}
.space-switch a {
  flex: 1; text-align: center; padding: 8px 6px; border-radius: 999px;
  color: var(--muted); font-weight: 700; font-size: 13px; white-space: nowrap;
}
body:not(.space-me) .space-switch .sw-team,
body.space-me .space-switch .sw-me { background: var(--btn-grad); color: #fff; box-shadow: 0 6px 16px -8px var(--accent); }

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px; }
.brand b { display: block; font-size: 20px; letter-spacing: 1px; color: var(--accent-dark); }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.brand-logo { width: 56px; height: 56px; flex: none; border-radius: 50%; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-4deg); } }

.me-card {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r2);
  background: var(--glass-hi); border: 1px solid var(--glass-edge);
}
.me-card b { display: block; }
.me-card small { color: var(--muted); font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { padding: 10px 12px; border-radius: 14px; color: var(--ink); font-weight: 500; }
.nav a:hover { background: var(--glass-hi); }
.nav a.active { background: var(--glass-hi); color: var(--accent-dark); font-weight: 700; box-shadow: var(--shadow-sm); }
.nav a.nav-minor { font-size: 13px; color: var(--muted); padding: 7px 12px; }
.tip-card {
  display: block; padding: 14px; border-radius: var(--r2); color: var(--ink);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, white), color-mix(in srgb, var(--accent-2) 16%, white));
  border: 1px solid var(--glass-edge);
}
.tip-card b { display: block; margin-bottom: 2px; }
.tip-card span { font-size: 12px; color: var(--muted); }

/* ---------- 顶列 ---------- */
.topbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.top-date { font-weight: 700; margin-right: auto; }
.avatar-stack { display: flex; }
.avatar-stack .av { margin-left: -8px; border: 2px solid #fff; }
.avatar-stack .av:first-child { margin-left: 0; }
.who { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.who select { border: 1px solid var(--glass-edge); background: var(--glass-hi); border-radius: 999px; padding: 6px 10px; font-weight: 700; color: var(--ink); }
.sync-pill { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--glass-hi); border: 1px solid var(--glass-edge); white-space: nowrap; }
.sync-pill[data-kind="denied"], .sync-pill[data-kind="err"] { background: #ffe1e1; color: #b3261e; }

/* ---------- 头像 ---------- */
.av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none; object-fit: cover; background: #fff; box-shadow: 0 0 0 2px #fff, 0 4px 10px -4px rgba(120, 90, 160, .45); }
.me-av { position: relative; border: 0; background: none; padding: 0; border-radius: 50%; flex: none; }
.me-av i { position: absolute; right: -4px; bottom: -2px; font-style: normal; font-size: 11px; width: 20px; height: 20px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.av-pick { border: 0; background: none; padding: 0; border-radius: 50%; cursor: pointer; flex: none; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.av-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px solid transparent; background: rgba(255, 255, 255, .7); border-radius: 18px; padding: 8px 4px; font-size: 13px; transition: transform .15s; }
.av-opt:hover { transform: translateY(-2px) rotate(-2deg); }
.av-opt img { width: 60px; height: 60px; }
.av-opt[aria-pressed="true"] { border-color: var(--accent); background: #fff; }
.av.more { width: 28px; height: 28px; background: #d9d6ea; color: var(--ink); font-size: 11px; margin-left: -8px; border: 2px solid #fff; }

/* ---------- 卡片、按钮、标签 ---------- */
.card {
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: var(--r1);
  backdrop-filter: blur(22px) saturate(1.35); -webkit-backdrop-filter: blur(22px) saturate(1.35);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.card-h { font-size: 17px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
summary.card-h { cursor: pointer; list-style: none; margin-bottom: 0; }
details[open] > summary.card-h { margin-bottom: 10px; }
summary::-webkit-details-marker { display: none; }
.sub { font-size: 13px; color: var(--muted); font-weight: 700; margin: 12px 0 6px; }
h4.sub { font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; white-space: nowrap; transition: transform .12s, box-shadow .2s, opacity .2s;
  background: var(--glass-hi); color: var(--ink);
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--btn-grad); color: #fff; box-shadow: 0 10px 22px -12px var(--accent); }
.btn.primary:hover { box-shadow: 0 12px 26px -10px var(--accent); }
.btn.ghost { background: var(--glass-hi); border-color: var(--glass-edge); color: var(--ink); }
.btn.danger { background: #e5484d; color: #fff; }
.btn.danger.ghost { background: transparent; color: #d33; border-color: #f3c2c2; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.lg { min-height: 50px; padding: 0 26px; font-size: 16px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-ghost.sm { border: 1px solid var(--glass-edge); background: var(--glass-hi); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; }
.icon-btn { border: 0; background: transparent; font-size: 16px; padding: 6px; border-radius: 10px; line-height: 1; }
.icon-btn:hover { background: var(--glass-hi); }
.chip { border: 1px solid var(--glass-edge); background: var(--glass-hi); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500; }
.chip.on, .chip[aria-pressed="true"] { background: var(--btn-grad); color: #fff; border-color: transparent; }

.tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tag.soft { background: rgba(120, 110, 170, .1); color: var(--muted); }
.st-todo { background: #e4e9f3; color: #56627a; }
.st-doing { background: #fff1c2; color: #8a6400; }
.st-blocked { background: #ffdcdc; color: #c0262d; }
.st-review { background: #e5e0ff; color: #5a49c9; }
.st-done { background: #d6f4e2; color: #18794e; }
.due-over { background: #ffdcdc; color: #c0262d; }
.due-today { background: #ffe5cc; color: #b35400; }
.due-soon { background: #fff1c2; color: #8a6400; }
.due-later, .due-none { background: rgba(120, 110, 170, .1); color: var(--muted); }
.cnt { font-size: 12px; background: rgba(120, 110, 170, .12); color: var(--muted); border-radius: 999px; padding: 1px 8px; font-weight: 700; }
.cnt.warn { background: #ffdcdc; color: #c0262d; }
.cnt.ok { background: #d6f4e2; color: #18794e; }

/* ---------- 表单 ---------- */
.inp {
  width: 100%; border: 1px solid rgba(120, 110, 170, .22); background: rgba(255, 255, 255, .8);
  border-radius: var(--r3); padding: 10px 12px; min-height: 42px; outline: none;
}
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea.inp { resize: vertical; min-height: 64px; }
.inp.w-auto { width: auto; }
.form { display: flex; flex-direction: column; gap: 12px; }
.fld { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.fld > span { font-size: 13px; font-weight: 700; color: var(--muted); }
.fld.sm { flex: 0 0 72px; }
.fld.sm2 { flex: 0 0 150px; }
.fld-row { display: flex; gap: 10px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--accent); }
.chk.big { font-weight: 700; }
.chk-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.quick-dates { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -4px; }
details.more { border-top: 1px dashed rgba(120, 110, 170, .3); padding-top: 10px; }
details.more summary { cursor: pointer; color: var(--muted); font-weight: 700; font-size: 13px; }
details.more[open] { display: flex; flex-direction: column; gap: 12px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { flex: 1; min-width: 96px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 10px 6px; border-radius: 14px; border: 1px solid rgba(120, 110, 170, .2); background: rgba(255, 255, 255, .7); font-weight: 700; cursor: pointer; }
.seg input:checked + span { background: var(--btn-grad); color: #fff; border-color: transparent; }
.seg input:focus-visible + span { outline: 3px solid var(--accent); }
.help-only { display: none; }
.is-help .help-only { display: flex; }
.form-foot { display: flex; justify-content: flex-end; }
.row-wrap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.add-row { display: flex; gap: 8px; margin-top: 10px; }
.file-btn { cursor: pointer; }
.shake { animation: shake .35s; border-color: #e5484d !important; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---------- 页首 ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 27px; }
.ph-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.sec { margin-bottom: 18px; }
.sec-h { font-size: 16px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
details.fold summary { cursor: pointer; list-style: none; }
.empty { text-align: center; padding: 32px 20px; }
.empty h2, .empty h3 { margin-bottom: 6px; }

/* ---------- 首页 ---------- */
.hero { position: relative; padding: 24px; overflow: hidden; }
.eyebrow { font-size: 13px; font-weight: 700; color: var(--accent-dark); letter-spacing: 1px; }
.hero-title { font-size: 30px; margin: 6px 0 8px; padding-right: 70px; word-break: break-word; }
.hero-crit { font-size: 15px; margin: 10px 0 0; }
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hero-face { position: absolute; right: 18px; top: 16px; width: 64px; height: 64px; opacity: .95; }
.review-link { display: block; margin-top: 14px; padding: 10px 14px; border-radius: 14px; background: #ece8ff; color: #5a49c9; font-weight: 700; }
.next-list { margin-top: 16px; border-top: 1px solid rgba(120, 110, 170, .15); padding-top: 4px; }
.next-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 10px 2px; text-align: left; border-bottom: 1px solid rgba(120, 110, 170, .1); }
.next-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-link { display: inline-block; margin-top: 10px; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--glass-hi); border-radius: var(--r2); padding: 12px; text-align: center; }
.stat b { display: block; font-size: 30px; font-family: "Fredoka", var(--font); font-weight: 600; color: #8a6400; }
.stat.warn b { color: #c0262d; }
.stat.ok b { color: #18794e; }
.stat span { font-size: 12px; color: var(--muted); }
.team-rows { display: flex; flex-direction: column; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; color: var(--ink); border-bottom: 1px solid rgba(120, 110, 170, .1); }
.team-row:last-child { border-bottom: 0; }
.tr-main { flex: 1; min-width: 0; }
.tr-main b { display: block; font-size: 14px; }
.tr-main span { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-n { font-weight: 900; color: var(--accent-dark); }
.game-entry { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.game-entry b { display: block; }
.game-entry .muted { font-size: 13px; }
.game-entry .go { margin-left: auto; font-size: 20px; color: var(--accent-dark); }
.ge-icon { width: 48px; height: 48px; flex: none; }
.sample-note { font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 4px 6px 20px; }

/* ---------- 任务卡 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.task-card {
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: var(--r2);
  padding: 14px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.task-card.is-urgent { border-color: #ffb3b3; box-shadow: 0 10px 26px -16px #ff4d4d; }
.task-card.is-done { opacity: .75; }
.task-card.review { border-color: #cfc6ff; }
.tc-top { display: flex; align-items: center; gap: 8px; }
.tc-title { border: 0; background: none; padding: 0; text-align: left; font-weight: 700; font-size: 16px; color: var(--ink); word-break: break-word; }
.tc-title:hover { color: var(--accent-dark); }
.tc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-line { font-size: 13px; color: var(--muted); margin: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tc-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.tc-btns .btn.primary { flex: 1; }
.done-banner, .inapp {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: var(--r2); margin-bottom: 14px;
  background: #d6f4e2; color: #18794e; font-weight: 700; animation: drop .3s;
}
.inapp { background: #fff1c2; color: #6b4e00; display: block; }
@keyframes drop { from { transform: translateY(-10px); opacity: 0; } }
.peek-bar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.peek-bar select { flex: 1; min-width: 140px; }

/* ---------- 分工 ---------- */
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.role-card { cursor: pointer; margin: 0; display: flex; flex-direction: column; gap: 8px; transition: transform .15s; }
.role-card:hover { transform: translateY(-2px); }
.rc-head { display: flex; align-items: center; gap: 8px; }
.rc-head h3 { font-size: 17px; flex: 1; }
.rc-no { width: 24px; height: 24px; border-radius: 50%; background: var(--btn-grad); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; }
.rc-icon { font-size: 20px; }
.rc-people { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.rc-duties { margin: 0; padding-left: 20px; font-size: 14px; }
.rc-foot { font-size: 13px; margin-top: auto; }
.kv { display: flex; gap: 10px; font-size: 14px; padding: 4px 0; }
.kv b { flex: 0 0 84px; color: var(--muted); font-weight: 700; font-size: 13px; }
.kv span { min-width: 0; word-break: break-word; }
.kvs { margin: 10px 0; }
.tips { margin: 0 0 6px; padding-left: 20px; }
.tips li { margin: 3px 0; }
.load-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; }
.lr-name { flex: 0 0 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-bar { flex: 1; height: 8px; background: rgba(120, 110, 170, .12); border-radius: 99px; overflow: hidden; }
.lr-bar i { display: block; height: 100%; background: var(--btn-grad); border-radius: 99px; }
.lr-bar i.over { background: #e5484d; }
.lr-n { font-weight: 700; width: 20px; text-align: right; }
.mem-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(120, 110, 170, .12); }
.mem-fields { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.mem-fields .inp { flex: 1 1 140px; min-width: 0; }
.mem-row input[type=color] { width: 36px; height: 36px; border: 0; background: none; padding: 0; }
.av-pick { cursor: pointer; }

/* ---------- 回报／AI ---------- */
.steps { display: flex; flex-direction: column; gap: 18px; }
.step { display: flex; gap: 14px; }
.step > b { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--btn-grad); color: #fff; display: grid; place-items: center; }
.step > div { flex: 1; min-width: 0; }
.step h3 { font-size: 16px; margin-bottom: 4px; }
.pv { padding: 10px 0; border-bottom: 1px solid rgba(120, 110, 170, .12); }
.pv ul { margin: 4px 0 0; padding-left: 20px; font-size: 14px; color: var(--muted); }
.warn-card { background: #fff1f1; color: #b3261e; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(120, 110, 170, .1); }
.hist-mini { margin: 0; padding-left: 18px; font-size: 13px; }

/* ---------- 会议 ---------- */
.next-meet { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.next-meet .fld { flex: 0 1 220px; }
.agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.agenda li { display: flex; gap: 10px; align-items: flex-start; }
.ag-no { flex: none; width: 30px; height: 30px; margin-top: 6px; border-radius: 50%; background: var(--btn-grad); color: #fff; font-weight: 900; display: grid; place-items: center; }
.ag-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ag-main details { display: flex; flex-direction: column; gap: 6px; }
.ag-main details[open] { display: flex; }
.ag-main details > * + * { margin-top: 6px; }
.ag-main summary { cursor: pointer; }
.ag-btns { display: flex; flex-direction: column; }
.meet-items { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.meet-items li { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.decision { font-size: 14px; color: #18794e; font-weight: 700; }

/* ---------- 弹窗 ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px;
  background: rgba(40, 32, 70, .32); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fadeIn .18s;
}
.modal {
  width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: rgba(255, 255, 255, .94); border-radius: var(--r1); box-shadow: 0 30px 70px -20px rgba(40, 30, 90, .5);
  animation: popIn .22s cubic-bezier(.2, .9, .3, 1.2); color: #2b2540;
}
.modal.wide { width: min(760px, 100%); }
.modal header { display: flex; align-items: center; gap: 10px; padding: 18px 20px 8px; }
.modal header h3 { flex: 1; font-size: 18px; word-break: break-word; }
.modal .x { border: 0; background: rgba(120, 110, 170, .1); width: 34px; height: 34px; border-radius: 50%; flex: none; }
.modal-body { padding: 8px 20px 16px; overflow-y: auto; }
.modal footer { display: flex; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid rgba(120, 110, 170, .12); flex-wrap: wrap; }
.confirm-msg { font-size: 16px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { transform: scale(.94) translateY(10px); opacity: 0; } }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 28px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 999px; background: rgba(43, 37, 64, .92); color: #fff; font-size: 14px; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .4); animation: drop .25s; transition: opacity .35s, transform .35s; }
.toast button { border: 0; background: rgba(255, 255, 255, .18); color: #fff; border-radius: 999px; padding: 4px 10px; font-weight: 700; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- 上一步／专注浮钟 ---------- */
.undo-btn {
  position: fixed; left: 16px; bottom: 20px; z-index: 800; border: 1px solid var(--glass-edge);
  background: var(--glass-hi); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 999px; padding: 9px 14px; font-weight: 700; font-size: 13px; box-shadow: var(--shadow-sm); color: var(--ink);
}
.undo-btn:disabled { opacity: .4; cursor: default; }
.focus-float {
  position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 850;
  padding: 8px 16px; border-radius: 999px; background: rgba(43, 37, 64, .9); color: #fff; font-weight: 700;
  font-variant-numeric: tabular-nums; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .4); display: flex; gap: 8px; align-items: center;
}
.focus-float .ff-btn { border: 0; background: rgba(255, 255, 255, .2); color: #fff; border-radius: 999px; width: 26px; height: 26px; }

/* ---------- 手机底部导览 ---------- */
.bottom-nav { display: none; }

/* =========================================================
 * 手机
 * ========================================================= */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 12px 15px 130px; }
  .mobile-only { display: flex !important; }
  .plan-only.mobile-only { display: none !important; }
  body.space-me .plan-pills.plan-only { display: flex !important; }
  .space-switch.mobile-only { margin-bottom: 12px; }
  .topbar { gap: 8px; margin-bottom: 10px; }
  .top-date { font-size: 14px; }
  .avatar-stack { display: none; }
  .who span { display: none; }
  .bg-tile { opacity: .42; }
  .bottom-nav {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 700;
    background: var(--glass-hi); border: 1px solid var(--glass-edge); border-radius: 26px;
    backdrop-filter: blur(22px) saturate(1.35); -webkit-backdrop-filter: blur(22px) saturate(1.35);
    box-shadow: 0 18px 40px -18px rgba(70, 56, 150, .45); padding: 6px 4px;
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; color: var(--muted); padding: 4px 0; font-weight: 700; }
  .bottom-nav a i { font-style: normal; font-size: 20px; line-height: 1.2; }
  .bottom-nav a.active { color: var(--accent-dark); }
  .bottom-nav a.bn-main i { width: 52px; height: 52px; margin-top: -26px; border-radius: 50%; background: var(--btn-grad); display: grid; place-items: center; color: #fff; box-shadow: 0 10px 22px -8px var(--accent); border: 4px solid #fff; font-size: 22px; }
  .undo-btn { bottom: calc(96px + env(safe-area-inset-bottom)); left: 12px; padding: 7px 12px; }
  body.space-me .undo-btn { bottom: calc(20px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .focus-float { top: auto; bottom: calc(96px + env(safe-area-inset-bottom)); }
  body.space-me .focus-float { bottom: calc(20px + env(safe-area-inset-bottom)); }
  .card { padding: 16px; border-radius: var(--r2); }
  .hero { padding: 20px 18px; }
  .hero-title { font-size: 22px; padding-right: 54px; }
  .hero-face { width: 48px; height: 48px; right: 14px; }
  .hero-btns .btn.primary { flex: 1; }
  .page-head h2 { font-size: 21px; }
  .cards, .role-grid { grid-template-columns: minmax(0, 1fr); }
  .fld-row { flex-wrap: wrap; }
  .fld.sm2 { flex: 1 1 140px; }
  .modal-wrap { align-items: end; padding: 0; }
  .modal { width: 100%; border-radius: 26px 26px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  .modal.wide { width: 100%; }
}
@media (max-width: 380px) {
  .space-switch a { font-size: 12px; padding: 8px 2px; }
  .sync-pill { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
