:root {
  color-scheme:light; --bg:#f7f7f4; --surface:#fff; --ink:#25382e; --muted:#80877f;
  --accent:#304e3e; --border:#e5e8e2; --soft:#edf1ea; --danger:#a44843;
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Noto Sans SC","Microsoft YaHei",sans-serif;
  color:var(--ink); background:var(--bg); font-size:16px; letter-spacing:0;
}
* { box-sizing:border-box }
body { margin:0 }
button,input,textarea,select { font:inherit; color:inherit; letter-spacing:0 }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent }
button { cursor:pointer; border:0; background:none }
button:disabled { cursor:default; opacity:.4 }
button:focus-visible,a:focus-visible { outline:2px solid var(--accent); outline-offset:4px }
input:focus,textarea:focus,select:focus { outline:2px solid #b6c3b2; outline-offset:2px }
button:hover:not(:disabled) { filter:brightness(.93) }
svg { width:20px; height:20px; stroke-width:1.7; flex-shrink:0 }
h1,h2,p { margin:0 }
h2 { font-size:17px; line-height:1.5 }
a { color:inherit; text-decoration:none }
[hidden] { display:none!important }
input,textarea,select { min-width:0; max-width:100% }
textarea { resize:vertical; line-height:1.7 }
input,select { min-height:42px }
.app-shell { max-width:808px; padding:0 44px; margin:0 auto; min-height:100dvh }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:48px 0 30px }
.heading { min-width:0 }
h1 { font-size:28px; font-weight:700; line-height:1.4; overflow-wrap:anywhere }
.heading p { color:var(--muted); font-size:13px; margin-top:5px }
.header-actions { display:flex; gap:12px; flex-shrink:0 }
.icon-button { display:inline-flex; align-items:center; justify-content:center; width:42px; height:42px; padding:0; border-radius:14px; flex-shrink:0 }
.menu-toggle { background:var(--surface); width:46px; height:46px; border-radius:17px }
.view { padding-bottom:40px }
.view.chat-view { padding:0 0 max(24px,env(safe-area-inset-bottom)); height:calc(100dvh - 141px); display:flex; flex-direction:column; min-height:280px }
.chat-scroll { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; padding:0 1px 26px; position:relative }
.messages { display:flex; flex-direction:column; gap:28px; padding-top:32px }
.message { max-width:100%; line-height:1.8; overflow-wrap:anywhere }
.message.user { align-self:flex-end; max-width:82%; color:#fff; background:var(--accent); border-radius:21px 21px 6px 21px; padding:13px 19px; white-space:pre-wrap }
.message.assistant { align-self:stretch; max-width:94% }
.message-label { font-size:11px; font-weight:600; color:var(--muted); margin-bottom:7px }
.message-body { white-space:pre-wrap }
#source-content { overflow-wrap:anywhere; max-height:60dvh; overflow:auto }
.message-body code { font-size:.9em; white-space:pre-wrap; overflow-wrap:anywhere }
.chat-welcome { color:var(--muted); font-size:18px; display:grid; place-items:center; min-height:55%; padding:40px 0 }
.composer { position:relative; flex-shrink:0; display:flex; flex-direction:column; gap:0; background:var(--surface); border:1px solid #e5e7de; border-radius:24px; padding:10px; margin-top:8px; box-shadow:0 4px 16px #0000000d }
.composer textarea { width:100%; border:0; background:none; outline:none; padding:10px 6px; resize:none; max-height:120px; min-height:44px; overflow-y:auto; font-size:16px; line-height:24px }
.composer textarea::placeholder { color:#91968e }
.send-button { border-radius:50%; width:44px; height:44px; background:var(--accent); color:#fff; display:grid; place-items:center; flex-shrink:0 }
.composer-toolbar { display:flex; align-items:center; gap:8px; width:100%; height:44px }
.composer-spacer { flex:1 }
.composer-tool { display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px; padding:0; border-radius:12px; background:#f0f1eb; color:#2f4a3a }
.composer-tool svg { width:21px; height:21px }
.attachment-anchor { position:relative; flex-shrink:0 }
.attachment-menu { position:absolute; bottom:54px; left:0; width:154px; padding:6px; border:1px solid var(--border); border-radius:8px; box-shadow:0 5px 24px #00000014; background:var(--surface); z-index:3 }
.attachment-menu button { display:flex; align-items:center; gap:12px; width:100%; text-align:left; min-height:44px; padding:8px 12px; font-size:14px; border-radius:4px }
.attachment-menu button:hover { background:var(--soft) }
.voice-status { min-height:44px; padding:10px 6px; font-size:13px; line-height:24px; color:var(--muted); overflow-wrap:anywhere }
.voice-status.is-error { color:var(--danger) }
.voice-active .composer-spacer { display:none }
.hold-record { display:flex; align-items:center; justify-content:center; gap:8px; flex:1; min-width:0; height:44px; padding:0 8px; background:#f0f1eb; border-radius:22px; color:var(--accent); font-size:14px; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; touch-action:none }
.hold-record.is-recording { background:var(--accent); color:white }
.photo-drafts { display:flex; gap:10px; padding:4px 6px 8px; overflow-x:auto }
.photo-draft { position:relative; width:68px; height:68px; flex-shrink:0 }
.photo-draft img { width:100%; height:100%; object-fit:cover; border-radius:8px }
.photo-draft button { position:absolute; top:-3px; right:-3px; display:grid; place-items:center; width:28px; height:28px; background:var(--surface); border:1px solid var(--border); border-radius:50%; padding:0 }
.photo-draft svg { width:15px; height:15px }
.message-photos { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; width:260px; max-width:100%; white-space:normal }
.message-photos:has(>button:only-child) { grid-template-columns:minmax(0,1fr) }
.message-photos button { min-width:0; padding:0; border-radius:8px; overflow:hidden; background:#dbe1d8; display:block; aspect-ratio:1 }
.message-photos:has(>button:only-child) button { aspect-ratio:4/3 }
.message-photos img { display:block; width:100%; height:100%; object-fit:contain }
.message-photos+span { display:block; padding-top:10px }
.voice-message { display:flex; align-items:center; justify-content:space-between; gap:20px; min-width:120px; min-height:44px; padding:6px 10px; border-radius:8px; background:rgba(255,255,255,.12); color:inherit }
.voice-message.is-playing { outline:2px solid currentColor; outline-offset:2px }
.voice-message+span { display:block; padding-top:10px }
.photo-dialog { width:min(960px,calc(100vw - 24px)); height:min(850px,calc(100dvh - 24px)); max-width:none; max-height:none; padding:50px 12px 12px; background:#171b18; border:0; border-radius:8px }
.photo-dialog::backdrop { background:#000b }
.photo-dialog>.icon-button { position:absolute; right:8px; top:4px; color:#fff }
.photo-dialog>img { display:block; width:100%; height:100%; object-fit:contain }
.is-chat { overflow:hidden }
.is-chat .app-shell { position:fixed; top:var(--viewport-top,0px); left:0; right:0; width:100%; height:var(--viewport-height,100dvh); min-height:0; display:flex; flex-direction:column }
.is-chat .topbar { flex-shrink:0 }
.is-chat .chat-view { height:auto; flex:1; min-height:0 }
.send-button svg { width:22px; height:22px; stroke-width:2 }
#stop-button svg { width:16px; height:16px }
.reply-status { color:var(--muted); font-size:13px; margin:20px 0 0; min-height:20px }
.reply-status:empty { display:none }
.chat-error { font-size:13px; color:var(--danger); margin-top:20px; line-height:1.6; display:flex; align-items:center; gap:12px; flex-wrap:wrap }
.older { display:block; margin:auto; font-size:12px!important }
.text-button { display:inline-flex; align-items:center; justify-content:center; gap:7px; font-size:13px; padding:8px 0; color:var(--accent) }
.text-button svg { width:16px; height:16px }
.section-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 24px }
.date-control { display:flex; align-items:center; gap:9px; font-size:13px; color:var(--muted) }
.date-control input { border:0; background:none; width:130px; font-size:13px }
.timeline-entry { display:grid; grid-template-columns:48px minmax(0,1fr) 32px; column-gap:20px; padding:20px 0 26px; position:relative }
.timeline-entry:before { content:""; position:absolute; top:30px; bottom:-12px; left:56px; width:1px; background:var(--border) }
.timeline-entry:after { content:""; position:absolute; left:53px; top:26px; width:7px; height:7px; background:#9eae9c; border-radius:50% }
.timeline-entry:last-child:before { display:none }
.timeline-entry time { color:var(--muted); font-size:12px; padding-top:3px }
.item-main { min-width:0 }
.item-title { line-height:1.7; font-size:16px; font-weight:500; overflow-wrap:anywhere }
.item-meta { display:flex; gap:7px; flex-wrap:wrap; margin-top:8px; font-size:12px; line-height:1.6; color:var(--muted); overflow-wrap:anywhere }
.item-meta button { font-size:12px; color:var(--muted); padding:0 }
.task-group { margin:22px 0 32px }
.task-group:first-child { margin-top:4px }
.group-title { font-size:14px; color:var(--muted); font-weight:500; padding-bottom:10px; display:flex; align-items:center; gap:8px }
.group-title .count { font-size:11px; background:var(--soft); padding:2px 6px; border-radius:10px }
.task-row { display:flex; gap:16px; align-items:center; min-height:86px; padding:18px 0; border-bottom:1px solid var(--border) }
.task-row .item-main { flex:1 }
.task-check { appearance:none; width:23px; height:23px; min-height:23px; flex-shrink:0; border:1.4px solid #abb6a6; border-radius:50%; margin:0; cursor:pointer; background:var(--surface) }
.task-check:checked { background:var(--accent); border-color:var(--accent); position:relative }
.task-check:checked:after { content:""; position:absolute; left:7px; top:3px; width:5px; height:10px; border:solid #fff; border-width:0 1.5px 1.5px 0; transform:rotate(45deg) }
.is-done .item-title { text-decoration:line-through; color:var(--muted) }
.row-button { width:32px; height:36px; display:grid; place-items:center; flex-shrink:0; color:var(--muted); border-radius:8px }
.row-button svg { width:19px; height:19px }
.overdue { color:var(--danger) }
.priority { width:5px; height:5px; background:#b27a43; display:inline-block; border-radius:50%; align-self:center }
.result-card { align-self:flex-start; width:min(100%,400px); background:var(--surface); border:1px solid #e9ece5; border-radius:17px; padding:0 18px }
.result-card .task-row { border:0; min-height:90px }
.result-card.today-result { display:flex; align-items:center; gap:14px; padding:18px }
.result-card.today-result>.item-main { flex:1 }
.result-card.today-result>svg { color:var(--muted) }
.today-result .item-title { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-size:14px; font-weight:400 }
.result-card.removed { padding:18px; color:var(--muted); font-size:13px }
.tabs { display:flex; gap:28px; border-bottom:1px solid var(--border); margin-bottom:24px }
.tabs button { position:relative; padding:12px 0 15px; font-size:16px; color:var(--muted) }
.tabs [aria-selected=true] { font-weight:600; color:var(--ink) }
.tabs [aria-selected=true]:after { content:""; position:absolute; bottom:-1px; left:0; right:0; height:2px; background:var(--accent) }
.search-bar { display:flex; align-items:center; gap:12px; background:var(--surface); border-radius:14px; padding:3px 8px 3px 16px; margin-bottom:24px }
.search-bar>svg { color:var(--muted) }
.search-bar input { border:0; background:none; flex:1; outline:none }
.section-meta { color:var(--muted); font-size:12px; margin:20px 0 12px }
.memory-row { display:flex; gap:14px; padding:24px 0; border-bottom:1px solid var(--border) }
.memory-row .item-main { flex:1 }
.tag { background:var(--soft); padding:2px 7px; border-radius:6px; font-size:11px }
.empty-state { text-align:center; color:var(--muted); font-size:14px; padding:100px 20px; line-height:1.8 }
.settings-group { margin:16px 0 38px }
.settings-group h2 { margin-bottom:16px }
.settings-group dl { margin:0 }
.schedule-row { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:62px; border-bottom:1px solid var(--border); font-size:14px }
.schedule-row>label,.schedule-row>span { min-width:0; overflow-wrap:anywhere }
.schedule-actions { display:flex; align-items:center; gap:8px; flex-shrink:0 }
#schedule-time { width:105px; border:1px solid var(--border); border-radius:6px; padding:5px; background:var(--surface) }
#schedule-enabled { appearance:none; width:40px; height:24px; min-height:24px; border-radius:12px; background:#a2a9a0; position:relative; cursor:pointer; flex-shrink:0; margin:0 }
#schedule-enabled:before { content:""; position:absolute; width:18px; height:18px; top:3px; left:3px; border-radius:50%; background:#fff }
#schedule-enabled:checked { background:var(--accent) }
#schedule-enabled:checked:before { left:19px }
#schedule-error:not(:empty) { padding-top:10px }
.settings-group dl>div,.plugin-row { display:flex; justify-content:space-between; gap:24px; padding:17px 0; border-bottom:1px solid var(--border); font-size:14px }
.settings-group dt { flex-shrink:0; color:var(--muted) }
.settings-group dd { margin:0; text-align:right; overflow-wrap:anywhere; min-width:0 }
.plugin-row span:last-child { font-size:12px; color:var(--muted) }
.settings-link { display:flex; justify-content:space-between; padding:14px 0; font-size:14px }
.drawer { position:fixed; inset:0 auto 0 0; margin:0; width:330px; max-width:88vw; height:100dvh; max-height:100dvh; border:0; padding:36px 22px 24px; background:var(--surface); color:var(--ink); box-shadow:12px 0 60px #20302710 }
.drawer[open] { display:flex; flex-direction:column }
.drawer::backdrop { background:#15261d30 }
.drawer-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:32px; padding-left:16px }
.drawer-brand { font-size:25px; font-weight:700 }
.nav-list { display:flex; flex-direction:column; gap:7px }
.nav-list button,.nav-settings { display:flex; align-items:center; gap:15px; min-height:50px; text-align:left; font-size:16px; padding:10px 16px; border-radius:13px }
.nav-list button.is-active { background:var(--soft); color:var(--accent); font-weight:600 }
.conversation-heading { display:flex; align-items:center; justify-content:space-between; color:var(--muted); font-size:12px; padding:22px 4px 8px 16px; margin-top:12px; border-top:1px solid var(--border) }
.conversation-list { flex:1; overflow-y:auto; min-height:60px; padding:0 4px }
.conversation-list button { display:block; width:100%; text-align:left; font-size:13px; padding:12px; border-radius:8px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted) }
.conversation-list button.is-active { background:var(--bg); color:var(--ink) }
.nav-settings { margin-top:20px; flex-shrink:0 }
.modal { width:440px; max-width:calc(100vw - 32px); border:1px solid var(--border); border-radius:20px; background:var(--surface); padding:22px 26px; color:var(--ink) }
.modal::backdrop { background:#15261d30 }
.dialog-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px }
.modal label { display:flex; flex-direction:column; gap:8px; font-size:13px; color:var(--muted); margin-bottom:18px }
.modal input,.modal textarea,.modal select { padding:10px 12px; background:var(--bg); border:1px solid var(--border); border-radius:9px; color:var(--ink); width:100%; font-size:16px }
.dialog-actions { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-top:20px }
.primary-button { color:#fff; background:var(--accent); padding:11px 24px; border-radius:11px; margin-left:auto }
.danger { color:var(--danger) }
.form-error { font-size:13px; color:var(--danger); line-height:1.7 }
.toast { position:fixed; left:50%; bottom:100px; transform:translate(-50%,8px); opacity:0; pointer-events:none; transition:opacity .15s,transform .15s; background:var(--ink); color:#fff; padding:11px 18px; border-radius:12px; max-width:calc(100vw - 36px); font-size:13px; z-index:10 }
.toast.is-visible { opacity:1; transform:translate(-50%,0) }
.toast.is-error { background:var(--danger) }
.is-embed .topbar { padding-top:24px }
.is-embed .menu-toggle { display:none }
@media(min-width:1000px) {
  .topbar { padding-top:54px } .view.chat-view { height:calc(100dvh - 147px) }
  .messages { padding-top:48px; gap:32px } .message.user { max-width:76% }
  .chat-scroll { padding-right:8px } .composer { margin-bottom:10px }
}
@media(max-width:600px) {
  .app-shell { padding:0 24px } .topbar { padding-top:max(35px,env(safe-area-inset-top)); padding-bottom:25px }
  .is-chat .app-shell { padding:0 20px }
  .is-chat .topbar { padding-top:max(24px,env(safe-area-inset-top)); padding-bottom:20px }
  .is-chat h1 { font-size:26px }
  .is-chat .heading p { font-size:11px }
  .is-chat .menu-toggle { width:40px; height:40px; border:1px solid var(--border); border-radius:12px }
  .view.chat-view { height:calc(100dvh - 123px); padding-bottom:max(16px,env(safe-area-inset-bottom)) }
  .header-actions { gap:6px } .messages { gap:26px; padding-top:25px }
  .message.user { max-width:88%; padding:12px 17px } .message.assistant { max-width:100% }
  .timeline-entry { column-gap:16px; grid-template-columns:42px minmax(0,1fr) 28px }
  .timeline-entry:before { left:48px } .timeline-entry:after { left:45px }
  .task-row { gap:13px } .modal { padding:20px } .tabs { gap:26px }
  .drawer { padding-top:max(30px,env(safe-area-inset-top)) }
  .settings-group dl>div { gap:12px } .section-toolbar { gap:8px }
  .section-toolbar .text-button { white-space:nowrap }
}
@media(prefers-reduced-motion:reduce) { * { scroll-behavior:auto!important; transition:none!important } }
