:root {
  --primary: #2f6fed;
  --primary-dark: #2559c9;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --border: #e5e6eb;
  --border-strong: #c9cdd4;
  --bg: #f7f8fa;
  --card: #fff;
  --danger: #e34d59;
  --ok: #00a870;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* 标题栏 */
.titlebar {
  height: 44px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px 0 84px; /* 让开 macOS 红绿灯 */
  background: var(--card);
  border-bottom: 1px solid var(--border);
  -webkit-app-region: drag;
  user-select: none;
}
.tb-left { display: flex; align-items: center; gap: 10px; }
.brand { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.brand img { display: block; border-radius: 5px; }
.brand span { color: var(--primary); }
.ver { font-size: 11px; color: var(--text-3); }
.tb-right { display: flex; gap: 6px; align-items: center; -webkit-app-region: no-drag; }
.tb-btn {
  padding: 5px 12px; font-size: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 5px; cursor: pointer; color: var(--text-2);
}
.tb-btn:hover { border-color: var(--primary); color: var(--primary); }
.conn { width: 8px; height: 8px; border-radius: 50%; background: #c9cdd4; margin-right: 4px; }
.conn.on { background: var(--ok); }
.conn.off { background: var(--danger); }

.view { height: calc(100% - 44px); }
.view[hidden], [hidden] { display: none !important; }

/* 登录页：整屏只有登录卡，不显示标题栏/设置/搜索/退出 */
body.login-mode .titlebar { display: none; }
body.login-mode .view { height: 100%; }
/* 标题栏没了，窗口还得能拖：登录页背景可拖，卡片本身不拖 */
body.login-mode #viewLogin { -webkit-app-region: drag; }
body.login-mode .login-card { -webkit-app-region: no-drag; }
/* 登录页也不要专注计时钮/悬浮条（登录态残留时也会藏）*/
body.login-mode .focus-fab, body.login-mode .focus-bar { display: none !important; }
#viewMain[hidden] { display: none !important; }

/* 登录 */
#viewLogin { display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 360px; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 32px 28px;
}
.login-card h1 { text-align: center; font-size: 26px; font-weight: 600; letter-spacing: .5px; }
.login-card h1 span { color: var(--primary); }
.login-card .sub { text-align: center; color: var(--text-3); font-size: 13px; margin: 6px 0 22px; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  flex: 1; text-align: center; padding: 10px 0; cursor: pointer;
  font-size: 14px; color: var(--text-3); border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.code-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.code-row input { flex: 1; }
.code-row .code-send { flex: none; white-space: nowrap; }
.code-row.hide { display: none !important; }
.login-links { text-align: right; margin-top: 10px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; outline: none; font-family: inherit;
  color: var(--text); background: var(--card);
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
.login-card input { margin-bottom: 12px; }
button.primary {
  width: 100%; padding: 11px; background: var(--primary); color: #fff;
  border: none; border-radius: 6px; font-size: 14px; cursor: pointer;
}
button.primary:hover { background: var(--primary-dark); }
button.primary:disabled { opacity: .5; cursor: not-allowed; }
button.primary.sm { width: auto; padding: 9px 22px; }
button.ghost {
  padding: 10px 14px; background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text-2); white-space: nowrap;
}
button.ghost:hover { border-color: var(--primary); color: var(--primary); }
.msg { font-size: 13px; min-height: 18px; margin-top: 10px; text-align: center; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }
.server-line {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px;
}
.server-line input { flex: 1; padding: 6px 8px; font-size: 12px; }
button.link {
  background: none; border: none; color: var(--primary); cursor: pointer; font-size: 12px;
  text-decoration: none;
}
.danger-link { color: var(--danger); padding: 0; margin-top: 4px; }

/* 主界面 */
#viewMain { display: flex; }
.sidebar {
  width: 190px; background: var(--card); border-right: 1px solid var(--border);
  padding: 16px 10px; display: flex; flex-direction: column;
}
.side-user { font-size: 13px; color: var(--text-2); padding: 6px 10px 14px; word-break: break-all; }
.side-nav { flex: 1; }
.side-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 10px; border-radius: 6px; font-size: 13px; color: var(--text-2);
  cursor: pointer; margin-bottom: 2px;
}
.side-item:hover { background: var(--bg); }
.side-item.active { background: #e8f1ff; color: var(--primary); font-weight: 500; }
.side-item b { font-weight: 400; color: var(--text-3); font-size: 12px; }
.side-item.active b { color: var(--primary); }
.side-stat { font-size: 12px; color: var(--text-3); padding: 10px; border-top: 1px solid var(--border); }
.side-refresh {
  margin-top: 8px; padding: 8px; background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; font-size: 12px; cursor: pointer; color: var(--text-2);
}
.side-refresh:hover { border-color: var(--primary); color: var(--primary); }

.content { flex: 1; padding: 18px 22px; overflow-y: auto; }
.composer { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 16px; }
.composer textarea { min-height: 74px; resize: vertical; border: 1px solid var(--border); line-height: 1.6; }
.composer-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.hint { font-size: 12px; color: var(--text-3); }

.task {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; margin-bottom: 10px;
}
.task:hover { border-color: #c9cdd4; }
.task.done .task-title { color: var(--text-3); text-decoration: line-through; }
.task-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.task-title { font-size: 15px; font-weight: 500; line-height: 1.5; flex: 1; word-break: break-word; }
.tag { padding: 2px 8px; border-radius: 4px; font-size: 12px; background: var(--bg); color: var(--text-2); white-space: nowrap; }
.tag-study { background:#e8f3ff; color:#1d6fd6; }
.tag-work { background:#f0eaff; color:#7048c4; }
.tag-life { background:#e6f7f0; color:#00915c; }
.tag-finance { background:#fff3e0; color:#c47b0a; }
.tag-social { background:#ffeef0; color:#d6455c; }
.task-meta { display: flex; gap: 10px; align-items: center; margin-top: 9px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.task-meta .urgent { color: var(--danger); font-weight: 500; }
.task-desc { margin-top: 8px; font-size: 13px; color: var(--text-2); line-height: 1.6; word-break: break-word; }
.task-actions { display: flex; gap: 14px; margin-top: 11px; }
.task-actions button { background: none; border: none; font-size: 13px; color: var(--text-2); cursor: pointer; padding: 0; }
.task-actions button:hover { color: var(--primary); }
.task-actions button.del:hover { color: var(--danger); }
.empty { text-align: center; color: var(--text-3); font-size: 14px; padding: 60px 20px; }

/* 遮罩 / 抽屉 */
.mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 90; }
.mask.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; width: 380px; max-width: 90vw; height: 100%;
  background: var(--card); box-shadow: -4px 0 18px rgba(0,0,0,.08);
  padding: 24px; overflow-y: auto; z-index: 100;
  transform: translateX(100%); transition: transform .2s ease;
}
.drawer.open { transform: translateX(0); }
.drawer h2 { font-size: 17px; margin-bottom: 8px; }
.drawer label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
.drawer .row { display: flex; gap: 8px; }
.drawer .row input { flex: 1; }
.drawer button.primary { margin-top: 20px; }
.dim { color: var(--text-3); font-size: 12px; }
.about { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.drawer-close { position: absolute; top: 18px; right: 18px; background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-3); }
.sec-title { font-size: 13px; font-weight: 600; color: var(--text); margin: 22px 0 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.sec-desc { font-size: 12px; color: var(--text-3); line-height: 1.6; margin-bottom: 4px; }
.key-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.hint-line { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }

/* 编辑弹窗 */
.modal {
  display: none; position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 420px; max-width: 90vw; max-height: 86vh; overflow-y: auto;
  background: var(--card); border-radius: 10px; padding: 24px; z-index: 110;
  box-shadow: 0 12px 40px rgba(0,0,0,.16);
}
.modal.open { display: block; }
.modal h2 { font-size: 17px; margin-bottom: 8px; }
.modal label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
.modal textarea { resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* 轻提示 */
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1f2329; color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.2); opacity: 0;
  transform: translateY(8px); transition: opacity .2s, transform .2s; max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ================= 自绘图标 ================= */
.ico { width: 15px; height: 15px; flex: 0 0 auto; vertical-align: -2px; }
.tb-btn { display: inline-flex; align-items: center; gap: 5px; }
.tb-btn.accent { color: var(--primary); border-color: #cfe0ff; background: #f5f9ff; }
.tb-btn.accent:hover { background: #e8f1ff; }
.side-item { gap: 8px; justify-content: flex-start; }
.side-item .ico { color: var(--text-3); }
.side-item.active .ico { color: var(--primary); }
.side-item b { margin-left: auto; }
.side-refresh { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
.nest-btn { display: inline-flex; }

/* 侧栏用户（头像 + 名字） */
.side-user { display: flex; align-items: center; gap: 9px; font-weight: 500; color: var(--text); }
.su-av {
  width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex: 0 0 28px;
  background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.su-av img { width: 100%; height: 100%; object-fit: cover; }
.su-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= 筛选栏 ================= */
.filterbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip {
  font-size: 12px; padding: 3px 10px; border-radius: 20px; cursor: pointer;
  background: var(--bg); color: var(--text-2); border: 1px solid transparent; transition: .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); color: #fff; }
.cat-filter { width: auto; padding: 6px 10px; font-size: 12px; }
.task-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.task-actions button { display: inline-flex; align-items: center; gap: 4px; }
.task-actions button .ico { width: 14px; height: 14px; }

/* ================= 日历 ================= */
.calendar { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-title { font-size: 15px; font-weight: 600; flex: 1; text-align: center; }
.cal-head .ghost.sm { padding: 3px 12px; font-size: 15px; line-height: 1; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-week span { text-align: center; font-size: 11.5px; color: var(--text-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  min-height: 84px; border: 1px solid var(--border); border-radius: 8px; padding: 6px;
  background: var(--card); overflow: hidden;
}
.cal-cell.out { border: none; background: transparent; }
.cal-cell.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-cell.has { background: #fcfdff; }
.cal-day { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.cal-cell.today .cal-day { color: var(--primary); font-weight: 600; }
.cal-ev {
  font-size: 11px; padding: 2px 6px; border-radius: 5px; margin-bottom: 3px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-ev:hover { filter: brightness(.94); }
.cal-ev.u-calm { background: #eef3fe; color: #2f6fed; }
.cal-ev.u-near { background: #fdf3e2; color: #b9770f; }
.cal-ev.u-hot  { background: #feecee; color: #c93a45; }
.cal-ev.u-lost { background: #f1f2f5; color: #737a85; }
.cal-ev.u-home { background: #e9f7f1; color: #00805a; text-decoration: line-through; }
.cal-more { font-size: 10.5px; color: var(--text-3); padding-left: 6px; }

/* ================= AI 整理 ================= */
.tidy-modal { width: 560px; }
.tidy-list { max-height: 52vh; overflow-y: auto; margin-top: 6px; }
.tidy-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.tidy-task { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.tidy-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-top: 5px; flex-wrap: wrap; }
.tidy-row .k { color: var(--text-3); width: 44px; flex: 0 0 44px; }
.tidy-old { color: var(--text-3); text-decoration: line-through; }
.tidy-new { color: var(--ok); font-weight: 500; }
.tidy-row .→ { color: var(--text-3); }
.tidy-sum { flex: 1; font-size: 12px; color: var(--text-3); text-align: left; }

/* ================= AI 助手对话 ================= */
.ai-drawer { width: 420px; display: flex; flex-direction: column; padding-bottom: 16px; }
.ai-drawer h2 { display: flex; align-items: center; gap: 7px; }
.chat-log { flex: 1; overflow-y: auto; margin: 14px 0 10px; display: flex; flex-direction: column; gap: 10px; }
.chat-hint { font-size: 12px; color: var(--text-3); text-align: center; padding: 24px 10px; line-height: 1.7; margin: auto; }
.bubble {
  max-width: 86%; padding: 10px 13px; border-radius: 12px; font-size: 13.5px;
  line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.bubble.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.bubble.ai { align-self: flex-start; background: var(--bg); color: var(--text); border-bottom-left-radius: 4px; }
.bubble.ai.err { background: #feecee; color: var(--danger); }
.bubble.ai.pending { color: var(--text-3); }
.bubble.sys { align-self: center; background: #e9f7f1; color: var(--ok); font-size: 12px; padding: 5px 12px; border-radius: 20px; }
.chat-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chat-quick button {
  font-size: 12px; padding: 5px 10px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--text-2);
}
.chat-quick button:hover { border-color: var(--primary); color: var(--primary); }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; min-height: 44px; }
.chat-input button.primary { width: auto; padding: 10px 18px; }

/* ================= 个人资料 ================= */
.profile { display: flex; gap: 14px; margin-top: 16px; }
.avatar {
  position: relative; width: 72px; height: 72px; border-radius: 50%; flex: 0 0 72px;
  overflow: hidden; cursor: pointer; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback { font-size: 28px; font-weight: 600; color: var(--primary); }
.avatar-edit {
  position: absolute; right: 0; bottom: 0; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(31,35,41,.72); color: #fff; display: flex; align-items: center; justify-content: center;
}
.avatar-edit .ico { width: 13px; height: 13px; }
.profile-fields { flex: 1; min-width: 0; }
.profile-fields label { margin-top: 0; }
.avatar-actions { display: flex; gap: 12px; margin-top: 8px; }

/* ---------- 邮箱区块 ---------- */
.hide { display: none !important; }
.mail-box {
  background: var(--bg, #f7f8fa); border: 1px solid var(--border);
  border-radius: 9px; padding: 12px 13px; margin-top: 2px;
}
.mail-row { display: flex; align-items: center; gap: 8px; }
.mail-addr { font-size: 13.5px; color: var(--text); word-break: break-all; flex: 1; }
.mail-badge { flex: none; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 9px; }
.mail-badge.ok { color: #0b8f5c; background: #e6f7f0; }
.mail-badge.warn { color: #b58200; background: rgba(240,180,41,.16); }
.mail-pending { font-size: 12px; color: #b58200; line-height: 1.6; margin-top: 6px; }
.mail-actions { display: flex; gap: 14px; margin-top: 8px; }
.mail-form { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.mail-form input { width: 100%; }
.mail-form .row { margin-top: 8px; }
.mail-form button.primary { margin-top: 0; }
.mail-form .msg { text-align: left; margin-top: 6px; }

/* ---------- 内置小邮箱（收件箱） ---------- */
.inbox-modal { width: 560px; padding: 0; overflow: hidden; }
.inbox-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.inbox-head h2 { font-size: 16px; margin: 0; }
.inbox-head .inbox-count {
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: rgba(47,111,237,.12); border-radius: 999px; padding: 2px 8px;
}
.inbox-head .inbox-readall { margin-left: auto; font-size: 12px; }
.inbox-body { max-height: 62vh; overflow-y: auto; }
.inbox-empty { text-align: center; color: var(--text-3); padding: 54px 20px; font-size: 13px; }
.inbox-item {
  display: flex; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.inbox-item:last-child { border-bottom: 0; }
.inbox-dot {
  flex: none; width: 7px; height: 7px; border-radius: 50%; margin-top: 6px;
  background: var(--primary);
}
.inbox-item.read .inbox-dot { background: transparent; }
.inbox-main { flex: 1; min-width: 0; }
.inbox-title {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.inbox-item.read .inbox-title { font-weight: 500; color: var(--text-2); }
.inbox-when { margin-left: auto; font-size: 11px; color: var(--text-3); font-weight: 400; white-space: nowrap; }
.inbox-text {
  font-size: 13px; color: var(--text-2); line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; margin-top: 3px;
}
.inbox-gift {
  margin-top: 9px; padding: 8px 11px; border-radius: 8px;
  background: rgba(47,111,237,.07); border: 1px dashed rgba(47,111,237,.4);
  display: flex; align-items: center; gap: 10px;
}
.inbox-gift code {
  font-family: ui-monospace, Menlo, monospace; font-size: 15px;
  letter-spacing: 2px; font-weight: 700; color: var(--primary);
}
.inbox-gift .gift-use { margin-left: auto; font-size: 12px; }
.mb-badge {
  position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px;
  padding: 0 4px; border-radius: 999px; background: #e34d59; color: #fff;
  font-size: 10px; line-height: 15px; text-align: center; font-weight: 700;
}
.tb-btn.only-ico { position: relative; }
body.dark .inbox-head { border-color: var(--border); }
body.dark .inbox-item { border-color: var(--border); }
body.dark .inbox-gift { background: rgba(76,141,255,.14); }

/* ---------- 应用内更新 ---------- */
.upd-modal { width: 440px; }
.upd-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--text-2); padding: 7px 0; }
.upd-row b { color: var(--text); font-weight: 600; }
.upd-row b.upd-new { color: var(--primary); }
.upd-note { font-size: 12.5px; color: var(--text-3); line-height: 1.7; margin: 10px 0 4px; }
.upd-bar { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; margin: 12px 0 2px; }
.upd-fill { height: 100%; width: 0; background: var(--primary); transition: width .18s ease; }
.drawer-update { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.drawer-update .upd-state { font-size: 12.5px; color: var(--text-3); }

/* 鸽巢卡片复用的小标签 */
.cd { font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.cd-calm { background: #eef3fe; color: #2f6fed; }
.cd-near { background: #fdf3e2; color: #b9770f; }
.cd-hot  { background: #feecee; color: #c93a45; }
.cd-lost { background: var(--bg); color: #737a85; }
.cd-home { background: #e9f7f1; color: #00805a; }
.cat { background: var(--bg); padding: 2px 7px; border-radius: 6px; }

.side-tip {
  font-size: 11px; color: var(--text-3); line-height: 1.6; margin-top: 10px;
  padding: 9px 10px; background: var(--bg); border-radius: 8px;
}
.side-tip b { color: var(--text-2); font-weight: 600; }

/* ================= 鸽巢（弹层） ================= */
.nest-btn { margin-top: 8px; }
.nest-modal { width: 760px; max-width: 94vw; max-height: 84vh; overflow-y: auto; }
.nest-head { display: flex; justify-content: space-between; align-items: center; }
.nest-head h2 { margin: 0; }
.nest-x { border: none; background: none; font-size: 16px; color: var(--text-3); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.nest-x:hover { background: var(--bg); color: var(--text); }
.nest-desc { font-size: 12.5px; color: var(--text-3); margin: 6px 0 10px; }
.nest-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); margin-bottom: 14px; }
.nest-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.lg-calm { background: #2f6fed; }
.lg-near { background: #d98a12; }
.lg-hot  { background: #e34d59; }
.lg-lost { background: #9aa0aa; }
.lg-home { background: #00a870; }

.nest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.ncard {
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px 10px;
  cursor: pointer; transition: .15s; background: var(--card);
}
.ncard:hover { border-color: #cfd6e4; box-shadow: 0 6px 16px rgba(31,35,41,.07); transform: translateY(-1px); }
.ncard-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.ndove { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.ndove svg { width: 19px; height: 19px; }
.ncard-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; margin-bottom: 5px; }
.ncard-letter { font-size: 11.5px; color: var(--text-3); line-height: 1.5; margin-bottom: 7px; }
.ncard-foot { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); flex-wrap: wrap; }

.u-calm .ndove { background: #eef3fe; color: #2f6fed; }
.u-near .ndove { background: #fdf3e2; color: #d98a12; }
.u-hot  .ndove { background: #feecee; color: #e34d59; }
.u-lost .ndove { background: #f1f2f5; color: #9aa0aa; }
.u-home .ndove { background: #e9f7f1; color: #00a870; }
.u-hot { border-color: #f7ccd1; }
.u-lost { border-style: dashed; }
.u-home .ncard-title { color: var(--text-3); text-decoration: line-through; }

.u-near .ndove svg { animation: doveNod 1.7s ease-in-out infinite; }
.u-hot  .ndove svg { animation: doveNod .7s ease-in-out infinite; }
@keyframes doveNod { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-3px) rotate(5deg); } }

/* ================= 今天 / 接下来 ================= */
.td-hero { margin-bottom: 18px; }
.td-hello { font-size: 22px; font-weight: 650; letter-spacing: -.3px; }
.td-date { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.td-sum {
  font-size: 13px; color: var(--text-2); background: var(--card, #fff);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 18px;
}
.td-sum b { font-weight: 600; }
.td-sum .td-lost { color: #e34d59; }
.td-sum .td-hot { color: #d98a12; }

.td-clear {
  display: flex; align-items: center; gap: 12px;
  padding: 22px; border: 1px dashed var(--border); border-radius: 10px;
  color: var(--text-3); font-size: 14px; margin-bottom: 18px;
}
.td-clear .ico { width: 28px; height: 28px; color: var(--primary); opacity: .8; flex: none; }

.td-sec { margin-bottom: 22px; }
.td-sec-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px;
}
.td-sec-head .ico { width: 15px; height: 15px; }
.td-sec.overdue .td-sec-head { color: #e34d59; }
.td-sec.done-sec .td-sec-head { color: #00a870; }
.td-count {
  font-weight: 500; font-size: 12px; color: var(--text-3);
  background: #f1f2f5; border-radius: 9px; padding: 1px 7px;
}
.td-sec.done-sec .task { opacity: .62; }

/* 接下来 */
.up-sec { margin-bottom: 26px; }
.up-day { margin-bottom: 14px; }
.up-day-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.up-day-num { font-size: 13px; font-weight: 600; }
.up-day-wd { font-size: 12px; color: var(--text-3); }

/* ================= AI 助手：模型选择 ================= */
.chat-model-row {
  display: flex; align-items: center; gap: 8px; margin: 10px 0 12px;
}
.chat-model-row label { font-size: 12px; color: var(--text-3); flex: none; }
.chat-model-row select {
  flex: 1; min-width: 0; font-size: 12px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--card, #fff); color: var(--text);
}
.chat-model-row .dim { font-size: 11px; flex: none; }

/* ================= AI 助手：侧栏大入口 ================= */
.ai-entry {
  position: relative; overflow: hidden; width: 100%;
  flex: none; min-height: 56px;
  display: flex; align-items: center; gap: 11px; text-align: left;
  margin: 12px 0 14px; padding: 9px 10px;
  border: none; border-radius: 8px; cursor: pointer;
  background: none;
  color: var(--text); font: inherit;
  transition: background .15s;
}
.ai-entry:hover { background: var(--bg); }
.ai-entry:active { transform: scale(.985); }

/* 扫光：鼠标悬停时从图标上掠过 */
.ai-entry-glow {
  position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.85), transparent);
  transform: skewX(-18deg); pointer-events: none; opacity: 0;
}
.ai-entry:hover .ai-entry-glow { animation: aiSheen .85s ease-out; }
@keyframes aiSheen {
  0% { left: -60%; opacity: 0; }
  15% { opacity: .9; }
  100% { left: 125%; opacity: 0; }
}

.ai-entry-ico {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4b8cff, #7a5cff);
  color: #fff; box-shadow: 0 3px 10px rgba(90,110,255,.32);
  transition: transform .3s cubic-bezier(.34,1.4,.64,1);
}
.ai-entry-ico .ico { width: 20px; height: 20px; }
.ai-entry:hover .ai-entry-ico { transform: rotate(-8deg) scale(1.08); }
/* 图标轻微呼吸，提示它是活的 */
.ai-entry-ico .ico { animation: aiBreath 3.4s ease-in-out infinite; }
@keyframes aiBreath {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .78; transform: scale(.92); }
}

.ai-entry-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-entry-text b { font-size: 14px; font-weight: 650; letter-spacing: -.1px; }
.ai-entry-text i {
  font-style: normal; font-size: 11.5px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-entry-go {
  flex: 0 0 auto; color: #7a95c9; display: flex;
  transition: transform .22s cubic-bezier(.34,1.3,.64,1);
}
.ai-entry-go .ico { width: 15px; height: 15px; }
.ai-entry:hover .ai-entry-go { transform: translateX(3px); color: var(--primary); }

/* 侧栏内边距与留白 */
.sidebar { padding-top: 10px; }
.side-user { padding: 6px 4px 2px; }

/* ================= 抽屉动画（更顺滑） ================= */
.mask { transition: opacity .24s ease; }
.mask.open { animation: maskIn .24s ease both; }
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  transition: transform .34s cubic-bezier(.22,1,.36,1), box-shadow .3s ease;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}
.drawer.open {
  transform: translateX(0);
  box-shadow: -12px 0 42px rgba(15,25,50,.14);
}

/* 抽屉里的内容依次淡入（用 --d 让每个元素错开） */
.drawer.open > * { animation: drawerItem .42s cubic-bezier(.22,1,.36,1) both; }
.drawer.open > *:nth-child(1) { animation-delay: .04s; }
.drawer.open > *:nth-child(2) { animation-delay: .07s; }
.drawer.open > *:nth-child(3) { animation-delay: .10s; }
.drawer.open > *:nth-child(4) { animation-delay: .13s; }
.drawer.open > *:nth-child(5) { animation-delay: .16s; }
.drawer.open > *:nth-child(n+6) { animation-delay: .19s; }
@keyframes drawerItem {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

/* AI 助手抽屉的头部：图标呼吸 + 标题 */
.ai-drawer h2 .ico { width: 17px; height: 17px; color: var(--primary); }
.ai-drawer.open h2 .ico { animation: aiBreath 3.4s ease-in-out infinite; }

/* 气泡入场 */
.bubble { animation: bubbleIn .28s cubic-bezier(.22,1,.36,1) both; }
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(7px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
/* 思考中的三点动画 */
.bubble.pending::after {
  content: ''; display: inline-block; width: 1em; text-align: left;
  animation: dots 1.1s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ''; } 25% { content: '·'; } 50% { content: '··'; } 75% { content: '···'; }
}

/* 侧栏统计：只有逾期才红 */
.side-stat .stat-lost { color: var(--danger); font-weight: 600; }
.side-stat .stat-week { color: var(--text-2); font-weight: 600; }

/* 尊重系统「减少动态效果」 */
@media (prefers-reduced-motion: reduce) {
  .ai-entry, .ai-entry-ico, .ai-entry-go, .drawer, .mask, .bubble, .drawer.open > * {
    transition: none !important; animation: none !important;
  }
}

/* 今天页头部右侧的「加一件事」 */
.td-hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.td-add {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 7px 13px; font-size: 12.5px; font: inherit; font-size: 12.5px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card);
  color: var(--text-2); cursor: pointer;
  transition: transform .16s cubic-bezier(.34,1.3,.64,1), border-color .16s, color .16s;
}
.td-add .ico { width: 14px; height: 14px; }
.td-add:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.td-add:active { transform: translateY(0) scale(.97); }

/* 「加一件事」按钮在待办页也常驻在粘贴框旁 */CSS
node --check app.js >/dev/null 2>&1 && echo "app.js OK"
cd /tmp/rt3
cp /Users/jiurige/PycharmProjects/biege-desktop/renderer/{index.html,app.js,style.css} .
~/PycharmProjects/biege/.venv/bin/python - <<'PY'
a=open('/tmp/rt3/index.html').read()
nt='<style>*{transition:none!important;animation:none!important}</style>'
a=a.replace('</head>', nt+'</head>')
inject='<script src="mock.js"></script>\n  <script src="app.js"></script>'
open('/tmp/rt3/t2.html','w').write(a.replace('<script src="app.js"></script>', inject+'\n  <script src="go_up.js"></script>'))
PY
CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
"$CHROME" --headless --disable-gpu --hide-scrollbars --window-size=1240,860 --virtual-time-budget=8000 --screenshot=/tmp/rt3/t2.png "http://localhost:8793/t2.html" 2>&1 | grep -i "bytes written"
cp /tmp/rt3/t2.png ~/.openclaw/workspace-aliyun-ai/shots/
/* ================= AI 对话：在左侧栏内展开 ================= */
.sidebar { width: 190px; transition: width .34s cubic-bezier(.22,1,.36,1); }
/* 窗口变矮 / 页面缩小时：整栏可滚动，绝不允许把子项压扁。
   （.ai-entry 因 overflow:hidden 的 min-height 为 0，若不锁 flex-shrink
   会被挤成十几像素，文字被裁掉 —— 这就是「缩小就坏」的根因。） */
.side-main {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
}
.side-main > * { flex-shrink: 0; }
.sidebar.ai-mode { width: 330px; }

/* 切到 AI 模式时，普通导航收起、对话面板出现 */
.sidebar.ai-mode .side-main { display: none; }

.ai-panel {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  animation: aiPanelIn .34s cubic-bezier(.22,1,.36,1) both;
}
@keyframes aiPanelIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
.ai-panel[hidden] { display: none !important; }

.ai-panel-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.ai-panel-head h2 {
  flex: 1; display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 650; margin: 0;
}
.ai-panel-head h2 .ico { width: 16px; height: 16px; color: var(--primary); }
.ai-panel-head h2 .ico { animation: aiBreath 3.4s ease-in-out infinite; }
.ai-back, .ai-close {
  flex: none; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 6px; background: none;
  color: var(--text-3); cursor: pointer; padding: 0;
  transition: background .15s, color .15s, transform .15s;
}
.ai-back .ico, .ai-close .ico { width: 14px; height: 14px; }
.ai-back:hover, .ai-close:hover { background: var(--bg); color: var(--text); }
.ai-back:active, .ai-close:active { transform: scale(.92); }

/* 面板内的聊天区（窄栏适配） */
.ai-panel .chat-model-row { margin: 0 0 10px; }
.ai-panel .chat-model-row select { font-size: 12px; }
.ai-panel .chat-log { margin: 0 0 10px; }
.ai-panel .chat-hint { padding: 16px 6px; white-space: pre-line; }
.ai-panel .bubble { max-width: 92%; font-size: 12.5px; padding: 8px 11px; }
.ai-panel .chat-quick { margin-bottom: 8px; }
.ai-panel .chat-quick button { font-size: 11.5px; padding: 4px 9px; }
.ai-panel .chat-input { gap: 6px; }
.ai-panel .chat-input textarea { font-size: 12.5px; min-height: 52px; }
.ai-panel .chat-input button.primary { padding: 8px 13px; font-size: 12.5px; }

/* 模型下拉：铺满整行，更像控件 */
.ai-panel .chat-model-row { display: block; }
.ai-panel .chat-model-row select {
  width: 100%; padding: 6px 8px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--card); color: var(--text-2);
  font-size: 12px; cursor: pointer;
}
.ai-panel .chat-model-row select:focus { border-color: var(--primary); outline: none; }
/* 输入框矮一点、圆润一点 */
.ai-panel .chat-input textarea {
  min-height: 46px; padding: 9px 11px; border-radius: 9px; resize: none;
}

/* ============ AI 的「手」 ============ */

/* 装上手开关 */
.hand-toggle {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 9px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line, #e3e6ec); background: var(--card);
  color: var(--text-3, #8a90a0); font-size: 12px; font-family: inherit;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.hand-toggle .ico { width: 14px; height: 14px; }
.hand-toggle:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.hand-toggle.on {
  background: linear-gradient(135deg, #34c98a, #22a86e);
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px rgba(34,168,110,.32);
}
.hand-toggle.on .ico { animation: handWave .5s ease; }
@keyframes handWave {
  0% { transform: rotate(0) } 30% { transform: rotate(-16deg) } 60% { transform: rotate(10deg) } 100% { transform: rotate(0) }
}

/* 执行确认卡 */
.bubble.tool-confirm {
  padding: 12px 13px; border: 1px solid #ffd9a8; background: var(--card)af1;
  border-radius: 12px; max-width: 100%;
}
.tool-confirm .tc-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #b06a10; font-weight: 600; margin-bottom: 7px;
}
.tool-confirm .tc-head .ico { width: 14px; height: 14px; }
.tool-confirm .tc-label { font-size: 13px; color: var(--text); line-height: 1.45; }
.tool-confirm .tc-warn {
  margin-top: 6px; font-size: 12px; color: #d9484f;
  background: #fdf0f1; border-radius: 6px; padding: 5px 9px;
}
.tool-confirm code {
  display: block; margin-top: 7px; padding: 7px 9px;
  background: #2c3038; color: #d9e2ef; border-radius: 7px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11.5px; line-height: 1.5; word-break: break-all;
  max-height: 110px; overflow-y: auto; white-space: pre-wrap;
}
.tool-confirm .tc-actions { display: flex; gap: 6px; margin-top: 10px; }
.tool-confirm .tc-actions button {
  flex: 1; padding: 6px 0; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-family: inherit; border: 1px solid transparent;
  transition: filter .15s, transform .12s;
}
.tool-confirm .tc-actions button:hover { filter: brightness(.95); transform: translateY(-1px); }
.tool-confirm .tc-ok { background: var(--primary); color: #fff; }
.tool-confirm .tc-always { background: #eef1f6; color: var(--text-2, #5c6373); }
.tool-confirm .tc-no { background: var(--card); color: var(--danger, #d9484f); border-color: #f0c4c7 !important; }
.tc-result { margin-top: 8px; font-size: 12px; font-weight: 600; }
.tc-result.yes { color: var(--ok, #22a86e); }
.tc-result.no { color: var(--danger, #d9484f); }

/* 截图气泡 */
.bubble.ai.shot { padding: 6px; background: var(--card); border: 1px solid var(--line, #e3e6ec); }
.bubble.ai.shot img { display: block; width: 100%; border-radius: 8px; }

/* 侧栏窄，确认卡按钮一行可能挤，允许换行 */
.ai-panel .tool-confirm .tc-actions { flex-wrap: wrap; }

/* ═══════════════ 深色模式 ═══════════════ */
body.dark {
  --primary: #4c8dff;
  --primary-dark: #3b78e0;
  --text: #e8eaed;
  --text-2: #a8aeb8;
  --text-3: #767c86;
  --border: #2c2f36;
  --border-strong: #40454f;
  --bg: #17191d;
  --card: #1f2228;
  --danger: #f0656f;
  --ok: #3ac48a;
}
body.dark .titlebar { background: #1b1e23; border-color: var(--border); }
body.dark .sidebar { background: #1b1e23; border-color: var(--border); }
body.dark .content { background: var(--bg); }
body.dark .task, body.dark .composer textarea, body.dark .modal,
body.dark .drawer, body.dark .search-panel, body.dark .nest-modal { background: var(--card); }
body.dark input, body.dark textarea, body.dark select {
  background: #23262c; color: var(--text); border-color: var(--border);
}
body.dark .task:hover { background: #252932; }
body.dark .toast { background: #2b2f37; }
body.dark .side-item:hover, body.dark .side-item.active { background: #252932; }
body.dark .cal-cell { background: #1f2228; border-color: var(--border); }
body.dark .cal-cell.out { background: #1a1c21; }

/* ═══════════════ 看板 ═══════════════ */
.board { padding: 16px 20px; overflow: auto; height: 100%; }
.board-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; min-height: 200px; }
.board-col {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; min-width: 0;
  transition: background .15s, border-color .15s;
}
.board-col.over { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--card)); }
.board-col-head {
  display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  color: var(--text-2); margin-bottom: 10px;
}
.board-col-head .bc-count {
  margin-left: auto; background: var(--bg); color: var(--text-3);
  border-radius: 9px; padding: 1px 7px; font-size: 11.5px; font-weight: 500;
}
.board-col-body { display: flex; flex-direction: column; gap: 8px; min-height: 40px; flex: 1; }
.board-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 11px; cursor: grab; transition: box-shadow .15s, transform .12s, opacity .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.board-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.09); transform: translateY(-1px); }
.board-card.dragging { opacity: .45; cursor: grabbing; }
.board-card .bct { font-size: 13px; line-height: 1.45; margin-bottom: 6px; }
.board-card .bcm { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; }
.board-card .bcm .late { color: var(--danger); }
.board-card .bcm .soon { color: #e08a2c; }
.board-empty { color: var(--text-3); font-size: 12.5px; text-align: center; padding: 18px 0; }

/* ═══════════════ 洞察 ═══════════════ */
.insights { padding: 16px 20px; overflow: auto; height: 100%; }
.ins-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.ins-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
}
.ins-card .ic-num { font-size: 25px; font-weight: 700; color: var(--text); line-height: 1.1; }
.ins-card .ic-label { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.ins-card.accent .ic-num { color: var(--primary); }
.ins-card.fire .ic-num { color: #e8722c; }
.ins-chart {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 15px; margin-bottom: 14px;
}
.ins-chart h3 { font-size: 13.5px; color: var(--text-2); font-weight: 600; margin-bottom: 12px; }
.ins-bars { display: flex; align-items: flex-end; gap: 5px; height: 110px; }
.ins-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.ins-bar {
  width: 100%; background: linear-gradient(180deg, #5b95f7, #2f6fed);
  border-radius: 4px 4px 2px 2px; min-height: 2px; transition: height .5s cubic-bezier(.22,1,.36,1);
}
.ins-bar.focus { background: linear-gradient(180deg, #ffb27a, #e8722c); }
.ins-bar-wrap .ib-label { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.ins-bar-wrap .ib-val { font-size: 10.5px; color: var(--text-2); font-weight: 600; }
.ins-cats { display: flex; flex-wrap: wrap; gap: 10px; }
.ins-cat {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px;
  background: var(--bg); border-radius: 8px; padding: 6px 11px;
}
.ins-cat i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ═══════════════ 专注计时 ═══════════════ */
.focus-fab { position: fixed; right: 22px; bottom: 22px; z-index: 60; }
.focus-fab-btn {
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #3d7bf7, #2f6fed); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(47,111,237,.36);
  transition: transform .15s, box-shadow .15s;
}
.focus-fab-btn:hover { transform: scale(1.07); box-shadow: 0 6px 18px rgba(47,111,237,.44); }
.focus-fab-btn .ico { width: 22px; height: 22px; }

.focus-bar {
  position: fixed; right: 22px; bottom: 22px; z-index: 61;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 11px 14px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 6px 22px rgba(0,0,0,.14); min-width: 250px;
}
.fb-left { display: flex; align-items: center; gap: 11px; }
.fb-ring { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.fb-ring svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.fb-ring .fb-track { fill: none; stroke: var(--border); stroke-width: 4; }
.fb-ring .fb-fill {
  fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 119.4; stroke-dashoffset: 0; transition: stroke-dashoffset .6s linear;
}
.fb-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fb-info b { font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.fb-info span, .fb-info #fbTask {
  font-size: 11.5px; color: var(--text-3); max-width: 150px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fb-actions { display: flex; gap: 6px; margin-left: auto; }
.fb-actions button {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.fb-actions button:hover { background: var(--border); }
.fb-actions .ico { width: 15px; height: 15px; }
.focus-bar.paused .fb-fill { stroke: #e08a2c; }

.focus-presets { display: flex; gap: 8px; margin: 4px 0 16px; }
.focus-presets button {
  flex: 1; padding: 9px 0; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-2); font-size: 13px; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.focus-presets button:hover { border-color: var(--primary); color: var(--primary); }
.focus-presets button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ═══════════════ 搜索面板 ═══════════════ */
.search-panel {
  position: fixed; top: 88px; left: 50%; transform: translateX(-50%) translateY(-8px) scale(.98);
  width: min(560px, 92vw); background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 16px 48px rgba(0,0,0,.2); z-index: 95;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  overflow: hidden;
}
.search-panel.open { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0) scale(1); }
.sp-input { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.sp-input .ico { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }
.sp-input input {
  flex: 1; border: none; outline: none; background: transparent; font-size: 15px;
  color: var(--text); font-family: inherit;
}
.sp-results { max-height: 340px; overflow-y: auto; padding: 6px; }
.sp-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px;
  cursor: pointer; transition: background .12s;
}
.sp-item:hover, .sp-item.sel { background: var(--bg); }
.sp-item .spi-main { flex: 1; min-width: 0; }
.sp-item .spi-title { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-item.done .spi-title { text-decoration: line-through; color: var(--text-3); }
.sp-item .spi-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.sp-item .spi-tag {
  font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--bg);
  color: var(--text-3); flex-shrink: 0;
}
.sp-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 26px 0; }
.sp-foot {
  padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11.5px;
  color: var(--text-3); display: flex; gap: 6px; align-items: center;
}
.sp-foot kbd {
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; font-family: inherit; font-size: 10.5px;
}

/* ═══════════════ 子任务 & 重复标记 ═══════════════ */
.sub-progress {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-3);
}
.sub-progress .sp-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.sub-progress .sp-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width .3s; }
.task-badges { display: flex; gap: 6px; align-items: center; }
.task-badges .tb {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px;
  color: var(--text-3); background: var(--bg); border-radius: 6px; padding: 2px 6px;
}
.task-badges .tb .ico { width: 11px; height: 11px; }

/* 顶部工具条：搜索按钮 + 深色切换 */
.tb-btn.only-ico { padding: 0 8px; }
.dark-toggle.on { color: var(--primary); }

/* 看板/洞察在网页版隐藏（桌面版独有） */
body.web-lite .board, body.web-lite .insights { display: none !important; }

/* ═══════════════ 子任务弹窗 ═══════════════ */
.sub-modal { width: 460px; max-width: 94vw; }
.sub-list { max-height: 300px; overflow-y: auto; margin: 6px 0 12px; }
.sub-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.sub-row.done .sub-title { text-decoration: line-through; color: var(--text-3); }
.sub-row .sub-check {
  width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid var(--border);
  background: transparent; cursor: pointer; color: transparent; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.sub-row .sub-check:hover { border-color: var(--primary); color: var(--primary); }
.sub-row.done .sub-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.sub-row .sub-check .ico { width: 13px; height: 13px; }
.sub-row .sub-title { flex: 1; font-size: 13.5px; min-width: 0; word-break: break-word; }
.sub-row .sub-del {
  border: none; background: transparent; cursor: pointer; color: var(--text-3);
  padding: 3px; border-radius: 6px; opacity: 0; transition: opacity .15s, color .15s;
}
.sub-row:hover .sub-del { opacity: 1; }
.sub-row .sub-del:hover { color: var(--danger); }
.sub-row .sub-del .ico { width: 14px; height: 14px; }
.sub-add { display: flex; gap: 8px; }
.sub-add input { flex: 1; }

/* 搜索定位后的高亮 */
.task.flash { animation: flashPulse 1.4s ease-out; }
@keyframes flashPulse {
  0% { box-shadow: 0 0 0 0 rgba(47,111,237,.5); }
  40% { box-shadow: 0 0 0 5px rgba(47,111,237,.16); }
  100% { box-shadow: 0 0 0 0 rgba(47,111,237,0); }
}
body.dark .modal.sub-modal { background: var(--card); }

/* ═══════════════ 深色模式：补齐写死浅色的元素 ═══════════════ */
body.dark .side-refresh,
body.dark .tb-btn,
body.dark .td-add,
body.dark .mail-box { background: #24282f; }
body.dark .mail-badge.ok { background: #1d3a2f; color: #5fd39c; }
body.dark .mail-badge.warn { background: #3a3320; color: #e0b34c; }
body.dark .ghost,
body.dark .cat-filter {
  background: #23262c; border-color: var(--border); color: var(--text-2);
}
body.dark .side-refresh:hover,
body.dark .tb-btn:hover,
body.dark .td-add:hover,
body.dark .ghost:hover { border-color: var(--primary); color: var(--primary); }

body.dark .side-tip,
body.dark .cat,
body.dark .chip,
body.dark .ins-cat,
body.dark .task-badges .tb {
  background: #262a31; color: var(--text-2);
}
body.dark .chip:hover { border-color: var(--primary); color: var(--primary); }
body.dark .chip.on { background: var(--primary); color: #fff; }

/* AI 入口在深色下也只是一行，不再有底色块 */
body.dark .ai-entry { background: none; }
body.dark .ai-entry b { color: #e8eaed; }
body.dark .ai-entry i { color: #9aa4b6; }

/* 聊天区 / 气泡 */
body.dark .ai-panel { background: #1b1e23; }
body.dark .chat-log { background: #1b1e23; }
body.dark .bubble.ai { background: #262a31; color: var(--text); }
body.dark .bubble.me { background: var(--primary); color: #fff; }
body.dark .chat-input textarea,
body.dark .chat-model-row select,
body.dark .hand-toggle { background: #23262c; border-color: var(--border); color: var(--text-2); }
body.dark .chat-hint { color: var(--text-3); }

/* 弹窗 / 抽屉 / 确认卡 */
body.dark .drawer, body.dark .modal, body.dark .nest-modal, body.dark .search-panel { background: var(--card); }
body.dark .tool-confirm { background: #2b2317; border-color: #4a3a20; }
body.dark .tool-confirm .tc-always { background: #2f343d; color: var(--text-2); }
body.dark .tool-confirm .tc-no { background: transparent; }
body.dark .tool-confirm .tc-warn { background: #3a2224; color: #f08a90; }

/* 今天视图 */
body.dark .td-hero { background: linear-gradient(160deg, #1f2733, #221f2e); }
body.dark .td-sec-head { color: var(--text-2); }
body.dark .td-clear { background: #1f2228; }

/* 日历 */
body.dark .cal-cell:hover { background: #252932; }
body.dark .cal-cell.today { background: #26314a; }
body.dark .cal-week span { color: var(--text-3); }

/* 空状态 / 分隔 */
body.dark .empty, body.dark .board-empty { color: var(--text-3); }
body.dark .cmp-note { background: #23262c; }

/* 深色模式：分类标签改用半透明深底 + 提亮文字，别再刺眼 */
body.dark .tag-study   { background: rgba(29,111,214,.20); color: #7fb4ff; }
body.dark .tag-work    { background: rgba(112,72,196,.22); color: #b79bff; }
body.dark .tag-life    { background: rgba(0,145,92,.20);  color: #5fd6a0; }
body.dark .tag-finance { background: rgba(196,123,10,.22); color: #f0b45c; }
body.dark .tag-social  { background: rgba(214,69,92,.20); color: #ff8fa1; }
body.dark .tag-other   { background: var(--bg); color: var(--text-2); }

/* 编辑弹窗里并排的下拉 */
.edit-row { display: flex; gap: 8px; }
.edit-row select { flex: 1; }
.edit-row input[type="number"] { width: 78px; flex: none; }

/* ═══════════════════════════════════════════════════════
   AI 面板翻新：把丑的地方一次性收拾干净
   - 输入框与发送键合成一体，不再"一高一矮"
   - 空状态换成小鸽头像 + 引导，不再一大片白
   - 模型下拉、快问按钮给足呼吸感
   ═══════════════════════════════════════════════════════ */
.sidebar.ai-mode { width: clamp(380px, 45vw, 720px); }

/* 顶栏：标题居中不飘 */
.ai-panel-head {
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.ai-panel-head h2 { font-size: 14.5px; letter-spacing: -.2px; }
.ai-close { display: flex; }

/* 模型行：下拉占满，开关缩成小胶囊跟在右边 */
.ai-panel .chat-model-row {
  display: flex; gap: 6px; align-items: center; margin: 0 0 12px;
}
.ai-panel .chat-model-row select {
  flex: 1; min-width: 0; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 12px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a90a0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  padding-right: 26px;
}
.ai-panel .chat-model-row select:focus { border-color: var(--primary); outline: none; }

/* 空状态：小鸽 + 两行字，居中 */
.chat-empty {
  margin: auto; text-align: center; padding: 28px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
}
.chat-empty-ico {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(88,120,255,.14), rgba(150,90,255,.14));
  color: var(--primary); margin-bottom: 4px;
}
.chat-empty-ico .ico { width: 32px; height: 32px; animation: aiBreath 3.4s ease-in-out infinite; }
.chat-empty b { font-size: 15px; color: var(--text); font-weight: 650; }
.chat-empty span { font-size: 13px; color: var(--text-2); line-height: 1.65; opacity: .85; }

/* 快问：带小图标，排成一列不挤 */
.ai-panel .chat-quick { flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ai-panel .chat-quick button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  font-size: 13.5px; padding: 11px 14px; border-radius: 10px; text-align: left;
  background: var(--bg); border: 1px solid var(--border);
}
.ai-panel .chat-quick button .ico { width: 16px; height: 16px; color: var(--text-2); flex: none; transition: color .15s; }
.ai-panel .chat-quick button:hover .ico { color: var(--primary); }

/* 输入区：一个圆角容器包住文本框 + 圆发送键 */
.ai-panel .chat-input {
  display: flex; align-items: flex-end; gap: 0;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--card); padding: 8px 8px 8px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.ai-panel .chat-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(88,120,255,.13);
}
.ai-panel .chat-input textarea {
  flex: 1; min-width: 0; min-height: 44px; max-height: 150px;
  border: none; background: none; padding: 8px 0; margin: 0;
  font-size: 14px; line-height: 1.55; resize: none; color: var(--text);
}
.ai-panel .chat-input textarea:focus { outline: none; }
.chat-send {
  flex: none; width: 34px; height: 34px; border-radius: 10px; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--primary); color: #fff; padding: 0;
  transition: transform .15s, opacity .15s, background .15s;
}
.chat-send .ico { width: 15px; height: 15px; }
.chat-send:hover { transform: translateY(-1px); }
.chat-send:active { transform: scale(.93); }
.chat-send:disabled { opacity: .45; cursor: default; transform: none; }

/* 气泡：更松弛的圆角 */
.ai-panel .bubble { border-radius: 14px; line-height: 1.6; font-size: 14px; max-width: 88%; padding: 11px 15px; }

/* ═══════════════════════════════════════════════════════
   鸽币条（侧栏常驻）
   ═══════════════════════════════════════════════════════ */
.coin-bar {
  display: flex; align-items: center; gap: 7px; width: 100%;
  margin-top: 10px; padding: 9px 11px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px;
  background: linear-gradient(135deg, rgba(240,180,41,.10), rgba(255,210,90,.06));
  font-family: inherit; text-align: left;
  transition: border-color .15s, transform .15s;
}
.coin-bar:hover { border-color: #f0b429; transform: translateY(-1px); }
.coin-bar-ico {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ffd54a, #f0a92a); color: #7a5200;
}
.coin-bar-ico .ico { width: 14px; height: 14px; }
.coin-bar-num { font-size: 15px; font-weight: 750; color: #b58200; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.coin-bar-label { font-size: 11px; color: var(--text-3); }
.coin-bar-sign {
  margin-left: auto; flex: none; font-size: 11px; padding: 3px 9px; border-radius: 20px;
  background: #f0b429; color: #fff; font-weight: 600; transition: background .15s, transform .15s;
}
.coin-bar-sign:hover { background: #e0a316; }
.coin-bar-sign:active { transform: scale(.94); }
.coin-bar-sign.done { background: var(--bg); color: var(--text-3); }

/* ═══════════════════════════════════════════════════════
   商城
   ═══════════════════════════════════════════════════════ */
.shop { max-width: 1000px; }
.shop-hero {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 20px; margin-bottom: 18px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(240,180,41,.13), rgba(255,140,60,.07), rgba(150,90,255,.06));
  border: 1px solid var(--border);
}
.shop-hero-bal { display: flex; align-items: baseline; gap: 5px; }
.shop-hero-bal b { font-size: 30px; font-weight: 800; color: #c99400; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.shop-hero-bal i { font-size: 13px; color: var(--text-3); font-style: normal; }
.shop-hero-sub { font-size: 12px; color: var(--text-3); margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; }
.shop-hero-sub b { color: var(--text-2); font-variant-numeric: tabular-nums; }
.shop-signin {
  flex: none; padding: 8px 16px; border-radius: 9px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #ffd54a, #f0a92a); color: #6b4a00;
  font-weight: 700; font-size: 13px; font-family: inherit;
  transition: transform .15s, box-shadow .15s;
}
.shop-signin:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(240,180,41,.35); }
.shop-signin:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }

/* 兑换码 */
.redeem-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 20px;
}
.redeem-ico { color: #c99400; display: flex; }
.redeem-ico .ico { width: 18px; height: 18px; }
.redeem-input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-size: 14px; letter-spacing: 1.5px; color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  min-width: 0;
}
.redeem-input::placeholder { letter-spacing: 0; font-family: inherit; color: var(--text-3); }
.redeem-btn {
  border: 0; background: var(--primary); color: #fff; border-radius: 8px;
  padding: 8px 18px; font-size: 13.5px; cursor: pointer; flex-shrink: 0;
}
.redeem-btn:hover { opacity: .88; }
.redeem-btn:disabled { opacity: .55; cursor: default; }
.shop-sec-title { font-size: 13px; font-weight: 700; margin: 0 0 12px; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.shop-sec-title .ico { width: 15px; height: 15px; color: var(--primary); }
.shop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 13px; margin-bottom: 24px;
}
.shop-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 15px 15px 13px; border-radius: 13px;
  background: var(--card); border: 1px solid var(--border);
  transition: transform .18s cubic-bezier(.34,1.3,.64,1), box-shadow .18s, border-color .18s;
}
.shop-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.shop-card.owned { border-color: rgba(34,168,110,.45); background: linear-gradient(160deg, rgba(34,168,110,.05), transparent); }
.shop-card.equipped { border-color: #f0b429; box-shadow: 0 0 0 2px rgba(240,180,41,.22); }
/* 已拥有但未装备：右上角挂个小勾，和稀有度徽章区分开 */
.shop-card.owned:not(.equipped)::after {
  content: '已拥有'; position: absolute; top: 9px; left: 9px;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
  background: rgba(34,168,110,.14); color: #1f9d63;
}
.shop-card-art {
  font-size: 34px; line-height: 1; text-align: center; padding: 8px 0 2px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.12));
}
.shop-card-art.swatch {
  width: 46px; height: 46px; border-radius: 50%; margin: 4px auto 2px; padding: 0;
}
.shop-card-name { font-size: 13.5px; font-weight: 700; text-align: center; }
.shop-card-desc { font-size: 11.5px; color: var(--text-3); text-align: center; line-height: 1.5; min-height: 32px; }
.shop-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.shop-price {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 700; color: #b58200; font-variant-numeric: tabular-nums;
}
.shop-price .ico { width: 13px; height: 13px; }
.shop-buy {
  margin-left: auto; flex: none; padding: 6px 13px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--primary); background: none; color: var(--primary);
  font-size: 12px; font-weight: 600; font-family: inherit;
  transition: background .15s, color .15s, transform .15s;
}
.shop-buy:hover { background: var(--primary); color: #fff; }
.shop-buy:active { transform: scale(.95); }
.shop-buy:disabled { opacity: .5; cursor: default; border-color: var(--border); color: var(--text-3); background: none; }
.shop-buy.equip { border-color: #f0b429; color: #b58200; }
.shop-buy.equip:hover { background: #f0b429; color: #fff; }
.shop-buy.equipped { background: #f0b429; border-color: #f0b429; color: #fff; }
.shop-badge {
  position: absolute; top: 9px; right: 9px; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px; letter-spacing: .3px;
}
.shop-badge.rare { background: rgba(88,120,255,.14); color: #4a6cf0; }
.shop-badge.epic { background: rgba(150,90,255,.15); color: #8a4cf0; }
.shop-badge.legendary { background: linear-gradient(135deg,#ffd54a,#f0a92a); color: #6b4a00; }
.shop-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 40px 0; }

/* 分类小标题隔断 */
.shop-kind-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--text-3); letter-spacing: .5px;
  margin: 4px 0 10px;
}
.shop-kind-head::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ═══════════════════════════════════════════════════════
   鸽币账单弹窗
   ═══════════════════════════════════════════════════════ */
.wallet-modal { width: 520px; }
.wallet-hero {
  padding: 18px 20px; border-radius: 13px; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(240,180,41,.14), rgba(255,140,60,.06));
  border: 1px solid rgba(240,180,41,.32);
}
.wallet-balance { display: flex; align-items: baseline; gap: 6px; }
.wallet-balance span { font-size: 36px; font-weight: 800; color: #c99400; letter-spacing: -1.2px; font-variant-numeric: tabular-nums; }
.wallet-balance i { font-size: 13px; color: var(--text-3); font-style: normal; }
.wallet-sub { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-top: 8px; }
.wallet-sub b { color: var(--text-2); font-variant-numeric: tabular-nums; }
.wallet-signin {
  margin-top: 13px; padding: 8px 18px; border-radius: 9px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #ffd54a, #f0a92a); color: #6b4a00;
  font-weight: 700; font-size: 13px; font-family: inherit;
  transition: transform .15s, box-shadow .15s;
}
.wallet-signin:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(240,180,41,.35); }
.wallet-signin:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.wallet-rules {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 7px 14px; margin-bottom: 18px;
}
.wallet-rule { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.wallet-rule .ico { width: 13px; height: 13px; color: #f0b429; flex: none; }
.wallet-rule b { margin-left: auto; color: #b58200; font-variant-numeric: tabular-nums; }
.wallet-sec-title { font-size: 12.5px; font-weight: 700; color: var(--text-3); margin-bottom: 9px; }
.wallet-txns { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.wallet-txn {
  display: flex; align-items: center; gap: 9px; padding: 9px 4px;
  border-bottom: 1px solid var(--border); font-size: 12.5px;
}
.wallet-txn:last-child { border-bottom: none; }
.wallet-txn-reason { flex: 1; min-width: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-txn-time { flex: none; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.wallet-txn-delta { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.wallet-txn-delta.in { color: #22a86e; }
.wallet-txn-delta.out { color: #e0574f; }
.wallet-empty { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 24px 0; }

/* 网页版：商城保留，鸽币保留（手机也能签到） */
body.web-lite .shop { display: block !important; }

/* ═══════════════════════════════════════════════════════
   宠物
   ═══════════════════════════════════════════════════════ */
.pet { max-width: 900px; }
.pet-loading { text-align: center; color: var(--text-3); padding: 48px 0; }
.pet-wrap { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }

.pet-stage {
  flex: 0 0 296px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 18px; border: 1px solid var(--border); border-radius: 20px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(124,92,255,.10), transparent 60%),
    var(--card);
}
.pet-avatar { width: 200px; height: 210px; position: relative; cursor: pointer; }
.pet-canvas { width: 100%; height: 100%; display: block; }
.pet-avatar.pop { animation: petPop .7s cubic-bezier(.34,1.56,.64,1); }
@keyframes petPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.14) rotate(-3deg); }
  70% { transform: scale(.96) rotate(2deg); }
  100% { transform: scale(1); }
}

.pet-meta { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.pet-name {
  border: 1px dashed transparent; background: none; font: inherit; font-size: 16.5px; font-weight: 700;
  color: var(--text); text-align: center; width: 132px; padding: 3px 6px; border-radius: 8px;
}
.pet-name:hover { border-color: var(--border-strong); }
.pet-name:focus { outline: none; border-color: var(--primary); background: var(--bg); }
.pet-lv {
  font-size: 11.5px; font-weight: 700; color: #b58200; white-space: nowrap;
  background: rgba(240,180,41,.16); padding: 3px 9px; border-radius: 999px;
}

.pet-bar { width: 100%; height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.pet-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#ff9dbb,#f4588f); transition: width .35s cubic-bezier(.22,1,.36,1); }
.pet-bar-txt { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.pet-feed {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 2px;
  border: none; background: linear-gradient(135deg,#ff8fb0,#f4588f); color: #fff;
  font-size: 13px; font-weight: 600; padding: 9px 20px; border-radius: 999px; cursor: pointer;
  transition: transform .16s, box-shadow .16s;
}
.pet-feed .ico { width: 15px; height: 15px; }
.pet-feed:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(244,88,143,.35); }
.pet-feed:active { transform: scale(.96); }
.pet-hint { font-size: 11px; color: var(--text-3); }

.pet-tagline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pet-lvtitle {
  font-size: 12px; font-weight: 600; color: #7c5cff;
  background: rgba(124,92,255,.12); padding: 3px 10px; border-radius: 999px;
}
.pet-mood { font-size: 12px; color: var(--text-2); background: var(--bg); padding: 3px 10px; border-radius: 999px; }
.pet-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pet-pat {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 2px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 13px; font-weight: 600; padding: 8px 18px; border-radius: 999px; cursor: pointer;
  transition: transform .16s, border-color .16s, color .16s;
}
.pet-pat .ico { width: 15px; height: 15px; }
.pet-pat:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.pet-pat:active { transform: scale(.96); }
.pet-pat:disabled { opacity: .5; cursor: default; }
.pet-bubble {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  background: #2f3540; color: #fff; font-size: 12px; padding: 6px 12px; border-radius: 12px;
  white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.18); pointer-events: none;
  animation: petBubbleIn .18s ease-out;
}
.pet-bubble.hide { display: none; }
@keyframes petBubbleIn { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.pet-worn { font-size: 11.5px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
body.dark .pet-lvtitle { background: rgba(124,92,255,.22); color: #c3b4ff; }
body.dark .pet-mood { background: #262a31; }

.pet-panel { flex: 1; min-width: 264px; }
.pet-slots { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pet-slot {
  border: 1px solid var(--border); background: var(--card); color: var(--text-2);
  font-size: 12.5px; padding: 6px 15px; border-radius: 999px; cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
}
.pet-slot:hover { border-color: var(--border-strong); }
.pet-slot.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

.pet-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 10px; }
.pet-opt {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--card); color: var(--text-2);
  font-size: 12.5px; padding: 11px 8px; border-radius: 12px; cursor: pointer;
  transition: border-color .16s, background .16s, color .16s, transform .16s;
}
.pet-opt:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.pet-opt.on {
  border-color: var(--primary); color: var(--primary); font-weight: 600;
  background: color-mix(in srgb, var(--primary) 10%, var(--card));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 16%, transparent);
}
.pet-sw { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); flex: none; }
.pet-owned { margin-top: 16px; font-size: 11.5px; color: var(--text-3); }

body.dark .pet-stage { background: radial-gradient(120% 80% at 50% 0%, rgba(124,92,255,.16), transparent 60%), var(--card); }
body.dark .pet-lv { color: #f0c65a; background: rgba(240,180,41,.18); }

/* ═══════════════ 好友与私聊 ═══════════════ */

.fr-wrap { display: flex; gap: 18px; align-items: stretch; height: calc(100vh - 190px); min-height: 420px; }

.fr-side {
  flex: 0 0 292px; display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 12px; overflow-y: auto;
}
.fr-find { display: flex; gap: 6px; }
.fr-find input {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 9px;
  padding: 7px 10px; font: inherit; font-size: 13px; background: var(--bg); color: var(--text);
}
.fr-find input:focus { outline: none; border-color: var(--primary); background: var(--card); }

.fr-mini {
  border: 1px solid var(--border-strong); background: var(--card); color: var(--text-2);
  font: inherit; font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 8px;
  cursor: pointer; white-space: nowrap; transition: background .14s, color .14s, border-color .14s;
}
.fr-mini:hover { border-color: var(--primary); color: var(--primary); }
.fr-mini.ok { background: var(--primary); border-color: var(--primary); color: #fff; }
.fr-mini.ok:hover { background: var(--primary-dark); color: #fff; }
.fr-mini:disabled { opacity: .45; cursor: default; }
.fr-mini:disabled:hover { border-color: var(--border-strong); color: var(--text-2); }

.fr-sec { font-size: 11.5px; font-weight: 700; color: var(--text-3); padding: 8px 2px 2px; letter-spacing: .3px; }
.fr-found-t { font-size: 11.5px; color: var(--text-3); padding: 6px 2px; }
.fr-found-t.dim { opacity: .7; }

.fr-req {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--bg);
}
.fr-req.dim { opacity: .66; }
.fr-req-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fr-req-t b { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-req-t span { font-size: 11px; color: var(--text-3); }

.fr-list { display: flex; flex-direction: column; gap: 4px; }
.fr-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 11px;
  cursor: pointer; border: 1px solid transparent; transition: background .14s, border-color .14s;
}
.fr-item:hover { background: var(--bg); }
.fr-item.on { background: rgba(47,111,237,.09); border-color: rgba(47,111,237,.3); }
.fr-i-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fr-i-top { display: flex; align-items: center; gap: 6px; }
.fr-i-top b { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-last { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-last.dim { color: var(--text-3); opacity: .8; }
.fr-unread {
  font-style: normal; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--danger);
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}
.fr-intim {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700;
  color: #e2568b; font-variant-numeric: tabular-nums;
}
.fr-intim .ico { width: 13px; height: 13px; }
.fr-tag { font-size: 11px; color: var(--text-3); padding: 5px 9px; }

.fr-av { border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.fr-av-txt {
  display: inline-flex; align-items: center; justify-content: center; font-style: normal;
  font-weight: 700; color: #fff; background: linear-gradient(135deg,#7fb3ff,#5a93e8);
}
.fr-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 26px 8px; line-height: 1.9; }
.fr-empty span { font-size: 11.5px; opacity: .8; }

/* 右侧会话 */
.fr-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
.fr-main:empty::after {
  content: '从左边选一个好友开始聊天'; display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-3); font-size: 13px;
}
.dm-head {
  display: flex; align-items: center; gap: 11px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.dm-h-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dm-h-t b { font-size: 15px; font-weight: 700; color: var(--text); }
.dm-h-t span { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: #e2568b; font-weight: 600; }
.dm-h-t span .ico { width: 12px; height: 12px; }
.dm-visit { display: flex; align-items: center; gap: 6px; }
.dm-pet-lv {
  font-size: 11.5px; font-weight: 700; color: #b58200; background: rgba(240,180,41,.16);
  padding: 4px 9px; border-radius: 999px;
}

.dm-body { flex: 1; min-height: 0; display: flex; }
.dm-petcard {
  flex: 0 0 176px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; border-right: 1px solid var(--border); padding: 14px;
  background: radial-gradient(120% 70% at 50% 10%, rgba(124,92,255,.10), transparent 62%);
}
.dm-petcard svg { width: 132px; height: 140px; }
.dm-pet-name { font-size: 12.5px; font-weight: 600; color: var(--text-2); }

.dm-msgs { flex: 1; min-width: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.dm-empty { color: var(--text-3); font-size: 12.5px; text-align: center; margin: auto; }
.dm-b {
  max-width: 74%; align-self: flex-start; padding: 8px 12px; border-radius: 13px;
  background: var(--bg); color: var(--text); font-size: 13.5px; line-height: 1.55;
  word-break: break-word; white-space: pre-wrap;
}
.dm-b.mine { align-self: flex-end; background: var(--primary); color: #fff; }
.dm-b.pet {
  align-self: center; max-width: 88%; background: rgba(240,180,41,.13); color: #8a6100;
  font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 5px 13px;
}
.dm-b.pet .ico { width: 13px; height: 13px; }

.dm-send { display: flex; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--border); flex: 0 0 auto; }
.dm-send input {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; font: inherit; font-size: 13.5px; background: var(--bg); color: var(--text);
}
.dm-send input:focus { outline: none; border-color: var(--primary); background: var(--card); }

body.dark .fr-side, body.dark .fr-main { background: var(--card); }
body.dark .fr-req { background: rgba(255,255,255,.04); }
body.dark .fr-item:hover { background: rgba(255,255,255,.055); }
body.dark .fr-item.on { background: rgba(47,111,237,.16); }
body.dark .dm-b { background: rgba(255,255,255,.07); }
body.dark .dm-b.mine { background: var(--primary); }
body.dark .dm-b.pet { background: rgba(240,180,41,.16); color: #e8b53f; }
:root {
  --primary: #2f6fed;
  --primary-dark: #2559c9;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --border: #e5e6eb;
  --border-strong: #c9cdd4;
  --bg: #f7f8fa;
  --card: #fff;
  --danger: #e34d59;
  --ok: #00a870;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* 标题栏 */
.titlebar {
  height: 44px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px 0 84px; /* 让开 macOS 红绿灯 */
  background: var(--card);
  border-bottom: 1px solid var(--border);
  -webkit-app-region: drag;
  user-select: none;
}
.tb-left { display: flex; align-items: center; gap: 10px; }
.brand { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.brand img { display: block; border-radius: 5px; }
.brand span { color: var(--primary); }
.ver { font-size: 11px; color: var(--text-3); }
.tb-right { display: flex; gap: 6px; align-items: center; -webkit-app-region: no-drag; }
.tb-btn {
  padding: 5px 12px; font-size: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 5px; cursor: pointer; color: var(--text-2);
}
.tb-btn:hover { border-color: var(--primary); color: var(--primary); }
.conn { width: 8px; height: 8px; border-radius: 50%; background: #c9cdd4; margin-right: 4px; }
.conn.on { background: var(--ok); }
.conn.off { background: var(--danger); }

.view { height: calc(100% - 44px); }
.view[hidden], [hidden] { display: none !important; }

/* 登录页：整屏只有登录卡，不显示标题栏/设置/搜索/退出 */
body.login-mode .titlebar { display: none; }
body.login-mode .view { height: 100%; }
/* 标题栏没了，窗口还得能拖：登录页背景可拖，卡片本身不拖 */
body.login-mode #viewLogin { -webkit-app-region: drag; }
body.login-mode .login-card { -webkit-app-region: no-drag; }
/* 登录页也不要专注计时钮/悬浮条（登录态残留时也会藏）*/
body.login-mode .focus-fab, body.login-mode .focus-bar { display: none !important; }
#viewMain[hidden] { display: none !important; }

/* 登录 */
#viewLogin { display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 360px; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 32px 28px;
}
.login-card h1 { text-align: center; font-size: 26px; font-weight: 600; letter-spacing: .5px; }
.login-card h1 span { color: var(--primary); }
.login-card .sub { text-align: center; color: var(--text-3); font-size: 13px; margin: 6px 0 22px; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  flex: 1; text-align: center; padding: 10px 0; cursor: pointer;
  font-size: 14px; color: var(--text-3); border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.code-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.code-row input { flex: 1; }
.code-row .code-send { flex: none; white-space: nowrap; }
.code-row.hide { display: none !important; }
.login-links { text-align: right; margin-top: 10px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; outline: none; font-family: inherit;
  color: var(--text); background: var(--card);
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
.login-card input { margin-bottom: 12px; }
button.primary {
  width: 100%; padding: 11px; background: var(--primary); color: #fff;
  border: none; border-radius: 6px; font-size: 14px; cursor: pointer;
}
button.primary:hover { background: var(--primary-dark); }
button.primary:disabled { opacity: .5; cursor: not-allowed; }
button.primary.sm { width: auto; padding: 9px 22px; }
button.ghost {
  padding: 10px 14px; background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text-2); white-space: nowrap;
}
button.ghost:hover { border-color: var(--primary); color: var(--primary); }
.msg { font-size: 13px; min-height: 18px; margin-top: 10px; text-align: center; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }
.server-line {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px;
}
.server-line input { flex: 1; padding: 6px 8px; font-size: 12px; }
button.link {
  background: none; border: none; color: var(--primary); cursor: pointer; font-size: 12px;
  text-decoration: none;
}
.danger-link { color: var(--danger); padding: 0; margin-top: 4px; }

/* 主界面 */
#viewMain { display: flex; }
.sidebar {
  width: 190px; background: var(--card); border-right: 1px solid var(--border);
  padding: 16px 10px; display: flex; flex-direction: column;
}
.side-user { font-size: 13px; color: var(--text-2); padding: 6px 10px 14px; word-break: break-all; }
.side-nav { flex: 1; }
.side-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 10px; border-radius: 6px; font-size: 13px; color: var(--text-2);
  cursor: pointer; margin-bottom: 2px;
}
.side-item:hover { background: var(--bg); }
.side-item.active { background: #e8f1ff; color: var(--primary); font-weight: 500; }
.side-item b { font-weight: 400; color: var(--text-3); font-size: 12px; }
.side-item.active b { color: var(--primary); }
.side-stat { font-size: 12px; color: var(--text-3); padding: 10px; border-top: 1px solid var(--border); }
.side-refresh {
  margin-top: 8px; padding: 8px; background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; font-size: 12px; cursor: pointer; color: var(--text-2);
}
.side-refresh:hover { border-color: var(--primary); color: var(--primary); }

.content { flex: 1; padding: 18px 22px; overflow-y: auto; }
.composer { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 16px; }
.composer textarea { min-height: 74px; resize: vertical; border: 1px solid var(--border); line-height: 1.6; }
.composer-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.hint { font-size: 12px; color: var(--text-3); }

.task {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; margin-bottom: 10px;
}
.task:hover { border-color: #c9cdd4; }
.task.done .task-title { color: var(--text-3); text-decoration: line-through; }
.task-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.task-title { font-size: 15px; font-weight: 500; line-height: 1.5; flex: 1; word-break: break-word; }
.tag { padding: 2px 8px; border-radius: 4px; font-size: 12px; background: var(--bg); color: var(--text-2); white-space: nowrap; }
.tag-study { background:#e8f3ff; color:#1d6fd6; }
.tag-work { background:#f0eaff; color:#7048c4; }
.tag-life { background:#e6f7f0; color:#00915c; }
.tag-finance { background:#fff3e0; color:#c47b0a; }
.tag-social { background:#ffeef0; color:#d6455c; }
.task-meta { display: flex; gap: 10px; align-items: center; margin-top: 9px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.task-meta .urgent { color: var(--danger); font-weight: 500; }
.task-desc { margin-top: 8px; font-size: 13px; color: var(--text-2); line-height: 1.6; word-break: break-word; }
.task-actions { display: flex; gap: 14px; margin-top: 11px; }
.task-actions button { background: none; border: none; font-size: 13px; color: var(--text-2); cursor: pointer; padding: 0; }
.task-actions button:hover { color: var(--primary); }
.task-actions button.del:hover { color: var(--danger); }
.empty { text-align: center; color: var(--text-3); font-size: 14px; padding: 60px 20px; }

/* 遮罩 / 抽屉 */
.mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 90; }
.mask.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; width: 380px; max-width: 90vw; height: 100%;
  background: var(--card); box-shadow: -4px 0 18px rgba(0,0,0,.08);
  padding: 24px; overflow-y: auto; z-index: 100;
  transform: translateX(100%); transition: transform .2s ease;
}
.drawer.open { transform: translateX(0); }
.drawer h2 { font-size: 17px; margin-bottom: 8px; }
.drawer label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
.drawer .row { display: flex; gap: 8px; }
.drawer .row input { flex: 1; }
.drawer button.primary { margin-top: 20px; }
.dim { color: var(--text-3); font-size: 12px; }
.about { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.drawer-close { position: absolute; top: 18px; right: 18px; background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-3); }
.sec-title { font-size: 13px; font-weight: 600; color: var(--text); margin: 22px 0 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.sec-desc { font-size: 12px; color: var(--text-3); line-height: 1.6; margin-bottom: 4px; }
.key-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.hint-line { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }

/* 编辑弹窗 */
.modal {
  display: none; position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 420px; max-width: 90vw; max-height: 86vh; overflow-y: auto;
  background: var(--card); border-radius: 10px; padding: 24px; z-index: 110;
  box-shadow: 0 12px 40px rgba(0,0,0,.16);
}
.modal.open { display: block; }
.modal h2 { font-size: 17px; margin-bottom: 8px; }
.modal label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
.modal textarea { resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* 轻提示 */
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1f2329; color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.2); opacity: 0;
  transform: translateY(8px); transition: opacity .2s, transform .2s; max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ================= 自绘图标 ================= */
.ico { width: 15px; height: 15px; flex: 0 0 auto; vertical-align: -2px; }
.tb-btn { display: inline-flex; align-items: center; gap: 5px; }
.tb-btn.accent { color: var(--primary); border-color: #cfe0ff; background: #f5f9ff; }
.tb-btn.accent:hover { background: #e8f1ff; }
.side-item { gap: 8px; justify-content: flex-start; }
.side-item .ico { color: var(--text-3); }
.side-item.active .ico { color: var(--primary); }
.side-item b { margin-left: auto; }
.side-refresh { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
.nest-btn { display: inline-flex; }

/* 侧栏用户（头像 + 名字） */
.side-user { display: flex; align-items: center; gap: 9px; font-weight: 500; color: var(--text); }
.su-av {
  width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex: 0 0 28px;
  background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.su-av img { width: 100%; height: 100%; object-fit: cover; }
.su-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= 筛选栏 ================= */
.filterbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip {
  font-size: 12px; padding: 3px 10px; border-radius: 20px; cursor: pointer;
  background: var(--bg); color: var(--text-2); border: 1px solid transparent; transition: .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); color: #fff; }
.cat-filter { width: auto; padding: 6px 10px; font-size: 12px; }
.task-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.task-actions button { display: inline-flex; align-items: center; gap: 4px; }
.task-actions button .ico { width: 14px; height: 14px; }

/* ================= 日历 ================= */
.calendar { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-title { font-size: 15px; font-weight: 600; flex: 1; text-align: center; }
.cal-head .ghost.sm { padding: 3px 12px; font-size: 15px; line-height: 1; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-week span { text-align: center; font-size: 11.5px; color: var(--text-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  min-height: 84px; border: 1px solid var(--border); border-radius: 8px; padding: 6px;
  background: var(--card); overflow: hidden;
}
.cal-cell.out { border: none; background: transparent; }
.cal-cell.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-cell.has { background: #fcfdff; }
.cal-day { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.cal-cell.today .cal-day { color: var(--primary); font-weight: 600; }
.cal-ev {
  font-size: 11px; padding: 2px 6px; border-radius: 5px; margin-bottom: 3px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-ev:hover { filter: brightness(.94); }
.cal-ev.u-calm { background: #eef3fe; color: #2f6fed; }
.cal-ev.u-near { background: #fdf3e2; color: #b9770f; }
.cal-ev.u-hot  { background: #feecee; color: #c93a45; }
.cal-ev.u-lost { background: #f1f2f5; color: #737a85; }
.cal-ev.u-home { background: #e9f7f1; color: #00805a; text-decoration: line-through; }
.cal-more { font-size: 10.5px; color: var(--text-3); padding-left: 6px; }

/* ================= AI 整理 ================= */
.tidy-modal { width: 560px; }
.tidy-list { max-height: 52vh; overflow-y: auto; margin-top: 6px; }
.tidy-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.tidy-task { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.tidy-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-top: 5px; flex-wrap: wrap; }
.tidy-row .k { color: var(--text-3); width: 44px; flex: 0 0 44px; }
.tidy-old { color: var(--text-3); text-decoration: line-through; }
.tidy-new { color: var(--ok); font-weight: 500; }
.tidy-row .→ { color: var(--text-3); }
.tidy-sum { flex: 1; font-size: 12px; color: var(--text-3); text-align: left; }

/* ================= AI 助手对话 ================= */
.ai-drawer { width: 420px; display: flex; flex-direction: column; padding-bottom: 16px; }
.ai-drawer h2 { display: flex; align-items: center; gap: 7px; }
.chat-log { flex: 1; overflow-y: auto; margin: 14px 0 10px; display: flex; flex-direction: column; gap: 10px; }
.chat-hint { font-size: 12px; color: var(--text-3); text-align: center; padding: 24px 10px; line-height: 1.7; margin: auto; }
.bubble {
  max-width: 86%; padding: 10px 13px; border-radius: 12px; font-size: 13.5px;
  line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.bubble.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.bubble.ai { align-self: flex-start; background: var(--bg); color: var(--text); border-bottom-left-radius: 4px; }
.bubble.ai.err { background: #feecee; color: var(--danger); }
.bubble.ai.pending { color: var(--text-3); }
.bubble.sys { align-self: center; background: #e9f7f1; color: var(--ok); font-size: 12px; padding: 5px 12px; border-radius: 20px; }
.chat-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chat-quick button {
  font-size: 12px; padding: 5px 10px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--text-2);
}
.chat-quick button:hover { border-color: var(--primary); color: var(--primary); }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; min-height: 44px; }
.chat-input button.primary { width: auto; padding: 10px 18px; }

/* ================= 个人资料 ================= */
.profile { display: flex; gap: 14px; margin-top: 16px; }
.avatar {
  position: relative; width: 72px; height: 72px; border-radius: 50%; flex: 0 0 72px;
  overflow: hidden; cursor: pointer; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback { font-size: 28px; font-weight: 600; color: var(--primary); }
.avatar-edit {
  position: absolute; right: 0; bottom: 0; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(31,35,41,.72); color: #fff; display: flex; align-items: center; justify-content: center;
}
.avatar-edit .ico { width: 13px; height: 13px; }
.profile-fields { flex: 1; min-width: 0; }
.profile-fields label { margin-top: 0; }
.avatar-actions { display: flex; gap: 12px; margin-top: 8px; }

/* ---------- 邮箱区块 ---------- */
.hide { display: none !important; }
.mail-box {
  background: var(--bg, #f7f8fa); border: 1px solid var(--border);
  border-radius: 9px; padding: 12px 13px; margin-top: 2px;
}
.mail-row { display: flex; align-items: center; gap: 8px; }
.mail-addr { font-size: 13.5px; color: var(--text); word-break: break-all; flex: 1; }
.mail-badge { flex: none; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 9px; }
.mail-badge.ok { color: #0b8f5c; background: #e6f7f0; }
.mail-badge.warn { color: #b58200; background: rgba(240,180,41,.16); }
.mail-pending { font-size: 12px; color: #b58200; line-height: 1.6; margin-top: 6px; }
.mail-actions { display: flex; gap: 14px; margin-top: 8px; }
.mail-form { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.mail-form input { width: 100%; }
.mail-form .row { margin-top: 8px; }
.mail-form button.primary { margin-top: 0; }
.mail-form .msg { text-align: left; margin-top: 6px; }

/* ---------- 内置小邮箱（收件箱） ---------- */
.inbox-modal { width: 560px; padding: 0; overflow: hidden; }
.inbox-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.inbox-head h2 { font-size: 16px; margin: 0; }
.inbox-head .inbox-count {
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: rgba(47,111,237,.12); border-radius: 999px; padding: 2px 8px;
}
.inbox-head .inbox-readall { margin-left: auto; font-size: 12px; }
.inbox-body { max-height: 62vh; overflow-y: auto; }
.inbox-empty { text-align: center; color: var(--text-3); padding: 54px 20px; font-size: 13px; }
.inbox-item {
  display: flex; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.inbox-item:last-child { border-bottom: 0; }
.inbox-dot {
  flex: none; width: 7px; height: 7px; border-radius: 50%; margin-top: 6px;
  background: var(--primary);
}
.inbox-item.read .inbox-dot { background: transparent; }
.inbox-main { flex: 1; min-width: 0; }
.inbox-title {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.inbox-item.read .inbox-title { font-weight: 500; color: var(--text-2); }
.inbox-when { margin-left: auto; font-size: 11px; color: var(--text-3); font-weight: 400; white-space: nowrap; }
.inbox-text {
  font-size: 13px; color: var(--text-2); line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; margin-top: 3px;
}
.inbox-gift {
  margin-top: 9px; padding: 8px 11px; border-radius: 8px;
  background: rgba(47,111,237,.07); border: 1px dashed rgba(47,111,237,.4);
  display: flex; align-items: center; gap: 10px;
}
.inbox-gift code {
  font-family: ui-monospace, Menlo, monospace; font-size: 15px;
  letter-spacing: 2px; font-weight: 700; color: var(--primary);
}
.inbox-gift .gift-use { margin-left: auto; font-size: 12px; }
.mb-badge {
  position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px;
  padding: 0 4px; border-radius: 999px; background: #e34d59; color: #fff;
  font-size: 10px; line-height: 15px; text-align: center; font-weight: 700;
}
.tb-btn.only-ico { position: relative; }
body.dark .inbox-head { border-color: var(--border); }
body.dark .inbox-item { border-color: var(--border); }
body.dark .inbox-gift { background: rgba(76,141,255,.14); }

/* ---------- 应用内更新 ---------- */
.upd-modal { width: 440px; }
.upd-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--text-2); padding: 7px 0; }
.upd-row b { color: var(--text); font-weight: 600; }
.upd-row b.upd-new { color: var(--primary); }
.upd-note { font-size: 12.5px; color: var(--text-3); line-height: 1.7; margin: 10px 0 4px; }
.upd-bar { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; margin: 12px 0 2px; }
.upd-fill { height: 100%; width: 0; background: var(--primary); transition: width .18s ease; }
.drawer-update { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.drawer-update .upd-state { font-size: 12.5px; color: var(--text-3); }

/* 鸽巢卡片复用的小标签 */
.cd { font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.cd-calm { background: #eef3fe; color: #2f6fed; }
.cd-near { background: #fdf3e2; color: #b9770f; }
.cd-hot  { background: #feecee; color: #c93a45; }
.cd-lost { background: var(--bg); color: #737a85; }
.cd-home { background: #e9f7f1; color: #00805a; }
.cat { background: var(--bg); padding: 2px 7px; border-radius: 6px; }

.side-tip {
  font-size: 11px; color: var(--text-3); line-height: 1.6; margin-top: 10px;
  padding: 9px 10px; background: var(--bg); border-radius: 8px;
}
.side-tip b { color: var(--text-2); font-weight: 600; }

/* ================= 鸽巢（弹层） ================= */
.nest-btn { margin-top: 8px; }
.nest-modal { width: 760px; max-width: 94vw; max-height: 84vh; overflow-y: auto; }
.nest-head { display: flex; justify-content: space-between; align-items: center; }
.nest-head h2 { margin: 0; }
.nest-x { border: none; background: none; font-size: 16px; color: var(--text-3); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.nest-x:hover { background: var(--bg); color: var(--text); }
.nest-desc { font-size: 12.5px; color: var(--text-3); margin: 6px 0 10px; }
.nest-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); margin-bottom: 14px; }
.nest-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.lg-calm { background: #2f6fed; }
.lg-near { background: #d98a12; }
.lg-hot  { background: #e34d59; }
.lg-lost { background: #9aa0aa; }
.lg-home { background: #00a870; }

.nest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.ncard {
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px 10px;
  cursor: pointer; transition: .15s; background: var(--card);
}
.ncard:hover { border-color: #cfd6e4; box-shadow: 0 6px 16px rgba(31,35,41,.07); transform: translateY(-1px); }
.ncard-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.ndove { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.ndove svg { width: 19px; height: 19px; }
.ncard-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; margin-bottom: 5px; }
.ncard-letter { font-size: 11.5px; color: var(--text-3); line-height: 1.5; margin-bottom: 7px; }
.ncard-foot { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); flex-wrap: wrap; }

.u-calm .ndove { background: #eef3fe; color: #2f6fed; }
.u-near .ndove { background: #fdf3e2; color: #d98a12; }
.u-hot  .ndove { background: #feecee; color: #e34d59; }
.u-lost .ndove { background: #f1f2f5; color: #9aa0aa; }
.u-home .ndove { background: #e9f7f1; color: #00a870; }
.u-hot { border-color: #f7ccd1; }
.u-lost { border-style: dashed; }
.u-home .ncard-title { color: var(--text-3); text-decoration: line-through; }

.u-near .ndove svg { animation: doveNod 1.7s ease-in-out infinite; }
.u-hot  .ndove svg { animation: doveNod .7s ease-in-out infinite; }
@keyframes doveNod { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-3px) rotate(5deg); } }

/* ================= 今天 / 接下来 ================= */
.td-hero { margin-bottom: 18px; }
.td-hello { font-size: 22px; font-weight: 650; letter-spacing: -.3px; }
.td-date { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.td-sum {
  font-size: 13px; color: var(--text-2); background: var(--card, #fff);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 18px;
}
.td-sum b { font-weight: 600; }
.td-sum .td-lost { color: #e34d59; }
.td-sum .td-hot { color: #d98a12; }

.td-clear {
  display: flex; align-items: center; gap: 12px;
  padding: 22px; border: 1px dashed var(--border); border-radius: 10px;
  color: var(--text-3); font-size: 14px; margin-bottom: 18px;
}
.td-clear .ico { width: 28px; height: 28px; color: var(--primary); opacity: .8; flex: none; }

.td-sec { margin-bottom: 22px; }
.td-sec-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px;
}
.td-sec-head .ico { width: 15px; height: 15px; }
.td-sec.overdue .td-sec-head { color: #e34d59; }
.td-sec.done-sec .td-sec-head { color: #00a870; }
.td-count {
  font-weight: 500; font-size: 12px; color: var(--text-3);
  background: #f1f2f5; border-radius: 9px; padding: 1px 7px;
}
.td-sec.done-sec .task { opacity: .62; }

/* 接下来 */
.up-sec { margin-bottom: 26px; }
.up-day { margin-bottom: 14px; }
.up-day-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.up-day-num { font-size: 13px; font-weight: 600; }
.up-day-wd { font-size: 12px; color: var(--text-3); }

/* ================= AI 助手：模型选择 ================= */
.chat-model-row {
  display: flex; align-items: center; gap: 8px; margin: 10px 0 12px;
}
.chat-model-row label { font-size: 12px; color: var(--text-3); flex: none; }
.chat-model-row select {
  flex: 1; min-width: 0; font-size: 12px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--card, #fff); color: var(--text);
}
.chat-model-row .dim { font-size: 11px; flex: none; }

/* ================= AI 助手：侧栏大入口 ================= */
.ai-entry {
  position: relative; overflow: hidden; width: 100%;
  flex: none; min-height: 56px;
  display: flex; align-items: center; gap: 11px; text-align: left;
  margin: 12px 0 14px; padding: 9px 10px;
  border: none; border-radius: 8px; cursor: pointer;
  background: none;
  color: var(--text); font: inherit;
  transition: background .15s;
}
.ai-entry:hover { background: var(--bg); }
.ai-entry:active { transform: scale(.985); }

/* 扫光：鼠标悬停时从图标上掠过 */
.ai-entry-glow {
  position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.85), transparent);
  transform: skewX(-18deg); pointer-events: none; opacity: 0;
}
.ai-entry:hover .ai-entry-glow { animation: aiSheen .85s ease-out; }
@keyframes aiSheen {
  0% { left: -60%; opacity: 0; }
  15% { opacity: .9; }
  100% { left: 125%; opacity: 0; }
}

.ai-entry-ico {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4b8cff, #7a5cff);
  color: #fff; box-shadow: 0 3px 10px rgba(90,110,255,.32);
  transition: transform .3s cubic-bezier(.34,1.4,.64,1);
}
.ai-entry-ico .ico { width: 20px; height: 20px; }
.ai-entry:hover .ai-entry-ico { transform: rotate(-8deg) scale(1.08); }
/* 图标轻微呼吸，提示它是活的 */
.ai-entry-ico .ico { animation: aiBreath 3.4s ease-in-out infinite; }
@keyframes aiBreath {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .78; transform: scale(.92); }
}

.ai-entry-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-entry-text b { font-size: 14px; font-weight: 650; letter-spacing: -.1px; }
.ai-entry-text i {
  font-style: normal; font-size: 11.5px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-entry-go {
  flex: 0 0 auto; color: #7a95c9; display: flex;
  transition: transform .22s cubic-bezier(.34,1.3,.64,1);
}
.ai-entry-go .ico { width: 15px; height: 15px; }
.ai-entry:hover .ai-entry-go { transform: translateX(3px); color: var(--primary); }

/* 侧栏内边距与留白 */
.sidebar { padding-top: 10px; }
.side-user { padding: 6px 4px 2px; }

/* ================= 抽屉动画（更顺滑） ================= */
.mask { transition: opacity .24s ease; }
.mask.open { animation: maskIn .24s ease both; }
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  transition: transform .34s cubic-bezier(.22,1,.36,1), box-shadow .3s ease;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}
.drawer.open {
  transform: translateX(0);
  box-shadow: -12px 0 42px rgba(15,25,50,.14);
}

/* 抽屉里的内容依次淡入（用 --d 让每个元素错开） */
.drawer.open > * { animation: drawerItem .42s cubic-bezier(.22,1,.36,1) both; }
.drawer.open > *:nth-child(1) { animation-delay: .04s; }
.drawer.open > *:nth-child(2) { animation-delay: .07s; }
.drawer.open > *:nth-child(3) { animation-delay: .10s; }
.drawer.open > *:nth-child(4) { animation-delay: .13s; }
.drawer.open > *:nth-child(5) { animation-delay: .16s; }
.drawer.open > *:nth-child(n+6) { animation-delay: .19s; }
@keyframes drawerItem {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

/* AI 助手抽屉的头部：图标呼吸 + 标题 */
.ai-drawer h2 .ico { width: 17px; height: 17px; color: var(--primary); }
.ai-drawer.open h2 .ico { animation: aiBreath 3.4s ease-in-out infinite; }

/* 气泡入场 */
.bubble { animation: bubbleIn .28s cubic-bezier(.22,1,.36,1) both; }
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(7px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
/* 思考中的三点动画 */
.bubble.pending::after {
  content: ''; display: inline-block; width: 1em; text-align: left;
  animation: dots 1.1s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ''; } 25% { content: '·'; } 50% { content: '··'; } 75% { content: '···'; }
}

/* 侧栏统计：只有逾期才红 */
.side-stat .stat-lost { color: var(--danger); font-weight: 600; }
.side-stat .stat-week { color: var(--text-2); font-weight: 600; }

/* 尊重系统「减少动态效果」 */
@media (prefers-reduced-motion: reduce) {
  .ai-entry, .ai-entry-ico, .ai-entry-go, .drawer, .mask, .bubble, .drawer.open > * {
    transition: none !important; animation: none !important;
  }
}

/* 今天页头部右侧的「加一件事」 */
.td-hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.td-add {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 7px 13px; font-size: 12.5px; font: inherit; font-size: 12.5px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card);
  color: var(--text-2); cursor: pointer;
  transition: transform .16s cubic-bezier(.34,1.3,.64,1), border-color .16s, color .16s;
}
.td-add .ico { width: 14px; height: 14px; }
.td-add:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.td-add:active { transform: translateY(0) scale(.97); }

/* 「加一件事」按钮在待办页也常驻在粘贴框旁 */CSS
node --check app.js >/dev/null 2>&1 && echo "app.js OK"
cd /tmp/rt3
cp /Users/jiurige/PycharmProjects/biege-desktop/renderer/{index.html,app.js,style.css} .
~/PycharmProjects/biege/.venv/bin/python - <<'PY'
a=open('/tmp/rt3/index.html').read()
nt='<style>*{transition:none!important;animation:none!important}</style>'
a=a.replace('</head>', nt+'</head>')
inject='<script src="mock.js"></script>\n  <script src="app.js"></script>'
open('/tmp/rt3/t2.html','w').write(a.replace('<script src="app.js"></script>', inject+'\n  <script src="go_up.js"></script>'))
PY
CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
"$CHROME" --headless --disable-gpu --hide-scrollbars --window-size=1240,860 --virtual-time-budget=8000 --screenshot=/tmp/rt3/t2.png "http://localhost:8793/t2.html" 2>&1 | grep -i "bytes written"
cp /tmp/rt3/t2.png ~/.openclaw/workspace-aliyun-ai/shots/
/* ================= AI 对话：在左侧栏内展开 ================= */
.sidebar { width: 190px; transition: width .34s cubic-bezier(.22,1,.36,1); }
/* 窗口变矮 / 页面缩小时：整栏可滚动，绝不允许把子项压扁。
   （.ai-entry 因 overflow:hidden 的 min-height 为 0，若不锁 flex-shrink
   会被挤成十几像素，文字被裁掉 —— 这就是「缩小就坏」的根因。） */
.side-main {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
}
.side-main > * { flex-shrink: 0; }
.sidebar.ai-mode { width: 330px; }

/* 切到 AI 模式时，普通导航收起、对话面板出现 */
.sidebar.ai-mode .side-main { display: none; }

.ai-panel {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  animation: aiPanelIn .34s cubic-bezier(.22,1,.36,1) both;
}
@keyframes aiPanelIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
.ai-panel[hidden] { display: none !important; }

.ai-panel-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.ai-panel-head h2 {
  flex: 1; display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 650; margin: 0;
}
.ai-panel-head h2 .ico { width: 16px; height: 16px; color: var(--primary); }
.ai-panel-head h2 .ico { animation: aiBreath 3.4s ease-in-out infinite; }
.ai-back, .ai-close {
  flex: none; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 6px; background: none;
  color: var(--text-3); cursor: pointer; padding: 0;
  transition: background .15s, color .15s, transform .15s;
}
.ai-back .ico, .ai-close .ico { width: 14px; height: 14px; }
.ai-back:hover, .ai-close:hover { background: var(--bg); color: var(--text); }
.ai-back:active, .ai-close:active { transform: scale(.92); }

/* 面板内的聊天区（窄栏适配） */
.ai-panel .chat-model-row { margin: 0 0 10px; }
.ai-panel .chat-model-row select { font-size: 12px; }
.ai-panel .chat-log { margin: 0 0 10px; }
.ai-panel .chat-hint { padding: 16px 6px; white-space: pre-line; }
.ai-panel .bubble { max-width: 92%; font-size: 12.5px; padding: 8px 11px; }
.ai-panel .chat-quick { margin-bottom: 8px; }
.ai-panel .chat-quick button { font-size: 11.5px; padding: 4px 9px; }
.ai-panel .chat-input { gap: 6px; }
.ai-panel .chat-input textarea { font-size: 12.5px; min-height: 52px; }
.ai-panel .chat-input button.primary { padding: 8px 13px; font-size: 12.5px; }

/* 模型下拉：铺满整行，更像控件 */
.ai-panel .chat-model-row { display: block; }
.ai-panel .chat-model-row select {
  width: 100%; padding: 6px 8px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--card); color: var(--text-2);
  font-size: 12px; cursor: pointer;
}
.ai-panel .chat-model-row select:focus { border-color: var(--primary); outline: none; }
/* 输入框矮一点、圆润一点 */
.ai-panel .chat-input textarea {
  min-height: 46px; padding: 9px 11px; border-radius: 9px; resize: none;
}

/* ============ AI 的「手」 ============ */

/* 装上手开关 */
.hand-toggle {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 9px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line, #e3e6ec); background: var(--card);
  color: var(--text-3, #8a90a0); font-size: 12px; font-family: inherit;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.hand-toggle .ico { width: 14px; height: 14px; }
.hand-toggle:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.hand-toggle.on {
  background: linear-gradient(135deg, #34c98a, #22a86e);
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px rgba(34,168,110,.32);
}
.hand-toggle.on .ico { animation: handWave .5s ease; }
@keyframes handWave {
  0% { transform: rotate(0) } 30% { transform: rotate(-16deg) } 60% { transform: rotate(10deg) } 100% { transform: rotate(0) }
}

/* 执行确认卡 */
.bubble.tool-confirm {
  padding: 12px 13px; border: 1px solid #ffd9a8; background: var(--card)af1;
  border-radius: 12px; max-width: 100%;
}
.tool-confirm .tc-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #b06a10; font-weight: 600; margin-bottom: 7px;
}
.tool-confirm .tc-head .ico { width: 14px; height: 14px; }
.tool-confirm .tc-label { font-size: 13px; color: var(--text); line-height: 1.45; }
.tool-confirm .tc-warn {
  margin-top: 6px; font-size: 12px; color: #d9484f;
  background: #fdf0f1; border-radius: 6px; padding: 5px 9px;
}
.tool-confirm code {
  display: block; margin-top: 7px; padding: 7px 9px;
  background: #2c3038; color: #d9e2ef; border-radius: 7px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11.5px; line-height: 1.5; word-break: break-all;
  max-height: 110px; overflow-y: auto; white-space: pre-wrap;
}
.tool-confirm .tc-actions { display: flex; gap: 6px; margin-top: 10px; }
.tool-confirm .tc-actions button {
  flex: 1; padding: 6px 0; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-family: inherit; border: 1px solid transparent;
  transition: filter .15s, transform .12s;
}
.tool-confirm .tc-actions button:hover { filter: brightness(.95); transform: translateY(-1px); }
.tool-confirm .tc-ok { background: var(--primary); color: #fff; }
.tool-confirm .tc-always { background: #eef1f6; color: var(--text-2, #5c6373); }
.tool-confirm .tc-no { background: var(--card); color: var(--danger, #d9484f); border-color: #f0c4c7 !important; }
.tc-result { margin-top: 8px; font-size: 12px; font-weight: 600; }
.tc-result.yes { color: var(--ok, #22a86e); }
.tc-result.no { color: var(--danger, #d9484f); }

/* 截图气泡 */
.bubble.ai.shot { padding: 6px; background: var(--card); border: 1px solid var(--line, #e3e6ec); }
.bubble.ai.shot img { display: block; width: 100%; border-radius: 8px; }

/* 侧栏窄，确认卡按钮一行可能挤，允许换行 */
.ai-panel .tool-confirm .tc-actions { flex-wrap: wrap; }

/* ═══════════════ 深色模式 ═══════════════ */
body.dark {
  --primary: #4c8dff;
  --primary-dark: #3b78e0;
  --text: #e8eaed;
  --text-2: #a8aeb8;
  --text-3: #767c86;
  --border: #2c2f36;
  --border-strong: #40454f;
  --bg: #17191d;
  --card: #1f2228;
  --danger: #f0656f;
  --ok: #3ac48a;
}
body.dark .titlebar { background: #1b1e23; border-color: var(--border); }
body.dark .sidebar { background: #1b1e23; border-color: var(--border); }
body.dark .content { background: var(--bg); }
body.dark .task, body.dark .composer textarea, body.dark .modal,
body.dark .drawer, body.dark .search-panel, body.dark .nest-modal { background: var(--card); }
body.dark input, body.dark textarea, body.dark select {
  background: #23262c; color: var(--text); border-color: var(--border);
}
body.dark .task:hover { background: #252932; }
body.dark .toast { background: #2b2f37; }
body.dark .side-item:hover, body.dark .side-item.active { background: #252932; }
body.dark .cal-cell { background: #1f2228; border-color: var(--border); }
body.dark .cal-cell.out { background: #1a1c21; }

/* ═══════════════ 看板 ═══════════════ */
.board { padding: 16px 20px; overflow: auto; height: 100%; }
.board-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; min-height: 200px; }
.board-col {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; min-width: 0;
  transition: background .15s, border-color .15s;
}
.board-col.over { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--card)); }
.board-col-head {
  display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  color: var(--text-2); margin-bottom: 10px;
}
.board-col-head .bc-count {
  margin-left: auto; background: var(--bg); color: var(--text-3);
  border-radius: 9px; padding: 1px 7px; font-size: 11.5px; font-weight: 500;
}
.board-col-body { display: flex; flex-direction: column; gap: 8px; min-height: 40px; flex: 1; }
.board-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 11px; cursor: grab; transition: box-shadow .15s, transform .12s, opacity .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.board-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.09); transform: translateY(-1px); }
.board-card.dragging { opacity: .45; cursor: grabbing; }
.board-card .bct { font-size: 13px; line-height: 1.45; margin-bottom: 6px; }
.board-card .bcm { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; }
.board-card .bcm .late { color: var(--danger); }
.board-card .bcm .soon { color: #e08a2c; }
.board-empty { color: var(--text-3); font-size: 12.5px; text-align: center; padding: 18px 0; }

/* ═══════════════ 洞察 ═══════════════ */
.insights { padding: 16px 20px; overflow: auto; height: 100%; }
.ins-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.ins-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
}
.ins-card .ic-num { font-size: 25px; font-weight: 700; color: var(--text); line-height: 1.1; }
.ins-card .ic-label { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.ins-card.accent .ic-num { color: var(--primary); }
.ins-card.fire .ic-num { color: #e8722c; }
.ins-chart {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 15px; margin-bottom: 14px;
}
.ins-chart h3 { font-size: 13.5px; color: var(--text-2); font-weight: 600; margin-bottom: 12px; }
.ins-bars { display: flex; align-items: flex-end; gap: 5px; height: 110px; }
.ins-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.ins-bar {
  width: 100%; background: linear-gradient(180deg, #5b95f7, #2f6fed);
  border-radius: 4px 4px 2px 2px; min-height: 2px; transition: height .5s cubic-bezier(.22,1,.36,1);
}
.ins-bar.focus { background: linear-gradient(180deg, #ffb27a, #e8722c); }
.ins-bar-wrap .ib-label { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.ins-bar-wrap .ib-val { font-size: 10.5px; color: var(--text-2); font-weight: 600; }
.ins-cats { display: flex; flex-wrap: wrap; gap: 10px; }
.ins-cat {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px;
  background: var(--bg); border-radius: 8px; padding: 6px 11px;
}
.ins-cat i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ═══════════════ 专注计时 ═══════════════ */
.focus-fab { position: fixed; right: 22px; bottom: 22px; z-index: 60; }
.focus-fab-btn {
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #3d7bf7, #2f6fed); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(47,111,237,.36);
  transition: transform .15s, box-shadow .15s;
}
.focus-fab-btn:hover { transform: scale(1.07); box-shadow: 0 6px 18px rgba(47,111,237,.44); }
.focus-fab-btn .ico { width: 22px; height: 22px; }

.focus-bar {
  position: fixed; right: 22px; bottom: 22px; z-index: 61;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 11px 14px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 6px 22px rgba(0,0,0,.14); min-width: 250px;
}
.fb-left { display: flex; align-items: center; gap: 11px; }
.fb-ring { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.fb-ring svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.fb-ring .fb-track { fill: none; stroke: var(--border); stroke-width: 4; }
.fb-ring .fb-fill {
  fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 119.4; stroke-dashoffset: 0; transition: stroke-dashoffset .6s linear;
}
.fb-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fb-info b { font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.fb-info span, .fb-info #fbTask {
  font-size: 11.5px; color: var(--text-3); max-width: 150px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fb-actions { display: flex; gap: 6px; margin-left: auto; }
.fb-actions button {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.fb-actions button:hover { background: var(--border); }
.fb-actions .ico { width: 15px; height: 15px; }
.focus-bar.paused .fb-fill { stroke: #e08a2c; }

.focus-presets { display: flex; gap: 8px; margin: 4px 0 16px; }
.focus-presets button {
  flex: 1; padding: 9px 0; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-2); font-size: 13px; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.focus-presets button:hover { border-color: var(--primary); color: var(--primary); }
.focus-presets button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ═══════════════ 搜索面板 ═══════════════ */
.search-panel {
  position: fixed; top: 88px; left: 50%; transform: translateX(-50%) translateY(-8px) scale(.98);
  width: min(560px, 92vw); background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 16px 48px rgba(0,0,0,.2); z-index: 95;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  overflow: hidden;
}
.search-panel.open { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0) scale(1); }
.sp-input { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.sp-input .ico { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }
.sp-input input {
  flex: 1; border: none; outline: none; background: transparent; font-size: 15px;
  color: var(--text); font-family: inherit;
}
.sp-results { max-height: 340px; overflow-y: auto; padding: 6px; }
.sp-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px;
  cursor: pointer; transition: background .12s;
}
.sp-item:hover, .sp-item.sel { background: var(--bg); }
.sp-item .spi-main { flex: 1; min-width: 0; }
.sp-item .spi-title { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-item.done .spi-title { text-decoration: line-through; color: var(--text-3); }
.sp-item .spi-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.sp-item .spi-tag {
  font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--bg);
  color: var(--text-3); flex-shrink: 0;
}
.sp-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 26px 0; }
.sp-foot {
  padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11.5px;
  color: var(--text-3); display: flex; gap: 6px; align-items: center;
}
.sp-foot kbd {
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; font-family: inherit; font-size: 10.5px;
}

/* ═══════════════ 子任务 & 重复标记 ═══════════════ */
.sub-progress {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-3);
}
.sub-progress .sp-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.sub-progress .sp-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width .3s; }
.task-badges { display: flex; gap: 6px; align-items: center; }
.task-badges .tb {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px;
  color: var(--text-3); background: var(--bg); border-radius: 6px; padding: 2px 6px;
}
.task-badges .tb .ico { width: 11px; height: 11px; }

/* 顶部工具条：搜索按钮 + 深色切换 */
.tb-btn.only-ico { padding: 0 8px; }
.dark-toggle.on { color: var(--primary); }

/* 看板/洞察在网页版隐藏（桌面版独有） */
body.web-lite .board, body.web-lite .insights { display: none !important; }

/* ═══════════════ 子任务弹窗 ═══════════════ */
.sub-modal { width: 460px; max-width: 94vw; }
.sub-list { max-height: 300px; overflow-y: auto; margin: 6px 0 12px; }
.sub-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.sub-row.done .sub-title { text-decoration: line-through; color: var(--text-3); }
.sub-row .sub-check {
  width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid var(--border);
  background: transparent; cursor: pointer; color: transparent; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.sub-row .sub-check:hover { border-color: var(--primary); color: var(--primary); }
.sub-row.done .sub-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.sub-row .sub-check .ico { width: 13px; height: 13px; }
.sub-row .sub-title { flex: 1; font-size: 13.5px; min-width: 0; word-break: break-word; }
.sub-row .sub-del {
  border: none; background: transparent; cursor: pointer; color: var(--text-3);
  padding: 3px; border-radius: 6px; opacity: 0; transition: opacity .15s, color .15s;
}
.sub-row:hover .sub-del { opacity: 1; }
.sub-row .sub-del:hover { color: var(--danger); }
.sub-row .sub-del .ico { width: 14px; height: 14px; }
.sub-add { display: flex; gap: 8px; }
.sub-add input { flex: 1; }

/* 搜索定位后的高亮 */
.task.flash { animation: flashPulse 1.4s ease-out; }
@keyframes flashPulse {
  0% { box-shadow: 0 0 0 0 rgba(47,111,237,.5); }
  40% { box-shadow: 0 0 0 5px rgba(47,111,237,.16); }
  100% { box-shadow: 0 0 0 0 rgba(47,111,237,0); }
}
body.dark .modal.sub-modal { background: var(--card); }

/* ═══════════════ 深色模式：补齐写死浅色的元素 ═══════════════ */
body.dark .side-refresh,
body.dark .tb-btn,
body.dark .td-add,
body.dark .mail-box { background: #24282f; }
body.dark .mail-badge.ok { background: #1d3a2f; color: #5fd39c; }
body.dark .mail-badge.warn { background: #3a3320; color: #e0b34c; }
body.dark .ghost,
body.dark .cat-filter {
  background: #23262c; border-color: var(--border); color: var(--text-2);
}
body.dark .side-refresh:hover,
body.dark .tb-btn:hover,
body.dark .td-add:hover,
body.dark .ghost:hover { border-color: var(--primary); color: var(--primary); }

body.dark .side-tip,
body.dark .cat,
body.dark .chip,
body.dark .ins-cat,
body.dark .task-badges .tb {
  background: #262a31; color: var(--text-2);
}
body.dark .chip:hover { border-color: var(--primary); color: var(--primary); }
body.dark .chip.on { background: var(--primary); color: #fff; }

/* AI 入口在深色下也只是一行，不再有底色块 */
body.dark .ai-entry { background: none; }
body.dark .ai-entry b { color: #e8eaed; }
body.dark .ai-entry i { color: #9aa4b6; }

/* 聊天区 / 气泡 */
body.dark .ai-panel { background: #1b1e23; }
body.dark .chat-log { background: #1b1e23; }
body.dark .bubble.ai { background: #262a31; color: var(--text); }
body.dark .bubble.me { background: var(--primary); color: #fff; }
body.dark .chat-input textarea,
body.dark .chat-model-row select,
body.dark .hand-toggle { background: #23262c; border-color: var(--border); color: var(--text-2); }
body.dark .chat-hint { color: var(--text-3); }

/* 弹窗 / 抽屉 / 确认卡 */
body.dark .drawer, body.dark .modal, body.dark .nest-modal, body.dark .search-panel { background: var(--card); }
body.dark .tool-confirm { background: #2b2317; border-color: #4a3a20; }
body.dark .tool-confirm .tc-always { background: #2f343d; color: var(--text-2); }
body.dark .tool-confirm .tc-no { background: transparent; }
body.dark .tool-confirm .tc-warn { background: #3a2224; color: #f08a90; }

/* 今天视图 */
body.dark .td-hero { background: linear-gradient(160deg, #1f2733, #221f2e); }
body.dark .td-sec-head { color: var(--text-2); }
body.dark .td-clear { background: #1f2228; }

/* 日历 */
body.dark .cal-cell:hover { background: #252932; }
body.dark .cal-cell.today { background: #26314a; }
body.dark .cal-week span { color: var(--text-3); }

/* 空状态 / 分隔 */
body.dark .empty, body.dark .board-empty { color: var(--text-3); }
body.dark .cmp-note { background: #23262c; }

/* 深色模式：分类标签改用半透明深底 + 提亮文字，别再刺眼 */
body.dark .tag-study   { background: rgba(29,111,214,.20); color: #7fb4ff; }
body.dark .tag-work    { background: rgba(112,72,196,.22); color: #b79bff; }
body.dark .tag-life    { background: rgba(0,145,92,.20);  color: #5fd6a0; }
body.dark .tag-finance { background: rgba(196,123,10,.22); color: #f0b45c; }
body.dark .tag-social  { background: rgba(214,69,92,.20); color: #ff8fa1; }
body.dark .tag-other   { background: var(--bg); color: var(--text-2); }

/* 编辑弹窗里并排的下拉 */
.edit-row { display: flex; gap: 8px; }
.edit-row select { flex: 1; }
.edit-row input[type="number"] { width: 78px; flex: none; }

/* ═══════════════════════════════════════════════════════
   AI 面板翻新：把丑的地方一次性收拾干净
   - 输入框与发送键合成一体，不再"一高一矮"
   - 空状态换成小鸽头像 + 引导，不再一大片白
   - 模型下拉、快问按钮给足呼吸感
   ═══════════════════════════════════════════════════════ */
.sidebar.ai-mode { width: clamp(380px, 45vw, 720px); }

/* 顶栏：标题居中不飘 */
.ai-panel-head {
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.ai-panel-head h2 { font-size: 14.5px; letter-spacing: -.2px; }
.ai-close { display: flex; }

/* 模型行：下拉占满，开关缩成小胶囊跟在右边 */
.ai-panel .chat-model-row {
  display: flex; gap: 6px; align-items: center; margin: 0 0 12px;
}
.ai-panel .chat-model-row select {
  flex: 1; min-width: 0; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 12px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a90a0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  padding-right: 26px;
}
.ai-panel .chat-model-row select:focus { border-color: var(--primary); outline: none; }

/* 空状态：小鸽 + 两行字，居中 */
.chat-empty {
  margin: auto; text-align: center; padding: 28px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
}
.chat-empty-ico {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(88,120,255,.14), rgba(150,90,255,.14));
  color: var(--primary); margin-bottom: 4px;
}
.chat-empty-ico .ico { width: 32px; height: 32px; animation: aiBreath 3.4s ease-in-out infinite; }
.chat-empty b { font-size: 15px; color: var(--text); font-weight: 650; }
.chat-empty span { font-size: 13px; color: var(--text-2); line-height: 1.65; opacity: .85; }

/* 快问：带小图标，排成一列不挤 */
.ai-panel .chat-quick { flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ai-panel .chat-quick button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  font-size: 13.5px; padding: 11px 14px; border-radius: 10px; text-align: left;
  background: var(--bg); border: 1px solid var(--border);
}
.ai-panel .chat-quick button .ico { width: 16px; height: 16px; color: var(--text-2); flex: none; transition: color .15s; }
.ai-panel .chat-quick button:hover .ico { color: var(--primary); }

/* 输入区：一个圆角容器包住文本框 + 圆发送键 */
.ai-panel .chat-input {
  display: flex; align-items: flex-end; gap: 0;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--card); padding: 8px 8px 8px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.ai-panel .chat-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(88,120,255,.13);
}
.ai-panel .chat-input textarea {
  flex: 1; min-width: 0; min-height: 44px; max-height: 150px;
  border: none; background: none; padding: 8px 0; margin: 0;
  font-size: 14px; line-height: 1.55; resize: none; color: var(--text);
}
.ai-panel .chat-input textarea:focus { outline: none; }
.chat-send {
  flex: none; width: 34px; height: 34px; border-radius: 10px; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--primary); color: #fff; padding: 0;
  transition: transform .15s, opacity .15s, background .15s;
}
.chat-send .ico { width: 15px; height: 15px; }
.chat-send:hover { transform: translateY(-1px); }
.chat-send:active { transform: scale(.93); }
.chat-send:disabled { opacity: .45; cursor: default; transform: none; }

/* 气泡：更松弛的圆角 */
.ai-panel .bubble { border-radius: 14px; line-height: 1.6; font-size: 14px; max-width: 88%; padding: 11px 15px; }

/* ═══════════════════════════════════════════════════════
   鸽币条（侧栏常驻）
   ═══════════════════════════════════════════════════════ */
.coin-bar {
  display: flex; align-items: center; gap: 7px; width: 100%;
  margin-top: 10px; padding: 9px 11px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px;
  background: linear-gradient(135deg, rgba(240,180,41,.10), rgba(255,210,90,.06));
  font-family: inherit; text-align: left;
  transition: border-color .15s, transform .15s;
}
.coin-bar:hover { border-color: #f0b429; transform: translateY(-1px); }
.coin-bar-ico {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ffd54a, #f0a92a); color: #7a5200;
}
.coin-bar-ico .ico { width: 14px; height: 14px; }
.coin-bar-num { font-size: 15px; font-weight: 750; color: #b58200; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.coin-bar-label { font-size: 11px; color: var(--text-3); }
.coin-bar-sign {
  margin-left: auto; flex: none; font-size: 11px; padding: 3px 9px; border-radius: 20px;
  background: #f0b429; color: #fff; font-weight: 600; transition: background .15s, transform .15s;
}
.coin-bar-sign:hover { background: #e0a316; }
.coin-bar-sign:active { transform: scale(.94); }
.coin-bar-sign.done { background: var(--bg); color: var(--text-3); }

/* ═══════════════════════════════════════════════════════
   商城
   ═══════════════════════════════════════════════════════ */
.shop { max-width: 1000px; }
.shop-hero {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 20px; margin-bottom: 18px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(240,180,41,.13), rgba(255,140,60,.07), rgba(150,90,255,.06));
  border: 1px solid var(--border);
}
.shop-hero-bal { display: flex; align-items: baseline; gap: 5px; }
.shop-hero-bal b { font-size: 30px; font-weight: 800; color: #c99400; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.shop-hero-bal i { font-size: 13px; color: var(--text-3); font-style: normal; }
.shop-hero-sub { font-size: 12px; color: var(--text-3); margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; }
.shop-hero-sub b { color: var(--text-2); font-variant-numeric: tabular-nums; }
.shop-signin {
  flex: none; padding: 8px 16px; border-radius: 9px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #ffd54a, #f0a92a); color: #6b4a00;
  font-weight: 700; font-size: 13px; font-family: inherit;
  transition: transform .15s, box-shadow .15s;
}
.shop-signin:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(240,180,41,.35); }
.shop-signin:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }

/* 兑换码 */
.redeem-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 20px;
}
.redeem-ico { color: #c99400; display: flex; }
.redeem-ico .ico { width: 18px; height: 18px; }
.redeem-input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-size: 14px; letter-spacing: 1.5px; color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  min-width: 0;
}
.redeem-input::placeholder { letter-spacing: 0; font-family: inherit; color: var(--text-3); }
.redeem-btn {
  border: 0; background: var(--primary); color: #fff; border-radius: 8px;
  padding: 8px 18px; font-size: 13.5px; cursor: pointer; flex-shrink: 0;
}
.redeem-btn:hover { opacity: .88; }
.redeem-btn:disabled { opacity: .55; cursor: default; }
.shop-sec-title { font-size: 13px; font-weight: 700; margin: 0 0 12px; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.shop-sec-title .ico { width: 15px; height: 15px; color: var(--primary); }
.shop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 13px; margin-bottom: 24px;
}
.shop-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 15px 15px 13px; border-radius: 13px;
  background: var(--card); border: 1px solid var(--border);
  transition: transform .18s cubic-bezier(.34,1.3,.64,1), box-shadow .18s, border-color .18s;
}
.shop-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.shop-card.owned { border-color: rgba(34,168,110,.45); background: linear-gradient(160deg, rgba(34,168,110,.05), transparent); }
.shop-card.equipped { border-color: #f0b429; box-shadow: 0 0 0 2px rgba(240,180,41,.22); }
/* 已拥有但未装备：右上角挂个小勾，和稀有度徽章区分开 */
.shop-card.owned:not(.equipped)::after {
  content: '已拥有'; position: absolute; top: 9px; left: 9px;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
  background: rgba(34,168,110,.14); color: #1f9d63;
}
.shop-card-art {
  font-size: 34px; line-height: 1; text-align: center; padding: 8px 0 2px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.12));
}
.shop-card-art.swatch {
  width: 46px; height: 46px; border-radius: 50%; margin: 4px auto 2px; padding: 0;
}
.shop-card-name { font-size: 13.5px; font-weight: 700; text-align: center; }
.shop-card-desc { font-size: 11.5px; color: var(--text-3); text-align: center; line-height: 1.5; min-height: 32px; }
.shop-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.shop-price {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 700; color: #b58200; font-variant-numeric: tabular-nums;
}
.shop-price .ico { width: 13px; height: 13px; }
.shop-buy {
  margin-left: auto; flex: none; padding: 6px 13px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--primary); background: none; color: var(--primary);
  font-size: 12px; font-weight: 600; font-family: inherit;
  transition: background .15s, color .15s, transform .15s;
}
.shop-buy:hover { background: var(--primary); color: #fff; }
.shop-buy:active { transform: scale(.95); }
.shop-buy:disabled { opacity: .5; cursor: default; border-color: var(--border); color: var(--text-3); background: none; }
.shop-buy.equip { border-color: #f0b429; color: #b58200; }
.shop-buy.equip:hover { background: #f0b429; color: #fff; }
.shop-buy.equipped { background: #f0b429; border-color: #f0b429; color: #fff; }
.shop-badge {
  position: absolute; top: 9px; right: 9px; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px; letter-spacing: .3px;
}
.shop-badge.rare { background: rgba(88,120,255,.14); color: #4a6cf0; }
.shop-badge.epic { background: rgba(150,90,255,.15); color: #8a4cf0; }
.shop-badge.legendary { background: linear-gradient(135deg,#ffd54a,#f0a92a); color: #6b4a00; }
.shop-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 40px 0; }

/* 分类小标题隔断 */
.shop-kind-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--text-3); letter-spacing: .5px;
  margin: 4px 0 10px;
}
.shop-kind-head::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ═══════════════════════════════════════════════════════
   鸽币账单弹窗
   ═══════════════════════════════════════════════════════ */
.wallet-modal { width: 520px; }
.wallet-hero {
  padding: 18px 20px; border-radius: 13px; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(240,180,41,.14), rgba(255,140,60,.06));
  border: 1px solid rgba(240,180,41,.32);
}
.wallet-balance { display: flex; align-items: baseline; gap: 6px; }
.wallet-balance span { font-size: 36px; font-weight: 800; color: #c99400; letter-spacing: -1.2px; font-variant-numeric: tabular-nums; }
.wallet-balance i { font-size: 13px; color: var(--text-3); font-style: normal; }
.wallet-sub { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-top: 8px; }
.wallet-sub b { color: var(--text-2); font-variant-numeric: tabular-nums; }
.wallet-signin {
  margin-top: 13px; padding: 8px 18px; border-radius: 9px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #ffd54a, #f0a92a); color: #6b4a00;
  font-weight: 700; font-size: 13px; font-family: inherit;
  transition: transform .15s, box-shadow .15s;
}
.wallet-signin:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(240,180,41,.35); }
.wallet-signin:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.wallet-rules {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 7px 14px; margin-bottom: 18px;
}
.wallet-rule { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.wallet-rule .ico { width: 13px; height: 13px; color: #f0b429; flex: none; }
.wallet-rule b { margin-left: auto; color: #b58200; font-variant-numeric: tabular-nums; }
.wallet-sec-title { font-size: 12.5px; font-weight: 700; color: var(--text-3); margin-bottom: 9px; }
.wallet-txns { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.wallet-txn {
  display: flex; align-items: center; gap: 9px; padding: 9px 4px;
  border-bottom: 1px solid var(--border); font-size: 12.5px;
}
.wallet-txn:last-child { border-bottom: none; }
.wallet-txn-reason { flex: 1; min-width: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-txn-time { flex: none; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.wallet-txn-delta { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.wallet-txn-delta.in { color: #22a86e; }
.wallet-txn-delta.out { color: #e0574f; }
.wallet-empty { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 24px 0; }

/* 网页版：商城保留，鸽币保留（手机也能签到） */
body.web-lite .shop { display: block !important; }

/* ═══════════════════════════════════════════════════════
   宠物
   ═══════════════════════════════════════════════════════ */
.pet { max-width: 900px; }
.pet-loading { text-align: center; color: var(--text-3); padding: 48px 0; }
.pet-wrap { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }

.pet-stage {
  flex: 0 0 296px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 18px; border: 1px solid var(--border); border-radius: 20px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(124,92,255,.10), transparent 60%),
    var(--card);
}
.pet-avatar { width: 200px; height: 210px; position: relative; cursor: pointer; }
.pet-canvas { width: 100%; height: 100%; display: block; }
.pet-avatar.pop { animation: petPop .7s cubic-bezier(.34,1.56,.64,1); }
@keyframes petPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.14) rotate(-3deg); }
  70% { transform: scale(.96) rotate(2deg); }
  100% { transform: scale(1); }
}

.pet-meta { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.pet-name {
  border: 1px dashed transparent; background: none; font: inherit; font-size: 16.5px; font-weight: 700;
  color: var(--text); text-align: center; width: 132px; padding: 3px 6px; border-radius: 8px;
}
.pet-name:hover { border-color: var(--border-strong); }
.pet-name:focus { outline: none; border-color: var(--primary); background: var(--bg); }
.pet-lv {
  font-size: 11.5px; font-weight: 700; color: #b58200; white-space: nowrap;
  background: rgba(240,180,41,.16); padding: 3px 9px; border-radius: 999px;
}

.pet-bar { width: 100%; height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.pet-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#ff9dbb,#f4588f); transition: width .35s cubic-bezier(.22,1,.36,1); }
.pet-bar-txt { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.pet-feed {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 2px;
  border: none; background: linear-gradient(135deg,#ff8fb0,#f4588f); color: #fff;
  font-size: 13px; font-weight: 600; padding: 9px 20px; border-radius: 999px; cursor: pointer;
  transition: transform .16s, box-shadow .16s;
}
.pet-feed .ico { width: 15px; height: 15px; }
.pet-feed:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(244,88,143,.35); }
.pet-feed:active { transform: scale(.96); }
.pet-hint { font-size: 11px; color: var(--text-3); }

.pet-tagline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pet-lvtitle {
  font-size: 12px; font-weight: 600; color: #7c5cff;
  background: rgba(124,92,255,.12); padding: 3px 10px; border-radius: 999px;
}
.pet-mood { font-size: 12px; color: var(--text-2); background: var(--bg); padding: 3px 10px; border-radius: 999px; }
.pet-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pet-pat {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 2px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 13px; font-weight: 600; padding: 8px 18px; border-radius: 999px; cursor: pointer;
  transition: transform .16s, border-color .16s, color .16s;
}
.pet-pat .ico { width: 15px; height: 15px; }
.pet-pat:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.pet-pat:active { transform: scale(.96); }
.pet-pat:disabled { opacity: .5; cursor: default; }
.pet-bubble {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  background: #2f3540; color: #fff; font-size: 12px; padding: 6px 12px; border-radius: 12px;
  white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.18); pointer-events: none;
  animation: petBubbleIn .18s ease-out;
}
.pet-bubble.hide { display: none; }
@keyframes petBubbleIn { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.pet-worn { font-size: 11.5px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
body.dark .pet-lvtitle { background: rgba(124,92,255,.22); color: #c3b4ff; }
body.dark .pet-mood { background: #262a31; }

.pet-panel { flex: 1; min-width: 264px; }
.pet-slots { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pet-slot {
  border: 1px solid var(--border); background: var(--card); color: var(--text-2);
  font-size: 12.5px; padding: 6px 15px; border-radius: 999px; cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
}
.pet-slot:hover { border-color: var(--border-strong); }
.pet-slot.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

.pet-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 10px; }
.pet-opt {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--card); color: var(--text-2);
  font-size: 12.5px; padding: 11px 8px; border-radius: 12px; cursor: pointer;
  transition: border-color .16s, background .16s, color .16s, transform .16s;
}
.pet-opt:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.pet-opt.on {
  border-color: var(--primary); color: var(--primary); font-weight: 600;
  background: color-mix(in srgb, var(--primary) 10%, var(--card));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 16%, transparent);
}
.pet-sw { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); flex: none; }
.pet-owned { margin-top: 16px; font-size: 11.5px; color: var(--text-3); }

body.dark .pet-stage { background: radial-gradient(120% 80% at 50% 0%, rgba(124,92,255,.16), transparent 60%), var(--card); }
body.dark .pet-lv { color: #f0c65a; background: rgba(240,180,41,.18); }

/* ═══════════════ 好友与私聊 ═══════════════ */

.fr-wrap { display: flex; gap: 18px; align-items: stretch; height: calc(100vh - 190px); min-height: 420px; }

.fr-side {
  flex: 0 0 292px; display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 12px; overflow-y: auto;
}
.fr-find { display: flex; gap: 6px; }
.fr-find input {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 9px;
  padding: 7px 10px; font: inherit; font-size: 13px; background: var(--bg); color: var(--text);
}
.fr-find input:focus { outline: none; border-color: var(--primary); background: var(--card); }

.fr-mini {
  border: 1px solid var(--border-strong); background: var(--card); color: var(--text-2);
  font: inherit; font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 8px;
  cursor: pointer; white-space: nowrap; transition: background .14s, color .14s, border-color .14s;
}
.fr-mini:hover { border-color: var(--primary); color: var(--primary); }
.fr-mini.ok { background: var(--primary); border-color: var(--primary); color: #fff; }
.fr-mini.ok:hover { background: var(--primary-dark); color: #fff; }
.fr-mini:disabled { opacity: .45; cursor: default; }
.fr-mini:disabled:hover { border-color: var(--border-strong); color: var(--text-2); }

.fr-sec { font-size: 11.5px; font-weight: 700; color: var(--text-3); padding: 8px 2px 2px; letter-spacing: .3px; }
.fr-found-t { font-size: 11.5px; color: var(--text-3); padding: 6px 2px; }
.fr-found-t.dim { opacity: .7; }

.fr-req {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--bg);
}
.fr-req.dim { opacity: .66; }
.fr-req-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fr-req-t b { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-req-t span { font-size: 11px; color: var(--text-3); }

.fr-list { display: flex; flex-direction: column; gap: 4px; }
.fr-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 11px;
  cursor: pointer; border: 1px solid transparent; transition: background .14s, border-color .14s;
}
.fr-item:hover { background: var(--bg); }
.fr-item.on { background: rgba(47,111,237,.09); border-color: rgba(47,111,237,.3); }
.fr-i-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fr-i-top { display: flex; align-items: center; gap: 6px; }
.fr-i-top b { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-last { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-last.dim { color: var(--text-3); opacity: .8; }
.fr-unread {
  font-style: normal; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--danger);
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}
.fr-intim {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700;
  color: #e2568b; font-variant-numeric: tabular-nums;
}
.fr-intim .ico { width: 13px; height: 13px; }
.fr-tag { font-size: 11px; color: var(--text-3); padding: 5px 9px; }

.fr-av { border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.fr-av-txt {
  display: inline-flex; align-items: center; justify-content: center; font-style: normal;
  font-weight: 700; color: #fff; background: linear-gradient(135deg,#7fb3ff,#5a93e8);
}
.fr-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 26px 8px; line-height: 1.9; }
.fr-empty span { font-size: 11.5px; opacity: .8; }

/* 右侧会话 */
.fr-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
.fr-main:empty::after {
  content: '从左边选一个好友开始聊天'; display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-3); font-size: 13px;
}
.dm-head {
  display: flex; align-items: center; gap: 11px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.dm-h-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dm-h-t b { font-size: 15px; font-weight: 700; color: var(--text); }
.dm-h-t span { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: #e2568b; font-weight: 600; }
.dm-h-t span .ico { width: 12px; height: 12px; }
.dm-visit { display: flex; align-items: center; gap: 6px; }
.dm-pet-lv {
  font-size: 11.5px; font-weight: 700; color: #b58200; background: rgba(240,180,41,.16);
  padding: 4px 9px; border-radius: 999px;
}

.dm-body { flex: 1; min-height: 0; display: flex; }
.dm-petcard {
  flex: 0 0 176px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; border-right: 1px solid var(--border); padding: 14px;
  background: radial-gradient(120% 70% at 50% 10%, rgba(124,92,255,.10), transparent 62%);
}
.dm-petcard svg { width: 132px; height: 140px; }
.dm-pet-name { font-size: 12.5px; font-weight: 600; color: var(--text-2); }

.dm-msgs { flex: 1; min-width: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.dm-empty { color: var(--text-3); font-size: 12.5px; text-align: center; margin: auto; }
.dm-b {
  max-width: 74%; align-self: flex-start; padding: 8px 12px; border-radius: 13px;
  background: var(--bg); color: var(--text); font-size: 13.5px; line-height: 1.55;
  word-break: break-word; white-space: pre-wrap;
}
.dm-b.mine { align-self: flex-end; background: var(--primary); color: #fff; }
.dm-b.pet {
  align-self: center; max-width: 88%; background: rgba(240,180,41,.13); color: #8a6100;
  font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 5px 13px;
}
.dm-b.pet .ico { width: 13px; height: 13px; }

.dm-send { display: flex; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--border); flex: 0 0 auto; }
.dm-send input {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; font: inherit; font-size: 13.5px; background: var(--bg); color: var(--text);
}
.dm-send input:focus { outline: none; border-color: var(--primary); background: var(--card); }

body.dark .fr-side, body.dark .fr-main { background: var(--card); }
body.dark .fr-req { background: rgba(255,255,255,.04); }
body.dark .fr-item:hover { background: rgba(255,255,255,.055); }
body.dark .fr-item.on { background: rgba(47,111,237,.16); }
body.dark .dm-b { background: rgba(255,255,255,.07); }
body.dark .dm-b.mine { background: var(--primary); }
body.dark .dm-b.pet { background: rgba(240,180,41,.16); color: #e8b53f; }

/* 创建群聊弹窗 */
.grp-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.grp-modal-mask {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
}
.grp-modal-box {
  position: relative;
  background: var(--card);
  border-radius: 12px;
  width: 400px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.grp-modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.grp-modal-head b {
  font-size: 16px;
  font-weight: 600;
}
.grp-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-3);
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.grp-modal-close:hover {
  background: var(--bg);
}
.grp-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.grp-modal-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}
.grp-modal-input:focus {
  outline: none;
  border-color: var(--primary);
}
.grp-modal-hint {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
}
.grp-modal-friends {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grp-modal-friend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.grp-modal-friend:hover {
  border-color: var(--primary);
  background: var(--bg);
}
.grp-modal-friend input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.grp-modal-friend span {
  font-size: 14px;
}
.grp-modal-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}


/* ═══════════════ 广场（现代社区风格）═══════════════ */
.mom-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* Banner */
.mom-banner {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  border-radius: 20px;
  padding: 48px 32px;
  margin-bottom: 28px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.25);
}

.mom-banner-deco {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.mom-banner-deco-1 {
  width: 200px;
  height: 200px;
  top: -80px;
  right: -60px;
}

.mom-banner-deco-2 {
  width: 120px;
  height: 120px;
  bottom: -40px;
  left: 10%;
}

.mom-banner-deco-3 {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 60%;
}

.mom-banner-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
}

.mom-banner-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.mom-banner h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.mom-banner p {
  font-size: 16px;
  opacity: 0.95;
  font-weight: 400;
}

/* 发布框 */
.mom-publish {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.mom-publish-head {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.mom-publish-head textarea {
  flex: 1;
  border: none;
  font-size: 15px;
  line-height: 1.6;
  resize: none;
  font-family: inherit;
  color: var(--text);
}

.mom-publish-head textarea:focus {
  outline: none;
}

.mom-publish-head textarea::placeholder {
  color: var(--text-3);
}

.mom-publish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.mom-publish-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mom-tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  transition: all 0.2s;
}

.mom-tool-btn:hover {
  background: white;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(47, 111, 237, 0.1);
}

.mom-tool-btn svg {
  flex-shrink: 0;
}

.mom-img-count {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}

.mom-publish-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mom-publish-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.mom-publish-btn:active {
  transform: translateY(0);
}

.mom-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.mom-prev-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mom-prev-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mom-prev-item span {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* 统计栏 */
.mom-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

/* 空状态 */
.mom-empty {
  text-align: center;
  padding: 80px 20px;
}

.mom-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.mom-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.mom-empty-desc {
  font-size: 14px;
  color: var(--text-3);
}

/* 动态列表 */
.mom-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 动态卡片 */
.mom-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mom-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.mom-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.mom-card-meta {
  flex: 1;
}

.mom-nick {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.mom-time {
  font-size: 12px;
  color: var(--text-3);
}

.mom-del {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
  opacity: 0.6;
}

.mom-del:hover {
  background: rgba(227, 77, 89, 0.1);
  color: var(--danger);
  opacity: 1;
}

.mom-card-body {
  margin-bottom: 16px;
}

.mom-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 图片网格 */
.mom-imgs {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  border-radius: 12px;
  overflow: hidden;
}

.mom-imgs-1 {
  grid-template-columns: 1fr;
}

.mom-imgs-2,
.mom-imgs-4 {
  grid-template-columns: repeat(2, 1fr);
}

.mom-imgs-3,
.mom-imgs-5,
.mom-imgs-6,
.mom-imgs-7,
.mom-imgs-8,
.mom-imgs-9 {
  grid-template-columns: repeat(3, 1fr);
}

.mom-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--bg);
}

.mom-img:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

.mom-video {
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  margin-top: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 操作按钮 */
.mom-card-foot {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.mom-act {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: all 0.2s;
}

.mom-act:hover {
  background: var(--bg);
  border-color: var(--border);
}

.mom-act.liked {
  background: rgba(227, 77, 89, 0.08);
  color: var(--danger);
}

.mom-act.liked:hover {
  background: rgba(227, 77, 89, 0.12);
}

.mom-act svg {
  flex-shrink: 0;
}

/* 评论区 */
.mom-comments-box {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
}

.mom-comments-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 12px;
}

.mom-comment {
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.6;
}

.mom-comment:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mom-comment-name {
  color: var(--primary);
  font-weight: 600;
  margin-right: 8px;
}

.mom-comment-text {
  color: var(--text);
}

/* 评论输入 */
.mom-comment-input {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.mom-comment-input input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg);
  transition: all 0.2s;
}

.mom-comment-input input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.1);
}

/* 加载更多 */
.mom-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  margin-top: 8px;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  background: white;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.mom-more:hover {
  background: var(--bg);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(47, 111, 237, 0.1);
}

/* 聊天界面建群按钮 */
.dm-create-group {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(47, 111, 237, 0.2);
}

.dm-create-group:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(47, 111, 237, 0.3);
}

.dm-create-group:active {
  transform: scale(0.95);
}

/* ═══════════ 聊天表情面板 ═══════════ */
.dm-send-wrap { position: relative; }

.dm-emoji-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--bg);
  cursor: pointer; overflow: hidden; padding: 4px;
  transition: all .2s; flex-shrink: 0;
}
.dm-emoji-btn:hover { border-color: var(--primary); transform: scale(1.08); }
.dm-emoji-btn-preview { width: 100%; height: 100%; }
.dm-emoji-btn-preview svg { width: 100%; height: 100%; }

.dm-emoji-panel {
  position: absolute; bottom: 100%; left: 0; right: 0;
  margin-bottom: 8px; background: white;
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  z-index: 100; max-height: 480px; overflow: hidden;
  display: flex; flex-direction: column;
  animation: emojiSlideUp .2s ease-out;
}
@keyframes emojiSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dm-emoji-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
}
.dm-emoji-my-pet { display: flex; align-items: center; gap: 12px; }
.dm-emoji-my-pet-preview {
  width: 48px; height: 48px; border-radius: 50%;
  background: white; border: 2px solid var(--primary);
  overflow: hidden; padding: 2px;
}
.dm-emoji-my-pet-preview svg { width: 100%; height: 100%; }
.dm-emoji-my-pet-name { font-weight: 600; color: var(--text); font-size: 14px; }
.dm-emoji-close {
  background: none; border: none; font-size: 24px;
  cursor: pointer; color: var(--text-2); line-height: 1;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.dm-emoji-close:hover { background: rgba(0,0,0,.05); color: var(--text); }

.dm-emoji-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; padding: 20px; overflow-y: auto;
}
.dm-emoji-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 8px; border: 2px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: all .2s; background: white;
}
.dm-emoji-item:hover {
  border-color: var(--primary); background: #f8f9ff;
  transform: translateY(-3px); box-shadow: 0 4px 12px rgba(47,111,237,.15);
}
.dm-emoji-preview { width: 80px; height: 80px; }
.dm-emoji-preview svg { width: 100%; height: 100%; }
.dm-emoji-name { font-size: 13px; color: var(--text-2); font-weight: 500; }

/* 表情消息气泡 */
.dm-b.emoji {
  background: transparent !important; padding: 0 !important;
  max-width: 140px; min-width: 100px;
}
.dm-b.emoji svg { width: 100%; height: auto; }

/* 表情动画 */
.dm-b.emoji { animation: emojiPop .35s ease-out; }
@keyframes emojiPop {
  0% { transform: scale(.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
/* 好友列表里的表情预览 */
.fr-last-emoji { display: inline-flex; align-items: center; gap: 4px; }
.fr-emoji-ico { display: inline-flex; width: 26px; height: 27px; vertical-align: middle; }
.fr-emoji-ico .pet-canvas { width: 100%; height: 100%; }

/* 发出后：尾巴摇两下、眼睛眨几下就停 */
.dm-b.emoji .pet-canvas .pet-tail {
  transform-origin: 140px 152px;
  animation: tailWagTwice 0.9s ease-in-out 2 both;
}
.dm-b.emoji .pet-canvas .pet-eyes {
  transform-origin: 100px 116px;
  animation: blinkFew 2.4s ease-in-out 1 both;
}
@keyframes tailWagTwice {
  0%, 100% { transform: rotate(-12deg); }
  50% { transform: rotate(12deg); }
}
@keyframes blinkFew {
  0%, 100% { transform: scaleY(1); }
  12%, 16% { transform: scaleY(.06); }
  28%, 32% { transform: scaleY(.06); }
  48%, 52% { transform: scaleY(.06); }
}

/* 宠物自己的小动作：眨眼 + 摇尾巴（全局生效） */
.pet-canvas .pet-eyes {
  transform-origin: 100px 116px;
  animation: petBlink 4.2s ease-in-out infinite;
}
.pet-canvas .pet-tail {
  transform-origin: 140px 152px;
  animation: petTailWag 1.5s ease-in-out infinite;
}
@keyframes petBlink {
  0%, 91%, 100% { transform: scaleY(1); }
  94%, 96% { transform: scaleY(0.06); }
}
@keyframes petTailWag {
  0%, 100% { transform: rotate(-12deg); }
  50% { transform: rotate(12deg); }
}
