:root {
  --ink: #eee4d8;
  --ink-soft: #b7a795;
  --ink-muted: #796c5f;
  --paper: #f5efe7;
  --night: #17120f;
  --night-2: #1e1712;
  --night-3: #282018;
  --line: rgba(232, 215, 195, .13);
  --line-strong: rgba(221, 177, 124, .28);
  --gold: #d4a574;
  --gold-light: #ebc79d;
  --gold-faint: rgba(212, 165, 116, .13);
  --sage: #91b287;
  --red: #d47d69;
  --blue: #8aa7c6;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --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 18px 50px rgba(0, 0, 0, .24);
}

* { 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; }
.wordmark-mark { display: inline-grid; place-items: center; width: 27px; height: 27px; color: var(--night); background: var(--gold); border-radius: 8px 8px 8px 2px; font-family: var(--serif); font-size: 17px; font-weight: 800; letter-spacing: 0; line-height: 1; }

/* Login */
.login-page { display: grid; place-items: center; padding: 28px; overflow-y: auto; background: #17120f; }
.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(179, 120, 64, .22), transparent 67%); }
.login-page::after { right: -18vw; bottom: -30vw; background: radial-gradient(circle, rgba(92, 124, 101, .2), 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-strong); border-radius: 28px; background: rgba(31, 24, 19, .88); box-shadow: var(--shadow); }
.login-intro { display: flex; flex-direction: column; padding: clamp(38px, 7vw, 76px); border-right: 1px solid var(--line); background: linear-gradient(145deg, rgba(45, 34, 25, .95), rgba(24, 18, 14, .88)); }
.intro-copy { margin: auto 0; }
.intro-copy .eyebrow { margin-bottom: 18px; }
.intro-copy h1 { margin: 0; color: #f2e7d9; 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 rgba(212, 165, 116, .7); }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 5vw, 62px); background: rgba(23, 18, 15, .62); }
.mobile-wordmark { display: none; margin-bottom: 48px; font-size: 22px; }
.login-card .eyebrow { margin-bottom: 15px; }
.login-card h2 { margin: 0; color: #f2e8dd; 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(2, 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: rgba(9,7,6,.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: rgba(9,7,6,.5); }
.auth-submit { gap: 8px; margin-top: 5px; background: var(--gold); color: #281b12; font-size: 14px; font-weight: 700; }.auth-submit:hover { background: var(--gold-light); }.auth-submit:disabled { cursor: wait; opacity: .65; transform: none; }
.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); }
/* 邮箱验证码：输入 + 获取按钮同行 */
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; }
.code-btn { flex: 0 0 auto; min-width: 96px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--gold-faint); color: var(--gold-light); cursor: pointer; font-size: 11px; transition: .18s ease; white-space: nowrap; }
.code-btn:hover:not(:disabled) { border-color: var(--gold); background: rgba(212, 165, 116, .2); }
.code-btn:disabled { cursor: wait; opacity: .6; }
.login-mode-toggle { display: block; margin: 10px auto 0; padding: 0; border: 0; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 11px; transition: .18s ease; }
.login-mode-toggle:hover { color: var(--gold-light); }
.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 { display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(23, 18, 15, .96); }
.topbar-brand, .topbar-center, .topbar-actions, .assistant-identity, .account-card { display: flex; align-items: center; }
.topbar-brand { gap: 9px; min-width: 230px; }
.topbar-brand .wordmark-mark { width: 25px; height: 25px; font-size: 16px; }
.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: rgba(212, 165, 116, .2); }
.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); }
.mobile-only, .mobile-nav { display: none; }
.app-workspace { --panel-width: 395px; display: grid; min-height: 0; flex: 1; grid-template-columns: minmax(300px, var(--panel-width)) 10px minmax(0, 1fr); }

/* Dashboard / the original second-brain panel language */
.dashboard-panel { display: flex; min-height: 0; flex-direction: column; border-right: 1px solid var(--line); background: #1b1511; }
.workspace-resizer { position: relative; z-index: 3; width: 10px; margin-left: -5px; cursor: col-resize; touch-action: none; }.workspace-resizer::before { position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; content: ""; background: var(--line); transition: .2s ease; }.workspace-resizer::after { position: absolute; top: 50%; left: 0; width: 10px; height: 38px; content: ""; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--night-3); transform: translateY(-50%); opacity: 0; transition: .2s ease; }.workspace-resizer:hover::before, .workspace-resizer.is-dragging::before { width: 2px; background: var(--gold); }.workspace-resizer:hover::after, .workspace-resizer.is-dragging::after { opacity: 1; }.workspace-resizer:focus-visible { outline: 2px solid var(--gold-light); outline-offset: -2px; } body.is-resizing { cursor: col-resize; user-select: none; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 24px 22px 16px; }
.panel-heading h1 { margin: 5px 0 0; color: #f0e5d9; font-family: var(--serif); font-size: 25px; font-weight: 600; letter-spacing: .03em; }
.view-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 0 22px 15px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .025); }
.view-tab { min-height: 29px; padding: 0 4px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 11px; transition: .2s ease; }
.view-tab:hover { color: var(--ink-soft); }
.view-tab.active { background: rgba(212, 165, 116, .14); color: var(--gold-light); }
.dashboard-content { min-height: 0; flex: 1; padding: 0 16px 18px 22px; overflow-y: auto; scrollbar-color: rgba(212, 165, 116, .32) transparent; scrollbar-width: thin; }
.dashboard-content::-webkit-scrollbar, .chat-messages::-webkit-scrollbar { width: 6px; }
.dashboard-content::-webkit-scrollbar-thumb, .chat-messages::-webkit-scrollbar-thumb { border-radius: 10px; background: rgba(212, 165, 116, .25); }
.dashboard-day { padding: 4px 4px 16px 0; }
.dashboard-date { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; color: var(--ink-muted); font-size: 11px; }
.dashboard-date strong { color: var(--ink-soft); font-family: var(--serif); font-size: 13px; font-weight: 600; }
.focus-hero { padding: 18px; overflow: hidden; border: 1px solid rgba(212, 165, 116, .23); border-radius: var(--radius); background: linear-gradient(135deg, rgba(76, 55, 37, .63), rgba(34, 26, 20, .76)); }
.focus-hero .eyebrow { color: #d7ae82; }
.focus-title { margin: 9px 0 7px; color: #f3e8da; 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: 12px; font-weight: 600; }
.section-marker { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(212, 165, 116, .6); }
.section-count { color: var(--ink-muted); font-size: 10px; }
.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: 10px; min-height: 48px; padding: 10px 11px; 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: rgba(212, 165, 116, .11); 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; }
.item-title { overflow: hidden; color: var(--ink); font-size: 12px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.item-title.done { color: var(--ink-muted); text-decoration: line-through; }
.item-meta { overflow: hidden; margin-top: 3px; color: var(--ink-muted); font-size: 10px; line-height: 1.35; 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(212, 125, 105, .1); }

/* 面板条目操作按钮（与 skill 前端一致）*/
.item-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; 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: 20px; height: 20px; padding: 0; border: 2px solid var(--line-strong); border-radius: 6px; 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(212, 125, 105, .15); }

/* 决策"结束跟踪"按钮 */
.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; }
.briefing-card { padding: 11px 12px; border: 1px solid var(--line); border-left: 2px solid var(--gold); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: rgba(212, 165, 116, .05); }
.briefing-card p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink-soft); font-size: 11px; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.briefing-card strong { color: var(--gold-light); font-weight: 600; }
.daily-review-section .briefing-card { border-left-color: var(--sage); background: rgba(145, 178, 135, .07); }
.daily-review-section .briefing-card p { display: block; overflow: visible; }
.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-direction: column; background: radial-gradient(ellipse at 85% 10%, rgba(104, 73, 44, .13), transparent 34%), #201813; }
.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: rgba(32, 24, 19, .8); }
.assistant-identity { gap: 11px; }.assistant-orb { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid rgba(230, 194, 151, .5); border-radius: 12px 12px 12px 3px; color: var(--night); background: linear-gradient(135deg, #e1b883, #b98459); font-family: var(--serif); font-size: 18px; font-weight: 700; }
.assistant-identity h2 { margin: 0; color: #f0e6da; 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(780px, 100%); min-height: 0; flex: 1 1 0; margin: 0 auto; padding: clamp(28px, 5.5vh, 72px) clamp(22px, 6vw, 70px) 25px; overflow-y: auto; scrollbar-color: rgba(212, 165, 116, .3) transparent; scrollbar-width: thin; -webkit-overflow-scrolling: touch; max-height: calc(100vh - 230px); }
/* 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: #f2e7db; 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(600px, 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 { margin-left: auto; border: 1px solid rgba(212, 165, 116, .31); border-bottom-right-radius: 4px; background: rgba(110, 75, 45, .48); color: #f4e9db; }.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 rgba(212, 165, 116, .55); 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: rgba(212, 165, 116, .35); background: rgba(212, 165, 116, .08); } }
@keyframes dotPulse { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.6); opacity: .45; } }.msg-error { border: 1px solid rgba(212, 125, 105, .3); background: rgba(212, 125, 105, .1); color: #e6a294; 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; }
.suggestion-chips { display: flex; width: min(780px, 100%); gap: 7px; margin: 0 auto; padding: 0 clamp(22px, 6vw, 70px) 12px; overflow-x: auto; scrollbar-width: none; }.suggestion-chips::-webkit-scrollbar { display: none; }.suggestion-chips button { flex: 0 0 auto; padding: 7px 10px; 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; }.suggestion-chips button: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: rgba(212, 165, 116, .08); 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(212, 125, 105, .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 rgba(212, 165, 116, .32); border-radius: 15px; background: rgba(29, 22, 17, .93); box-shadow: 0 12px 30px rgba(0, 0, 0, .12); 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: #21170f; 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 rgba(255, 255, 255, .16); border-radius: 6px; color: var(--ink-soft); font-size: 10px; }

.deep-mode-button { flex: 0 0 auto; min-width: 35px; height: 35px; padding: 0 7px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 10px; transition: .2s ease; }.deep-mode-button:hover:not(:disabled), .deep-mode-button.active { border-color: var(--gold); background: var(--gold-faint); color: var(--gold-light); }.deep-mode-button:disabled { cursor: not-allowed; opacity: .45; }

/* Subscription */
.modal { display: grid; position: fixed; z-index: 10; inset: 0; place-items: center; padding: 22px; background: rgba(8, 6, 5, .68); backdrop-filter: blur(7px); }.modal-content { width: min(900px, 100%); max-height: min(700px, 100%); overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 22px; background: #211914; 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: #f1e5d8; 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(212, 125, 105, .5); }.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: linear-gradient(155deg, rgba(212, 165, 116, .15), rgba(255, 255, 255, .025)); }.badge-popular { position: absolute; top: -10px; right: 14px; padding: 3px 8px; border-radius: 9px; background: var(--gold); color: #251a11; 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: #21170f; 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; }
.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: #37281e; 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: rgba(212, 165, 116, .6); background: linear-gradient(180deg, rgba(212, 165, 116, .14), rgba(212, 165, 116, .06)); color: var(--gold-light); }

/* Original Skill also offers a calm paper-like light theme. */
html[data-theme="light"] { --ink: #332920; --ink-soft: #655747; --ink-muted: #8b7b69; --paper: #fffaf4; --night: #f7f1e9; --night-2: #eee4d8; --night-3: #e5d7c8; --line: rgba(89, 66, 44, .15); --line-strong: rgba(151, 104, 60, .35); --gold: #a66b37; --gold-light: #8b542a; --gold-faint: rgba(166, 107, 55, .11); --shadow: 0 18px 50px rgba(69, 48, 31, .14); }
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: rgba(255, 251, 246, .94); }
html[data-theme="light"] .login-intro { background: linear-gradient(145deg, #fbf5ed, #efe2d5); }
html[data-theme="light"] .login-card { background: rgba(255, 252, 247, .78); }
html[data-theme="light"] .app-topbar { background: rgba(250, 245, 238, .96); }
html[data-theme="light"] .dashboard-panel { background: #f5ede3; }
html[data-theme="light"] .assistant-workspace { background: radial-gradient(ellipse at 85% 10%, rgba(176, 118, 63, .13), transparent 34%), #fffaf4; }
html[data-theme="light"] .assistant-header { background: rgba(255, 250, 244, .84); }
html[data-theme="light"] .chat-input-area { background: rgba(255, 253, 249, .96); box-shadow: 0 12px 30px rgba(91, 60, 33, .09); }
html[data-theme="light"] .modal-content { background: #fffaf4; }
html[data-theme="light"] .toast { background: #f0dfcc; }
html[data-theme="light"] .intro-copy h1, html[data-theme="light"] .login-card h2, html[data-theme="light"] .panel-heading h1, html[data-theme="light"] .assistant-identity h2, html[data-theme="light"] .welcome-msg h2, html[data-theme="light"] .focus-title, html[data-theme="light"] .topbar-name { color: #38291f; }
html[data-theme="light"] .form-field input { background: rgba(255, 255, 255, .75); }
html[data-theme="light"] .msg-user { color: #fffaf4; background: #8d5a35; }
html[data-theme="light"] .mobile-nav { background: rgba(250, 245, 238, .98); }
html[data-theme="light"] .focus-hero { border-color: rgba(162, 112, 64, .28); background: linear-gradient(135deg, #fffdf9 0%, #f7ebde 100%); box-shadow: 0 10px 28px rgba(111, 75, 43, .10); }
html[data-theme="light"] .focus-hero .eyebrow { color: #a66b37; }
html[data-theme="light"] .focus-title { color: #3b2d22; }
html[data-theme="light"] .focus-summary { color: #735f4c; }
html[data-theme="light"] .view-switch, html[data-theme="light"] .section-list, html[data-theme="light"] .plan-card { background: rgba(255, 255, 255, .56); }
html[data-theme="light"] .plan-card.featured { background: linear-gradient(155deg, rgba(230, 190, 145, .34), rgba(255, 255, 255, .72)); }
html[data-theme="light"] .panel-item:hover { background: rgba(166, 107, 55, .06); }
html[data-theme="light"] .account-card { background: rgba(255, 255, 255, .45); }
html[data-theme="light"] .avatar { background: #ead8c4; }
html[data-theme="light"] .msg-tool, html[data-theme="light"] .typing-indicator, html[data-theme="light"] .suggestion-chips button { background: rgba(111, 76, 45, .045); }
html[data-theme="light"] .msg-attachment { border-color: rgba(89, 66, 44, .20); }

@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; padding: 0; }.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%; min-height: 100%; border: 0; border-radius: 0; background: transparent; box-shadow: none; }.login-intro { display: none; }.login-card { min-height: 100vh; 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; }.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-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-right: 0; }.assistant-workspace { z-index: 2; }.app-page[data-mobile-view="panel"] .assistant-workspace, .app-page[data-mobile-view="knowledge"] .assistant-workspace { display: none; }.app-page[data-mobile-view="chat"] .dashboard-panel { display: none; }.panel-heading { padding: 20px 20px 15px; }.dashboard-content { padding: 0 14px calc(85px + 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 { 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; }.suggestion-chips { padding: 0 16px 10px; }.composer-wrap { padding: 0 16px calc(67px + env(safe-area-inset-bottom)); }.composer-hint { display: none; }.mobile-nav { display: grid; position: absolute; z-index: 4; right: 0; bottom: 0; left: 0; grid-template-columns: repeat(2, 1fr); height: calc(62px + env(safe-area-inset-bottom)); padding: 7px 17px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(23, 18, 15, .97); }.mobile-nav-item { display: grid; place-items: center; gap: 2px; padding: 0; border: 0; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 10px; }.mobile-nav-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }.mobile-nav-item.active { color: var(--gold-light); }.plans { grid-template-columns: 1fr; padding: 4px 18px 20px; }.plan-card { min-height: auto; }.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) {
  .app-topbar { position: relative; }
  .topbar-brand { flex: 1 1 auto; min-width: 0 !important; }
  .topbar-actions { display: flex; position: absolute; top: 50%; right: 12px; flex: 0 0 auto; min-width: 0 !important; transform: translateY(-50%); }
  .plan-pill { display: inline-flex; max-width: 96px; }
  #btn-mobile-menu { display: inline-grid !important; }
  /* 移动端按钮始终可见（无 hover）*/
  .item-actions { opacity: 1; }
  .panel-item.is-done .item-actions { opacity: .7; }
}

@media (max-height: 640px) and (min-width: 761px) { .panel-heading { padding-top: 15px; padding-bottom: 12px; }.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); }

/* 注意力信号 */
.attention-signals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.attention-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 99px; background: rgba(212, 165, 116, .08); color: var(--gold-light); font-size: 10px; }
.attention-pill em { font-style: normal; font-weight: 700; }
.attention-pill.overdue, .attention-pill.conflict, .attention-pill.blocked { border-color: rgba(212, 125, 105, .4); background: rgba(212, 125, 105, .1); color: #e0a291; }
.attention-pill.deadline, .attention-pill.need_decision { border-color: rgba(212, 165, 116, .45); background: rgba(212, 165, 116, .14); color: #e3c094; }

/* 区块标题右侧操作区 */
.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); }

/* 晨报 5 区块 */
.briefing-card.briefing-blocks { display: grid; gap: 10px; padding: 13px 14px; }
.briefing-block { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .02); }
.briefing-block-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.briefing-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.briefing-dot.red { background: var(--red); box-shadow: 0 0 8px rgba(212, 125, 105, .55); }
.briefing-dot.green { background: var(--sage); box-shadow: 0 0 8px rgba(145, 178, 135, .5); }
.briefing-dot.white { background: var(--ink-muted); }
.briefing-dot.gold { background: var(--gold); box-shadow: 0 0 8px rgba(212, 165, 116, .6); }
.briefing-block-label { color: var(--ink-soft); font-size: 10px; font-weight: 600; letter-spacing: .05em; }
.briefing-block-text { color: var(--ink-soft); font-size: 11px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

/* 日程卡片时间列 */
.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: 2px 6px; border-radius: 5px; font-size: 9px; font-weight: 600; margin-top: 2px; }
.commitment-tag.must { background: rgba(212, 125, 105, .16); color: #e0a291; }
.commitment-tag.should { background: rgba(212, 165, 116, .14); 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: rgba(212, 165, 116, .14); 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(212, 125, 105, .13); 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(212, 125, 105, .12); 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-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.note-tab { padding: 3px 9px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 10px; transition: .18s ease; }
.note-tab:hover { color: var(--ink-soft); border-color: var(--line-strong); }
.note-tab.active { border-color: var(--gold); color: var(--gold-light); background: var(--gold-faint); }
.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; }
.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: rgba(212, 165, 116, .09); 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: rgba(212, 165, 116, .2); }
.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: rgba(212, 165, 116, .1); 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: hidden; text-overflow: ellipsis; white-space: nowrap; }
.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(212, 125, 105, .35); border-radius: 8px; background: transparent; color: #e0a291; cursor: pointer; font-size: 10px; transition: .18s ease; }
.topic-delete-btn:hover { background: rgba(212, 125, 105, .12); }

/* 实体表单（添加/编辑模态框） */
.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-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); }
.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: #281b12; font-weight: 700; }
.entity-submit:hover { background: var(--gold-light); }
.entity-submit:disabled { cursor: wait; opacity: .6; }

/* 时间编辑 */
.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 { 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 { border-color: rgba(212, 165, 116, .35); }
.calendar-cell.today { border-color: var(--gold); color: var(--gold-light); font-weight: 700; }
.calendar-cell.selected { background: var(--gold); color: #281b12; font-weight: 700; }
.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 { border: 1px solid rgba(212, 165, 116, .5); }
.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"] .briefing-block, 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"] .attention-pill.overdue, html[data-theme="light"] .attention-pill.conflict, html[data-theme="light"] .attention-pill.blocked { 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: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .goal-type-tag, .goal-signal { vertical-align: 0; }
  .briefing-card.briefing-blocks { padding: 11px 12px; }
  .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; }
  .note-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .note-tab { flex: 0 0 auto; }
  .focus-actions { flex-direction: column; }
  .focus-action { width: 100%; }
  /* 触控目标放大：移动端小按钮统一 ≥ 32px 点击区 */
  .section-add-btn, .item-time-edit, .item-delete, .item-check, .day-nav-btn, .calendar-nav { width: 32px; height: 32px; min-width: 32px; min-height: 32px; }
  .goal-caret, .note-caret { width: 24px; height: 24px; font-size: 12px; display: grid; place-items: center; }
  .item-check { border-radius: 8px; }
  .note-tab, .errand-filter-chip, .note-save-btn, .note-cancel-btn, .note-edit-btn, .topic-delete-btn, .action-context-toggle, .item-resolve { 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; }

/* 晨报/反思 空态 */
.briefing-card.is-empty { padding: 22px 14px; text-align: center; }
.briefing-empty-text { color: var(--ink-muted); font-size: 11px; }

/* focus-hero 主操作按钮（+ 加入日程 / 添加事项） */
.focus-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.focus-action { display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(255, 255, 255, .02); color: var(--ink-soft); cursor: pointer; font-size: 11px; font-weight: 600; transition: .18s ease; }
.focus-action:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-faint); }
.focus-action.primary { background: var(--gold); border-color: var(--gold); color: #281b12; }
.focus-action.primary:hover { background: var(--gold-light); border-color: var(--gold-light); }

/* 待办筛选 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: rgba(212, 165, 116, .14); color: var(--gold-light); }

/* 笔记顶部记录卡（+ 记录笔记 + AI 提示） */
.note-add-card { padding: 14px 16px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(212, 165, 116, .04); }
.note-add-card .note-add-trigger-btn { display: block; width: 100%; padding: 9px 12px; border: 1px dashed var(--line-strong); border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 12px; transition: .18s ease; }
.note-add-card .note-add-trigger-btn:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-faint); }
.note-chat-import-hint { margin: 9px 0 0; color: var(--ink-muted); font-size: 10px; line-height: 1.7; }

/* 决策横排卡（对齐 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; }

/* 目标样式微调（区分字段层级） */
.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-add-card { background: rgba(166, 107, 55, .05); }
html[data-theme="light"] .briefing-card.is-empty { background: rgba(255, 255, 255, .55); }
html[data-theme="light"] .focus-action { background: rgba(255, 255, 255, .7); }
html[data-theme="light"] .focus-action.primary { background: var(--gold); color: #fffaf4; border-color: var(--gold); }
html[data-theme="light"] .errand-filter { background: rgba(255, 255, 255, .55); }

/* ═══════════════════════════════════════════════════════════════════════════
   冲突横幅 / 冲突详情 / 执行上下文 / 卡片元数据（对齐 skill 原版）
   ═══════════════════════════════════════════════════════════════════════════ */

.conflict-banner { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; padding: 11px 13px; border: 1px solid rgba(212, 125, 105, .42); border-radius: var(--radius-sm); background: rgba(212, 125, 105, .09); cursor: pointer; transition: .18s ease; }
.conflict-banner:hover { background: rgba(212, 125, 105, .14); }
.conflict-icon { flex: 0 0 auto; color: #e0a291; font-size: 15px; line-height: 1.4; }
.conflict-content { min-width: 0; flex: 1; }
.conflict-title { color: #e8b3a6; font-size: 12px; font-weight: 600; line-height: 1.5; }
.conflict-desc { margin-top: 3px; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.conflict-suggestion { margin-top: 5px; color: var(--gold-light); font-size: 11px; line-height: 1.6; }

.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: rgba(212, 165, 116, .07); 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: rgba(212, 165, 116, .12); 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: rgba(212, 165, 116, .12); color: var(--gold-light); }
.task-retention.memory { background: rgba(138, 167, 198, .12); color: var(--blue); }
.errand-linked-notes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.errand-linked-note { padding: 1px 7px; border-radius: 99px; background: rgba(138, 167, 198, .1); color: var(--blue); font-size: 9px; }

/* 执行上下文 */
.action-context-toggle { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 10px; 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: 190px; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-muted); font-size: 10px; }
.action-context { display: grid; gap: 6px; margin-top: 7px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .02); }
.action-context-line { display: flex; gap: 7px; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.action-context-label { flex: 0 0 auto; color: var(--ink-muted); font-size: 9px; font-weight: 600; }
.action-context-reason { 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; }

/* 主题树分组 */
.tree-note-time { margin-left: auto; color: var(--ink-muted); font-size: 9px; white-space: nowrap; }

html[data-theme="light"] .conflict-banner { background: rgba(212, 125, 105, .08); }
html[data-theme="light"] .conflict-title { color: #b3573f; }
html[data-theme="light"] .conflict-icon { color: #b3573f; }
html[data-theme="light"] .attention-pill.deadline, html[data-theme="light"] .attention-pill.need_decision { color: #a66b37; }
html[data-theme="light"] .ddl-info.ddl-overdue { color: #b3573f; }
html[data-theme="light"] .action-context { background: rgba(255, 255, 255, .55); }
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: flex-start; gap: 10px; width: 100%; padding: 10px 12px; margin-bottom: 4px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; text-align: left; transition: .15s ease; font: inherit; }
.history-item:hover { background: rgba(212, 165, 116, .08); border-color: var(--line); }
.history-item.active { background: rgba(212, 165, 116, .16); border-color: rgba(212, 165, 116, .35); }
.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; }
@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 rgba(212, 165, 116, .35); border-radius: 0 8px 8px 0; background: rgba(212, 165, 116, .05); 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; }

/* 笔记跳转按钮（在事件卡的执行上下文里） */
.note-jump-btn { display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 8px; margin: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: .15s ease; }
.note-jump-btn:hover { border-color: var(--line); background: var(--gold-faint); color: var(--gold-light); }
.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; }

/* 笔记卡片展开按钮（更明显） */
.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(212, 125, 105, .16); color: #e6a294; }
.voice-button.listening::after { content: ''; position: absolute; inset: -5px; border-radius: 10px; border: 1px solid rgba(212, 125, 105, .6); 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(201, 106, 79, .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); }
