/* ============================================================
   愿景工作台 · 设计系统（薄荷绿 · 私人管家风）
   ============================================================ */
:root {
  /* 薄荷曼波官方五色：#bce3e4 漂白水色 / #b1deca 溪绿 / #b8eab3 铜锈绿 / #64bfa5 荷兰薄荷 / #00a071 薄荷绿 */
  --mint-700: #006b4e;
  --mint-600: #00a071;
  --mint-500: #64bfa5;
  --mint-400: #8fd3bb;
  --mint-300: #b1deca;
  --mint-fresh: #b8eab3;
  --mint-aqua: #bce3e4;
  --mint-200: #d3eee2;
  --mint-100: #e6f6ee;
  --mint-50:  #f2fbf6;
  --bg: #f4faf7;
  --card: #ffffff;
  --ink: #0f3a2c;
  --ink-2: #3d5c50;
  --ink-3: #7a978b;
  --line: #d9eee4;
  /* 点缀色：淡紫（薄荷绿 × 淡紫 参考搭配） */
  --gold: #a58fd4;
  --gold-soft: #efe9fa;
  --rose: #e2707a;
  --shadow: 0 4px 18px rgba(0, 160, 113, .10);
  --shadow-lg: 0 12px 40px rgba(0, 160, 113, .16);
  --radius: 16px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--ink); }
img, video { display: block; max-width: 100%; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--mint-300); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--mint-600); color: #fff; transition: all .18s;
  box-shadow: 0 2px 8px rgba(0,160,113,.35);
}
.btn:hover { background: var(--mint-600); transform: translateY(-1px); }
.btn.ghost { background: var(--mint-100); color: var(--mint-700); box-shadow: none; }
.btn.ghost:hover { background: var(--mint-200); }
.btn.danger { background: #fdecec; color: var(--rose); box-shadow: none; }
.btn.sm { padding: 6px 12px; font-size: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 14px; border-radius: 999px; font-size: 13px;
  background: var(--mint-100); color: var(--mint-700); white-space: nowrap;
  cursor: pointer; transition: all .15s; border: 1px solid transparent;
}
.chip:hover { background: var(--mint-200); }
.chip.on { background: var(--mint-600); color: #fff; font-weight: 600; }
.chip.sub { background: #fff; border-color: var(--mint-300); color: var(--ink-2); margin-left: 14px; position: relative; }
.chip.sub::before { content: "└"; position: absolute; left: -12px; color: var(--mint-400); }
.chip.sub.on { background: var(--mint-400); color: #fff; border-color: var(--mint-400); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field input[type=text], .field input[type=url], .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fbfdfc; outline: none; transition: border .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--mint-500); }
.field textarea { resize: vertical; min-height: 72px; }

/* ---------- 启动页（随机愿景） ---------- */
#splash {
  position: fixed; inset: 0; z-index: 1000; background: #04382b;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  transition: opacity .6s;
}
#splash.hide { opacity: 0; pointer-events: none; }
#splash .bg-media { position: absolute; inset: 0; }
#splash .bg-media img, #splash .bg-media video { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
#splash .overlay {
  position: relative; z-index: 2; text-align: center; color: #fff; padding: 24px; max-width: 560px;
  animation: splashIn 1s ease both;
}
#splash .butler-line { font-size: 14px; letter-spacing: .15em; color: var(--mint-300); margin-bottom: 14px; }
#splash .vision-title { font-size: 32px; font-weight: 700; text-shadow: 0 2px 20px rgba(0,0,0,.4); margin-bottom: 10px; }
#splash .vision-desc { font-size: 15px; opacity: .85; line-height: 1.7; margin-bottom: 28px; }
#splash .enter-btn {
  padding: 12px 40px; border-radius: 999px; background: var(--mint-600); color: #fff;
  font-size: 15px; font-weight: 600; box-shadow: 0 4px 24px rgba(0,160,113,.5);
}
#splash .enter-btn:hover { background: var(--mint-500); }
@keyframes splashIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 500; background: rgba(14, 42, 33, .45);
  backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.open { display: flex; }
/* 弹窗叠放层级：编辑窗(默认500) < 领域管理 < 定义说明（后两者从编辑窗内弹出，必须盖在上面） */
#domainModal { z-index: 620; }
#defModal { z-index: 640; }
.modal {
  background: var(--card); border-radius: 20px; width: 640px; max-width: 100%;
  max-height: 88vh; overflow-y: auto; padding: 26px; box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 18px; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- 瀑布流 ---------- */
.waterfall { column-gap: 16px; }
.waterfall .v-card {
  break-inside: avoid; margin-bottom: 16px; background: var(--card); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: transform .18s, box-shadow .18s;
  border: 1px solid var(--line);
}
.waterfall .v-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.v-card .v-media { position: relative; background: var(--mint-100); }
.v-card .v-media img, .v-card .v-media video { width: 100%; }
.v-card .v-body { padding: 14px 16px 16px; }
.v-card .v-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.v-card .v-desc { font-size: 13px; color: var(--ink-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.v-card .v-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.v-card .v-tag { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--mint-100); color: var(--mint-700); }
.v-card .v-tag.subtag { background: #fff; border: 1px solid var(--mint-200); color: var(--ink-3); }
.v-card .pin-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2; padding: 4px 10px; border-radius: 999px;
  background: rgba(165,143,212,.92); color: #fff; font-size: 11px; font-weight: 600;
}
.v-card .status-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: rgba(255,255,255,.9); color: var(--mint-700);
}
.v-card .status-badge.achieved { background: var(--gold); color: #fff; }
.v-card .link-card { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--mint-50); }
.v-card .link-card .ico { font-size: 22px; }
.v-card .link-card .u { font-size: 12px; color: var(--ink-3); word-break: break-all; }
.v-card .text-only { padding: 22px 18px 6px; font-size: 17px; font-weight: 600; line-height: 1.7; color: var(--mint-700); }
.v-card .text-only::before { content: "“"; font-size: 34px; color: var(--mint-300); display: block; line-height: .5; margin-bottom: 8px; }

/* ---------- 编辑器内的素材列表 ---------- */
.media-item { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; background: #fbfdfc; }
.media-item .thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--mint-100); flex-shrink: 0; display:flex; align-items:center; justify-content:center; font-size:20px; overflow:hidden; }
.media-item .thumb img, .media-item .thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-item .mi-info { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-3); }
.media-item .mi-ops { display: flex; gap: 4px; }
.media-item .mi-ops button { font-size: 11px; padding: 4px 8px; border-radius: 6px; background: var(--mint-100); color: var(--mint-700); }
.media-item .mi-ops button:hover { background: var(--mint-200); }

/* ---------- 学习模块 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.stat-card .num { font-size: 26px; font-weight: 700; color: var(--mint-600); }
.stat-card .lbl { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.learn-card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); margin-bottom: 14px; cursor: pointer; transition: transform .15s; }
.learn-card:hover { transform: translateY(-2px); }
.learn-card .lc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.learn-card .lc-title { font-size: 15px; font-weight: 700; }
.learn-card .lc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.learn-card .lc-progress { margin-top: 12px; height: 6px; border-radius: 3px; background: var(--mint-100); overflow: hidden; }
.learn-card .lc-progress i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--mint-400), var(--mint-600)); }
.learn-card .lc-reflection { margin-top: 10px; font-size: 12px; color: var(--ink-2); background: var(--mint-50); border-left: 3px solid var(--mint-400); padding: 8px 10px; border-radius: 0 8px 8px 0; }
.badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.badge.m-method { background: var(--mint-100); color: var(--mint-700); }
.badge.m-type { background: #eef3ff; color: #4a6bb5; }
.badge.m-purpose { background: var(--gold-soft); color: #9a7420; }
.badge.st-doing { background: #fff3e0; color: #c07f1a; }
.badge.st-done { background: var(--mint-600); color: #fff; }
.badge.st-want { background: #f2f2f2; color: #888; }
/* 优先级徽章配色（P0-P4，与手机端一致） */
.badge.p0 { background: #fde8e8; color: #c0392b; }
.badge.p1 { background: #fdf3e0; color: #b8791a; }
.badge.p2 { background: var(--mint-100); color: var(--mint-700); }
.badge.p3 { background: #f0f0f0; color: #888; }
.badge.p4 { background: #f7f7f7; color: #aaa; }
/* 优先级二维矩阵（紧迫性 × 影响力） */
.prio-matrix { display: grid; grid-template-columns: 62px repeat(3, 1fr); gap: 5px; }
.prio-matrix .pm-label { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--ink-3); text-align: center; }
.prio-matrix .pm-cell { border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 2px; text-align: center; font-size: 10px; color: var(--ink-2); background: #fff; cursor: pointer; transition: all .15s; }
.prio-matrix .pm-cell b { display: block; font-size: 14px; color: var(--ink); margin-bottom: 1px; }
.prio-matrix .pm-cell.on { border-color: var(--mint-600); background: var(--mint-100); box-shadow: 0 0 0 2px var(--mint-200); }
.prio-matrix .pm-cell.on b { color: var(--mint-700); }

.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.map-cell { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; text-align: center; box-shadow: var(--shadow); }
.map-cell .mc-ico { font-size: 24px; }
.map-cell .mc-name { font-size: 13px; font-weight: 600; margin: 6px 0; }
.map-cell .mc-bar { height: 5px; border-radius: 3px; background: var(--mint-100); overflow: hidden; }
.map-cell .mc-bar i { display: block; height: 100%; background: var(--mint-500); }
.map-cell .mc-n { font-size: 11px; color: var(--ink-3); margin-top: 5px; }

/* ---------- 浮动 + 按钮 ---------- */
.fab {
  position: fixed; z-index: 200; width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--mint-500), var(--mint-600)); color: #fff; font-size: 28px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(0,160,113,.45);
  transition: transform .18s;
}
.fab:hover { transform: scale(1.08) rotate(90deg); }

/* ---------- 管家语录条 ---------- */
.butler-bar {
  display: flex; align-items: center; gap: 10px; background: linear-gradient(90deg, var(--mint-100), #fff);
  border: 1px solid var(--mint-200); border-radius: var(--radius); padding: 12px 18px; margin-bottom: 18px;
}
.butler-bar .avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--mint-400), var(--mint-600));
  display: flex; align-items: center; justify-content: center; font-size: 19px; color: #fff;
}
.butler-bar .say { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.butler-bar .say b { color: var(--mint-700); }

.empty-tip { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty-tip .big { font-size: 44px; margin-bottom: 12px; }

/* 标签筛选底栏（桌面端愿景模块底部） */
.tag-dock {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; background: rgba(255,255,255,.92); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(6px);
}
.tag-dock .td-label { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-right: 4px; }

/* 反射笔记条目 */
.note-item { border-left: 3px solid var(--mint-400); background: var(--mint-50); padding: 10px 12px; border-radius: 0 8px 8px 0; margin-bottom: 8px; }
.note-item .n-date { font-size: 11px; color: var(--ink-3); margin-bottom: 4px; }
.note-item .n-text { font-size: 13px; line-height: 1.6; color: var(--ink-2); white-space: pre-wrap; }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 900;
  background: var(--ink); color: #fff; padding: 10px 22px; border-radius: 999px; font-size: 13px;
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.toast.show { opacity: .92; }

/* ---------- 领域选择器：分层配色（薄荷曼波五色按层级递进） ---------- */
.dom-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.dom-row .row-lab { font-size: 10px; color: var(--ink-3); width: 34px; flex-shrink: 0; }
.dom-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .15s; border: 1px solid transparent; white-space: nowrap;
}
.dom-chip.dc-0 { background: #00a071; color: #fff; }
.dom-chip.dc-1 { background: #64bfa5; color: #fff; }
.dom-chip.dc-2 { background: #8fd3bb; color: #0f3a2c; }
.dom-chip.dc-3 { background: #b1deca; color: #0f3a2c; }
.dom-chip.dc-4 { background: #b8eab3; color: #0f3a2c; }
.dom-chip.dc-5 { background: #bce3e4; color: #0f3a2c; }
.dom-chip .kids { font-size: 10px; opacity: .75; }
.dom-chip.on { box-shadow: 0 0 0 2px var(--gold); font-weight: 700; }
.dom-chip.on::after { content: "✓"; font-size: 10px; }
.dom-chip.exp { box-shadow: 0 0 0 2px rgba(15,58,44,.35); }

/* ---------- 素材封面标记 ---------- */
.cover-badge {
  position: absolute; left: 0; top: 0; padding: 3px 9px; border-radius: 8px 0 8px 0;
  background: var(--gold); color: #fff; font-size: 10px; font-weight: 700;
}
.media-item .thumb { position: relative; }

/* ---------- 筛选面板领域按层级着色 ---------- */
.dp-chip .depth-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
