:root { --bg:#f6f8f7; --panel:#fff; --ink:#17231e; --muted:#66756d; --line:#d9e1dc; --accent:#08775d; --accent-strong:#05634c; --user:#e5f1ee; --assistant:#fff; --danger:#ad3c37; --soft-accent:#e8f4ef; }
* { box-sizing:border-box; }
html, body { height:100%; margin:0; overflow:hidden; }
body { min-height:100dvh; background:var(--bg); color:var(--ink); font:14px/1.45 Inter,"Segoe UI","Microsoft YaHei",sans-serif; letter-spacing:0; }
button, input, textarea { font:inherit; }
button { cursor:pointer; }
.hidden { display:none !important; }
.login-shell { min-height:100dvh; display:grid; place-items:center; padding:24px; }
.login { width:min(400px, 100%); padding:28px; border:1px solid var(--line); border-radius:8px; background:var(--panel); box-shadow:0 10px 30px rgba(23,44,35,.08); }
.brand { display:flex; align-items:center; gap:10px; margin-bottom:25px; }
.mark { width:32px; height:32px; display:grid; place-items:center; flex:0 0 auto; border-radius:50%; background:var(--accent); color:#fff; font-weight:700; }
h1, h2, p { margin:0; }
h1 { font-size:18px; }
.subtle { margin-top:3px; color:var(--muted); font-size:13px; }
label { display:block; margin:15px 0 6px; color:var(--muted); font-size:13px; }
input:not([type="checkbox"]), textarea { width:100%; border:1px solid var(--line); border-radius:6px; background:#fff; color:var(--ink); outline:none; }
input:not([type="checkbox"]) { height:40px; padding:0 10px; }
textarea { min-height:48px; max-height:160px; padding:11px 12px; resize:vertical; }
input:not([type="checkbox"]):focus, textarea:focus { border-color:var(--accent); box-shadow:0 0 0 2px rgba(8,119,93,.12); }
.button { min-height:38px; padding:0 13px; border:1px solid var(--accent); border-radius:6px; background:var(--accent); color:#fff; }
.button:hover { background:var(--accent-strong); }
.button:disabled { opacity:.55; cursor:wait; }
.login .button { width:100%; margin-top:20px; }
.remember-login { display:flex; align-items:center; gap:7px; margin:15px 0 0; color:var(--muted); }
.remember-login input { width:16px; height:16px; margin:0; accent-color:var(--accent); }
.notice { min-height:20px; margin-top:12px; color:var(--danger); font-size:13px; }
.app { height:100dvh; min-height:0; overflow:hidden; display:grid; grid-template-columns:272px minmax(0,1fr); }
.sidebar { display:flex; flex-direction:column; min-height:0; overflow:hidden; border-right:1px solid var(--line); background:var(--panel); }
.side-top { padding:20px 18px 16px; border-bottom:1px solid var(--line); }
.side-top .brand { margin-bottom:0; }
.account { margin-top:20px; overflow:hidden; color:var(--muted); text-overflow:ellipsis; white-space:nowrap; }
.life-actions { display:flex; gap:8px; margin-top:14px; }
.life-actions .button { flex:1; }
.life-list { min-height:0; overflow:auto; padding:10px; }
.life { width:100%; min-height:58px; padding:10px 11px; border:1px solid transparent; border-radius:6px; background:transparent; color:var(--ink); text-align:left; transition:background .15s ease,border-color .15s ease; }
.life:hover { background:#f0f5f2; }
.life.active { border-color:#b7dacc; background:var(--soft-accent); box-shadow:inset 3px 0 0 var(--accent); }
.life-name { display:block; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.life-meta { display:block; margin-top:2px; color:var(--muted); font-size:12px; }
.side-bottom { padding:12px 16px; border-top:1px solid var(--line); }
.plain { padding:0; border:0; background:transparent; color:var(--muted); }
.plain:hover { color:var(--accent); }
.main { min-width:0; min-height:0; overflow:hidden; display:grid; grid-template-rows:auto minmax(0,1fr) auto; }
.top { display:flex; align-items:center; gap:20px; min-height:68px; padding:10px 26px; border-bottom:1px solid var(--line); background:rgba(255,255,255,.94); }
.title { min-width:0; flex:1 1 auto; }
.title-row { display:flex; align-items:center; gap:6px; }
.title h2 { min-width:0; overflow:hidden; font-size:17px; text-overflow:ellipsis; white-space:nowrap; }
.title-edit { display:grid; width:32px; min-width:32px; height:27px; place-items:center; flex:0 0 auto; border-radius:4px; color:var(--accent); font-size:15px; white-space:nowrap; }
.title-edit:hover { background:var(--soft-accent); }
.title p { margin-top:2px; color:var(--muted); font-size:12px; }
.title-form { display:flex; align-items:center; gap:7px; margin-top:8px; }
.title-form input { min-width:0; height:32px; }
.title-form .button { min-height:32px; padding:0 10px; }
.header-tools { display:flex; align-items:center; gap:10px; min-width:0; margin-left:auto; }
.status { flex:0 0 auto; color:var(--muted); font-size:12px; white-space:nowrap; }
.messages { min-height:0; overflow:auto; overscroll-behavior:contain; padding:28px max(20px, calc((100% - 840px) / 2)); }
.empty { display:grid; min-height:100%; place-items:center; color:var(--muted); text-align:center; }
.message { max-width:min(720px, 90%); margin:0 0 16px; padding:12px 14px; border:1px solid var(--line); border-radius:7px; background:var(--assistant); font-size:15px; line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; }
.message.user { margin-left:auto; border-color:#c5dfd5; background:var(--user); }
.message-meta { display:flex; align-items:center; flex-wrap:wrap; min-height:20px; margin-bottom:6px; color:var(--muted); font-size:12px; }
.message-retry { display:inline-flex; align-items:center; flex-wrap:wrap; gap:7px; max-width:100%; color:var(--danger); }
.message-retry-reason { overflow-wrap:anywhere; }
.retry { min-width:88px; min-height:42px; padding:8px 16px; border:1px solid var(--accent); border-radius:6px; background:var(--accent); color:#fff; font:600 15px/1.2 Inter,"Segoe UI","Microsoft YaHei",sans-serif; cursor:pointer; }
.retry:hover { background:var(--accent-strong); }
.retry:disabled { cursor:wait; opacity:.6; }
.message-text { position:relative; }
.message.user .message-text { padding-right:26px; }
.correction-button { position:absolute; top:-2px; right:-2px; width:24px; height:24px; padding:0; border:0; border-radius:4px; background:transparent; color:var(--muted); cursor:pointer; font-size:15px; line-height:1; }
.correction-button:hover { background:rgba(23,107,76,.12); color:var(--accent); }
.correction-status { display:flex; align-items:center; justify-content:space-between; min-height:28px; margin:0 0 7px; padding:4px 7px; border:1px solid var(--line); border-radius:5px; color:var(--muted); font-size:12px; }
.correction-status[hidden] { display:none; }
.correction-status button { width:24px; height:24px; padding:0; border:0; background:transparent; color:inherit; font-size:18px; line-height:1; }
.speech-button { width:28px; height:28px; margin-left:8px; padding:0; border:1px solid var(--line); border-radius:50%; background:#fff; color:var(--accent); cursor:pointer; font-size:12px; line-height:1; }
.speech-button:hover { border-color:var(--accent); background:var(--soft-accent); }
.speech-button:disabled { cursor:default; opacity:.55; }
.speech-button.loading::after { content:'...'; }
.speech-button.error { color:#b43d34; }
.composer { padding:15px max(20px, calc((100% - 840px) / 2)); border-top:1px solid var(--line); background:var(--panel); }
.compose-row { display:flex; align-items:flex-end; gap:10px; }
.compose-row textarea { flex:1; }
.compose-row .button { flex:0 0 auto; }
.asr-button { width:44px; height:44px; flex:0 0 44px; padding:0; border:1px solid var(--line); border-radius:6px; background:#fff; color:var(--accent); cursor:pointer; font-size:17px; touch-action:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; -webkit-tap-highlight-color:transparent; }
.asr-button:hover { border-color:var(--accent); background:var(--soft-accent); }
.asr-button.recording { border-color:#c44a41; background:#fff0ee; color:#b43d34; }
.asr-button.canceling { transform:translateY(-4px); color:#b43d34; }
.asr-button:disabled { cursor:default; opacity:.55; }
.asr-button[hidden], .asr-status[hidden] { display:none; }
.asr-status { min-height:18px; margin:0 0 7px; color:var(--muted); font-size:12px; }
.speech-control { display:flex; align-items:center; gap:7px; }
.speech-control label, .privacy-toggle-label { display:flex; align-items:center; gap:6px; margin:0; color:var(--muted); font-size:12px; white-space:nowrap; }
.live-control { display:flex; align-items:center; gap:6px; white-space:nowrap; }
.live-button { min-height:30px; padding:0 9px; border:1px solid var(--accent); border-radius:5px; background:var(--soft-accent); color:var(--accent); font-size:12px; }
.live-button:hover { background:#d8eee5; }
.live-button.active { border-color:#b43d34; background:#fff0ee; color:#b43d34; }
.live-button:disabled { cursor:wait; opacity:.55; }
.live-status { color:var(--muted); font-size:12px; }
input[type="checkbox"][role="switch"] { width:32px; height:18px; margin:0; appearance:none; border:1px solid #b7c3bd; border-radius:999px; background:#dce3df; cursor:pointer; position:relative; vertical-align:middle; transition:background .15s ease,border-color .15s ease; }
input[type="checkbox"][role="switch"]::after { content:""; position:absolute; top:2px; left:2px; width:12px; height:12px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.18); transition:transform .15s ease; }
input[type="checkbox"][role="switch"]:checked { border-color:var(--accent); background:var(--accent); }
input[type="checkbox"][role="switch"]:checked::after { transform:translateX(14px); }
input[type="checkbox"][role="switch"]:focus-visible { outline:2px solid rgba(8,119,93,.35); outline-offset:2px; }
.speech-control select { height:30px; padding:0 25px 0 8px; border:1px solid var(--line); border-radius:5px; background:#fff; color:var(--ink); font:inherit; font-size:12px; }
.review-trigger { display:inline-flex; align-items:center; gap:6px; height:30px; padding:0 9px; border:1px solid var(--line); border-radius:5px; background:#fff; color:var(--accent); font-size:12px; white-space:nowrap; }
.review-trigger:hover { border-color:var(--accent); background:var(--soft-accent); }
.review-badge { display:grid; width:18px; height:18px; place-items:center; border-radius:50%; background:var(--accent); color:#fff; font-size:11px; }
dialog { width:min(620px, calc(100vw - 32px)); max-height:min(700px, calc(100dvh - 32px)); padding:0; border:1px solid var(--line); border-radius:7px; color:var(--ink); background:var(--panel); box-shadow:0 16px 42px rgba(23,44,35,.18); }
dialog::backdrop { background:rgba(25,34,30,.35); }
.dialog-head, .dialog-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 16px; }
.dialog-head { border-bottom:1px solid var(--line); }
.dialog-head h2 { font-size:16px; }
.dialog-close { width:28px; height:28px; padding:0; border:0; border-radius:4px; background:transparent; color:var(--muted); font-size:20px; line-height:1; }
.dialog-close:hover { background:#f0f4f1; color:var(--accent); }
.reflection-body { padding:16px; }
.reflection-meta { margin-bottom:8px; color:var(--muted); font-size:12px; }
#reflection-text { min-height:220px; max-height:45dvh; }
.reflection-error { min-height:20px; margin-top:8px; color:var(--danger); font-size:13px; }
.dialog-actions { justify-content:flex-end; border-top:1px solid var(--line); }
.dialog-actions select { min-height:34px; min-width:0; flex:1; padding:0 7px; border:1px solid var(--line); border-radius:5px; background:#fff; color:var(--ink); font:inherit; }
.dialog-actions .plain { flex:0 0 auto; }
.menu-toggle, .sidebar-backdrop { display:none; }
body.privacy-mode { --bg:#e3e5e5; --panel:#f1f2f2; --ink:#242729; --muted:#606568; --line:#b8bcbe; --accent:#34393c; --accent-strong:#202426; --user:#ced1d2; --danger:#9e342d; }
body.privacy-mode .top, body.privacy-mode .composer { background:#eef0f0; }
body.privacy-mode .message.private { border-color:#858a8d; background:#e7e9e9; }
body.privacy-mode .message.private.user { background:#c8cbcd; }
@media (max-width:680px) {
  .app { display:block; }
  .sidebar { position:fixed; z-index:20; top:0; bottom:0; left:0; width:min(288px, calc(100vw - 56px)); min-height:100dvh; border-right:1px solid var(--line); border-bottom:0; box-shadow:8px 0 24px rgba(23,44,35,.12); transform:translateX(-100%); transition:transform .18s ease; }
  .app.sidebar-open .sidebar { transform:translateX(0); }
  .sidebar-backdrop { position:fixed; z-index:19; inset:0; width:100%; height:100%; padding:0; border:0; background:rgba(25,34,30,.35); opacity:0; pointer-events:none; transition:opacity .18s ease; }
  .app.sidebar-open .sidebar-backdrop { display:block; opacity:1; pointer-events:auto; }
  .side-top { padding:20px 18px 16px; border-bottom:1px solid var(--line); }
  .side-top .brand { display:flex; }
  .account { display:block; }
  .life-actions { margin-top:14px; }
  .life-actions .button { min-height:38px; }
  .life-list { display:block; padding:10px; }
  .life { width:100%; min-width:0; min-height:58px; padding:10px 11px; }
  .life-meta, .side-bottom { display:block; }
  .main { height:100dvh; min-height:0; }
  .top { position:sticky; z-index:10; top:0; gap:10px; min-height:51px; padding:0 12px; }
  .menu-toggle { display:grid; width:34px; height:34px; padding:0; place-items:center; flex:0 0 auto; border:1px solid var(--line); border-radius:5px; background:#fff; color:var(--accent); font-size:21px; line-height:1; }
  .menu-toggle:hover { border-color:var(--accent); background:var(--soft-accent); }
  .title-form { flex-wrap:wrap; }
  .title-form input { flex:1 1 100%; }
  .messages { padding:16px; }
  .composer { padding:10px 12px; }
  .top .status { display:none; }
  .speech-control { display:none; }
  .dialog-actions { flex-wrap:wrap; }
  .dialog-actions select { flex-basis:100%; }
}
