:root {
  --ink: #ececf0;
  --ink-soft: #b4b4bd;
  --ink-muted: #7e7e89;
  --paper: #ffffff;
  --night: #101013;
  --night-2: #17171b;
  --night-3: #202027;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);
  --gold: #6d9dff;
  --gold-light: #9db9ff;
  --gold-faint: rgba(109, 157, 255, .13);
  --on-accent: #0b1324;
  --glow: rgba(109, 157, 255, .5);
  --sage: #7ab894;
  --red: #e5484d;
  --blue: #6d9dd3;
  --chat-assistant-avatar: url("./assets/zhigui-turtle-mascot.png");
  --chat-user-avatar: none;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  /* 默认 4:6 分栏：AI 对话区占视口 60%（可拖拽 360px–视口 72%），信息栏占剩余 40%（localStorage 覆盖本值） */
  --chat-w: clamp(420px, 60vw, 1200px);
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --shadow: 0 12px 40px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body { overflow: hidden; background: var(--night); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
.hidden { display: none !important; }
.page { min-height: 100%; }
.eyebrow { margin: 0; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .14em; line-height: 1.4; }
.wordmark, .mobile-wordmark { display: flex; align-items: center; gap: 8px; color: var(--ink); font-family: var(--serif); font-size: 25px; font-weight: 700; letter-spacing: .08em; }
.brand-mascot { display: inline-grid; position: relative; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 11px 11px 11px 4px; background: linear-gradient(145deg, #2c2c33, #1a1a1f); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
/* The source art has a taller portrait composition. Center its face instead
   of relying on grid centering plus a one-sided transform, which made it look
   low and left in the small top-bar frame. */
.brand-mascot img { position: absolute; top: 50%; left: 50%; width: 142%; height: auto; max-width: none; transform: translate(-50%, -46%); }

/* Login */
.login-page { display: grid; place-items: center; padding: 28px; overflow-y: auto; background: var(--night); }
.login-page::before, .login-page::after { position: fixed; width: 44vw; height: 44vw; content: ""; border-radius: 50%; pointer-events: none; filter: blur(4px); }
.login-page::before { top: -23vw; left: -13vw; background: radial-gradient(circle, rgba(109, 157, 255, .10), transparent 67%); }
.login-page::after { right: -18vw; bottom: -30vw; background: radial-gradient(circle, rgba(109, 157, 255, .05), transparent 65%); }
.login-shell { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(340px, 1.2fr) minmax(340px, .8fr); width: min(1020px, 100%); min-height: 610px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--night-2); box-shadow: var(--shadow); }
.login-intro { display: flex; flex-direction: column; padding: clamp(38px, 7vw, 76px); border-right: 1px solid var(--line); background: var(--night-3); }
.intro-copy { margin: auto 0; }
.intro-copy .eyebrow { margin-bottom: 18px; }
.intro-copy h1 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: clamp(34px, 4vw, 53px); font-weight: 600; letter-spacing: .04em; line-height: 1.28; }
.intro-copy p:not(.eyebrow) { max-width: 380px; margin: 22px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 2; }
.intro-notes { display: grid; gap: 12px; color: var(--ink-soft); font-size: 13px; }
.intro-notes div { display: flex; align-items: center; gap: 10px; }
.note-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--glow); }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 5vw, 62px); background: var(--night-2); }
.mobile-wordmark { display: none; margin-bottom: 48px; font-size: 22px; }
.login-card .eyebrow { margin-bottom: 15px; }
.login-card h2 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: 28px; font-weight: 600; letter-spacing: .025em; }
.login-subtitle { margin: 12px 0 35px; color: var(--ink-soft); font-size: 14px; line-height: 1.8; }
.login-action { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; text-decoration: none; transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.login-action:hover { transform: translateY(-1px); }
.auth-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0 0 17px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
.auth-tab { min-height: 31px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 12px; transition: .2s ease; }
.auth-tab:hover { color: var(--ink-soft); }.auth-tab.active { background: var(--gold-faint); color: var(--gold-light); }
.auth-form { display: grid; gap: 13px; }.form-field { display: grid; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 600; letter-spacing: .03em; }.form-field span { display: flex; justify-content: space-between; }.form-field em { color: var(--ink-muted); font-style: normal; font-weight: 400; }.form-field input { width: 100%; height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--night-3); color: var(--ink); font: inherit; font-size: 13px; transition: border-color .2s ease, background .2s ease; }.form-field input::placeholder { color: var(--ink-muted); }.form-field input:focus { border-color: var(--gold); background: var(--night-3); }
.auth-submit { gap: 8px; margin-top: 5px; background: var(--gold); color: var(--on-accent); font-size: 14px; font-weight: 700; }.auth-submit:hover { background: var(--gold-light); }.auth-submit:disabled { cursor: wait; opacity: .65; transform: none; }
.auth-link-row { display: flex; justify-content: flex-end; margin-top: -4px; }.auth-text-button { padding: 2px 0; border: 0; background: transparent; color: var(--gold-light); cursor: pointer; font-size: 11px; }.auth-text-button:hover { color: var(--ink); text-decoration: underline; }
.code-row { display: flex; align-items: center; gap: 8px; }.form-field .code-row input { min-width: 0; flex: 1; }.auth-send-code { flex: 0 0 auto; min-height: 36px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--gold-faint); color: var(--gold-light); cursor: pointer; font: inherit; font-size: 11px; white-space: nowrap; }.auth-send-code:disabled { cursor: wait; opacity: .65; }
.auth-recovery-note { margin: 0; color: var(--ink-muted); font-size: 11px; line-height: 1.65; }
.local-preview-action { width: 100%; margin-top: 12px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: transparent; color: var(--ink-soft); cursor: pointer; font: inherit; font-size: 12px; }.local-preview-action:hover { border-color: var(--gold); color: var(--gold-light); }
.registration-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.privacy-note { margin: 26px 0 0; color: var(--ink-muted); font-size: 11px; line-height: 1.7; text-align: center; }
.privacy-note a { color: var(--ink-soft); text-decoration: none; }
.privacy-note a:hover { color: var(--gold); }

/* App frame */
.app-page { display: flex; height: 100%; flex-direction: column; background: var(--night); }
.app-topbar { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--night); }
.topbar-brand, .topbar-center, .topbar-actions, .assistant-identity, .account-card { display: flex; align-items: center; }
.topbar-brand { gap: 9px; min-width: 190px; }
.topbar-brand .brand-mascot { width: 29px; height: 29px; border-radius: 10px 10px 10px 3px; }
.topbar-name { color: var(--ink); font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .12em; }
.topbar-divider { width: 1px; height: 15px; margin-left: 6px; background: var(--line-strong); }
.topbar-context { color: var(--ink-muted); font-size: 12px; }
.topbar-center { justify-content: center; gap: 7px; color: var(--ink-muted); font-size: 11px; }
.conn-status { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-muted); }
.conn-status.connected { background: var(--sage); box-shadow: 0 0 9px rgba(145, 178, 135, .8); }
.conn-status.connecting { background: var(--gold); animation: pulse 1.4s infinite ease-in-out; }
.conn-status.disconnected { background: var(--red); }
.topbar-actions { justify-content: flex-end; gap: 13px; min-width: 230px; }
.plan-pill, .quiet-button, .icon-button, .new-chat-button { border: 0; cursor: pointer; }
.plan-pill { display: flex; align-items: center; gap: 7px; max-width: 250px; min-height: 31px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--gold-faint); color: var(--gold-light); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: .2s ease; }
.plan-pill:hover { border-color: var(--gold); background: var(--gold-faint); }
.plan-spark { font-size: 14px; }
.quiet-button { color: var(--ink-muted); background: transparent; font-size: 12px; }
.quiet-button:hover { color: var(--ink); }
.icon-button { display: inline-grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink-muted); transition: .2s ease; }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75; }
.icon-button:hover { border-color: var(--line-strong); background: var(--gold-faint); color: var(--gold-light); }
/* 顶部文字按钮：教程入口用文字而非符号（2026-10-06 用户反馈「符号很难看懂」）。
   full/short 双文案：手机档空间紧张时显示短版（安装 / 示例）。 */
.topbar-text-btn { flex: 0 0 auto; min-height: 31px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 99px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 12px; white-space: nowrap; /* 只过渡颜色类属性：写 all 会让响应式断点切换时 padding/字号也渐变，产生 0.18s 的布局抖动 */ transition: color .18s ease, border-color .18s ease, background-color .18s ease; }
.topbar-text-btn:hover { border-color: var(--gold); background: var(--gold-faint); color: var(--gold-light); }
.topbar-text-btn .btn-label-short { display: none; }
.mobile-only { display: none; }

/* 主导航：顶栏 tab 切换四个全屏视图 */
.app-nav { display: flex; gap: 2px; padding: 0; border: 0; background: transparent; }
.app-nav button { min-height: 30px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 12.5px; transition: .18s ease; }
.app-nav button:hover { color: var(--ink-soft); background: var(--gold-faint); }
.app-nav button.active { background: var(--gold-faint); color: var(--gold-light); font-weight: 600; }
/* 「对话」未读红点：AI 主动消息到达而用户不在对话视图时点亮，切到对话即清除。
   absolute 定位让它脱离 inline-grid 的网格流，不会把按钮文字挤成两行。 */
.app-nav button { position: relative; }
.nav-dot { position: absolute; top: 3px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--night); animation: pulse 1.8s infinite ease-in-out; }
html[data-theme="light"] .nav-dot { box-shadow: 0 0 0 2px #fff; }
@media (min-width: 900px) {
  .app-nav { position: absolute; left: 50%; transform: translateX(-50%); }
}
/* 单视图布局（<900px）需要「对话」tab 切回聊天，避免 760–900px 断裂带无入口 */
@media (max-width: 899.98px) {
  .app-nav button.mobile-only { display: inline-grid; }
}
/* 手机端导航绝对居中：不随品牌/图标宽度差异偏移（topbar-center 此档已隐藏，无重叠） */
@media (max-width: 760px) {
  .app-nav { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
}

/* 右上角个人中心按钮（与主题按钮同款图标样式） */
.topbar-avatar { display: inline-grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; padding: 0; overflow: hidden; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink-muted); cursor: pointer; transition: .2s ease; }
.topbar-avatar svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75; }
.topbar-avatar:hover { border-color: var(--line-strong); background: var(--gold-faint); color: var(--gold-light); }
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 单视图全屏：对话 / 今天 / 笔记 互斥显示，由 data-app-view 驱动（移动端默认） */
.app-workspace { display: flex; min-height: 0; flex: 1; }
.app-page[data-app-view="chat"] .dashboard-panel { display: none; }
.app-page[data-app-view="today"] .assistant-workspace, .app-page[data-app-view="notes"] .assistant-workspace { display: none; }

/* 面板折叠/拖宽手柄：贴在分栏线上，仅桌面显示（媒体查询在其后，覆盖 display:none）；点击折叠，按住左右拖动调宽 */
.panel-toggle { position: absolute; z-index: 5; top: 50%; display: none; place-items: center; width: 17px; height: 56px; padding: 0; border: 1px solid var(--line-strong); border-radius: 9px 0 0 9px; background: var(--night-2); color: var(--ink-muted); cursor: col-resize; transform: translateY(-50%); transition: right .28s cubic-bezier(.3, .7, .3, 1), color .18s ease, border-color .18s ease; }
.panel-toggle:hover { border-color: var(--gold); color: var(--gold-light); }
.panel-toggle::before { content: "›"; font-size: 15px; font-weight: 700; line-height: 1; }
.app-page.panel-collapsed .panel-toggle::before { content: "‹"; }

/* 拖拽调宽过程中关闭过渡，保证跟手 */
.app-page.panel-resizing, .app-page.panel-resizing .dashboard-panel, .app-page.panel-resizing .panel-toggle, .app-page.panel-resizing .dashboard-content { transition: none !important; }
body.panel-dragging { cursor: col-resize; user-select: none; }

/* 桌面端混合布局：面板常驻右侧，对话在左，两者同屏；顶部 tab 仅切换面板内容 */
@media (min-width: 900px) {
  .app-workspace { position: relative; }
  /* 导航绝对居中后，连接状态文字不再放顶栏中部，避免与 tab 重叠 */
  .topbar-center { display: none; }
  .app-page[data-app-view] .assistant-workspace { display: flex; flex: 0 0 var(--chat-w); order: 2; transition: flex-basis .28s cubic-bezier(.3, .7, .3, 1); }
  .app-page[data-app-view] .dashboard-panel { display: flex; flex: 1 1 0; order: 1; min-width: 0; overflow: hidden; transition: flex-basis .28s cubic-bezier(.3, .7, .3, 1); }
  .app-page.panel-collapsed .assistant-workspace { flex: 1 1 0; }
  .app-page.panel-collapsed .dashboard-panel { flex: 0 0 0; border-right-color: transparent; }
  .app-page[data-app-view] .dashboard-content { min-width: 0; }
  .app-page.panel-collapsed .dashboard-content { opacity: 0; }
  .panel-toggle { display: grid; right: 0; border-radius: 0 9px 9px 0; }
  .app-page:not(.panel-collapsed) .panel-toggle { right: var(--chat-w); }
  /* 笔记独立全屏：对话区隐藏，面板占满整行铺开田字格 */
  .app-page[data-app-view="notes"] .assistant-workspace { display: none; }
  .app-page[data-app-view="notes"] .dashboard-panel { flex: 1 1 0; border-right: 0; }
  .app-page[data-app-view="notes"] .dashboard-content { min-width: 0; }
  .app-page[data-app-view="notes"] .panel-toggle { display: none; }
}

/* 灵动微交互 */
.msg { animation: msgIn .32s cubic-bezier(.25, .8, .35, 1) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.welcome-symbol { animation: floaty 3.6s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.send-button:hover { transform: scale(1.06); }
.auth-submit:hover, .entity-submit:hover { transform: translateY(-1px); }

/* Dashboard / the original second-brain panel language */
.dashboard-panel { display: flex; min-height: 0; flex: 1; flex-direction: column; border-left: 1px solid var(--line); background: var(--night-3); }
.dashboard-content { min-height: 0; flex: 1; padding: 0 16px 18px 22px; overflow-y: auto; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; transition: opacity .16s ease; }
.dashboard-content.is-syncing { opacity: .72; }
.dashboard-content::-webkit-scrollbar, .chat-messages::-webkit-scrollbar { width: 6px; }
.dashboard-content::-webkit-scrollbar-thumb, .chat-messages::-webkit-scrollbar-thumb { border-radius: 10px; background: var(--line-strong); }
.dashboard-day { max-width: 860px; margin: 0 auto; padding: 4px 4px 16px 0; }
/* 滚动日期条：吸顶、横向滚动、两端暗示可滚 */
.date-strip { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; margin: 0 -16px 12px -22px; padding: 10px 16px 8px 22px; background: var(--night-3); border-bottom: 1px solid var(--line); }
.date-strip-scroll { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; scroll-behavior: auto; }
.date-strip-scroll::-webkit-scrollbar { display: none; }
.date-chip { display: grid; justify-items: center; gap: 1px; min-width: 40px; padding: 5px 4px 6px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink-muted); cursor: pointer; font: inherit; transition: .15s ease; }
.date-chip-week { font-size: 10px; line-height: 1.3; }
.date-chip-day { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink-soft); }
.date-chip::after { content: ""; width: 5px; height: 5px; border-radius: 999px; margin-top: 1px; }
.date-chip.has::after { background: var(--gold); }
.date-chip.today .date-chip-week { color: var(--gold); }
.date-chip.selected { border-color: var(--gold); background: rgba(214, 178, 106, .08); }
.date-strip-calendar { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--ink-muted); cursor: pointer; }
.date-strip-calendar svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }
html[data-theme="light"] .date-strip { background: #f7f9fd; }
.focus-hero { padding: 18px; overflow: hidden; border: 1px solid var(--gold-faint); border-radius: var(--radius); background: linear-gradient(135deg, rgba(109, 157, 255, .13), rgba(16, 16, 19, .82)); }
.focus-hero .eyebrow { color: var(--gold-light); }
.focus-title { margin: 9px 0 7px; color: var(--ink); font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: .02em; line-height: 1.45; }
.focus-summary { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink-soft); font-size: 12px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.focus-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line); }
.focus-metric strong { display: block; color: var(--gold-light); font-family: var(--serif); font-size: 18px; font-weight: 600; }
.focus-metric span { display: block; margin-top: 2px; color: var(--ink-muted); font-size: 10px; }
.dashboard-section { margin-top: 21px; }
.dashboard-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; padding-right: 3px; }
.dashboard-section-title { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.section-marker { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--glow); }
.section-count { color: var(--ink-muted); font-size: 11px; }

/* 总览板「已逾期 N」筛选按钮：默认弱化警示色胶囊，激活时实底 */
.overview-overdue-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; line-height: 1.6; cursor: pointer;
  color: var(--red); background: transparent;
  border: 1px solid color-mix(in srgb, var(--red) 45%, transparent);
}
.overview-overdue-toggle:hover { background: color-mix(in srgb, var(--red) 10%, transparent); }
.overview-overdue-toggle.active { color: #fff; background: var(--red); border-color: var(--red); }
.section-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .018); }
.panel-item { position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 58px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.panel-item:last-child { border-bottom: 0; }
.panel-item:hover { background: rgba(255, 255, 255, .025); }
.item-time, .item-icon { display: grid; flex: 0 0 31px; place-items: center; min-height: 25px; color: var(--gold); font-family: var(--serif); font-size: 11px; }
.item-time { justify-content: start; }
.item-icon { width: 25px; flex-basis: 25px; border-radius: 7px; background: var(--gold-faint); font-size: 12px; }
.item-icon.goal { color: #d9b785; }
.item-icon.note { color: var(--blue); background: rgba(138, 167, 198, .1); }
.item-icon.decision { color: var(--sage); background: rgba(145, 178, 135, .1); }
.item-copy { min-width: 0; flex: 1; }
/* BUGFIX: 之前 overflow:hidden + text-overflow:ellipsis + white-space:nowrap → 长标题被截断（"论文笔记：Deep ...（扩散概"），改为自动换行。任务名/小目标名仍保留单行（避免视觉碎片化）。 */
.item-title { color: var(--ink); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; word-break: break-word; }
.item-title.done { color: var(--ink-muted); text-decoration: line-through; }
.note-item .item-title { font-weight: 600; }
/* 笔记「田地」网格：卡片独立成块，不再是横向长条 */
.section-list.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: stretch; gap: 14px; border: 0; background: transparent; }
.note-grid .panel-item { flex-direction: column; align-items: stretch; height: 100%; min-height: 168px; padding: 16px 16px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--night-2); box-shadow: 0 1px 3px rgba(0, 0, 0, .04); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.note-grid .panel-item:hover { border-color: var(--gold); box-shadow: 0 8px 22px rgba(23, 42, 88, .10); transform: translateY(-2px); }
.note-grid .panel-item.expanded { grid-column: 1 / -1; }
.note-grid .item-title { display: -webkit-box; overflow: hidden; margin: 2px 0 8px; color: var(--ink); font-size: 14px; font-weight: 650; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.note-grid .item-actions { position: absolute; top: 7px; right: 7px; opacity: 0; transition: opacity .18s ease; }
.note-grid .panel-item:hover .item-actions, .note-grid .panel-item.expanded .item-actions { opacity: 1; }
.note-grid .section-empty { grid-column: 1 / -1; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.note-grid .note-detail { border-top: 1px dashed var(--line); margin-top: 9px; padding-top: 9px; }
.note-grid .note-caret { position: absolute; right: 9px; bottom: 9px; opacity: 0; transition: opacity .18s ease; }
.note-grid .panel-item:hover .note-caret, .note-grid .panel-item.expanded .note-caret { opacity: 1; }

.entity-form-hint { margin: 0; color: var(--ink-muted); font-size: 11.5px; line-height: 1.7; }
/* 短元素（任务名/单行 chip）仍用单行 + 省略号 */
.item-meta { overflow: hidden; margin-top: 4px; color: var(--ink-muted); font-size: 12px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.item-status { flex: 0 0 auto; align-self: center; padding: 3px 5px; border-radius: 5px; background: rgba(145, 178, 135, .1); color: var(--sage); font-size: 9px; }
.item-status.pending { color: var(--gold); background: var(--gold-faint); }
.item-status.risk { color: var(--red); background: rgba(229, 72, 77, .16); }

/* 面板条目操作按钮（与 skill 前端一致）*/
.item-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 5px; opacity: 0; transition: opacity .18s ease; }
.panel-item:hover .item-actions { opacity: 1; }
.panel-item.is-done .item-actions { opacity: .55; }

/* 完成勾选框（task / errand）*/
.item-check { flex: 0 0 auto; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 2px solid var(--line-strong); border-radius: 7px; background: transparent; cursor: pointer; transition: .18s ease; }
.item-check:hover { border-color: var(--gold); background: var(--gold-faint); }
.item-check.checked { border-color: var(--gold); background: var(--gold); }
.item-check.checked::after { content: "✓"; color: var(--night); font-size: 12px; font-weight: 800; line-height: 1; }

/* 目标完成按钮（对勾图标）*/
.item-check.goal-check { border: 0; border-radius: 6px; background: transparent; color: var(--ink-muted); }
.item-check.goal-check svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.item-check.goal-check:hover { background: rgba(145, 178, 135, .15); color: var(--sage); }
.item-check.goal-check.checked { opacity: 1 !important; color: var(--sage); background: rgba(145, 178, 135, .12); }

/* 删除按钮（垃圾桶图标）*/
.item-delete { display: grid; flex: 0 0 auto; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink-muted); cursor: pointer; transition: .18s ease; }
.item-delete svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.item-delete:hover { color: var(--red); background: rgba(229, 72, 77, .16); }

/* 决策"结束跟踪"按钮 */
.item-resolve { flex: 0 0 auto; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 5px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 9px; white-space: nowrap; transition: .18s ease; }
.item-resolve:hover { border-color: var(--sage); color: var(--sage); background: rgba(145, 178, 135, .1); }

/* 已完成条目整体降低存在感 */
.panel-item.is-done { opacity: .6; }
.panel-item.is-done:hover { opacity: 1; }
.dashboard-empty { padding: 21px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--ink-muted); font-size: 11px; line-height: 1.8; text-align: center; }
.dashboard-empty b { display: block; margin-bottom: 5px; color: var(--ink-soft); font-weight: 500; }
.panel-loading { display: flex; justify-content: center; gap: 7px; padding: 45px; }
.panel-loading span { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); animation: bounce 1.1s infinite ease-in-out; }
.panel-loading span:nth-child(2) { animation-delay: .14s; }.panel-loading span:nth-child(3) { animation-delay: .28s; }
.account-card { gap: 10px; min-height: 70px; padding: 12px 20px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, .12); }
.avatar { display: grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold-light); background: #33251c; font-family: var(--serif); font-size: 13px; object-fit: cover; }
.account-copy { min-width: 0; flex: 1; }.account-copy strong, .account-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { color: var(--ink-soft); font-size: 11px; font-weight: 600; }.account-copy span { margin-top: 3px; color: var(--ink-muted); font-size: 10px; }

/* AI workspace */
.assistant-workspace { display: flex; position: relative; min-width: 0; flex: 1; flex-direction: column; background: var(--night-2); }
.assistant-header { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 0 clamp(22px, 4vw, 52px); border-bottom: 1px solid var(--line); background: var(--night-2); }
.assistant-identity { gap: 11px; }.assistant-orb { display: grid; position: relative; place-items: center; width: 39px; height: 39px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 14px 14px 14px 4px; background: linear-gradient(135deg, #2e2e35, #1b1b20); }.assistant-orb img { position: absolute; top: 50%; left: 50%; width: 150%; height: auto; max-width: none; transform: translate(-50%, -46%); }
.assistant-identity h2 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: .03em; }.assistant-identity p { margin: 3px 0 0; color: var(--ink-muted); font-size: 11px; }
.new-chat-button { display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; color: var(--ink-soft); font-size: 11px; transition: .2s ease; }.new-chat-button:hover { color: var(--gold-light); border-color: var(--gold); background: var(--gold-faint); }.new-chat-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.chat-messages { width: min(980px, 100%); min-height: 0; flex: 1 1 0; margin: 0 auto; padding: clamp(22px, 4vh, 52px) clamp(32px, 6vw, 70px) 18px; overflow-y: auto; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; -webkit-overflow-scrolling: touch; max-height: calc(100vh - 250px); }
/* BUGFIX: 有消息时隐藏欢迎空态，避免和对话内容共存（截图 1 问题） */
.chat-messages.has-messages .welcome-msg { display: none; }
.welcome-msg { max-width: 570px; margin: clamp(10px, 10vh, 95px) auto 0; text-align: center; }.welcome-symbol { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 24px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold-light); background: var(--gold-faint); font-size: 19px; }.welcome-msg .eyebrow { margin-bottom: 13px; }.welcome-msg h2 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: clamp(24px, 3vw, 31px); font-weight: 600; letter-spacing: .025em; }.welcome-msg p:last-child { max-width: 470px; margin: 17px auto 0; color: var(--ink-soft); font-size: 14px; line-height: 1.9; }
.msg { max-width: min(760px, 88%); margin: 0 0 17px; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }.msg-user { width: fit-content; max-width: min(640px, 76%); margin-left: auto; }.msg-ai { margin-right: auto; padding: 0; color: var(--ink); }.msg-tool { display: inline-flex; align-items: center; gap: 6px; margin: 3px 0 14px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, .03); color: var(--ink-muted); font-size: 10px; animation: toolPulse 1.8s ease-in-out infinite; transition: opacity .35s ease; }.msg-tool.fading { opacity: .35; animation: none; }
.msg-tool::before { width: 6px; height: 6px; content: ""; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--glow); animation: dotPulse 1.2s ease-in-out infinite; }
@keyframes toolPulse { 0%, 100% { border-color: var(--line); background: rgba(255, 255, 255, .03); } 50% { border-color: var(--line-strong); background: var(--gold-faint); } }
@keyframes dotPulse { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.6); opacity: .45; } }.msg-error { border: 1px solid rgba(229, 72, 77, .35); background: rgba(229, 72, 77, .1); color: var(--red); font-size: 12px; }.typing-indicator { display: flex; align-items: center; gap: 5px; width: fit-content; margin: 0 0 18px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, .025); }.typing-indicator span { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); animation: bounce 1.2s infinite ease-in-out; }.typing-indicator span:nth-child(2) { animation-delay: .15s; }.typing-indicator span:nth-child(3) { animation-delay: .3s; }
/* AI 回复末尾附带的可点击选项（用户点击即发送该选项） */
.ai-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ai-option-chip { flex: 0 0 auto; min-height: 28px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 99px; background: rgba(255, 255, 255, .02); color: var(--ink-muted); cursor: pointer; font-size: 11px; transition: .2s ease; }
.ai-option-chip:hover { border-color: var(--line-strong); color: var(--gold-light); background: var(--gold-faint); }
.composer-wrap { width: min(780px, 100%); margin: 0 auto; padding: 0 clamp(22px, 6vw, 70px) 23px; }.attachment-preview { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 8px; }.attachment-preview.hidden { display: none; }.attachment-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 30px; padding: 4px 6px 4px 8px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--gold-faint); color: var(--ink-soft); font-size: 11px; }.attachment-chip.uploading { color: var(--gold-light); }.attachment-chip .attachment-name { overflow: hidden; max-width: 170px; text-overflow: ellipsis; white-space: nowrap; }.attachment-chip button { display: grid; place-items: center; width: 19px; height: 19px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 15px; line-height: 1; }.attachment-chip button:hover { background: rgba(229, 72, 77, .16); color: var(--red); }.file-input { display: none; }.chat-input-area { display: flex; align-items: flex-end; gap: 10px; padding: 8px 9px 8px 10px; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--night-2); box-shadow: 0 8px 28px rgba(0, 0, 0, .1); transition: border-color .2s ease; }.chat-input-area:focus-within { border-color: var(--gold); }.attach-button { display: grid; flex: 0 0 auto; place-items: center; width: 35px; height: 35px; padding: 0; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink-muted); cursor: pointer; transition: .2s ease; }.attach-button:hover { border-color: var(--line-strong); background: var(--gold-faint); color: var(--gold-light); }.attach-button:disabled { cursor: wait; opacity: .5; }.attach-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }.chat-input-area textarea { display: block; width: 100%; max-height: 136px; padding: 6px 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; line-height: 1.6; }.chat-input-area textarea::placeholder { color: var(--ink-muted); }.send-button { display: grid; flex: 0 0 auto; place-items: center; width: 35px; height: 35px; padding: 0; border: 0; border-radius: 10px; background: var(--gold); color: var(--on-accent); cursor: pointer; transition: .2s ease; }.send-button:hover { background: var(--gold-light); transform: translateY(-1px); }.send-button:disabled { cursor: wait; opacity: .55; transform: none; }.send-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }.composer-hint { margin: 8px 0 0; color: var(--ink-muted); font-size: 10px; text-align: center; }.composer-hint span { color: var(--ink-soft); }.msg-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }.msg-attachment { max-width: 100%; padding: 3px 7px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--gold-faint); color: var(--ink-soft); font-size: 10px; }
/* BUGFIX: 用户消息卡片是深棕色，里面的 chip 文字颜色变量被主题覆盖（浅色主题下深棕文字看不清），强制用浅色 */
.msg-user .msg-attachments { gap: 4px; }
.msg-user .msg-attachment { border-color: var(--line-strong); background: var(--gold-faint); color: var(--ink-soft); }

/* Chat avatars are real elements rather than pseudo-elements.  Pseudo-elements
   were positioned against multi-line messages and could split the avatar from
   its message after a history restore. */
.msg[data-avatar] { display: flex; align-items: flex-start; gap: 10px; max-width: min(760px, 88%); padding: 0; }
.msg[data-avatar="user"] { flex-direction: row-reverse; width: fit-content; max-width: min(640px, 76%); }
.message-avatar { display: grid; flex: 0 0 32px; place-items: center; width: 32px; height: 32px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 11px 11px 11px 4px; background-color: var(--night-2); background-position: center; background-repeat: no-repeat; background-size: cover; color: var(--gold-light); font-size: 12px; font-weight: 700; }
.message-avatar.ai { background-image: var(--chat-assistant-avatar); background-size: 150%; }
.message-avatar.user { background-image: var(--chat-user-avatar); background-color: var(--gold-faint); }
.message-content { min-width: 0; white-space: pre-wrap; word-break: break-word; }
.ai-panel-write { width: fit-content; margin-top: 9px; padding: 3px 8px; border-radius: 999px; background: rgba(122, 184, 148, .14); color: var(--sage); font-size: 11px; line-height: 1.5; }
.msg-user .message-content { padding: 12px 14px; border: 1px solid transparent; border-radius: 14px 14px 4px 14px; background: rgba(109, 157, 255, .17); color: #dfe9ff; }
.avatar-crop-content { width: min(390px, 100%); }.avatar-crop-body { display: grid; justify-items: center; gap: 13px; padding: 0 28px 12px; }.avatar-crop-body canvas { width: min(280px, 74vw); height: auto; border: 1px solid var(--line-strong); border-radius: 18px 18px 18px 5px; background: var(--night-2); cursor: grab; touch-action: none; }.avatar-crop-body canvas:active { cursor: grabbing; }.avatar-crop-body p { margin: 0; color: var(--ink-muted); font-size: 11px; }.avatar-crop-body label { display: flex; align-items: center; width: 100%; gap: 10px; color: var(--ink-soft); font-size: 12px; }.avatar-crop-body input { flex: 1; accent-color: var(--gold); }

.profile-customization-locked { padding: 13px 14px; border: 1px dashed var(--line-strong); border-radius: 11px; background: var(--gold-faint); color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.profile-account-warning { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--gold-faint); color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.profile-referral-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--gold-faint); color: var(--ink-soft); }.profile-referral-card p { margin: 0; line-height: 1.7; }.profile-referral-card > div { display: flex; align-items: center; gap: 12px; }.profile-referral-card strong { color: var(--gold-light); font-size: 20px; letter-spacing: .08em; }.profile-referral-card button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; color: var(--gold-light); cursor: pointer; }.profile-referral-card small { color: var(--ink-muted); }
.profile-mcp-help { margin: 0 0 12px; color: var(--ink-muted); font-size: 11px; line-height: 1.7; }.profile-mcp-create { display: flex; gap: 8px; margin-bottom: 10px; }.profile-mcp-create input { flex: 1 1 auto; min-width: 0; height: 37px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--night-3); color: var(--ink); font: inherit; font-size: 12px; }.profile-mcp-create input:focus { border-color: var(--gold); }.profile-mcp-create button, .profile-mcp-token-reveal button { flex: 0 0 auto; min-height: 37px; padding: 0 13px; border: 1px solid var(--gold); border-radius: 9px; background: var(--gold-faint); color: var(--gold-light); cursor: pointer; font: inherit; font-size: 12px; }.profile-mcp-create button:disabled, .profile-mcp-revoke:disabled { cursor: wait; opacity: .6; }.profile-mcp-token-reveal { display: grid; gap: 7px; margin: 8px 0 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--gold-faint); }.profile-mcp-token-reveal.hidden { display: none; }.profile-mcp-token-reveal p { margin: 0; color: var(--ink-soft); font-size: 11px; }.profile-mcp-token-reveal > div { display: flex; align-items: center; gap: 8px; }.profile-mcp-token-reveal code { flex: 1 1 auto; min-width: 0; overflow: hidden; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--night-3); color: var(--gold-light); font-family: ui-monospace, Consolas, monospace; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.profile-mcp-token-reveal button { min-height: 32px; }.profile-mcp-endpoint { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 10px 0 12px; padding: 11px 13px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--ink-muted); font-size: 11px; }.profile-mcp-endpoint code { color: var(--ink-soft); font-family: ui-monospace, Consolas, monospace; font-size: 11px; word-break: break-all; }.profile-mcp-token-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }.profile-mcp-token-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .015); }.profile-mcp-token-meta { display: grid; min-width: 0; gap: 3px; }.profile-mcp-token-meta strong { color: var(--ink-soft); font-size: 12px; }.profile-mcp-token-meta small { color: var(--ink-muted); font-size: 10px; }.profile-mcp-revoke { flex: 0 0 auto; min-height: 29px; padding: 0 10px; border: 1px solid rgba(229, 72, 77, .28); border-radius: 8px; background: rgba(229, 72, 77, .06); color: #d97b6b; cursor: pointer; font: inherit; font-size: 11px; }.profile-mcp-revoke:hover { background: rgba(229, 72, 77, .14); }.profile-mcp-empty { padding: 12px 2px; color: var(--ink-muted); font-size: 11px; }
#user-avatar { overflow: hidden; } #user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-customization-form { display: grid; gap: 15px; }.avatar-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }.avatar-setting { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }.custom-avatar-preview { display: grid; flex: 0 0 auto; place-items: center; width: 54px; height: 54px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 18px 18px 18px 5px; background: var(--gold-faint); color: var(--gold-light); font-size: 20px; font-weight: 700; }.custom-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }.avatar-setting > div:last-child { display: grid; min-width: 0; gap: 4px; }.avatar-setting strong { color: var(--ink-soft); font-size: 12px; }.avatar-setting small { color: var(--ink-muted); font-size: 10px; line-height: 1.5; }.avatar-setting span { display: flex; align-items: center; gap: 8px; margin-top: 3px; }.avatar-setting input { max-width: 155px; color: var(--ink-muted); font-size: 10px; }.avatar-setting button, .profile-customization-form > button { justify-self: start; min-height: 31px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--gold-faint); color: var(--gold-light); cursor: pointer; font: inherit; font-size: 10px; }.profile-customization-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }.profile-customization-common { grid-template-columns: repeat(2, minmax(0, 1fr)); }.profile-customization-grid label, .profile-customization-note { display: grid; gap: 5px; color: var(--ink-muted); font-size: 11px; }.profile-customization-grid input, .profile-customization-grid select, .profile-customization-note textarea { min-width: 0; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: var(--night-3); color: var(--ink); font: inherit; font-size: 12px; }.profile-customization-grid input, .profile-customization-grid select { height: 37px; padding: 0 9px; }.profile-customization-note textarea { min-height: 66px; padding: 9px; resize: vertical; }.profile-customization-grid input:focus, .profile-customization-grid select:focus, .profile-customization-note textarea:focus { border-color: var(--gold); }.customization-mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }.customization-mode-switch button { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink-muted); cursor: pointer; text-align: left; }.customization-mode-switch button[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-faint); color: var(--ink); }.customization-mode-switch strong { font-size: 12px; }.customization-mode-switch span, .customization-mode-panel > p { margin: 0; color: var(--ink-muted); font-size: 10px; line-height: 1.6; }.customization-mode-panel { display: grid; gap: 8px; }.customization-mode-panel.hidden { display: none; }#custom-advanced-panel textarea { min-height: 150px; }

/* Subscription */
.modal { display: grid; position: fixed; z-index: 10; inset: 0; place-items: center; padding: 22px; background: rgba(0, 0, 0, .5); backdrop-filter: blur(7px); }.modal-content { width: min(1120px, 100%); max-height: min(86vh, 880px); overflow-y: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--night-2); box-shadow: var(--shadow); }.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 28px 30px 18px; }.modal-header h2 { margin: 5px 0 0; color: var(--ink); font-family: var(--serif); font-size: 25px; font-weight: 600; }.btn-close { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 21px; line-height: 1; }.btn-close:hover { color: var(--red); border-color: rgba(229, 72, 77, .16); }.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 4px 26px 22px; }.plan-card { position: relative; display: flex; min-height: 320px; flex-direction: column; padding: 21px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .02); }.plan-card.featured { border-color: var(--gold); background: var(--night-2); }.badge-popular { position: absolute; top: -10px; right: 14px; padding: 3px 8px; border-radius: 9px; background: var(--gold); color: var(--on-accent); font-size: 10px; font-weight: 700; }.plan-card h3 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: 17px; }.plan-price { margin: 13px 0 3px; color: var(--gold-light); font-family: var(--serif); font-size: 30px; font-weight: 600; }.plan-price small { color: var(--ink-muted); font-family: var(--font); font-size: 11px; font-weight: 400; }.plan-card > p { min-height: 34px; margin: 0 0 15px; color: var(--ink-muted); font-size: 11px; line-height: 1.55; }.plan-card ul { display: grid; gap: 9px; margin: 0 0 20px; padding: 0; list-style: none; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }.plan-card li::before { margin-right: 7px; color: var(--sage); content: "✓"; }.btn-plan { width: 100%; margin-top: auto; padding: 10px; border: 1px solid transparent; border-radius: 8px; background: var(--gold); color: var(--on-accent); cursor: pointer; font-size: 12px; font-weight: 700; }.btn-plan:hover { background: var(--gold-light); }.btn-plan.subtle { border-color: var(--line-strong); background: transparent; color: var(--gold-light); }.btn-plan.subtle:hover { border-color: var(--gold); background: var(--gold-faint); }.btn-plan:disabled { opacity: .55; cursor: wait; }
.refund-policy-consent { margin: 0 26px 18px; padding: 14px 15px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--gold-faint); }.refund-policy-consent label { display: flex; align-items: flex-start; gap: 9px; color: var(--ink-soft); font-size: 11px; line-height: 1.7; cursor: pointer; }.refund-policy-consent input { flex: 0 0 auto; width: 15px; height: 15px; margin: 3px 0 0; accent-color: var(--gold); cursor: pointer; }.refund-policy-consent a { color: var(--gold-light); text-decoration: underline; text-underline-offset: 2px; }.refund-policy-consent p { margin: 8px 0 0 24px; color: var(--ink-muted); font-size: 10px; line-height: 1.65; }
.billing-clarity { margin: 0 26px 30px; padding: 18px 0 0; border-top: 1px solid var(--line); }.billing-clarity { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }.clarity-item { padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, .018); }.clarity-item h3 { margin: 0 0 7px; color: var(--ink); font-size: 12px; font-weight: 650; }.clarity-item p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.72; }
.toast { position: fixed; z-index: 20; bottom: 28px; left: 50%; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--night-3); box-shadow: var(--shadow); color: var(--ink); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: .25s ease; }.toast.visible { opacity: 1; transform: translate(-50%, 0); }.toast.warning { border-color: var(--line-strong); background: var(--night-3); color: var(--gold-light); }

/* Original Skill also offers a calm paper-like light theme. */
html[data-theme="light"] { --ink: #17171a; --ink-soft: #4c4f58; --ink-muted: #83868f; --paper: #ffffff; --night: #fafbfd; --night-2: #ffffff; --night-3: #f3f5fa; --line: rgba(32, 52, 96, .10); --line-strong: rgba(38, 64, 120, .20); --gold: #4a7df0; --gold-light: #3563d8; --gold-faint: rgba(74, 125, 240, .09); --on-accent: #ffffff; --glow: rgba(74, 125, 240, .38); --shadow: 0 10px 36px rgba(23, 42, 88, .10); }
html[data-theme="light"] body, html[data-theme="light"] .login-page, html[data-theme="light"] .app-page { background: var(--night); }
html[data-theme="light"] .login-shell { background: #ffffff; }
html[data-theme="light"] .login-intro { background: linear-gradient(155deg, #f5f8ff, #e9f0fb); }
html[data-theme="light"] .login-card { background: #ffffff; }
html[data-theme="light"] .app-topbar { background: rgba(255, 255, 255, .92); }
html[data-theme="light"] .dashboard-panel { background: #f7f9fd; }
html[data-theme="light"] .assistant-workspace { background: radial-gradient(ellipse at 88% -8%, rgba(74, 125, 240, .055), transparent 42%), #ffffff; }
html[data-theme="light"] .assistant-header { background: rgba(255, 255, 255, .88); }
html[data-theme="light"] .chat-input-area { background: #ffffff; box-shadow: 0 6px 24px rgba(0, 0, 0, .06); }
html[data-theme="light"] .modal-content { background: #ffffff; }
html[data-theme="light"] .toast { border-color: rgba(38, 64, 120, .22); background: #ffffff; box-shadow: 0 10px 34px rgba(23, 42, 88, .18); }
html[data-theme="light"] .intro-copy .eyebrow { color: #8a8a93; }
html[data-theme="light"] .form-field input { background: #ffffff; }
html[data-theme="light"] .msg-user .message-content { border-color: transparent; background: #dce8fd; color: #17294d; }
html[data-theme="light"] .msg-user .msg-attachment { border-color: rgba(23, 41, 77, .18); background: rgba(255, 255, 255, .55); color: #2a3f66; }
html[data-theme="light"] .focus-hero { border-color: var(--gold-faint); background: linear-gradient(135deg, #f4f7ff, #e7eefc); box-shadow: 0 4px 20px rgba(23, 42, 88, .06); }
html[data-theme="light"] .focus-hero .eyebrow { color: #4a7df0; }
html[data-theme="light"] .section-list, html[data-theme="light"] .plan-card { background: #ffffff; }
html[data-theme="light"] .app-nav { background: transparent; }
html[data-theme="light"] .note-grid .panel-item { background: #ffffff; }
html[data-theme="light"] .note-grid .panel-item:hover { background: #ffffff; }
html[data-theme="light"] .plan-card.featured { background: #ffffff; }
html[data-theme="light"] .panel-item:hover { background: rgba(0, 0, 0, .04); }
html[data-theme="light"] .account-card { background: #ffffff; }
html[data-theme="light"] .avatar { background: #ececef; }
html[data-theme="light"] .msg-tool, html[data-theme="light"] .typing-indicator, html[data-theme="light"] .ai-option-chip { background: rgba(0, 0, 0, .04); }
html[data-theme="light"] .msg-attachment { border-color: rgba(0, 0, 0, .14); }

/* ── AI 回复 Markdown 富文本（流式结束后由纯文本转换）── */
.msg-ai .message-content:has(.md-wrap) { white-space: normal; }
.md-wrap { white-space: normal; }
.md-p { margin: 6px 0; line-height: 1.75; }
.md-p:first-child { margin-top: 0; }
.md-p:last-child { margin-bottom: 0; }
.md-h { margin: 12px 0 6px; color: var(--ink); font-weight: 700; line-height: 1.4; }
.md-h:first-child { margin-top: 2px; }
.md-h1 { font-size: 17px; }
.md-h2 { font-size: 15.5px; }
.md-h3 { font-size: 14px; }
.md-h4 { font-size: 13px; }
.md-list { margin: 6px 0; padding-left: 20px; line-height: 1.7; }
.md-list li { margin: 2px 0; }
.md-wrap code { padding: 1px 5px; border-radius: 5px; background: var(--gold-faint); color: var(--gold-light); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .92em; }
.md-code { margin: 8px 0; padding: 10px 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--night-3); white-space: pre; }
.md-code code { padding: 0; background: transparent; color: var(--ink); font-size: 12px; line-height: 1.6; }
.md-bq { margin: 8px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--gold); color: var(--ink-soft); line-height: 1.7; }
.md-hr { height: 1px; margin: 12px 0; background: var(--line-strong); }
.md-table { margin: 8px 0; overflow-x: auto; }
.md-table table { border-collapse: collapse; font-size: 12.5px; }
.md-table th, .md-table td { padding: 6px 10px; border: 1px solid var(--line-strong); text-align: left; }
.md-table th { background: var(--gold-faint); font-weight: 600; }
.md-wrap a { color: var(--gold-light); }

/* ── 对话内矢量图（```zhigui-diagram）── */
.zg-diagram { margin: 10px 0 4px; padding: 12px 12px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--night-2); }
.zg-diagram-title { margin: 0 0 8px; color: var(--ink); font-size: 13px; font-weight: 600; text-align: center; }
.zg-diagram-scroll { overflow-x: auto; }
.zg-diagram svg { display: block; margin: 0 auto; }
.zg-diagram-node { fill: var(--night-3); stroke: var(--line-strong); stroke-width: 1.4; }
.zg-kind-process { fill: var(--night-3); stroke: var(--line-strong); }
.zg-kind-decision { fill: var(--night-2); stroke: var(--gold); stroke-width: 1.6; }
.zg-kind-start { fill: var(--gold); stroke: none; }
.zg-kind-end { fill: var(--gold-faint); stroke: var(--gold); stroke-width: 1.5; }
.zg-diagram-label { fill: var(--ink); font-weight: 500; text-anchor: middle; dominant-baseline: central; }
.zg-kind-start + .zg-diagram-label { fill: var(--on-accent); font-weight: 600; }
.zg-diagram-edge { fill: none; stroke: var(--ink-muted); stroke-width: 1.4; }
.zg-diagram-arrow { stroke: var(--ink-muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.zg-diagram-edge-label { fill: var(--gold-light); font-size: 11px; text-anchor: middle; paint-order: stroke; stroke: var(--night-2); stroke-width: 3px; }

@keyframes pulse { 50% { opacity: .4; transform: scale(.7); } }
@keyframes bounce { 50% { opacity: .35; transform: translateY(-3px); } }

@media (max-width: 760px) {
  body { overflow: hidden; }.desktop-only { display: none; }.mobile-only { display: inline-grid; }.login-page { display: block; height: 100%; padding: 0; overflow: hidden; }.login-page::before { width: 100vw; height: 100vw; top: -55vw; left: -30vw; }.login-page::after { width: 90vw; height: 90vw; right: -48vw; bottom: -34vw; }.login-shell { display: block; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }.login-intro { display: none; }.login-card { height: 100%; min-height: 0; padding: max(38px, env(safe-area-inset-top)) 30px max(36px, env(safe-area-inset-bottom)); background: transparent; justify-content: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }.mobile-wordmark { display: flex; }.login-card h2 { font-size: 29px; }.login-subtitle { max-width: 280px; margin-bottom: auto; }.login-action { margin-top: 12px; }.auth-tabs { margin-top: 30px; }.privacy-note { margin-bottom: 5px; }
  .app-page { height: 100dvh; min-height: 100dvh; }.app-topbar { min-height: 56px; padding: 0 15px; }.topbar-brand { min-width: 0; gap: 7px; }.topbar-name { font-size: 17px; }.topbar-context, .topbar-divider, .topbar-center { display: none; }.topbar-actions { min-width: 0; gap: 5px; }.plan-pill { max-width: 115px; min-height: 29px; padding: 0 8px; font-size: 10px; }.plan-spark { display: none; }.app-workspace { display: block; position: relative; min-height: 0; }.dashboard-panel, .assistant-workspace { position: absolute; inset: 0; min-height: 0; }.dashboard-panel { z-index: 1; border-left: 0; }.assistant-workspace { z-index: 2; }.dashboard-content { padding: 0 14px calc(24px + env(safe-area-inset-bottom)) 20px; }.assistant-header { min-height: 63px; padding: 0 18px; }.assistant-orb { width: 31px; height: 31px; font-size: 16px; }.assistant-identity h2 { font-size: 16px; }.assistant-identity p { font-size: 10px; }.new-chat-button { padding: 6px 8px; font-size: 10px; }.chat-messages { max-height: none; padding: 22px 20px 14px; }.welcome-msg { margin-top: max(25px, 8vh); }.welcome-msg h2 { font-size: 25px; }.welcome-msg p:last-child { font-size: 13px; }.msg { max-width: 92%; font-size: 13px; }.composer-wrap { padding: 0 16px calc(14px + env(safe-area-inset-bottom)); }.composer-hint { display: none; }.app-nav { gap: 2px; padding: 2px; }.app-nav button { min-height: 28px; padding: 0 9px; font-size: 11px; }.plans { grid-template-columns: 1fr; padding: 4px 18px 20px; }.plan-card { min-height: auto; }.refund-policy-consent { margin: 0 18px 14px; padding: 12px; }.refund-policy-consent p { margin-left: 24px; }.billing-clarity { grid-template-columns: 1fr; margin: 0 18px 20px; }.modal-header { padding: 22px 20px 16px; }.modal-header h2 { font-size: 22px; }
}

@media (max-width: 760px) {
  /* 移动端按钮始终可见（无 hover）*/
  .item-actions { opacity: 1; }
  .panel-item.is-done .item-actions { opacity: .7; }
}

@media (max-height: 640px) and (min-width: 761px) { .dashboard-section { margin-top: 13px; }.focus-hero { padding: 13px; }.welcome-msg { margin-top: 20px; }.chat-messages { padding-top: 25px; }.assistant-header { min-height: 62px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ═══════════════════════════════════════════════════════════════════════════
   Second Brain 面板组件（迁移自本地 Skill 面板，保持网页暖金风格）
   ═══════════════════════════════════════════════════════════════════════════ */

/* 日期导航 */
.day-nav { display: inline-flex; align-items: center; gap: 2px; }
.day-nav-btn { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 11px; transition: .18s ease; }
.day-nav-btn:hover { border-color: var(--line-strong); color: var(--gold-light); background: var(--gold-faint); }
.day-nav-today { font-family: var(--serif); font-size: 12px; font-weight: 600; color: var(--ink-soft); }

/* 区块标题右侧操作区 */
.section-header-right { display: flex; align-items: center; gap: 7px; }
.section-add-btn { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--ink-muted); cursor: pointer; transition: .18s ease; }
.section-add-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2; }
.section-add-btn:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-faint); }

/* ── 周期任务卡片 ─────────────────────────────────────────────────────────── */

.period-section .section-list { display: flex; flex-direction: column; gap: 8px; }
.period-card {
  display: flex; flex-direction: column; gap: 9px;
  padding: 10px 11px; border: 1px solid var(--line);
  border-radius: 10px; transition: border-color .18s ease, background .18s ease, opacity .3s ease;
}
.period-card--due { border-color: rgba(229, 72, 77, .5); background: linear-gradient(180deg, transparent, rgba(229, 72, 77, .10)); }
.period-card--idle { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; opacity: .82; }
.period-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.period-copy { min-width: 0; }
.period-title { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.period-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 4px; font-size: 11px; color: var(--ink-muted); }
.period-cycle-tag {
  padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: var(--gold-light); background: var(--gold-faint); border: 1px solid rgba(109, 157, 255, .35);
}
.period-window { opacity: .8; }
.period-state { font-size: 11px; color: var(--gold-light); font-weight: 600; }
.period-due { font-size: 11px; font-weight: 700; color: var(--red); }

.period-progress { display: flex; align-items: center; gap: 10px; padding: 0 2px; }
.period-bar { flex: 1 1 auto; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.period-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, rgba(109, 157, 255, .5), var(--gold)); transition: width .35s ease; }
.period-count { flex: 0 0 auto; font-size: 12px; color: var(--ink-muted); white-space: nowrap; }
.period-count strong { font-size: 13px; color: var(--gold-light); font-weight: 700; }

.period-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.period-btn {
  min-height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px;
  background: transparent; color: var(--ink-soft); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: .18s ease;
}
.period-btn:hover { border-color: var(--gold); color: var(--gold-light); }
.period-btn--plus { color: var(--gold-light); }
.period-btn--done { border-color: rgba(70, 160, 110, .45); color: #2e8b57; }
.period-btn--done:hover { background: rgba(70, 160, 110, .12); border-color: #2e8b57; }
.period-btn--skip { color: var(--ink-muted); }
.period-btn--next { color: var(--ink-muted); }

/* ── 日程内周期任务行（周期融入当日日程） ─────────────────────────────────── */

.period-sched-row { flex-direction: column; gap: 8px; }
.period-sched-row--due { border-left: 3px solid var(--red); }
.period-sched-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.period-sched-line { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.period-window-tag {
  padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: #fff; background: var(--gold); border: 1px solid transparent;
}
.period-due-tag { font-size: 11px; font-weight: 700; color: var(--red); }
.period-sched-meta { font-size: 11px; color: var(--ink-muted); opacity: .85; }
.period-sched-progress { padding: 0 2px; }
.period-sched-row .period-actions { justify-content: flex-start; }

/* ── 首页缩略笔记行 + 「查看全部」按钮 ────────────────────────────────────── */

.note-sched-row { cursor: pointer; gap: 10px; }
.note-sched-row .note-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 999px; background: var(--gold); opacity: .7; margin-top: 5px; }
.note-sched-row:hover { border-color: var(--gold-weak, var(--line-strong)); background: var(--gold-faint); }
.note-sched-chip { flex: 0 0 auto; font-size: 11px; color: var(--gold-light); background: var(--gold-faint); border: 1px solid rgba(109,157,255,.35); border-radius: 999px; padding: 1px 7px; }
.section-go-btn {
  margin-left: auto; padding: 3px 8px; border: none; background: none; cursor: pointer;
  color: var(--gold-light); font: inherit; font-size: 12px; font-weight: 600;
}
.section-go-btn:hover { text-decoration: underline; }

.home-schedule > .dashboard-section-header + .dashboard-date { margin-top: 8px; }
.dashboard-home .dashboard-section + .dashboard-section { margin-top: 14px; }

/* 三板切换（总览 / 日程 / 目标）：下划线式 tab，贴合简约风格 */
.board-tabs { display: flex; gap: 2px; margin: 2px 0 14px; border-bottom: 1px solid var(--line); }
.board-tab { flex: 1 1 0; min-height: 36px; padding: 0; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-muted); cursor: pointer; font: inherit; font-size: 13px; transition: .18s ease; }
.board-tab:hover { color: var(--ink-soft); }
.board-tab.active { border-bottom-color: var(--gold); color: var(--gold-light); font-weight: 600; }

/* 总览板：全量平铺，右侧 DDL 徽标 */
.overview-row { padding-right: 8px; }
.ddl-badge { flex: 0 0 auto; align-self: center; padding: 4px 9px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-soft); font-size: 11px; font-weight: 600; white-space: nowrap; }
.ddl-badge.overdue { border-color: rgba(229, 72, 77, .16); background: rgba(229, 72, 77, .16); color: #e0a291; }
html[data-theme="light"] .ddl-badge.overdue { border-color: rgba(229, 72, 77, .35); background: #fff5f5; color: #b3573f; }
.overview-row.ddl-overdue .item-title { color: #e0a291; }
html[data-theme="light"] .overview-row.ddl-overdue .item-title { color: #b3573f; }
.ddl-inline { color: var(--gold-light); font-weight: 600; }
.ddl-inline.overdue { color: #e0a291; }
html[data-theme="light"] .ddl-inline { color: #2f6fed; }
html[data-theme="light"] .ddl-inline.overdue { color: #b3573f; }
.overview-head { margin-bottom: 10px; }

/* 日程卡片时间列 */
.task-time-block { display: grid; flex: 0 0 52px; gap: 1px; min-width: 52px; padding-top: 2px; }
.task-time-value { color: var(--gold-light); font-family: var(--serif); font-size: 13px; font-weight: 600; }
.task-time-end, .task-time-duration { color: var(--ink-muted); font-size: 9px; line-height: 1.3; }
.item-time-edit { display: grid; flex: 0 0 auto; place-items: center; width: 22px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 12px; transition: .18s ease; }
.item-time-edit:hover { color: var(--gold-light); background: var(--gold-faint); }
.item-tags { display: flex; gap: 5px; margin-top: 4px; }
.tag-chip { padding: 1px 6px; border-radius: 99px; background: rgba(138, 167, 198, .12); color: var(--blue); font-size: 9px; }

/* 待办承诺级别 */
.commitment-tag { flex: 0 0 auto; align-self: flex-start; padding: 3px 7px; border-radius: 6px; font-size: 10px; font-weight: 600; margin-top: 3px; }
.commitment-tag.must { background: rgba(229, 72, 77, .16); color: #e0a291; }
.commitment-tag.should { background: var(--gold-faint); color: #e3c094; }
.commitment-tag.nice { background: rgba(145, 178, 135, .13); color: var(--sage); }

/* 目标 */
.goal-caret { flex: 0 0 auto; align-self: flex-start; width: 16px; height: 16px; padding: 0; border: 0; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 10px; transition: .18s ease; }
.goal-caret:hover { color: var(--gold-light); }
.goal-item.overdue .item-title { color: #e0a291; }
.goal-type-tag { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px; font-size: 8px; font-weight: 600; vertical-align: 1px; }
.goal-type-tag.strategic { background: var(--gold-faint); color: var(--gold-light); }
.goal-type-tag.current { background: rgba(138, 167, 198, .14); color: var(--blue); }
.goal-type-tag.constraint { background: rgba(145, 178, 135, .13); color: var(--sage); }
.goal-signal { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px; font-size: 8px; font-weight: 500; vertical-align: 1px; background: rgba(145, 178, 135, .13); color: var(--sage); }
.goal-signal.at_risk, .goal-signal.blocked { background: rgba(229, 72, 77, .16); color: #e0a291; }
.ddl-info { color: var(--ink-muted); font-size: 10px; }
.ddl-info.ddl-overdue { color: #e0a291; }
.goal-detail { display: grid; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.goal-field { display: grid; gap: 2px; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.goal-field-label { color: var(--ink-muted); font-size: 9px; font-weight: 600; letter-spacing: .05em; }
.goal-derived { display: grid; gap: 4px; }
.goal-derived-title { color: var(--ink-muted); font-size: 9px; font-weight: 600; letter-spacing: .05em; }
.goal-derived-task { display: flex; align-items: baseline; gap: 6px; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.goal-derived-task.done { color: var(--ink-muted); text-decoration: line-through; }
.goal-derived-check { flex: 0 0 auto; color: var(--gold); font-size: 10px; }
.goal-derived-meta { margin-left: auto; color: var(--ink-muted); font-size: 9px; white-space: nowrap; }

/* 决策状态 */
.decision-status-tag { flex: 0 0 auto; align-self: flex-start; margin-top: 2px; padding: 2px 6px; border-radius: 5px; font-size: 9px; font-weight: 600; background: rgba(145, 178, 135, .13); color: var(--sage); }
.decision-status-tag.accepted { background: rgba(145, 178, 135, .15); color: var(--sage); }
.decision-status-tag.pending { background: var(--gold-faint); color: var(--gold-light); }
.decision-status-tag.rejected, .decision-status-tag.expired { background: rgba(229, 72, 77, .16); color: #e0a291; }
.decision-status-tag.resolved, .decision-status-tag.revised, .decision-status-tag.reversed { background: rgba(138, 167, 198, .12); color: var(--blue); }

/* 笔记 */
.note-caret { flex: 0 0 auto; width: 16px; height: 16px; padding: 0; border: 0; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 10px; transition: .18s ease; }
.note-caret:hover { color: var(--gold-light); }
/* 笔记分类：目录式可折叠行（一行一个分类，点行头展开/折叠，折叠状态持久化） */
.note-cat-list { display: grid; gap: 4px; margin-bottom: 4px; }
.note-cat { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .015); transition: border-color .18s ease; }
.note-cat:hover { border-color: var(--line-strong); }
/* 「自动分类」固定在列表最上方：写进去的笔记交给 AI 判断归属 */
.note-cat.is-auto { border-color: var(--line-strong); background: var(--gold-faint); }
.note-cat-head { display: flex; align-items: center; gap: 4px; padding-right: 6px; }
.note-cat-toggle { display: flex; flex: 1 1 auto; align-items: center; gap: 8px; min-width: 0; padding: 8px 4px 8px 9px; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; font: inherit; text-align: left; }
.note-cat-toggle:hover { color: var(--ink); }
.note-cat-chevron { flex: 0 0 auto; width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 5px solid currentColor; opacity: .65; transform: rotate(90deg); transition: transform .18s ease; }
.note-cat.collapsed .note-cat-chevron { transform: rotate(0deg); }
.note-cat-text { display: grid; flex: 1 1 auto; gap: 1px; min-width: 0; }
.note-cat-label { overflow: hidden; color: inherit; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.note-cat-hint { overflow: hidden; color: var(--ink-muted); font-size: 10px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.note-cat-count { flex: 0 0 auto; padding: 1px 6px; border-radius: 99px; background: var(--gold-faint); color: var(--gold-light); font-size: 10px; }
.note-cat-add { display: grid; flex: 0 0 auto; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 15px; line-height: 1; transition: .18s ease; }
.note-cat-add:hover { border-color: var(--gold); background: var(--gold-faint); color: var(--gold-light); }
.note-cat-add svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2; }
/* 「⋯」分类管理入口：只出现在真分类行（自动分类/待整理没有） */
.note-cat-more { display: grid; flex: 0 0 auto; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--ink-muted); cursor: pointer; transition: .18s ease; }
.note-cat-more:hover { border-color: var(--gold); background: var(--gold-faint); color: var(--gold-light); }
.note-cat-more svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
/* ── 分类管理弹窗（重命名 / 删除）────────────────────────────────────────── */
.topic-manage-content { width: min(440px, 100%); }
.topic-manage-body { padding: 0 26px 26px; display: grid; gap: 14px; }
.topic-manage-actions { display: flex; justify-content: flex-end; gap: 9px; }
.topic-manage-divider { margin: 2px 0; border: 0; border-top: 1px solid var(--line); }
.topic-manage-danger { padding: 10px 14px; border: 1px solid rgba(214, 90, 74, .5); border-radius: 9px; background: transparent; color: #d65a4a; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; transition: .18s ease; }
.topic-manage-danger:hover { background: rgba(214, 90, 74, .1); }
.topic-manage-warn { margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; }
.topic-manage-impact { margin: 0; padding-left: 18px; display: grid; gap: 5px; color: var(--ink-muted); font-size: 12px; line-height: 1.6; }
.entity-submit.is-danger { background: rgba(214, 90, 74, .16); border-color: rgba(214, 90, 74, .5); color: #d65a4a; }
.note-cat-body { padding: 0 9px 9px; border-top: 1px solid var(--line); }
.note-cat-body .note-grid { margin-top: 8px; }
.note-cat-body .section-empty { padding: 14px 4px 8px; }
.note-detail { margin-top: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .02); }
.note-content-text { color: var(--ink-soft); font-size: 11px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
/* 笔记关联信息行：其余分类 / 关联目标 / 相关笔记（2026-10-06 多主题） */
.note-relations { margin-top: 7px; display: grid; gap: 3px; }
.note-relations-row { color: var(--ink-muted); font-size: 10.5px; line-height: 1.6; }
.note-edit-textarea { display: block; width: 100%; min-height: 90px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 8px; outline: 0; background: rgba(9, 7, 6, .3); color: var(--ink); font: inherit; font-size: 12px; line-height: 1.6; resize: vertical; }
.note-edit-textarea:focus { border-color: var(--gold); }
.note-edit-actions { display: flex; gap: 6px; margin-top: 7px; }
.note-save-btn, .note-cancel-btn, .note-edit-btn { padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 10px; transition: .18s ease; }
.note-save-btn { border-color: var(--gold); background: var(--gold-faint); color: var(--gold-light); }
.note-save-btn:hover, .note-cancel-btn:hover, .note-edit-btn:hover { border-color: var(--gold); }

/* 加载更多 */
.list-more-btn { display: block; width: 100%; margin-top: 8px; padding: 8px; border: 1px dashed var(--line-strong); border-radius: 9px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 10px; transition: .18s ease; }
.list-more-btn:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-faint); }

/* 每日反思 */
.reflection-card { display: grid; gap: 9px; }
.reflection-summary { display: block; overflow: visible; }
.reflection-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.reflection-stat { padding: 3px 8px; border-radius: 99px; background: var(--gold-faint); color: var(--gold-light); font-size: 10px; }
.reflection-health-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: var(--ink-soft); font-size: 11px; }
.reflection-health-item b { color: var(--ink); font-weight: 600; }
.reflection-health-item span { color: var(--ink-muted); font-size: 10px; }
.reflection-suggestion { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.7; }

/* 知识库工具栏 */
.kb-toolbar { display: flex; gap: 7px; margin-bottom: 12px; }
.kb-category-filter, .kb-search-input { height: 31px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: rgba(9, 7, 6, .3); color: var(--ink); font: inherit; font-size: 11px; transition: border-color .18s ease; }
.kb-category-filter:focus, .kb-search-input:focus { border-color: var(--gold); }
.kb-category-filter { flex: 0 0 auto; max-width: 110px; }
.kb-search-input { min-width: 0; flex: 1; }
.kb-search-btn { flex: 0 0 auto; padding: 0 12px; border: 1px solid var(--gold); border-radius: 8px; background: var(--gold-faint); color: var(--gold-light); cursor: pointer; font-size: 11px; transition: .18s ease; }
.kb-search-btn:hover { background: var(--gold-faint); }
.kb-search-results { margin-bottom: 10px; }
.kb-hit { cursor: pointer; }
.kb-hit-type { flex: 0 0 auto; align-self: center; padding: 2px 6px; border-radius: 4px; background: rgba(138, 167, 198, .12); color: var(--blue); font-size: 9px; }
.kb-more { margin: 8px 0; color: var(--ink-muted); font-size: 10px; text-align: center; }

/* 主题卡片 */
.topics-grid { display: grid; gap: 9px; }
.topic-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .018); transition: border-color .18s ease; }
.topic-card:hover, .topic-card.expanded { border-color: var(--line-strong); }
.topic-head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; cursor: pointer; }
.topic-caret { flex: 0 0 auto; color: var(--ink-muted); font-size: 10px; }
.topic-label { min-width: 0; flex: 1; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.topic-category { flex: 0 0 auto; padding: 2px 7px; border-radius: 99px; background: var(--gold-faint); color: var(--gold-light); font-size: 9px; }
.topic-count { flex: 0 0 auto; color: var(--ink-muted); font-size: 10px; white-space: nowrap; }
.topic-body { padding: 0 12px 12px; border-top: 1px dashed var(--line); }
.topic-body > .panel-loading { padding: 18px; }
.tree-group { margin-top: 10px; }
.tree-group-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--ink-muted); font-size: 10px; font-weight: 600; }
.tree-ico { color: var(--gold); }
.tree-group-body { display: grid; gap: 4px; padding-left: 18px; }
.tree-note { display: flex; align-items: baseline; gap: 7px; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.tree-note-type { flex: 0 0 auto; padding: 0 5px; border-radius: 4px; background: rgba(138, 167, 198, .1); color: var(--blue); font-size: 8px; }
.tree-note-title { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.tree-note-meta { margin-left: auto; color: var(--ink-muted); font-size: 9px; white-space: nowrap; }
.tree-empty { padding: 8px 0 2px; color: var(--ink-muted); font-size: 10px; }
.topic-actions { margin-top: 11px; text-align: right; }
.topic-delete-btn { padding: 5px 11px; border: 1px solid rgba(229, 72, 77, .16); border-radius: 8px; background: transparent; color: #e0a291; cursor: pointer; font-size: 10px; transition: .18s ease; }
.topic-delete-btn:hover { background: rgba(229, 72, 77, .16); }

/* 实体表单（添加/编辑模态框） */
.entity-modal-content { width: min(480px, 100%); }
.entity-form { display: grid; gap: 14px; padding: 4px 30px 28px; }
.entity-field { display: grid; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.entity-form-hint { margin: -6px 0 0; color: var(--ink-muted); font-size: 12px; line-height: 1.6; font-weight: 500; }
/* 笔记分类回显：分类由「分类行 +」带进来，表单里只读展示，不再让用户写完再选 */
.entity-cat-banner { display: flex; align-items: center; gap: 4px; margin: 0; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--gold-faint); color: var(--ink-muted); font-size: 12px; }
.entity-cat-banner strong { color: var(--gold-light); font-weight: 600; }
.entity-cat-banner.is-auto { border-style: dashed; }
.entity-field-label { display: flex; justify-content: space-between; }
.entity-field em { color: var(--ink-muted); font-style: normal; font-weight: 400; }
.entity-field input, .entity-field select, .entity-field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: rgba(9, 7, 6, .3); color: var(--ink); font: inherit; font-size: 12px; transition: border-color .18s ease; }
.entity-field select { appearance: auto; }
.entity-field textarea { min-height: 70px; resize: vertical; line-height: 1.6; }
.entity-field input:focus, .entity-field select:focus, .entity-field textarea:focus { border-color: var(--gold); }
.entity-field input::placeholder, .entity-field textarea::placeholder { color: var(--ink-muted); }

/* ── 事项级提醒：跟随全局 / 提前（天+小时）/ 指定时刻 / 不提醒 ──────────────
 * 2026-10-06：这组类此前**一条样式都没有** —— 四个选项挤成一坨、输入框宽度
 * 被 `.entity-field input { width:100% }` 撑满，用户报障"提醒 UI 没做好"。
 * 改这里时注意：`.entity-remind-opt input[type=number]` 的选择器权重
 * （0-2-1）必须高于 `.entity-field input`（0-1-1），否则宽度会被抢回去。 */
.entity-remind-options { display: grid; gap: 6px; }
.entity-remind-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(9, 7, 6, .2); color: var(--ink-soft); font-size: 12px; font-weight: 500; cursor: pointer; }
.entity-remind-opt.is-on { border-color: var(--gold); background: rgba(212, 175, 55, .08); color: var(--ink); }
.entity-remind-opt input[type="radio"] { flex: 0 0 auto; width: auto; margin: 0; accent-color: var(--gold); }
.entity-remind-opt > span { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.entity-remind-opt input[type="number"] { width: 62px; padding: 4px 7px; font-size: 12px; }
.entity-remind-opt input[type="datetime-local"] { padding: 4px 7px; font-size: 12px; }
.entity-remind-preview { margin: 9px 0 0; color: var(--gold-light); font-size: 12px; font-weight: 600; }
.entity-remind-hint { margin: 6px 0 0; color: var(--ink-muted); font-size: 11px; line-height: 1.6; }
html[data-theme="light"] .entity-remind-opt { background: rgba(255, 255, 255, .6); }
.entity-form-actions { display: flex; justify-content: flex-end; gap: 9px; }
.entity-cancel, .entity-submit { padding: 9px 16px; border-radius: 9px; cursor: pointer; font-size: 12px; transition: .18s ease; }
.entity-cancel { border: 1px solid var(--line); background: transparent; color: var(--ink-soft); }
.entity-cancel:hover { border-color: var(--line-strong); }
.entity-submit { border: 1px solid var(--gold); background: var(--gold); color: var(--on-accent); font-weight: 700; }
.entity-submit:hover { background: var(--gold-light); }
.entity-submit:disabled { cursor: wait; opacity: .6; }

/* 注销账号模态（自定义弹窗替代原生 confirm/prompt） */
.delete-account-content { width: min(430px, calc(100vw - 32px)); }
.delete-account-warning {
  margin: 0 0 14px; padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--red) 40%, transparent);
  border-left: 3px solid var(--red);
  border-radius: 8px;
  color: var(--ink-soft); font-size: 12.5px; line-height: 1.7;
  background: color-mix(in srgb, var(--red) 7%, transparent);
}
.delete-account-code-row { display: flex; gap: 8px; }
.delete-account-code-row input { flex: 1; min-width: 0; }
.delete-account-resend {
  flex: 0 0 auto; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: transparent; color: var(--ink-soft); font-size: 12px; cursor: pointer;
}
.delete-account-resend:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-light); }
.delete-account-resend:disabled { opacity: .55; cursor: not-allowed; }
.delete-account-hint { margin: 9px 0 0; color: var(--ink-muted); font-size: 11.5px; line-height: 1.6; }
.entity-submit.danger { border-color: var(--red); background: var(--red); }
.entity-submit.danger:hover { background: color-mix(in srgb, var(--red) 85%, #fff); }
.entity-relations { border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.015); }
.entity-relations summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; color: var(--ink-soft); cursor: pointer; font-size: 12px; font-weight: 600; }
.entity-relations summary small { color: var(--ink-muted); font-size: 10px; font-weight: 400; }
.entity-relations-body { display: grid; gap: 13px; padding: 2px 12px 13px; border-top: 1px solid var(--line); }
.entity-relation-group { display: grid; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.entity-relation-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; max-height: 132px; overflow: auto; padding: 2px; }
.entity-relation-options label { display: flex; align-items: flex-start; gap: 7px; min-width: 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); cursor: pointer; font-size: 11px; font-weight: 400; line-height: 1.4; }
.entity-relation-options label:has(input:checked) { border-color: var(--gold); background: var(--gold-faint); color: var(--ink); }
.entity-relation-options input { flex: 0 0 auto; width: auto; margin: 2px 0 0; padding: 0; }
.entity-relation-options span { min-width: 0; overflow-wrap: anywhere; }
.entity-relation-empty, .entity-relations-hint { margin: 0; color: var(--ink-muted); font-size: 10px; font-weight: 400; line-height: 1.55; }
.context-review-badge { display: inline-flex; align-items: center; margin-left: 7px; padding: 2px 7px; border: 1px solid rgba(183,115,50,.28); border-radius: 999px; background: var(--gold-faint); color: var(--gold-light); font-size: 9px; font-weight: 500; vertical-align: middle; white-space: nowrap; }
.context-review-badge.needs_user { border-color: rgba(138,167,198,.3); background: rgba(138,167,198,.1); color: var(--blue); }
.context-review-badge.failed { border-color: rgba(229, 72, 77, .35); background: rgba(229, 72, 77, .08); color: #d97b6b; }

/* 时间编辑 */
.time-editor-content { width: min(440px, 100%); }
.time-editor-target { padding: 9px 11px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--ink); font-size: 12px; font-weight: 400; line-height: 1.5; }
.time-editor-hint { margin: -4px 0 0; color: var(--ink-muted); font-size: 10px; line-height: 1.6; }


/* 删除确认 */
.delete-modal-content { width: min(460px, 100%); }
.delete-modal-body { padding: 2px 30px 6px; }
.delete-modal-target { margin: 0 0 12px; color: var(--ink); font-size: 13px; line-height: 1.7; }
.delete-modal-impact { display: grid; gap: 6px; }
.impact-line { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.impact-line.muted { color: var(--ink-muted); border-style: dashed; }
.impact-manifest { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.impact-manifest span { padding: 2px 7px; border-radius: 99px; background: rgba(138, 167, 198, .1); color: var(--blue); font-size: 9px; }
.delete-modal-warn { margin: 13px 0 0; color: var(--ink-muted); font-size: 10px; line-height: 1.6; }
.delete-modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 30px 26px; }
.delete-confirm { background: var(--red); border-color: var(--red); color: #fff8f5; }
.delete-confirm:hover { background: #d98a76; border-color: #d98a76; }

/* 日历 */
.calendar-content { width: min(420px, 100%); padding-bottom: 18px; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 26px 10px; }
.calendar-nav { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 15px; transition: .18s ease; }
.calendar-nav:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-faint); }
.calendar-title { color: var(--ink); font-family: var(--serif); font-size: 16px; font-weight: 600; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; padding: 6px 26px 4px; color: var(--ink-muted); font-size: 10px; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; padding: 4px 26px 10px; }
.calendar-cell { position: relative; display: grid; place-items: center; height: 34px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 12px; transition: .15s ease; }
.calendar-cell:hover { border-color: var(--line-strong); background: var(--gold-faint); }
.calendar-cell.empty { cursor: default; }
.calendar-cell.empty:hover { border-color: transparent; background: transparent; }
.calendar-cell.has { color: var(--gold-light); font-weight: 700; }
.calendar-cell.has::after { content: ''; position: absolute; bottom: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--gold-faint); }
.calendar-cell.today { border-color: var(--gold); color: var(--gold-light); font-weight: 700; }
.calendar-cell.selected { background: var(--gold); color: var(--on-accent); font-weight: 700; }
.calendar-cell.selected.has::after { background: var(--on-accent); box-shadow: none; }
.calendar-cell.selected:hover { background: var(--gold-light); }
.calendar-legend { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 4px 26px 14px; color: var(--ink-muted); font-size: 9px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 2px; vertical-align: 0; }
.legend-dot.has { background: var(--gold); box-shadow: 0 0 0 2px var(--gold-faint); }
.legend-dot.today { border: 1px solid var(--gold); }
.legend-dot.selected { background: var(--gold); }
.calendar-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 8px 26px 4px; }

/* 亮色主题适配 */
html[data-theme="light"] .kb-category-filter, html[data-theme="light"] .kb-search-input,
html[data-theme="light"] .note-edit-textarea, html[data-theme="light"] .entity-field input,
html[data-theme="light"] .entity-field select, html[data-theme="light"] .entity-field textarea { background: rgba(255, 255, 255, .75); }
html[data-theme="light"] .note-detail, html[data-theme="light"] .topic-card { background: rgba(255, 255, 255, .5); }
html[data-theme="light"] .goal-signal.at_risk, html[data-theme="light"] .goal-signal.blocked { color: #b3573f; }
html[data-theme="light"] .commitment-tag.must { color: #b3573f; }
html[data-theme="light"] .commitment-tag.should { color: #a66b37; }
html[data-theme="light"] .decision-status-tag.rejected, html[data-theme="light"] .decision-status-tag.expired { color: #b3573f; }
html[data-theme="light"] .goal-item.overdue .item-title { color: #b3573f; }
html[data-theme="light"] .topic-delete-btn { color: #b3573f; }
html[data-theme="light"] .delete-confirm { color: #fff; }

/* 移动端适配（新面板组件） */
@media (max-width: 760px) {
  .day-nav-today { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .task-time-block { flex-basis: 46px; min-width: 46px; }
  .kb-toolbar { flex-wrap: wrap; }
  .kb-category-filter { max-width: none; width: 100%; }
  .kb-search-input { min-width: 0; }
  .kb-search-btn { flex: 0 0 auto; }
  .calendar-cell { height: 38px; }
  .topic-count { max-width: 150px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .goal-type-tag, .goal-signal { vertical-align: 0; }
  .delete-modal-body, .entity-form, .calendar-weekdays, .calendar-grid, .calendar-legend { padding-left: 20px; padding-right: 20px; }
  .delete-modal-actions { padding-right: 20px; padding-left: 20px; }
  .calendar-header { padding-left: 20px; padding-right: 20px; }
  .entity-modal-content, .time-editor-content, .delete-modal-content, .calendar-content { width: 100%; max-height: min(640px, 92vh); }
  .entity-form { padding-bottom: 24px; }
  /* 分类行在窄屏保持整行可点：行头与「+」都放大到 ≥32px 触控区 */
  .note-cat-toggle { padding: 9px 4px 9px 8px; }
  .note-cat-add { width: 32px; height: 32px; font-size: 17px; }
  /* 触控目标放大：移动端小按钮统一 ≥ 32px 点击区 */
  .section-add-btn, .item-time-edit, .item-delete, .item-check, .day-nav-btn:not(.day-nav-today), .calendar-nav { width: 32px; height: 32px; min-width: 32px; min-height: 32px; }
  .day-nav-today { width: auto; min-width: 0; max-width: 118px; padding: 0 7px; }
  .goal-caret, .note-caret { width: 24px; height: 24px; font-size: 12px; display: grid; place-items: center; }
  .item-check { border-radius: 8px; }
  .errand-filter-chip, .note-save-btn, .note-cancel-btn, .note-edit-btn, .topic-delete-btn, .action-context-toggle, .item-resolve, .action-context-link-edit { min-height: 32px; }
  .errand-filter { flex-wrap: wrap; }
  .kb-search-btn { min-height: 36px; }
  /* 模态框移动端收紧边距 */
  .modal { padding: 12px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   区块空态（对齐 skill 原版：永远渲染区块标题 + 空态文案 + 添加按钮）
   ═══════════════════════════════════════════════════════════════════════════ */

.section-empty { display: block; padding: 22px 14px; color: var(--ink-muted); font-size: 11px; line-height: 1.6; text-align: center; }
.section-empty-double { padding: 30px 14px; color: var(--ink-muted); font-size: 12px; line-height: 1.8; }
.section-empty-sub { display: block; margin-top: 5px; color: var(--ink-muted); font-size: 10px; }
.section-date-inline { color: var(--ink-muted); font-size: 10px; }

/* 待办筛选 chip（未安排时间 / 全部） */
.errand-filter { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .025); }
.errand-filter-chip { padding: 3px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 10px; transition: .18s ease; }
.errand-filter-chip:hover { color: var(--ink-soft); }
.errand-filter-chip.active { background: var(--gold-faint); color: var(--gold-light); }

/* 笔记视图工具区（标题行 / 搜索 / 分类） */
.notes-header { margin-bottom: 10px; }
/* 顶部「添加笔记」文字按钮（2026-10-06 用户拍板：只有分类行的 + 图标容易让人找不到入口） */
.note-add-btn { padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 99px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 11.5px; white-space: nowrap; transition: color .18s ease, border-color .18s ease, background-color .18s ease; }
.note-add-btn:hover { border-color: var(--gold); background: var(--gold-faint); color: var(--gold-light); }
.note-search-row { position: relative; margin: 0 0 10px; }
.note-search-row .note-search-icon { position: absolute; top: 50%; left: 11px; display: grid; place-items: center; width: 15px; height: 15px; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; }
.note-search-row .note-search-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.note-search-row .note-search-input { width: 100%; padding: 8px 30px 8px 32px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--night-2); color: var(--ink); font: inherit; font-size: 12.5px; transition: border-color .18s ease; }
.note-search-row .note-search-input::placeholder { color: var(--ink-muted); }
.note-search-row .note-search-input:focus { outline: none; border-color: var(--gold); }
.note-search-row .note-search-clear { position: absolute; top: 50%; right: 8px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: var(--night-3); color: var(--ink-muted); cursor: pointer; font-size: 13px; line-height: 1; transform: translateY(-50%); }
.note-search-row .note-search-clear:hover { color: var(--red); }
.note-preview { display: -webkit-box; overflow: hidden; margin: 0; color: var(--ink-muted); font-size: 12px; line-height: 1.62; word-break: break-word; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
/* 搜索结果里显示「命中正文」的片段（服务端 searchSnippet 的窗口，前后可能带 …）。
   左侧竖条把它和普通摘要区分开——用户要能一眼看出这条为什么被搜到。 */
.note-preview-match { padding-left: 8px; border-left: 2px solid var(--gold); color: var(--ink); -webkit-line-clamp: 4; }
.note-grid .item-copy { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.note-grid .note-tags-row { margin-top: auto; padding-top: 10px; }

/* 决策横排卡（对齐 skill 原版） */
.decision-card-row { align-items: center; padding: 12px 13px; }
.decision-card-row .decision-copy { flex: 1; display: grid; gap: 3px; }
.decision-evidence { display: -webkit-box; overflow: hidden; color: var(--ink-soft); font-size: 11px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.decision-related { color: var(--ink-muted); font-size: 10px; }
.decision-time { color: var(--ink-muted); font-size: 9px; }
.decision-card-row.archived { opacity: .6; }

/* 笔记 tag 行（替换原 item-meta） */
.note-tags-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.note-tag-chip { padding: 1px 7px; border-radius: 99px; background: rgba(138, 167, 198, .1); color: var(--blue); font-size: 9px; }
.note-enrich-btn { margin-top: 8px; padding: 5px 10px; border: 1px solid var(--gold); border-radius: 999px; background: transparent; color: var(--gold-light); font: inherit; font-size: 12px; cursor: pointer; }
.note-enrich-btn:hover { background: rgba(175, 113, 55, .08); }
.note-enrich-hint { display: inline-block; margin-top: 8px; color: var(--ink-muted); font-size: 11px; }

/* 目标样式微调（区分字段层级） */
.goal-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; white-space: normal; }
.goal-title-text { min-width: 0; white-space: normal; word-break: break-word; }
.goal-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.goal-next { color: var(--ink-soft); font-size: 10px; }
.goal-note-badge { padding: 1px 6px; border-radius: 99px; background: rgba(138, 167, 198, .1); color: var(--blue); font-size: 9px; }
.goal-caret { cursor: pointer; }

html[data-theme="light"] .note-search-row .note-search-input { background: #ffffff; }
html[data-theme="light"] .errand-filter { background: rgba(255, 255, 255, .55); }

/* ═══════════════════════════════════════════════════════════════════════════
   冲突横幅 / 冲突详情 / 执行上下文 / 卡片元数据（对齐 skill 原版）
   ═══════════════════════════════════════════════════════════════════════════ */

/* 冲突单行提示：日程板顶部紧凑红条，点击弹详情 */
.conflict-strip { display: flex; width: 100%; align-items: center; gap: 9px; margin-bottom: 14px; padding: 10px 13px; border: 1px solid rgba(229, 72, 77, .3); border-radius: var(--radius-sm); background: rgba(229, 72, 77, .16); cursor: pointer; text-align: left; font: inherit; transition: .18s ease; }
.conflict-strip:hover { background: rgba(229, 72, 77, .24); }
.conflict-icon { flex: 0 0 auto; color: #e0a291; font-size: 14px; line-height: 1.4; }
.conflict-strip-text { flex: 1 1 auto; min-width: 0; overflow: hidden; color: #e8b3a6; font-size: 12.5px; font-weight: 600; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.conflict-strip-arrow { flex: 0 0 auto; color: #e0a291; font-size: 15px; }
html[data-theme="light"] .conflict-strip { background: #fff5f5; border-color: rgba(229, 72, 77, .35); }
html[data-theme="light"] .conflict-strip-text { color: #b3573f; }

.conflict-modal-content { width: min(460px, 100%); }
.conflict-modal-body { padding: 2px 30px 8px; color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
.conflict-date { margin-bottom: 8px; color: var(--ink-muted); font-size: 12px; }
.conflict-detail-desc { color: var(--ink-soft); }
.conflict-detail-suggestion { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--gold-faint); color: var(--gold-light); font-size: 12px; line-height: 1.7; }
.conflict-modal-actions { display: flex; justify-content: flex-end; padding: 10px 30px 26px; }

/* 卡片元数据：周期 / 锁定 / 来源 / 留存 / 资源 / 关联笔记 */
.errand-pattern-tag.recurring { margin-left: 6px; font-size: 11px; vertical-align: 0; }
.locked-badge { margin-left: 5px; color: var(--gold-light); font-size: 11px; cursor: help; }
.task-resource { margin-top: 3px; color: var(--ink-soft); font-size: 10px; line-height: 1.6; }
.task-card-footer { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.task-source { padding: 1px 6px; border-radius: 4px; font-size: 9px; }
.task-source.manual { background: var(--gold-faint); color: var(--gold-light); }
.task-source.recurring { background: rgba(138, 167, 198, .12); color: var(--blue); }
.task-source:not(.manual):not(.recurring) { background: rgba(145, 178, 135, .12); color: var(--sage); }
.task-retention { padding: 1px 6px; border-radius: 4px; font-size: 9px; }
.task-retention.review { background: var(--gold-faint); color: var(--gold-light); }
.task-retention.memory { background: rgba(138, 167, 198, .12); color: var(--blue); }
/* 执行上下文 */
.action-context-toggle { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin-top: 7px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 10px; line-height: 1.4; transition: .18s ease; }
.action-context-toggle:hover { border-color: var(--line-strong); color: var(--gold-light); background: var(--gold-faint); }
.action-context-summary { overflow: hidden; max-width: 220px; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-muted); font-size: 10px; }
.action-context-caret { line-height: 1; }
.action-context { display: grid; gap: 10px; margin-top: 9px; padding: 10px 0 2px; border-top: 1px solid var(--line); }
.action-context-group { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: start; gap: 9px; }
.action-context-label { padding-top: 3px; color: var(--ink-muted); font-size: 10px; font-weight: 500; line-height: 1.45; }
.action-context-chips { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.action-context-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border-radius: 999px; background: var(--gold-faint); color: var(--ink-soft); font-size: 10px; line-height: 1.4; }
.action-context-chip.topic { background: rgba(138, 167, 198, .1); color: var(--blue); }
.action-context-reason { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 9px; color: var(--ink-soft); font-size: 10px; line-height: 1.6; }
.action-context-item { display: flex; flex-direction: column; gap: 2px; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.action-context-item-type { color: var(--ink-muted); font-size: 9px; }
.action-context-item strong { color: var(--ink); font-weight: 600; font-size: 11px; line-height: 1.5; }
.action-context-item p { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.6; }

/* 页脚更新时间 */
.panel-footer-info { padding: 12px 2px 4px; color: var(--ink-muted); font-size: 9px; text-align: center; }

/* 秘书主动消息 */
.msg-proactive { display: grid; gap: 6px; padding: 11px 14px; border: 1px solid rgba(145, 178, 135, .28); border-radius: 14px; background: rgba(145, 178, 135, .06); }
.msg-proactive-head { display: flex; align-items: center; gap: 8px; }
.msg-proactive-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; background: rgba(145, 178, 135, .14); color: var(--sage); font-size: 10px; font-weight: 600; }
.msg-proactive-badge::before { width: 5px; height: 5px; content: ""; border-radius: 50%; background: var(--sage); }
.msg-proactive-action { color: var(--ink-muted); font-size: 10px; }
.msg-proactive-body { color: var(--ink-soft); font-size: 13px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.msg-reminder { border-color: rgba(109, 157, 255, .30); background: rgba(109, 157, 255, .06); }
.msg-reminder-badge { background: rgba(109, 157, 255, .16); color: var(--gold-light); }
.msg-reminder-badge::before { background: var(--gold); box-shadow: 0 0 8px var(--glow); }

/* 主题树分组 */
.tree-note-time { margin-left: auto; color: var(--ink-muted); font-size: 9px; white-space: nowrap; }

html[data-theme="light"] .conflict-icon { color: #b3573f; }
html[data-theme="light"] .ddl-info.ddl-overdue { color: #b3573f; }
html[data-theme="light"] .action-context-chip { background: rgba(183, 115, 50, .08); }
html[data-theme="light"] .task-source.manual { color: #a66b37; }
html[data-theme="light"] .task-source.recurring { color: #5d7ea6; }
html[data-theme="light"] .task-source:not(.manual):not(.recurring) { color: #5f8a55; }
html[data-theme="light"] .task-retention.review { color: #a66b37; }
html[data-theme="light"] .task-retention.memory { color: #5d7ea6; }
html[data-theme="light"] .errand-linked-note { color: #5d7ea6; }

/* 历史对话抽屉 */
.history-drawer { position: fixed; inset: 0; z-index: 50; display: flex; pointer-events: auto; }
.history-drawer.hidden { display: none; pointer-events: none; }
.history-drawer-overlay { position: absolute; inset: 0; background: rgba(15, 12, 10, .55); backdrop-filter: blur(2px); }
.history-panel { position: relative; z-index: 1; width: min(320px, 80vw); max-width: 360px; height: 100%; display: flex; flex-direction: column; padding: 0; border-right: 1px solid var(--line); background: #2a1f17; box-shadow: 12px 0 40px rgba(0, 0, 0, .45); animation: drawerIn .22s ease; }
@keyframes drawerIn { from { transform: translateX(-8px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.history-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.history-panel-header h3 { margin: 0; font-family: var(--serif); font-size: 17px; color: var(--ink); font-weight: 600; }
.history-close-btn { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 22px; line-height: 1; }
.history-close-btn:hover { background: var(--gold-faint); color: var(--gold-light); }
.history-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px 20px; }
.history-empty { padding: 30px 16px; color: var(--ink-muted); font-size: 12px; text-align: center; line-height: 1.7; }
.history-item { display: flex; align-items: stretch; gap: 3px; width: 100%; margin-bottom: 4px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: inherit; transition: .15s ease; }
.history-item:hover { background: var(--gold-faint); border-color: var(--line); }
.history-item.active { background: var(--gold-faint); border-color: var(--line-strong); }
.history-open-button { display: flex; flex: 1; min-width: 0; align-items: flex-start; gap: 10px; padding: 10px 8px 10px 12px; border: 0; border-radius: 9px; background: transparent; color: inherit; cursor: pointer; text-align: left; font: inherit; }
.history-open-button:focus-visible, .history-delete-button:focus-visible, .history-load-more:focus-visible, .history-load-earlier:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.history-delete-button { flex: 0 0 auto; align-self: center; margin-right: 7px; padding: 5px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-muted); cursor: pointer; font: inherit; font-size: 10px; opacity: .72; transition: .15s ease; }
.history-delete-button:hover { background: rgba(183, 83, 63, .16); color: #d8816f; opacity: 1; }
.history-delete-button:disabled { cursor: wait; opacity: .5; }
.history-icon { flex: 0 0 auto; width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold-light); background: var(--gold-faint); font-size: 11px; }
.history-meta { flex: 1; min-width: 0; }
.history-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.45; color: var(--ink); }
.history-time { margin-top: 4px; font-size: 10px; color: var(--ink-muted); }
.history-loading { padding: 24px; text-align: center; color: var(--ink-muted); font-size: 11px; }
.history-loading::after { content: ''; display: inline-block; width: 10px; height: 10px; margin-left: 8px; border: 1.5px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
.history-load-more, .history-load-earlier { display: block; margin: 10px auto; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink-muted); cursor: pointer; font: inherit; font-size: 11px; transition: .15s ease; }
.history-load-more:hover, .history-load-earlier:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-faint); }
.history-load-more:disabled, .history-load-earlier:disabled { cursor: wait; opacity: .55; }
.history-load-earlier { position: sticky; top: 6px; z-index: 1; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) { .history-panel { width: min(82vw, 340px); } }
html[data-theme="light"] .history-drawer-overlay { background: rgba(40, 28, 18, .25); }
html[data-theme="light"] .history-panel { background: #fbf5ed; box-shadow: 12px 0 40px rgba(100, 70, 45, .18); }

/* AI 思考过程（可折叠） */
.ai-thinking { max-width: min(600px, 88%); margin: 0 0 6px; }
.ai-thinking-toggle { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px dashed var(--line-strong); border-radius: 8px; background: rgba(255, 255, 255, .02); color: var(--ink-muted); cursor: pointer; font-size: 11px; transition: .15s ease; }
.ai-thinking-toggle:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-faint); }
.tt-arrow { display: inline-block; transition: transform .18s ease; font-size: 10px; }
.ai-thinking.expanded .tt-arrow { transform: rotate(90deg); }
.ai-thinking-body { margin-top: 6px; padding: 9px 11px; border-left: 2px solid var(--line-strong); border-radius: 0 8px 8px 0; background: var(--gold-faint); color: var(--ink-muted); font-size: 11px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow-y: auto; }
.ai-thinking-body.hidden { display: none; }
html[data-theme="light"] .ai-thinking-toggle { color: #8b7b69; }
html[data-theme="light"] .ai-thinking-body { color: #655747; }

/* 笔记跳转按钮（在事件卡的执行上下文里） */
.action-context-note-list { display: grid; min-width: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.action-context .note-jump-btn { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 0; padding: 8px 10px; margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: .15s ease; }
.action-context .note-jump-btn:last-child { border-bottom: 0; }
.action-context .note-jump-btn:hover { border-color: var(--gold); background: var(--gold-faint); color: var(--gold-light); }
.action-context-mini { display: grid; gap: 4px; min-width: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.action-context-mini span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-context-ai .action-context-mini { padding: 7px 9px; border: 1px solid var(--line); border-left: 2px solid var(--gold); border-radius: 8px; background: var(--gold-faint); color: var(--ink-soft); white-space: normal; }
.ctx-unresolved { color: var(--gold); }
.ctx-decision { color: var(--sage); }
.note-jump-btn strong { overflow: hidden; color: var(--ink); font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.note-jump-btn:hover .note-jump-arrow { transform: translateX(2px); }
.note-jump-arrow { margin-left: auto; color: var(--ink-muted); font-size: 12px; transition: transform .15s ease; }

/* 「相关笔记」区块：笔记列表 + 管理入口 + 内联勾选编辑器。
   日程/待办即使一条都没挂也常驻这个区块，保证「补挂第一条」有入口。 */
.action-context-notes-body { display: grid; gap: 6px; min-width: 0; }
.action-context-hint { margin: 0; color: var(--ink-muted); font-size: 10px; line-height: 1.55; }
.action-context-link-edit { justify-self: start; min-height: 24px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-muted); font-size: 10px; line-height: 1.4; cursor: pointer; transition: .15s ease; }
.action-context-link-edit:hover { border-color: var(--gold); background: var(--gold-faint); color: var(--gold-light); }
.note-link-editor { display: grid; min-width: 0; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.note-link-option { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; line-height: 1.45; cursor: pointer; }
.note-link-option:last-child { border-bottom: 0; }
.note-link-option:hover { background: var(--gold-faint); }
.note-link-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--gold); cursor: pointer; }
.note-link-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-link-option input:checked + span { color: var(--ink); font-weight: 600; }

/* 笔记卡片展开按钮（更明显） */
.note-expand-btn { display: inline-flex; align-items: center; flex: 0 0 auto; min-width: 56px; padding: 3px 9px; margin-right: 6px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-muted); font-size: 10px; cursor: pointer; transition: .15s ease; }
.note-expand-btn:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-faint); }

/* 语音输入按钮 */
.voice-button { position: relative; }
.voice-button svg { transition: transform .15s ease; }
.voice-button.listening { border-color: var(--red, #d47d69); background: rgba(229, 72, 77, .16); color: #e6a294; }
.voice-button.listening::after { content: ''; position: absolute; inset: -5px; border-radius: 10px; border: 1px solid rgba(229, 72, 77, .16); animation: voiceRipple 1.2s ease-out infinite; pointer-events: none; }
@keyframes voiceRipple { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.35); opacity: 0; } }
.voice-button.listening svg { animation: voicePulse 1s ease-in-out infinite; }
@keyframes voicePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
html[data-theme="light"] .voice-button.listening { border-color: #c96a4f; color: #b3543c; background: rgba(229, 72, 77, .1); }

/* Bug 反馈链接（账户卡下方） */
.feedback-link { display: block; margin: 14px 20px 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: 11px; text-decoration: none; transition: color .15s ease; }
.feedback-link:hover { color: var(--gold-light); }

/* 主题卡笔记项可点击 */
.tree-note-link { display: block; width: 100%; padding: 6px 8px; margin: 2px 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink-soft); font-size: 11px; line-height: 1.6; text-align: left; cursor: pointer; transition: .15s ease; }
.tree-note-link:hover { border-color: var(--line); background: var(--gold-faint); color: var(--gold-light); }

/* 完整个人主页 */
.profile-page { min-height: 0; flex: 1; overflow-y: auto; background: radial-gradient(ellipse at 86% 0%, var(--gold-faint), transparent 35%), var(--night); scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.app-page.profile-open .app-workspace { display: none; }
.profile-page-scroll { width: min(1120px, 100%); margin: 0 auto; padding: clamp(32px, 5vw, 68px) clamp(22px, 5vw, 56px) 72px; }
.profile-page-header { display: flex; align-items: flex-end; justify-content: flex-start; gap: 20px; margin: 0 0 26px; }
.profile-page-header h1 { margin: 5px 0 0; color: var(--ink); font-family: var(--serif); font-size: clamp(30px, 4vw, 42px); font-weight: 600; letter-spacing: .03em; }
.profile-back-button { display: inline-flex; align-items: center; gap: 5px; padding: 7px 0; border: 0; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 12px; transition: color .2s ease; }
.profile-back-button:hover { color: var(--gold-light); }.profile-back-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.profile-hero-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px; min-height: 164px; padding: 28px; border: 1px solid var(--line-strong); border-radius: 22px; background: var(--night-2); box-shadow: 0 16px 46px rgba(0,0,0,.09); }
.profile-page-avatar { display: grid; position: relative; place-items: center; width: 82px; height: 82px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 28px 28px 28px 8px; background: linear-gradient(135deg, #2e2e35, #1b1b20); box-shadow: 0 6px 18px rgba(0, 0, 0, .14); }
.profile-page-avatar img { position: absolute; top: 50%; left: 50%; width: 148%; height: auto; max-width: none; transform: translate(-50%, -46%); }.profile-hero-copy { min-width: 0; }.profile-kicker { margin: 0 0 8px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .1em; }.profile-hero-copy h2 { margin: 0; overflow: hidden; color: var(--ink); font-family: var(--serif); font-size: clamp(23px, 3vw, 31px); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }.profile-hero-copy > p:last-child { margin: 8px 0 0; overflow: hidden; color: var(--ink-muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.profile-plan-summary { display: grid; justify-items: end; gap: 5px; padding-left: 22px; border-left: 1px solid var(--line); text-align: right; }.profile-plan-summary span { color: var(--ink-muted); font-size: 11px; }.profile-plan-summary strong { color: var(--gold-light); font-size: 16px; font-weight: 650; }.profile-plan-summary button, .profile-preference-row button { padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 11px; transition: .18s ease; }.profile-plan-summary button:hover, .profile-preference-row button:hover { border-color: var(--gold); background: var(--gold-faint); color: var(--gold-light); }
.profile-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }.profile-metric { min-height: 118px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.025); }.profile-metric span, .profile-metric small { display: block; color: var(--ink-muted); font-size: 11px; }.profile-metric strong { display: block; margin: 10px 0 5px; overflow: hidden; color: var(--ink); font-family: var(--serif); font-size: 25px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.profile-checkin-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 24px; margin: 0 0 14px; padding: 20px 22px; border: 1px solid var(--line-strong); border-radius: 17px; background: var(--night-2); }.profile-checkin-card h2 { margin: 4px 0 5px; color: var(--ink); font-family: var(--serif); font-size: 20px; font-weight: 600; }.profile-checkin-card p:last-child { margin: 0; color: var(--ink-muted); font-size: 11px; }.profile-checkin-stats { display: flex; gap: 20px; }.profile-checkin-stats span { color: var(--ink-muted); font-size: 11px; white-space: nowrap; }.profile-checkin-stats strong { display: block; margin-top: 5px; color: var(--ink); font-family: var(--serif); font-size: 18px; font-weight: 600; }.profile-checkin-card button { min-width: 126px; padding: 12px 16px; border: 1px solid var(--gold); border-radius: 12px; background: var(--gold); color: var(--on-accent); cursor: pointer; font-weight: 700; }.profile-checkin-card button:disabled { border-color: var(--line); background: transparent; color: var(--ink-muted); cursor: default; }
.profile-content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }.profile-page-section { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.02); }.profile-page-section-wide { grid-column: 1 / -1; }.profile-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }.profile-section-heading h2 { margin: 4px 0 0; color: var(--ink); font-family: var(--serif); font-size: 20px; font-weight: 600; }.profile-detail-list { margin: 0; }.profile-detail-list > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }.profile-detail-list dt { color: var(--ink-muted); font-size: 12px; }.profile-detail-list dd { min-width: 0; margin: 0; overflow: hidden; color: var(--ink-soft); font-size: 12px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.profile-email-form { display: grid; gap: 9px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }.profile-email-form p { margin: 0 0 2px; color: var(--ink-muted); font-size: 11px; line-height: 1.55; }.profile-email-form label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 11px; }.profile-email-form input { min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: var(--night-3); color: var(--ink); font: inherit; font-size: 12px; }.profile-email-form input:focus { border-color: var(--gold); }.profile-email-form button { justify-self: start; min-height: 34px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--gold-faint); color: var(--gold-light); cursor: pointer; font-size: 11px; }.profile-email-form button:disabled { cursor: wait; opacity: .65; }
.profile-preference-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }.profile-preference-row strong, .profile-preference-row span { display: block; }.profile-preference-row strong { color: var(--ink-soft); font-size: 13px; font-weight: 600; }.profile-preference-row span { margin-top: 4px; color: var(--ink-muted); font-size: 11px; }.profile-preference-row button { flex: 0 0 auto; }
.profile-page-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }.profile-page-actions button { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 12px; min-height: 94px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.018); color: var(--ink-soft); cursor: pointer; text-align: left; transition: transform .18s ease, border-color .18s ease, background .18s ease; }.profile-page-actions button:hover { border-color: var(--line-strong); background: var(--gold-faint); transform: translateY(-1px); }.profile-page-actions span { font-size: 13px; font-weight: 650; }.profile-page-actions small { grid-column: 1 / 2; color: var(--ink-muted); font-size: 11px; line-height: 1.55; }.profile-page-actions b { grid-column: 2; grid-row: 1 / 3; color: var(--gold); font-size: 20px; font-weight: 400; }.profile-page-actions .profile-danger-action:hover { border-color: rgba(229, 72, 77, .16); background: rgba(229, 72, 77, .16); }.profile-page-actions .profile-danger-action b { color: var(--red); }

/* 旧版个人主页 modal 的兼容样式（历史 DOM 不再使用） */
.profile-modal { width: min(720px, 100%); max-height: 86vh; }
.profile-body { padding: 4px 30px 28px; overflow-y: auto; }
.profile-section { margin: 22px 0 18px; }
.profile-h3 { margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--gold-light); font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.profile-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.profile-row:last-child { border-bottom: 0; }
.profile-label { color: var(--ink-muted); flex: 0 0 auto; }
.profile-value { color: var(--ink); font-weight: 500; text-align: right; word-break: break-all; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-action-btn { padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; color: var(--ink-soft); font-size: 12.5px; cursor: pointer; transition: .15s ease; }
.profile-action-btn:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-faint); }

/* 思考过程 极简版：消息内文底部小灰字按钮 */
.ai-thinking-mini { margin-top: 6px; padding: 0; }
.ai-thinking-mini-btn { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-muted); font-size: 10.5px; cursor: pointer; transition: .12s ease; }
.ai-thinking-mini-btn:hover { border-color: var(--line-strong); color: var(--ink-soft); }
.ai-thinking-mini .ai-thinking-body { display: none; margin-top: 6px; padding: 8px 10px; border-left: 2px solid var(--line); background: rgba(255,255,255,.02); color: var(--ink-muted); font-size: 11px; line-height: 1.7; white-space: pre-wrap; max-height: 200px; overflow-y: auto; border-radius: 0 6px 6px 0; }
.ai-thinking-mini .ai-thinking-body:not(.hidden) { display: block; }

/* 移动端：旧双导航已合并为顶部 tab，聊天操作按钮保留在对话页内。 */
@media (max-width: 760px) {
  .app-topbar { min-height: 52px; padding: 0 12px; }
  .topbar-brand { gap: 6px; }.topbar-brand .brand-mascot { width: 26px; height: 26px; border-radius: 9px 9px 9px 3px; }.topbar-name { font-size: 16px; }
  .topbar-actions { gap: 5px; }.topbar-actions .plan-pill { display: none !important; }
  /* 两个教程入口（「装到手机」「使用示例」）手机顶栏直接显示（2026-10-06 用户拍板）：
     用短文案（安装 / 示例）+ 小号胶囊防止与居中导航重叠。
     主题切换图标在手机档收起 —— 功能不丢，个人中心「界面主题」是替代入口，
     顶栏 390px 宽度要留给两个教程入口。 */
  .topbar-actions #btn-theme { display: none !important; }
  .topbar-actions #btn-install-app,
  .topbar-actions #btn-guide { min-height: 27px; padding: 0 7px; font-size: 11px; }
  .topbar-actions #btn-install-app .btn-label-full,
  .topbar-actions #btn-guide .btn-label-full { display: none; }
  .topbar-actions #btn-install-app .btn-label-short,
  .topbar-actions #btn-guide .btn-label-short { display: inline; }
  .assistant-identity { display: none; }.assistant-actions { justify-content: flex-end; width: 100%; }
  .app-page.profile-open .app-workspace { display: none; }
  .profile-page { position: relative; min-height: 0; flex: 1; }
  .profile-page-scroll { padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
  .profile-page-header { align-items: center; margin-bottom: 18px; }.profile-page-header h1 { font-size: 28px; }.profile-page-header .eyebrow { font-size: 9px; }
  .profile-back-button { padding: 6px 0; font-size: 11px; }
  .profile-hero-card { grid-template-columns: auto minmax(0, 1fr); gap: 14px; min-height: 0; padding: 18px; border-radius: 18px; }.profile-page-avatar { width: 58px; height: 58px; border-radius: 20px 20px 20px 6px; font-size: 25px; }.profile-kicker { margin-bottom: 5px; font-size: 9px; }.profile-hero-copy h2 { font-size: 22px; }.profile-hero-copy > p:last-child { margin-top: 5px; font-size: 11px; }
  .profile-plan-summary { grid-column: 1 / -1; grid-template-columns: 1fr auto auto; align-items: center; justify-items: start; gap: 8px; padding: 12px 0 0; border-top: 1px solid var(--line); border-left: 0; text-align: left; }.profile-plan-summary span { font-size: 10px; }.profile-plan-summary strong { font-size: 14px; }.profile-plan-summary button { justify-self: end; padding: 6px 8px; }
  .profile-metrics { gap: 7px; margin: 10px 0; }.profile-metric { min-height: 96px; padding: 13px 11px; border-radius: 13px; }.profile-metric span, .profile-metric small { font-size: 9px; }.profile-metric strong { margin: 7px 0 3px; font-size: 17px; }
  .profile-checkin-card { grid-template-columns: 1fr auto; gap: 14px 10px; padding: 17px 16px; }.profile-checkin-card > div:first-child { grid-column: 1 / -1; }.profile-checkin-card h2 { font-size: 18px; }.profile-checkin-stats { gap: 14px; }.profile-checkin-stats span { font-size: 9px; }.profile-checkin-stats strong { font-size: 15px; }.profile-checkin-card button { min-width: 112px; padding: 10px 12px; font-size: 12px; }
  .profile-content-grid { grid-template-columns: 1fr; gap: 10px; }.profile-page-section { padding: 18px 16px; border-radius: 15px; }.profile-page-section-wide { grid-column: auto; }.profile-section-heading { margin-bottom: 9px; }.profile-section-heading h2 { font-size: 18px; }.profile-detail-list > div { grid-template-columns: 65px minmax(0, 1fr); padding: 10px 0; }.profile-detail-list dt, .profile-detail-list dd { font-size: 11px; }
  .profile-preference-row { padding: 12px 0; }.profile-preference-row strong { font-size: 12px; }.profile-preference-row span { font-size: 10px; }.profile-preference-row button { padding: 6px 8px; font-size: 10px; }
  .profile-page-actions { grid-template-columns: 1fr; gap: 8px; }.profile-page-actions button { min-height: 72px; padding: 13px; }.profile-page-actions small { font-size: 10px; }
  .avatar-settings, .profile-customization-grid { grid-template-columns: 1fr; }.avatar-setting input { max-width: 100%; }.message-avatar { flex-basis: 27px; width: 27px; height: 27px; border-radius: 9px 9px 9px 3px; }
}

/* 笔记附件（个人版/专业版） */
.note-attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.note-attach-item { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px 2px 10px; background: rgba(255,255,255,.02); }
.note-attach-open { border: 0; background: transparent; color: var(--ink-soft); font-size: 11.5px; cursor: pointer; padding: 2px 4px; }
.note-attach-open:hover { color: var(--gold-light); }
.note-attach-del { border: 0; background: transparent; color: var(--ink-muted); font-size: 12px; cursor: pointer; padding: 2px 4px; line-height: 1; }
.note-attach-del:hover { color: #e07b6e; }
.note-attach-actions { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; }
.note-attach-add { padding: 4px 12px; border: 1px dashed var(--line-strong); border-radius: 999px; background: transparent; color: var(--ink-soft); font-size: 11.5px; cursor: pointer; }
.note-attach-add:hover { border-color: var(--gold); color: var(--gold-light); }
.note-attach-hint { color: var(--ink-muted); font-size: 10px; }
.note-attach-overlay { position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 20px; }
.note-attach-panel { width: min(860px, 96vw); height: min(86vh, 720px); background: var(--night); border: 1px solid var(--line-strong); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.note-attach-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.note-attach-panel-head strong { font-size: 13px; color: var(--ink); word-break: break-all; }
.note-attach-panel-actions { display: inline-flex; gap: 10px; align-items: center; }
.note-attach-dl { color: var(--gold-light); font-size: 12.5px; text-decoration: none; border-bottom: 1px solid transparent; }
.note-attach-dl:hover { border-color: var(--gold); }
.note-attach-close { border: 0; background: transparent; color: var(--ink-soft); font-size: 20px; cursor: pointer; line-height: 1; }
.note-attach-close:hover { color: var(--ink); }
.note-attach-panel-body { flex: 1; overflow: auto; display: grid; place-items: center; }
.note-attach-frame { width: 100%; height: 100%; border: 0; }
.note-attach-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.note-attach-no-preview { color: var(--ink-muted); font-size: 13px; }
.note-attach-office-fallback { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; color: var(--ink-muted); font-size: 11px; }
.plan-ai-note { margin: 8px 0 0; padding: 7px 10px; border-left: 3px solid var(--gold); background: var(--gold-faint); color: var(--ink-muted); font-size: 11px; line-height: 1.6; }

/* 实体弹窗内附件区（笔记专属） */
.entity-attach-area { margin: 14px 0 6px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; background: rgba(255,255,255,.015); }
.entity-attach-area.hidden { display: none; }
.entity-attach-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.entity-attach-head > :first-child { font-size: 13px; color: var(--gold-light); font-weight: 600; }
.entity-attach-hint { color: var(--ink-muted); font-size: 11px; }
.entity-attach-list { margin-bottom: 6px; }
.entity-attach-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.02); font-size: 12.5px; }
.entity-attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.entity-attach-name small { color: var(--ink-muted); font-size: 10.5px; margin-left: 4px; }
.entity-attach-rm { padding: 0 6px; border: 0; background: transparent; color: var(--ink-muted); font-size: 14px; cursor: pointer; line-height: 1; }
.entity-attach-rm:hover { color: #e07b6e; }
.entity-attach-add { padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--ink-soft); font-size: 11.5px; cursor: pointer; }
/* 头像上传：隐藏原生 file input（其「选择文件」文字是浏览器控件语言，英文站会露中文），用可翻译的自定义按钮触发 */
.avatar-file-hidden { display: none !important; }
.avatar-pick-btn { padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--ink-soft); font-size: 11.5px; cursor: pointer; }
.avatar-pick-btn:hover { border-color: var(--gold); color: var(--gold-light); }
.entity-attach-add:hover { border-color: var(--gold); color: var(--gold-light); }

/* 移动端弹窗 padding 压缩（宽度仍自适应） */
@media (max-width: 760px) { .modal-content { max-height: 92vh !important; } }

/* 笔记弹窗专属：比通用 modal 更宽 + 更高，确保附件区舒适 */
.modal-content.entity-wide { width: min(1180px, 100%); max-height: min(90vh, 940px); }
.modal-content.entity-wide textarea[name="content"] { min-height: 240px; }
@media (max-width: 760px) { .modal-content.entity-wide { width: 100% !important; max-height: 94vh !important; } }

/* 移动端弹窗紧凑（不限制宽度，让 .modal-content 默认 width: min(1180px, 100%) 在窄屏占满） */
@media (max-width: 760px) {
  .modal-content { max-height: 92vh !important; border-radius: 14px !important; }
  .modal-header { padding: 14px 16px 8px !important; }
  .modal-header h2 { font-size: 18px !important; }
  .entity-form { padding: 6px 16px 22px !important; gap: 10px !important; }
  .entity-form input, .entity-form textarea, .entity-form select { font-size: 15px !important; padding: 7px 9px !important; }
  .entity-form textarea { min-height: 110px !important; }
  .modal-content.entity-wide textarea[name="content"] { min-height: 160px !important; }
  .entity-attach-area { padding: 8px 10px !important; margin: 8px 0 !important; }
  .entity-attach-row { padding: 8px 10px !important; align-items: flex-start !important; flex-wrap: wrap !important; gap: 4px !important; }
  .entity-attach-name { white-space: normal !important; word-break: break-all !important; font-size: 12.5px !important; flex: 1 1 auto !important; min-width: 0 !important; }
  .entity-attach-add { width: 100% !important; padding: 8px 12px !important; font-size: 12.5px !important; }
  .entity-form-actions button { padding: 9px 18px !important; font-size: 13px !important; }
  .entity-relation-options { grid-template-columns: 1fr; max-height: 150px; }
  .entity-relation-options input { width: auto !important; padding: 0 !important; }
}

/* 消息气泡内可点击的附件 chip（用户消息附件） */
.msg-attachment-clickable { border: 0; cursor: pointer; font: inherit; font-size: 10px; }
.msg-attachment-clickable:hover { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .22); color: #fff; }
.msg-user .msg-attachment-clickable:hover { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .24); }
/* 音频附件：内联播放器 + 转写按钮（阶段 5 · 任务 5） */
.msg-audio { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: min(420px, 100%); padding: 6px 8px; }
.msg-audio .msg-audio-name { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-audio audio { display: block; width: 100%; height: 34px; }
.msg-audio-transcribe { padding: 3px 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: transparent; color: var(--ink-soft); cursor: pointer; font: inherit; font-size: 10px; transition: .15s ease; }
.msg-audio-transcribe:hover:not(:disabled) { border-color: rgba(255, 255, 255, .5); color: #fff; }
.msg-audio-transcribe:disabled { opacity: .55; cursor: default; }
/* 附件存储超 90% 警示 */
.profile-metric strong[data-warn="1"] { color: var(--red, #e07b6e); }
.deep-button { font-size: 15px; }
.deep-button.active { border-color: var(--gold); background: var(--gold-faint); color: var(--gold-light); }

/* 模型版本切换（Flash / Pro 互斥按钮组） */
.model-switch { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--gold-faint); }
.model-switch-btn { padding: 0 9px; height: 27px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 11px; letter-spacing: .02em; transition: .18s ease; }
.model-switch-btn:hover { color: var(--ink-soft); }
.model-switch-btn.is-active { background: var(--gold-faint); color: var(--gold-light); font-weight: 600; }
.model-switch-btn:disabled, .model-switch-btn.is-locked { cursor: not-allowed; opacity: .48; }

/* 思考强度选择（紧凑 select，思考关闭时禁用） */
.thinking-effort-select { height: 27px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 11px; transition: .18s ease; }
.thinking-effort-select:disabled { cursor: not-allowed; opacity: .45; }
.thinking-effort-select:not(:disabled):hover { border-color: var(--line-strong); color: var(--gold-light); }
.thinking-effort-select:focus { outline: none; border-color: var(--gold); color: var(--gold-light); }

/* Spacious, two-row composer: the input stays readable while controls remain
   within reach, instead of forcing every control into one narrow line. */
.composer-wrap { width: min(980px, 100%); padding: 0 clamp(32px, 6vw, 70px) 18px; }
.chat-input-area { flex-direction: column; align-items: stretch; gap: 8px; padding: 13px 14px 10px; border-radius: 20px; }
.chat-input-area textarea { min-height: 52px; padding: 3px 0; }
.chat-input-toolbar, .chat-input-tools { display: flex; align-items: center; }
.chat-input-toolbar { justify-content: space-between; gap: 12px; }
.chat-input-tools { gap: 5px; }
.deep-button { width: auto; gap: 4px; padding: 0 9px; border-color: var(--line); border-radius: 999px; font-size: 12px; }
.send-button { width: 38px; height: 38px; border-radius: 12px; }

@media (max-width: 760px) {
  .chat-messages { padding: 18px 16px 12px; }
  .composer-wrap { padding: 0 12px calc(78px + env(safe-area-inset-bottom)); }
  .chat-input-area { gap: 5px; padding: 9px 10px 8px; border-radius: 17px; }
  .chat-input-area textarea { min-height: 38px; font-size: 14px; }
  .chat-input-tools { gap: 2px; }
  .deep-button { padding: 0 7px; font-size: 11px; }
}

/* ── 智能回顾（阶段 5）：总览页今日摘要 / 明日建议 ── */
.smart-review-section .smart-review-body { padding: 0 0 6px; }
.smart-review-text { font-size: 13.5px; line-height: 1.7; color: var(--text, #333); white-space: pre-wrap; word-break: break-word; }
.smart-review-placeholder { font-size: 13px; line-height: 1.7; color: var(--text-muted, #999); }
.smart-review-loading { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted, #999); }
.smart-review-loading span { width: 14px; height: 14px; border: 2px solid var(--line, #e5e5e5); border-top-color: var(--accent, #4a7cff); border-radius: 50%; animation: smart-review-spin 0.8s linear infinite; }
@keyframes smart-review-spin { to { transform: rotate(360deg); } }
.smart-review-actions { margin-top: 4px; }
.smart-review-btn { border: 1px solid var(--line, #e5e5e5); border-radius: 999px; padding: 5px 14px; font-size: 12.5px; background: var(--card, #fff); color: var(--text, #333); cursor: pointer; }
.smart-review-btn:hover { border-color: var(--accent, #4a7cff); color: var(--accent, #4a7cff); }
.smart-review-tomorrow { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line, #e5e5e5); }

/* ── 阶段 6：版本历史 / 导入 / 周期回顾 / 提醒设置 ── */
.smart-review-btn.active { border-color: var(--accent, #4a7cff); color: var(--accent, #4a7cff); background: var(--card, #fff); }
.smart-review-period-text { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line, #e5e5e5); }
.smart-review-period-label { font-size: 11px; color: var(--text-muted, #999); margin-bottom: 4px; }
.smart-review-history { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.smart-review-history-item { border: 1px solid var(--line, #e5e5e5); border-radius: 10px; padding: 8px 10px; background: var(--card, #fff); }
.smart-review-history-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted, #999); margin-bottom: 4px; }
.smart-review-history-text { font-size: 12.5px; line-height: 1.65; color: var(--text, #333); white-space: pre-wrap; }

.reminder-settings-body { display: flex; flex-direction: column; gap: 10px; }
.reminder-types { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.reminder-type { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text, #333); }
.reminder-advanced { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.reminder-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text, #333); }
.reminder-field input { border: 1px solid var(--line-strong, #d9d9d9); border-radius: 7px; padding: 3px 6px; background: var(--card, #fff); color: var(--text, #333); }
.reminder-save-btn { align-self: flex-start; border: 1px solid var(--accent, #4a7cff); background: var(--accent, #4a7cff); color: #fff; border-radius: 8px; padding: 6px 16px; font-size: 12.5px; cursor: pointer; }

.note-version-panel { margin-top: 8px; border-top: 1px dashed var(--line, #e5e5e5); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.note-version-row { display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; align-items: center; font-size: 12px; padding: 4px 6px; border-radius: 7px; }
.note-version-row.active { background: var(--card, #fff); box-shadow: inset 0 0 0 1px var(--accent, #4a7cff); }
.note-version-no { font-weight: 600; color: var(--text, #333); }
.note-version-meta, .note-version-date { color: var(--text-muted, #999); }
.note-version-ops { display: inline-flex; gap: 6px; }
.note-version-ops button { border: 1px solid var(--line-strong, #d9d9d9); background: transparent; border-radius: 6px; padding: 2px 8px; font-size: 11px; color: var(--ink-soft, #666); cursor: pointer; }
.note-version-ops button:hover { border-color: var(--accent, #4a7cff); color: var(--accent, #4a7cff); }
.note-version-preview { margin-top: 6px; padding: 8px; border-radius: 8px; border: 1px solid var(--line, #e5e5e5); font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; color: var(--text, #333); }
.note-version-empty { font-size: 12px; color: var(--text-muted, #999); }

/* 导入向导（.import-*）的样式 2026-10-01 随 UI 一起删除 —— 保留后端，界面入口已摘除。
   要恢复，从 git 历史取回 .import-entry-btn / .import-modal-content / #import-modal-body /
   .import-step / .import-field / .import-textarea / .import-actions / .import-summary /
   .import-error / .import-items / .import-item* / .import-retopic* 那一整段。 */

.profile-mcp-locked { margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--line, #e5e5e5); border-radius: 8px; font-size: 12.5px; color: var(--text-muted, #999); }

.msg-reminder-actions { margin-top: 6px; }
.msg-reminder-convert { border: 1px solid var(--line-strong, #d9d9d9); background: transparent; border-radius: 999px; padding: 4px 12px; font-size: 12px; color: var(--ink-soft, #666); cursor: pointer; }
.msg-reminder-convert:hover:not(:disabled) { border-color: var(--accent, #4a7cff); color: var(--accent, #4a7cff); }
.msg-reminder-convert:disabled { opacity: .6; cursor: default; }

/* ── 离线推送区块 ──────────────────────────────────────────────
   刻意不做成裸勾选框：勾选框只能表达「服务端该不该发」，而用户真正会踩的坑是
   「开关是开的，但这台设备没接上」（未授权 / iOS 未添加到主屏 / 订阅被回收）。
   所以把「服务端开关」和「本机订阅状态」合成一个动作 + 一句人话状态。
   这里用真实主题变量（--ink / --night-2 / --line）而不是硬编码色值，
   保证浅色与深色主题下都可读。 */
.reminder-push { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--night-2); }
.reminder-push.is-on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold-faint); }
.reminder-push-head { display: flex; flex-direction: column; gap: 1px; min-width: 132px; }
.reminder-push-title { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.reminder-push-sub { font-size: 11px; color: var(--ink-muted); }
.reminder-push-status { flex: 1 1 150px; font-size: 12px; color: var(--ink-muted); }
.reminder-push.is-on .reminder-push-status { color: var(--sage); }
.reminder-push .push-toggle { margin-left: auto; }

.carried-badge { margin-left: 6px; padding: 1px 5px; border-radius: 4px; font-size: 10px; background: rgba(186, 117, 23, .12); color: #854f0b; white-space: nowrap; }

/* ── 相关记忆（Heads Up）────────────────────────────────────── */
.msg-related { max-width: min(520px, 86%); padding: 8px 10px; border: 1px solid rgba(0,0,0,.1); border-radius: 10px; background: rgba(0,0,0,.02); font-size: 12.5px; }
.related-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted, #888); margin-bottom: 4px; }
.related-count { padding: 0 6px; border-radius: 8px; font-size: 10.5px; background: rgba(0,0,0,.06); }
.related-item { display: flex; align-items: center; gap: 6px; width: 100%; padding: 3px 4px; border: 0; border-radius: 6px; background: transparent; text-align: left; font: inherit; color: inherit; }
button.related-item { cursor: pointer; }
button.related-item:hover { background: rgba(0,0,0,.045); }
.related-tag { flex: none; padding: 1px 5px; border-radius: 4px; font-size: 10.5px; background: rgba(83, 74, 183, .1); color: #534ab7; }
.related-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 早间简报 ───────────────────────────────────────────────── */
.briefing-section .briefing-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px dashed rgba(0,0,0,.08); font-size: 12.5px; }
.briefing-row:last-child { border-bottom: 0; }
.briefing-tag { flex: none; padding: 1px 6px; border-radius: 4px; font-size: 10.5px; background: rgba(29, 158, 117, .12); color: #0f6e56; }
.briefing-tag-warn { background: rgba(226, 75, 74, .12); color: #a32d2d; }
.briefing-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.briefing-time { flex: none; font-size: 11.5px; color: var(--text-muted, #999); }
.briefing-missed .briefing-title { text-decoration: line-through; opacity: .75; }

/* AI 建议区块：AI 写的**自然语言**建议（必做 / 推荐 / 不建议 / 战略提醒 / 每日一言）。
   与上面的 .briefing-* 分开写：那套是「算出来的条目」（标题 + 时间，nowrap 省略号），
   这套是整段话，必须换行。混用会把 AI 的建议截成一行省略号。 */
.ai-briefing-row { display: flex; align-items: flex-start; gap: 8px; padding: 7px 4px; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.ai-briefing-row:last-of-type { border-bottom: 0; }
.ai-briefing-label { flex: none; padding: 1px 6px; border-radius: 4px; font-size: 10.5px; font-weight: 600; background: var(--gold-faint); color: var(--gold-light); }
.ai-briefing-must .ai-briefing-label { background: rgba(122, 184, 148, .16); color: #9ed4b5; }
.ai-briefing-warn .ai-briefing-label { background: rgba(229, 72, 77, .16); color: #e0a291; }
.ai-briefing-text { flex: 1; min-width: 0; line-height: 1.65; overflow-wrap: anywhere; }
.ai-briefing-quote { margin-top: 8px; padding: 6px 10px; border-left: 2px solid var(--line-strong); color: var(--ink-soft); font-family: var(--serif); font-size: 12.5px; line-height: 1.7; }
html[data-theme="light"] .ai-briefing-must .ai-briefing-label { background: rgba(45, 122, 84, .10); color: #2d7a54; }
html[data-theme="light"] .ai-briefing-warn .ai-briefing-label { background: rgba(226, 75, 74, .10); color: #a32d2d; }
/* 遗漏事项：与早间简报同构，但用红色标记强调「这是已经漏掉的」 */
.missed-section .section-marker { background: var(--red); box-shadow: 0 0 8px rgba(229, 72, 77, .45); }
.missed-section .section-count { color: var(--red); }

/* ── 问我的库（.kq-*）的样式 2026-10-01 随 UI 一起删除 ──
   用户拍板「只需一个对话窗口，即主对话」，面板里不再放第二个 AI 问答入口。
   后端 POST /api/knowledge/ask 与 src/agent/knowledge-qa.js 保留。
   要恢复，从 git 历史取回 .kq-input-row / .kq-input / .kq-ask-btn / .kq-answer /
   .kq-sources / .kq-source / .kq-n / .kq-loading / .kq-error。 */


/* ─── AI 画像（个人中心展示）────────────────────────────────── */
.profile-ai-body { display: flex; flex-direction: column; gap: 6px; }
.profile-ai-row { display: flex; gap: 12px; padding: 7px 10px; border: 1px solid var(--border, rgba(0,0,0,.08)); border-radius: 8px; background: var(--panel-bg, rgba(0,0,0,.02)); }
.profile-ai-label { flex: none; width: 88px; font-size: 12.5px; color: var(--text-secondary, #666); }
.profile-ai-value { font-size: 13px; color: var(--text, #222); overflow-wrap: anywhere; }
.profile-ai-subtitle { font-size: 12.5px; color: var(--text-secondary, #666); margin: 8px 0 2px; font-weight: 600; }

/* ─── 总览页提醒设置入口行（此前是裸原生按钮，破坏设计系统）───────── */
.reminder-entry { display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid var(--line, #e5e5e5); border-radius: 12px; background: var(--card, #fff);
  padding: 10px 14px; margin: 14px 0; cursor: pointer; font: inherit; text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease; }
.reminder-entry:hover { border-color: var(--accent, #4a7cff); }
.reminder-entry-icon { display: inline-flex; width: 17px; height: 17px; color: var(--text-muted, #98a1ab); }
.reminder-entry-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.reminder-entry-label { font-size: 13.5px; font-weight: 600; color: var(--text, #333); }
.reminder-entry-summary { font-size: 12.5px; color: var(--text-muted, #98a1ab); }
.reminder-entry-arrow { margin-left: auto; color: var(--text-muted, #98a1ab); font-size: 17px; line-height: 1; }


.dashboard-content { overflow-x: hidden; }


/* ── 英文站（SITE_LOCALE=en）：账号体系 = 邮箱 + 账号密码，无短信通道 ──
   服务端把 __SITE_LOCALE__ 注入 <html data-site-locale>，手机号相关 UI 全部隐藏 */
html[data-site-locale="en"] [data-phone-ui] { display: none !important; }
html[data-site-locale="en"] .auth-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ── 中文站（SITE_LOCALE=zh，默认）：账号体系 = 手机 + 账号密码，无邮件通道（未配 SMTP）──
   英文站反向隐藏手机 UI（见上）；两套规则都按部署注入的 data-site-locale 生效 */
html[data-site-locale="zh"] [data-email-ui] { display: none !important; }
html[data-site-locale="zh"] .auth-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ═══════════════════════════════════════════════════════════════════════════
 * 「装到手机主屏幕」图文教程弹窗（2026-10-05）
 *
 * 入口有两个：#btn-install-app（桌面顶部栏，在「免费版」按钮右侧）
 *       与 #profile-page-install-app（个人中心 · 常用操作，手机端靠它）。
 * 为什么要两个：`.topbar-actions .plan-pill` 在 ≤760px 是 **display:none**，
 *   而「免费版」旁边的位置正是桌面才看得见 —— 手机用户只能从个人中心进。
 * 图片是用户提供的 iPhone 实拍截图（已压到 720px 宽），iOS/Android 分栏。
 * ═══════════════════════════════════════════════════════════════════════════ */
.install-guide-modal { width: min(760px, 100%); }
.install-guide-body { padding: 0 30px 30px; }
.install-guide-lead { margin: 0 0 20px; color: var(--ink-soft); font-size: 13px; line-height: 1.75; }
.install-guide-lead strong { color: var(--gold-light); }
.install-platform { margin-bottom: 22px; padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .02); }
.install-platform h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 0 0 15px; color: var(--ink); font-family: var(--serif); font-size: 16px; font-weight: 600; }
.install-platform-tag { padding: 3px 9px; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--gold-light); font-family: var(--font); font-size: 10.5px; font-weight: 700; }
.install-steps { display: grid; gap: 14px; }
.install-step { display: grid; gap: 11px; }
.install-step-copy { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 11px; }
.install-step-no { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold-faint); color: var(--gold-light); font-size: 11px; font-weight: 700; }
.install-step-copy h4 { margin: 2px 0 3px; color: var(--ink); font-size: 13px; font-weight: 600; }
.install-step-copy p { margin: 0; color: var(--ink-muted); font-size: 11.5px; line-height: 1.6; }
.install-step img { width: 100%; max-width: 320px; margin-left: 33px; border: 1px solid var(--line); border-radius: 12px; }
.install-note { margin: 14px 0 0; padding: 10px 12px; border-left: 2px solid var(--line-strong); border-radius: 0 8px 8px 0; background: rgba(255, 255, 255, .02); color: var(--ink-muted); font-size: 11.5px; line-height: 1.65; }
.install-note strong { color: var(--ink-soft); }
.install-guide-foot { margin: 0; padding-top: 4px; color: var(--ink-muted); font-size: 11.5px; line-height: 1.7; }
.install-guide-foot strong { color: var(--gold-light); }

/* ═══════════════════════════════════════════════════════════════════════════
 * 「知归能做什么」· 真实示例弹窗（2026-10-05）
 *   入口：顶部栏 #btn-guide（桌面）/ 个人中心 #profile-page-guide（手机）。
 *   三张图是**真实对话截图**（无头 Edge 驱动真实 AI 抓的，见 scripts/tmp-probe-guide-shots.js）：
 *   图片是竖长条（900×1262），所以走单列、限宽居中，别缩成小缩略图。
 * ═══════════════════════════════════════════════════════════════════════════ */
.guide-modal-content { width: min(680px, 100%); }
.guide-body { padding: 0 30px 30px; }
.guide-lead { margin: 0 0 22px; color: var(--ink-soft); font-size: 13px; line-height: 1.75; }
.guide-lead strong { color: var(--gold-light); }
.guide-case { margin-bottom: 22px; padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .02); }
.guide-case-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 11px; margin-bottom: 14px; }
.guide-case-no { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold-faint); color: var(--gold-light); font-size: 11px; font-weight: 700; }
.guide-case-head h3 { margin: 2px 0 3px; color: var(--ink); font-family: var(--serif); font-size: 15px; font-weight: 600; }
.guide-case-head p { margin: 0; color: var(--ink-muted); font-size: 11.5px; line-height: 1.6; }
.guide-case img { display: block; width: 100%; max-width: 340px; margin: 0 auto; border: 1px solid var(--line); border-radius: 12px; }
.guide-case-note { margin: 14px 0 0; padding: 10px 12px; border-left: 2px solid var(--line-strong); border-radius: 0 8px 8px 0; background: rgba(255, 255, 255, .02); color: var(--ink-muted); font-size: 11.5px; line-height: 1.65; }
.guide-case-note strong { color: var(--ink-soft); }
.guide-foot { margin: 0; padding-top: 4px; color: var(--ink-muted); font-size: 11.5px; line-height: 1.7; }
.guide-foot strong { color: var(--gold-light); }

@media (max-width: 760px) {
  .install-guide-modal { width: 100%; }
  .install-guide-body { padding: 0 18px 24px; }
  .install-platform { padding: 15px 14px 17px; }
  .install-step img { margin-left: 0; max-width: 100%; }
  .guide-modal-content { width: 100%; }
  .guide-body { padding: 0 18px 24px; }
  .guide-case { padding: 15px 14px 17px; }
  .guide-case img { max-width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
 * 移动端：禁止 iOS 聚焦自动放大（2026-10-05 用户报障）
 *
 * 现象：手机上点输入框，页面整体放大、只剩输入框可见。
 * 根因：**iOS Safari 的硬规则** —— 聚焦的 input/textarea/select 若计算后
 *   font-size **小于 16px**，它会自动 zoom in。本项目设计字号普遍 10–14px
 *   （.note-search-row .note-search-input 12.5px / .chat-input-area textarea 14px /
 *   .entity-field input 12px ……），**桌面天经地义，iOS 上挨个触发**。
 * 修法（两层，都要）：
 *   1. index.html 的 viewport 加 maximum-scale=1, user-scalable=no（硬顶住缩放）；
 *   2. 下面这条规则把手机档所有输入控件顶到 16px —— 治本那层。锁 viewport 只挡
 *      iOS 的自动缩放，安卓/桌面用户仍应能双指缩放看内容。
 * ⚠️ 用 !important 是有意的：文件里散着十几条媒体查询在给这些控件指定 11–15px，
 *    靠提高特异度来赢非常脆（加一条新规则就把 16px 顶掉）。
 * ⚠️ **本块必须留在文件最末尾** —— 放在前面会被后面同特异度的规则覆盖，
 *    看起来改了没用。
 * ⚠️ 代价：输入框里的字比周围正文大一号。这是正确的取舍 —— iOS 的 16px 阈值
 *    没有例外，宁可字大一点，也不能让页面跳来跳去。
 * ⚠️ 改这里时，test/ui-local-preview.js 里 `mobileHardRules` 那段断言要同步改 ——
 *    它盯着所有可见输入控件 >= 16px，正是防止这条被后来的改动无声顶掉。
 * ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 760px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ── 手机端「关联信息」胶囊修复：label 被压缩成一字一行（竖排）问题 ──
   toggle 在窄屏被 flex 挤压时，label span 缩到 min-content 导致竖排。
   label 禁止换行收缩；窄屏下 toggle 独占一行，摘要右侧省略。 */
.action-context-toggle > span:first-child { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 640px) {
  .action-context-toggle { display: flex; width: 100%; max-width: 100%; }
  .action-context-summary { flex: 1 1 auto; min-width: 0; max-width: none; }
}
