/* ========== 全局变量与基础 ========== */
:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gray: #9ca3af;
  --gray-light: #f3f4f6;
  --gray-border: #e5e7eb;
  --text: #1f2937;
  --text-light: #6b7280;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.15);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  background: #f5f7fa;
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }

/* ========== 通用按钮 ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px; border: none; border-radius: 8px; font-size: 14px;
  background: var(--primary); color: #fff; transition: all .2s; white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #16a34a; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--gray-border); }
.btn-ghost:hover { background: var(--gray-light); }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn-sm.ico { padding: 4px 10px; }

/* ========== 输入框 ========== */
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; color: var(--text-light); font-size: 13px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--gray-border);
  border-radius: 8px; outline: none; transition: border-color .2s; background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.field textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.error-text { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 4px; }

/* ========== 认证页面 ========== */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 16px;
  padding: 36px 32px; box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 24px; text-align: center; margin-bottom: 6px; }
.auth-card .subtitle { text-align: center; color: var(--text-light); font-size: 13px; margin-bottom: 26px; }
.auth-card .btn { width: 100%; padding: 11px; font-size: 15px; }
.auth-footer { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-light); }
.auth-footer a { margin: 0 6px; }
.auth-tip {
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8;
  border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 18px; line-height: 1.6;
}
.step-dot {
  display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center;
  background: var(--primary); color: #fff; border-radius: 50%; font-size: 12px; margin-right: 8px;
}

/* ========== 主页布局 ========== */
.topbar {
  position: sticky; top: 0; z-index: 100; height: 56px;
  background: #fff; border-bottom: 1px solid var(--gray-border);
  display: flex; align-items: center; padding: 0 20px; gap: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.logo { font-size: 18px; font-weight: 700; color: var(--primary); margin-right: 24px; white-space: nowrap; }
.nav-btn {
  padding: 8px 22px; border: none; background: transparent; font-size: 15px; color: var(--text-light);
  border-radius: 8px; transition: all .2s;
}
.nav-btn:hover { background: var(--gray-light); }
.nav-btn.active { background: var(--primary); color: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-light); padding: 4px 8px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.user-chip:hover { background: var(--gray-light); }
.user-chip:active { background: var(--gray-border); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.content { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }
.view { display: none; }
.view.active { display: block; }

/* 页面标题条 */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-head h2 { font-size: 20px; }
.page-head .sub { color: var(--text-light); font-size: 13px; margin-top: 4px; }

/* ========== 时间轴 ========== */
.timeline-group { margin-bottom: 26px; }
.timeline-date {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  font-size: 15px; font-weight: 600; color: var(--text);
}
.timeline-date .line { flex: 1; height: 1px; background: var(--gray-border); }
.timeline-date .count { font-size: 12px; color: var(--text-light); font-weight: 400; }
.timeline-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; border: 1px solid var(--gray-border); transition: all .2s;
  display: flex; flex-direction: column; gap: 10px;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-title { font-size: 15px; font-weight: 600; line-height: 1.4; word-break: break-all; }
.card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.icon-btn {
  border: none; background: transparent; color: var(--text-light); font-size: 15px;
  padding: 4px; border-radius: 6px; transition: all .15s; line-height: 1;
}
.icon-btn:hover { background: var(--gray-light); color: var(--text); }
.icon-btn.del:hover { color: var(--danger); background: #fef2f2; }
.card-content { color: var(--text-light); line-height: 1.6; font-size: 13px; word-break: break-all;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.card-imgs img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1px solid var(--gray-border); }
.card-meta { display: flex; align-items: center; gap: 10px; margin-top: auto; font-size: 12px; color: var(--text-light); }
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; background: var(--gray-light); color: var(--text-light);
}
.tag.remind { background: #fef3c7; color: #b45309; }
.tag.voice { background: #ede9fe; color: #7c3aed; }

/* 图片预览大图 */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out;
}
.lightbox img { max-width: 90%; max-height: 90%; border-radius: 8px; }

/* ========== 弹窗 ========== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
/* 通用新建/编辑弹窗要显示在全屏思维导图(mindmapModalRoot z:200)之上 */
#modalRoot .modal-mask { z-index: 400; }
/* 全屏思维导图 modal 自己也提到 300，确保在提醒弹窗之下、其他弹窗之上 */
#mindmapModalRoot .modal-mask { z-index: 300; }
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .2s ease;
}
.modal.wide { max-width: 720px; }
.modal.fullscreen {
  max-width: 96vw; max-height: 96vh; width: 96vw; height: 96vh;
  border-radius: 12px;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--gray-border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--gray-border); display: flex; justify-content: flex-end; gap: 10px; }

/* ========== Toast ========== */
.toast-wrap { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1f2937; color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 14px; box-shadow: var(--shadow-lg); animation: toastIn .25s ease;
  max-width: 80vw;
}
.toast.ok { background: #16a34a; }
.toast.err { background: #dc2626; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ========== 语音按钮 ========== */
.mic-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border: 1px solid var(--gray-border); background: #fff; border-radius: 8px;
  color: var(--text); font-size: 13px; transition: all .2s;
}
.mic-btn:hover { border-color: var(--primary); color: var(--primary); }
.mic-btn.recording { background: var(--danger); color: #fff; border-color: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

/* ========== 计划树 ========== */
.plan-layout { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .plan-layout { grid-template-columns: 1fr; } }
.plan-panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--gray-border); padding: 16px; }
.plan-panel h4 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-panel h4 > .btn { margin-left: auto; }

/* ---- 思维导图（组织树横版 - 居中分布） ---- */
.mindmap-wrap { overflow: auto; max-height: 620px; padding: 16px; background: linear-gradient(135deg, #fafbff 0%, #fef8fb 100%); border-radius: 8px; min-width: 0; }
.mindmap-wrap.fullscreen { max-height: none; height: calc(95vh - 140px); background: linear-gradient(135deg, #f5f7ff 0%, #fef5fb 100%); padding: 28px; }
.mindmap { display: flex; justify-content: center; width: 100%; min-width: 0; }
.mindmap > ul, .mindmap ul {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start;
  padding-top: 20px; position: relative; transition: all .3s; gap: 8px;
  width: 100%; min-width: 0;
}
.mindmap ul.root-ul { padding-top: 0; }
.mindmap li {
  flex: 0 1 280px;
  text-align: center; list-style-type: none; position: relative;
  padding: 20px 8px 0 8px; transition: all .3s;
}
.mindmap li::before, .mindmap li::after {
  content: ''; position: absolute; top: 0; right: 50%;
  border-top: 2px solid #cbd5e1; width: 50%; height: 20px;
}
.mindmap li::after { right: auto; left: 50%; border-left: 2px solid #cbd5e1; }
.mindmap li:only-child::after, .mindmap li:only-child::before { display: none; }
.mindmap li:only-child { padding-top: 0; }
.mindmap li:first-child::before, .mindmap li:last-child::after { border: 0 none; }
.mindmap li:last-child::before { border-right: 2px solid #cbd5e1; border-radius: 0 5px 0 0; }
.mindmap li:first-child::after { border-radius: 5px 0 0 0; }
.mindmap ul ul::before { content: ''; position: absolute; top: 0; left: 50%; border-left: 2px solid #cbd5e1; width: 0; height: 20px; }
.mindmap .mm-node { display: inline-flex; flex-direction: column; align-items: center; position: relative; }
.mm-card {
  display: flex; align-items: center; gap: 10px; padding: 14px 20px;
  background: #fff; border: 2px solid var(--gray); border-radius: 12px;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: all .2s;
  min-width: 120px; max-width: 220px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.mm-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.12); transform: translateY(-2px); }
.mm-card.done { border-color: var(--success); background: #f0fdf4; }
.mm-card.done .mm-name { color: #15803d; }
/* BoardMix 风格：根节点紫色胶囊 */
.mm-card.root {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: #fff; border: none;
  padding: 18px 28px; font-size: 18px; font-weight: 800;
  box-shadow: 0 8px 24px rgba(124,58,237,.35);
  border-radius: 28px;
  min-width: 160px; max-width: 280px;
}
.mm-card.root .mm-name { color: #fff; }
.mm-card.root .mm-dot { background: #fff; }
.mm-card.root .mm-tools .icon-btn { color: rgba(255,255,255,.85); }
.mm-card.root .mm-tools .icon-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.mm-card.root .mm-tools .mm-fold { background: rgba(255,255,255,.2); color: #fff; }
.mm-card.root.done { background: linear-gradient(135deg, #22c55e, #16a34a); }
/* 子节点按层级分配颜色 */
.mm-card.lv-1 { border-color: #3b82f6; background: #eff6ff; }
.mm-card.lv-2 { border-color: #8b5cf6; background: #f5f3ff; }
.mm-card.lv-3 { border-color: #ec4899; background: #fdf2f8; }
.mm-card.lv-4 { border-color: #10b981; background: #ecfdf5; }
.mm-card.lv-5 { border-color: #f59e0b; background: #fffbeb; }
.mm-card.lv-6 { border-color: #06b6d4; background: #ecfeff; }
.mm-card.lv-7 { border-color: #f43f5e; background: #fff1f2; }
.mm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.mm-card.fullscreen-mode { padding: 16px 22px; font-size: 15px; max-width: 240px; }
.mm-card.fullscreen-mode.root { padding: 20px 30px; font-size: 20px; max-width: 320px; }
.mm-card.fullscreen-mode .mm-name { max-width: 200px; }
.mm-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; font-size: 11px; max-width: 220px; }
.mm-meta span { background: rgba(0,0,0,.06); padding: 1px 7px; border-radius: 8px; color: var(--text-light); }
.mm-card.root .mm-meta span { background: rgba(255,255,255,.25); color: #fff; }

/* ---- 节点简略模式（只显示主题） ---- */
.mm-card.mm-simple {
  font-size: 14px;
}
.mm-card.mm-simple.fullscreen-mode { font-size: 15px; }
.mm-title {
  flex: 1; font-weight: inherit; font-size: inherit; line-height: 1.4;
  border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; min-height: 24px;
  word-break: break-word; outline: none; cursor: text;
  transition: background .15s, border-color .15s;
}
.mm-title:hover { background: rgba(0,0,0,.04); }
.mm-title:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.mm-card.root .mm-title { color: #fff; }
.mm-card.root .mm-title:hover { background: rgba(255,255,255,.18); }
.mm-card.root .mm-title:focus { background: #fff; color: var(--text); border-color: var(--primary); }
.mm-card.done .mm-title { text-decoration: line-through; opacity: .8; }
.mm-card.done.root .mm-title { color: #fff; opacity: .8; }
.mm-fields { display: flex; flex-direction: column; gap: 4px; }
.mm-field {
  display: flex; align-items: flex-start; gap: 4px;
  padding: 4px 8px; border-radius: 6px; font-size: 12px;
  background: rgba(0,0,0,.04); color: var(--text);
  cursor: pointer; transition: all .15s; word-break: break-word;
}
.mm-field:hover { background: rgba(59,130,246,.12); }
.mm-field.empty { color: var(--text-light); font-style: italic; opacity: .65; }
.mm-field.empty:hover { opacity: 1; }
.mm-field.editing { padding: 0; background: #fff; box-shadow: 0 0 0 2px var(--primary); }
.mm-f-icon { font-size: 13px; flex-shrink: 0; margin-top: 1px; }
.mm-f-val {
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  flex: 1; min-width: 0; line-height: 1.5;
}
.mm-field input, .mm-field textarea {
  border: none; outline: none; padding: 5px 8px; font-size: 12px;
  background: transparent; color: var(--text); width: 220px; font-family: inherit;
  border-radius: 4px;
}
.mm-field textarea { width: 220px; min-height: 40px; resize: vertical; }
.mm-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 6px; border-top: 1px dashed rgba(0,0,0,.08); }
.mm-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px;
  border-radius: 10px; font-size: 11px; background: var(--gray-light); color: var(--text-light);
  cursor: pointer; transition: all .15s;
}
.mm-tag:hover { background: rgba(245,158,11,.18); color: #b45309; }
.mm-tag.remind { background: #fef3c7; color: #b45309; }
.mm-tag.remind:hover { background: #fde68a; }
.mm-card.root .mm-field { background: rgba(255,255,255,.18); color: rgba(255,255,255,.95); }
.mm-card.root .mm-field:hover { background: rgba(255,255,255,.3); }
.mm-card.root .mm-field.empty { color: rgba(255,255,255,.6); font-style: italic; }
.mm-card.root .mm-foot { border-top-color: rgba(255,255,255,.2); }
.mm-card.root .mm-tag { background: rgba(255,255,255,.2); color: rgba(255,255,255,.95); }
.mm-card.root .mm-tag:hover { background: rgba(255,255,255,.35); }
.mm-card.root .mm-tag.remind { background: rgba(255,255,255,.25); color: #fef3c7; }
.done-toggle { font-size: 12px; padding: 3px 8px; }
.mm-card.done .done-toggle { background: #dcfce7; color: #15803d; }
.mm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); flex-shrink: 0; }
.mm-card.done .mm-dot { background: var(--success); }
.mm-tools { display: flex; gap: 2px; margin-left: 2px; align-items: center; }
.mm-tools .icon-btn { font-size: 13px; }
/* "+" 添加子任务按钮单独高亮 */
.mm-add-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px dashed #94a3b8; background: #fff; color: #64748b;
  font-size: 18px; font-weight: 700; line-height: 1; cursor: pointer; transition: all .2s;
  font-family: inherit; flex-shrink: 0;
}
.mm-add-btn:hover { border-style: solid; border-color: var(--primary); color: var(--primary); transform: scale(1.15); background: #eff6ff; }
.mm-card.root .mm-add-btn { background: #fff; color: #7c3aed; border-color: rgba(255,255,255,.7); }
.mm-fold {
  width: 18px; height: 18px; border-radius: 50%; border: none; background: var(--gray-light);
  color: var(--text-light); font-size: 11px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.mm-fold:hover { background: var(--gray-border); }

/* ---- 任务卡片列表 ---- */
.task-list { display: flex; flex-direction: column; gap: 10px; max-height: 620px; overflow-y: auto; padding-right: 4px; }

/* ---- 右侧根任务卡片网格（思维导图入口） ---- */
.root-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding: 4px; }
.root-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; background: #fff;
  border: 2px solid #c4b5fd; border-radius: 14px;
  cursor: pointer; transition: all .2s;
  position: relative;
  box-shadow: 0 2px 8px rgba(124,58,237,.08);
}
.root-card::before {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px;
  background: linear-gradient(180deg, #8b5cf6, #7c3aed); border-radius: 4px;
}
.root-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(124,58,237,.15); border-color: #8b5cf6; }
.root-card.done { border-color: var(--success); background: linear-gradient(135deg, #f0fdf4, #ffffff); }
.root-card.done::before { background: linear-gradient(180deg, #22c55e, #16a34a); }
.root-card-head { display: flex; align-items: center; gap: 8px; }
.root-card-name {
  font-size: 16px; font-weight: 700; color: #4c1d95; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.root-card.done .root-card-name { color: #15803d; text-decoration: line-through; }
.root-card-head .mm-dot { width: 10px; height: 10px; background: #8b5cf6; flex-shrink: 0; }
.root-card.done .mm-dot { background: var(--success); }
.status-mini { margin-left: auto; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.status-mini.done { background: #dcfce7; color: #15803d; }
.root-card-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--text-light); }
.root-card-meta span { background: var(--gray-light); padding: 2px 8px; border-radius: 10px; }
.root-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.root-card-actions { display: flex; gap: 4px; }
.root-card-actions .btn-sm { padding: 4px 10px; font-size: 12px; }
.task-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: #fff; border: 2px solid var(--gray); border-radius: 10px; cursor: pointer;
  transition: all .2s;
}
.task-card:hover { box-shadow: var(--shadow); }
.task-card.done { border-color: var(--success); background: #f0fdf4; }
.task-check {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--gray);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: transparent; transition: all .2s; background: #fff;
}
.task-card.done .task-check { background: var(--success); border-color: var(--success); color: #fff; }
.task-main { flex: 1; min-width: 0; }
.task-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-card.done .task-name { color: #15803d; text-decoration: line-through; }
.task-sub { font-size: 12px; color: var(--text-light); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--gray-light); color: var(--text-light); flex-shrink: 0; }
.task-badge.remind { background: #fef3c7; color: #b45309; }
.task-badge.child { background: #eff6ff; color: #2563eb; }
.task-op { display: flex; gap: 2px; flex-shrink: 0; }
.empty-tip { text-align: center; color: var(--text-light); padding: 40px 20px; font-size: 13px; line-height: 2; }

/* ---- 计划详情 ---- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-item { background: var(--gray-light); border-radius: 8px; padding: 10px 12px; }
.detail-item.full { grid-column: 1 / -1; }
.detail-item .k { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.detail-item .v { font-size: 14px; line-height: 1.6; word-break: break-all; white-space: pre-wrap; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 12px; }
.status-pill.pending { background: var(--gray-light); color: var(--text-light); }
.status-pill.completed { background: #dcfce7; color: #15803d; }

/* ========== 记账 ========== */
.ledger-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 720px) { .ledger-summary { grid-template-columns: repeat(2, 1fr); } }
.ledger-stat { background: #fff; border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); border-left: 4px solid var(--primary); }
.ledger-stat.income { border-left-color: var(--success); }
.ledger-stat.expense { border-left-color: var(--danger); }
.ledger-stat.net { border-left-color: var(--primary); }
.ledger-stat.count { border-left-color: #f59e0b; }
.ledger-stat .stat-label { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.ledger-stat .stat-val { font-size: 20px; font-weight: 700; color: var(--text); }
.ledger-stat.income .stat-val { color: var(--success); }
.ledger-stat.expense .stat-val { color: var(--danger); }

.ledger-calendar {
  background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 1px solid var(--gray-border);
}
.ledger-cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 8px; }
.ledger-weekday { text-align: center; font-size: 13px; color: var(--text-light); padding: 6px 0; font-weight: 600; }
.ledger-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ledger-cell {
  min-height: 84px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--gray-border);
  background: #fafafa; cursor: pointer; transition: all .15s; display: flex; flex-direction: column;
}
.ledger-cell:hover { background: #eff6ff; border-color: var(--primary); transform: translateY(-1px); }
.ledger-cell.has-data { background: linear-gradient(135deg, #fff, #f0f9ff); border-color: #93c5fd; }
.ledger-cell.has-data:hover { background: linear-gradient(135deg, #eff6ff, #dbeafe); }
.ledger-cell.today .ledger-day-num { background: var(--primary); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.ledger-cell.other-month { opacity: .35; cursor: default; }
.ledger-cell.other-month:hover { transform: none; background: #fafafa; border-color: var(--gray-border); }
.ledger-day-num { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.ledger-cell-stats { margin-top: auto; font-size: 11px; }
.cell-count { color: var(--text-light); }
.cell-net { font-weight: 700; margin-top: 2px; }
.cell-net.net-pos { color: var(--success); }
.cell-net.net-neg { color: var(--danger); }
.cell-empty { color: var(--gray); text-align: center; }

.ledger-day-list { max-height: 420px; overflow-y: auto; }
.ledger-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--gray-border); }
.ledger-item:hover { background: var(--gray-light); }
.ledger-item-time { font-size: 12px; color: var(--text-light); min-width: 50px; }
.ledger-item-main { flex: 1; min-width: 0; }
.ledger-item-cat { font-weight: 600; color: var(--text); font-size: 14px; }
.ledger-item-note { font-size: 12px; color: var(--text-light); margin-top: 2px; word-break: break-all; }
.ledger-item-amount { font-weight: 700; font-size: 15px; }
.ledger-item-amount.amount-pos { color: var(--success); }
.ledger-item-amount.amount-neg { color: var(--danger); }

/* ========== 帮助与支持 ========== */
.help-menu { display: flex; flex-direction: column; gap: 8px; }
.help-menu-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border: 1px solid var(--gray-border); border-radius: 10px;
  background: #fff; cursor: pointer; transition: all .15s; text-align: left;
}
.help-menu-btn:hover { border-color: var(--primary); background: #eff6ff; transform: translateX(2px); }
.help-icon { font-size: 22px; flex-shrink: 0; }
.help-text { flex: 1; min-width: 0; }
.help-title { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.help-desc { display: block; font-size: 12px; color: var(--text-light); margin-top: 2px; }
.help-arrow { font-size: 20px; color: var(--text-light); flex-shrink: 0; }

/* 反馈记录 */
.fb-item { border: 1px solid var(--gray-border); border-radius: 8px; padding: 10px 12px; background: #fafafa; }
.fb-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.fb-type { font-size: 11px; padding: 2px 8px; border-radius: 8px; background: #eff6ff; color: #2563eb; }
.fb-status { font-size: 11px; padding: 2px 8px; border-radius: 8px; background: #fef3c7; color: #b45309; }
.fb-status.done { background: #dcfce7; color: #15803d; }
.fb-title { font-size: 13px; font-weight: 600; color: var(--text); }
.fb-content { font-size: 12px; color: var(--text-light); margin-top: 4px; line-height: 1.6; word-break: break-all; }
.fb-reply { font-size: 12px; background: #eff6ff; border-left: 3px solid var(--primary); padding: 6px 10px; margin-top: 6px; border-radius: 4px; line-height: 1.5; }
.fb-no-reply { font-size: 12px; color: var(--text-light); font-style: italic; margin-top: 6px; opacity: .7; }
.fb-time { font-size: 11px; color: var(--gray); margin-top: 6px; }
.fb-meta-row { display: flex; gap: 12px; margin-top: 8px; font-size: 11px; color: var(--text-light); }
.fb-meta { background: var(--gray-light); padding: 2px 8px; border-radius: 8px; }
.fb-dev-form { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--gray-border); }
.fb-reply-input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--gray-border); border-radius: 6px;
  font-family: inherit; font-size: 13px; min-height: 60px; resize: vertical; outline: none;
  transition: border-color .15s;
}
.fb-reply-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59,130,246,.15); }
.fb-dev-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.fb-status-sel { padding: 6px 10px; border: 1px solid var(--gray-border); border-radius: 6px; font-size: 12px; background: #fff; }

/* 用户须知 */
.guide-block { margin-bottom: 16px; padding: 12px 14px; background: var(--gray-light); border-radius: 10px; }
.guide-block h4 { font-size: 14px; margin-bottom: 8px; color: var(--primary-dark); }
.guide-block p { font-size: 13px; color: var(--text-light); line-height: 1.8; margin: 4px 0; }

/* ========== 我的页面 ========== */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.set-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--gray-border); padding: 18px; }
.set-card h4 { font-size: 15px; margin-bottom: 4px; }
.set-card .desc { font-size: 12px; color: var(--text-light); margin-bottom: 14px; }
.info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--gray-border); font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--text-light); }
.info-row .v { font-weight: 500; }

/* 账户信息卡片内的"退出登录"区域 */
.account-actions { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--gray-border); }
.account-meta { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.account-actions .btn-logout { font-size: 14px; }

/* ========== 登录通知弹窗 ========== */
.notif-section { margin-bottom: 18px; }
.notif-section h4 { font-size: 14px; color: var(--primary-dark); margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--gray-border); }
.notif-item {
  background: #fff; border: 1px solid var(--gray-border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer; transition: all .15s;
}
.notif-item:hover { border-color: var(--primary); background: #f5faff; transform: translateX(2px); box-shadow: 0 2px 8px rgba(59,130,246,.1); }
.notif-tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 8px; background: #dcfce7; color: #15803d; margin-bottom: 4px; }
.notif-tag.today { background: #fef3c7; color: #b45309; }
.notif-tag.urgent { background: #fee2e2; color: #dc2626; }
.notif-content { font-size: 12px; color: var(--text-light); margin-top: 4px; line-height: 1.6; word-break: break-all; }
.notif-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.notif-reply { font-size: 13px; color: var(--text-light); background: #eff6ff; border-left: 3px solid var(--primary); padding: 6px 10px; border-radius: 4px; margin: 6px 0; line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--gray); margin-top: 4px; }
.notif-action { font-size: 12px; color: var(--primary); margin-top: 6px; font-weight: 600; }

/* ========== 提醒弹窗（点击跳转） ========== */
.remind-pop {
  position: fixed; top: 80px; right: 20px; z-index: 600;
  background: #fff; border-left: 4px solid var(--warning); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 14px 18px; width: 320px; max-width: 90vw;
  animation: slideIn .3s ease; cursor: pointer; transition: all .2s;
}
.remind-pop:hover { box-shadow: 0 12px 36px rgba(245,158,11,.25); transform: translateX(-3px); }
.remind-pop .t { font-size: 13px; color: #b45309; font-weight: 600; margin-bottom: 6px; }
.remind-pop .m { font-size: 14px; line-height: 1.5; word-break: break-all; }
.remind-pop .close-btn { position: absolute; top: 8px; right: 10px; border: none; background: none; font-size: 16px; color: var(--text-light); cursor: pointer; }
.remind-jump-btn {
  margin-top: 10px; padding: 6px 14px; border: 1px solid var(--warning); background: #fffbeb;
  color: #b45309; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.remind-jump-btn:hover { background: var(--warning); color: #fff; }
@keyframes slideIn { from { transform: translateX(120%); } to { transform: translateX(0); } }

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
::-webkit-scrollbar-track { background: transparent; }

/* ========== 手机端适配（安卓/苹果浏览器 + PWA 桌面模式） ========== */
@media (max-width: 768px) {
  body { font-size: 14px; }
  /* 顶部菜单栏 */
  .topbar { height: auto; padding: 8px 10px; flex-wrap: wrap; gap: 6px; }
  .logo { font-size: 16px; margin-right: 10px; }
  .nav-btn { padding: 6px 12px; font-size: 14px; }
  .topbar-right { width: 100%; justify-content: flex-end; padding-top: 4px; border-top: 1px solid var(--gray-border); }
  .user-chip span { font-size: 12px; }
  /* 内容区 */
  .content { padding: 14px 10px 40px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head h2 { font-size: 18px; }
  .page-head .sub { font-size: 12px; }
  .page-head > div:last-child { width: 100%; }
  .page-head input[type="text"] { width: 100% !important; margin-bottom: 4px; }
  /* 时间轴卡片单列 */
  .timeline-cards { grid-template-columns: 1fr; }
  .card-imgs img { width: 70px; height: 70px; }
  /* 计划树 */
  .plan-layout { grid-template-columns: 1fr; }
  .mindmap-wrap { max-height: 50vh; }
  .mindmap-wrap.fullscreen { height: calc(96vh - 120px); padding: 12px; }
  .root-cards-grid { grid-template-columns: 1fr 1fr; }
  .root-card { padding: 12px; }
  .root-card-name { font-size: 14px; }
  /* 思维导图节点在手机上紧凑些 */
  .mm-card.mm-simple { min-width: 100px; max-width: 160px; padding: 10px 12px; font-size: 13px; }
  .mm-card.mm-simple.root { min-width: 120px; max-width: 200px; padding: 14px 18px; font-size: 16px; }
  .mindmap li { padding: 16px 4px 0 4px; }
  /* 记账 */
  .ledger-summary { grid-template-columns: 1fr 1fr; }
  .ledger-stat { padding: 10px 12px; }
  .ledger-stat .stat-val { font-size: 17px; }
  .ledger-cell { min-height: 62px; padding: 4px 4px; }
  .ledger-cell-stats { font-size: 10px; }
  /* 弹窗全屏化 */
  .modal-mask { padding: 8px; }
  .modal { max-width: 100%; max-height: 96vh; border-radius: 10px; }
  .modal.fullscreen { max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
  .modal-head { padding: 12px 14px; }
  .modal-body { padding: 14px; }
  .modal-foot { padding: 10px 14px; }
  .detail-grid { grid-template-columns: 1fr; }
  /* 认证页 */
  .auth-card { padding: 24px 20px; }
  /* 提醒弹窗 */
  .remind-pop { top: 60px; right: 10px; width: calc(100vw - 20px); max-width: 340px; }
  /* 通知弹窗 */
  .notif-item { padding: 10px 12px; }
  /* toast */
  .toast { font-size: 13px; padding: 8px 14px; }
}

/* 超小屏（<360px） */
@media (max-width: 380px) {
  .nav-btn { padding: 5px 9px; font-size: 13px; }
  .root-cards-grid { grid-template-columns: 1fr; }
  .ledger-calendar { padding: 10px; }
  .ledger-cell { min-height: 54px; }
}
