* { box-sizing:border-box; } body { margin:0; background:var(--bg); color:var(--text); font:var(--fs-md)/1.6 var(--font-sans); }
progress { width:100%; height:12px; accent-color:var(--primary); margin:12px 0; }
pre { max-width:100%; overflow-x:auto; white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px; }
.preserve-lines { white-space:pre-wrap; overflow-wrap:anywhere; }
.prose { overflow-wrap:anywhere; }
a { color:var(--link); text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.nav-item,.tab,.mobile-nav a,.account,.button,.icon-button,.brand { text-decoration:none; }
a:hover { text-decoration:underline; }
button,input,select,textarea { font:inherit; border-radius:var(--radius-sm); }
input,select,textarea { width:100%; min-height:44px; border:1px solid var(--border-strong); background:var(--bg); color:var(--text); padding:10px 12px; }
textarea { min-height:100px; resize:vertical; } input[type="checkbox"] { width:20px; min-height:20px; }
label { display:block; margin-bottom:6px; font-size:var(--fs-sm); font-weight:550; }
button,.button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-width:44px; min-height:44px; padding:10px 16px; border:1px solid var(--border-strong); background:var(--surface-2); color:var(--text); cursor:pointer; transition:background var(--t-fast); white-space:nowrap; border-radius:var(--radius-sm); }
button:hover,.button:hover { background:var(--border); text-decoration:none; } .primary { background:var(--primary); color:var(--on-primary); border-color:var(--primary); } .primary:hover { background:#1d4ed8; }
.quiet { background:transparent; border-color:transparent; color:var(--muted); } .quiet:hover { color:var(--text); background:var(--surface-2); }
button:disabled { opacity:.5; cursor:wait; } h1,h2,h3,p { margin:0 0 12px; } h1 { font-size:28px; font-weight:650; letter-spacing:-.6px; } h2 { font-size:18px; font-weight:600; } h3 { font-size:16px; }
small,.fine { font-size:var(--fs-xs); } .muted { color:var(--muted); } .eyebrow { color:var(--muted); font-size:10px; letter-spacing:1.8px; font-weight:650; } .stack { display:grid; gap:20px; } .compact { max-width:440px; }
.sidebar { position:fixed; width:var(--sidebar-w); height:100dvh; padding:28px 16px 20px; border-right:1px solid var(--border); background:var(--surface); display:flex; flex-direction:column; z-index:20; }
.brand { display:flex; gap:12px; align-items:center; color:var(--text); font-size:20px; font-weight:650; letter-spacing:-.4px; padding:0 8px 36px; } .brand:hover { text-decoration:none; }
.brand small { display:block; color:var(--muted); font-size:10px; font-weight:400; letter-spacing:1.2px; }
.brand-mark { display:flex; align-items:center; justify-content:center; width:36px; height:40px; border-radius:8px; background:var(--primary); color:white; font-size:24px; font-weight:750; } .brand-mark.large { width:48px; height:52px; margin-bottom:28px; }
.nav-label { color:var(--muted); font-size:10px; padding:0 14px 14px; letter-spacing:2px; }
.nav-item { display:flex; align-items:center; min-height:44px; padding:10px 14px; gap:12px; color:var(--muted); margin-bottom:8px; border-radius:6px; } .nav-item:hover { background:var(--surface-2); color:var(--text); text-decoration:none; } .nav-item.selected { color:var(--link); background:color-mix(in srgb,var(--primary) 15%,var(--surface)); }
svg { width:20px; height:20px; flex-shrink:0; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; } .sidebar-bottom { margin-top:auto; color:var(--muted); font-size:11px; padding:18px 8px 0; border-top:1px solid var(--border); } .sidebar-bottom small { display:block; font-size:10px; margin:6px 0 0 12px; }
.status-dot { display:inline-block; width:5px; height:5px; background:var(--sky); border-radius:50%; margin-right:5px; }
.workspace { margin-left:var(--sidebar-w); } .topbar { height:64px; display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid var(--border); padding:0 32px; background:var(--bg); } .breadcrumb { font-size:12px; color:var(--muted); } .breadcrumb span { padding:0 10px; color:var(--border-strong); }
.top-actions { display:flex; align-items:center; gap:8px; } .top-actions form { margin:0; } .account { display:inline-flex; align-items:center; justify-content:center; min-height:44px; min-width:44px; color:var(--text); font-size:12px; padding:8px; } .icon-button { padding:8px; }
.main-content { max-width:1552px; padding:36px 32px; margin:auto; min-height:calc(100dvh - 140px); } .page-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:32px; } .page-heading p { margin-bottom:4px; } .page-heading h1 { margin-bottom:8px; }
.grid { display:grid; gap:16px; margin-bottom:24px; } .three { grid-template-columns:repeat(3,minmax(0,1fr)); } .two { grid-template-columns:repeat(2,minmax(0,1fr)); }
.panel { min-width:0; padding:24px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); margin-bottom:20px; } .grid>.panel { margin-bottom:0; } .panel-label { color:var(--muted); font-size:12px; margin-bottom:24px; } .panel p { font-size:13px; } .panel .pill { margin-top:8px; }
.pill,.badge { display:inline-flex; align-items:center; padding:3px 8px; border:1px solid var(--border); border-radius:4px; font-size:10px; color:var(--muted); white-space:nowrap; }
.pill.danger { color:var(--red); border-color:var(--red); }
.tabs { display:flex; gap:4px; overflow-x:auto; border-bottom:1px solid var(--border); margin-bottom:20px; }
.tab { display:block; padding:10px 14px; min-height:44px; color:var(--muted); font-size:13px; white-space:nowrap; border-bottom:2px solid transparent; }
.tab.selected { color:var(--text); border-bottom-color:var(--primary); }
.seg { gap:2px; } .seg-btn { padding:6px 12px; min-height:44px; border:1px solid var(--border); border-radius:4px; background:transparent; color:var(--muted); font-size:12px; cursor:pointer; }
.seg-btn.on { color:var(--text); border-color:var(--primary); }
.check { display:inline-flex; align-items:center; gap:6px; min-height:44px; font-size:12px; color:var(--muted); cursor:pointer; }
.check input { width:18px; height:18px; }
.kline { width:100%; height:280px; } @media (min-width:768px) { .kline { height:420px; } }
.chart-readout { font-size:12px; color:var(--muted); min-height:20px; padding:4px 0; font-variant-numeric:tabular-nums; }
.chart-controls { flex-wrap:wrap; margin-bottom:8px; }
.hidden { display:none !important; }
.score-row { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.score-name { width:44px; font-size:13px; }
.score-val { font-variant-numeric:tabular-nums; font-size:13px; }
meter { flex:1; height:8px; }
table.mini { font-size:12px; } table.mini td { padding:4px 8px 4px 0; border:0; }
ul.list { list-style:none; padding:0; margin:0; } ul.list li { padding:10px 0; border-bottom:1px solid var(--border); font-size:13px; } ul.list li:last-child { border-bottom:0; }
.spark { color:var(--muted); vertical-align:middle; }
.field { margin-bottom:14px; } .field label { display:block; font-size:12px; color:var(--muted); margin-bottom:6px; }
.field input[type=text], .field textarea { width:100%; padding:10px; border:1px solid var(--border); border-radius:6px; background:var(--surface-2); color:var(--text); font:inherit; }
.small { font-size:11px; }
.empty { text-align:center; padding:64px 20px; } .empty-symbol { font-size:30px; width:56px; height:56px; border-radius:50%; background:var(--surface-2); color:var(--muted); margin:0 auto 20px; } .empty .button { margin-top:16px; }
footer { padding:20px 32px; font-size:11px; color:var(--muted); border-top:1px solid var(--border); }
.login-container { min-height:100dvh; display:grid; place-content:center; padding:24px; background:radial-gradient(ellipse at top right,color-mix(in srgb,var(--primary) 14%,var(--bg)),var(--bg) 70%); }
.login-card { width:min(100%,420px); padding:32px; border:1px solid var(--border); border-radius:12px; background:var(--surface); } .login-card>p.muted { margin-bottom:32px; } .login-card .fine { text-align:center; margin:28px 0 0; } .login-card h1 { font-size:26px; }
.notice { padding:14px 18px; margin-bottom:20px; border:1px solid var(--border-strong); border-left:3px solid var(--sky); border-radius:6px; background:var(--surface); } .notice.error { border-left-color:var(--red); } .session { border-top:1px solid var(--border); padding:18px 0; display:flex; justify-content:space-between; gap:12px; overflow-wrap:anywhere; } .session strong { font-size:13px; }
.mobile-nav { display:none; } .skip-link { position:fixed; top:-100px; z-index:100; padding:12px; background:var(--surface); } .skip-link:focus { top:0; } #toast:empty { display:none; } #toast { position:fixed; bottom:80px; right:24px; padding:14px; background:var(--surface); border:1px solid var(--border); border-radius:8px; z-index:50; }
.htmx-indicator { opacity:0; } .htmx-request .htmx-indicator,.htmx-request.htmx-indicator { opacity:1; transition:opacity 150ms ease 300ms; }
.table-wrap { overflow-x:auto; } table { width:100%; border-collapse:collapse; font-size:13px; } th,td { text-align:left; padding:12px; border-bottom:1px solid var(--border); } th { color:var(--muted); font-weight:500; background:var(--surface); position:sticky; top:0; } tbody tr:hover { background:var(--surface-2); } .right { text-align:right; } .row { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
@media (min-width:1440px) { .main-content { padding:40px; } }
@media (max-width:1023px) { :root { --sidebar-w:176px; } .sidebar { padding-inline:10px; } .brand { font-size:17px; gap:8px; } .three { grid-template-columns:repeat(2,minmax(0,1fr)); } .main-content { padding:28px 24px; } .two { grid-template-columns:1fr; } }
@media (max-width:767px) { .sidebar { display:none; } .workspace { margin-left:0; padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom)); } .topbar { padding:0 16px; height:56px; } .breadcrumb { font-size:11px; } .main-content { padding:24px 16px; } h1 { font-size:24px; } .page-heading { align-items:flex-start; flex-wrap:wrap; gap:12px; margin-bottom:24px; } .page-heading>.pill { display:none; } .grid { grid-template-columns:1fr; gap:12px; } .panel { padding:20px; margin-bottom:16px; } .panel-label { margin-bottom:16px; } .empty { padding:44px 20px; } footer { padding:16px; } .mobile-nav { display:flex; position:fixed; bottom:0; width:100%; min-height:56px; padding-bottom:env(safe-area-inset-bottom); background:var(--surface); border-top:1px solid var(--border); z-index:30; } .mobile-nav a { flex:1; display:flex; justify-content:center; align-items:center; min-height:56px; color:var(--muted); font-size:12px; } .login-container { padding:16px; } .login-card { padding:24px; } }

/* ===== 自选（M1） ===== */
.search-results { margin-top:12px; }
.search-list { list-style:none; margin:0; padding:0; }
.search-item { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-top:1px solid var(--border); }
.search-item .name { display:block; font-size:13px; }
.undo-notice { display:flex; align-items:center; gap:12px; }
.inline-edit { display:inline-block; position:relative; }
.inline-edit summary { list-style:none; cursor:pointer; }
.inline-edit summary::-webkit-details-marker { display:none; }
.inline-edit[open] summary { color:var(--text); }
.edit-form { display:grid; gap:8px; min-width:240px; padding:12px; border:1px solid var(--border); border-radius:6px; background:var(--surface); }
.edit-form label { display:grid; gap:4px; font-size:12px; color:var(--muted); }
.button.danger { color:var(--red); }
@media (max-width:767px) {
  .watch-table thead { display:none; }
  .watch-table tr { display:block; padding:12px 0; }
  .watch-table td { display:flex; justify-content:space-between; align-items:center; gap:12px; border:none; padding:5px 0; }
  .watch-table td::before { content:attr(data-label); color:var(--muted); font-size:11px; flex-shrink:0; }
  .watch-table td.right { justify-content:flex-end; }
  .watch-table td.right::before { content:''; }
  .search-item { align-items:flex-start; flex-direction:column; }
}
.search-input { flex:1; min-width:200px; }
.inline-form { display:inline; }

/* Ask AI */
.ask-layout { display:grid; grid-template-columns:260px 1fr; gap:16px; }
@media (max-width:768px) {
  .ask-layout { grid-template-columns:1fr; }
  .ask-sidebar { display:none; position:fixed; top:0; left:0; bottom:0; width:min(78vw,300px); z-index:40; overflow:auto; background:var(--surface); }
  .ask-sidebar.open { display:block; box-shadow:0 0 40px rgba(0,0,0,.4); }
  .ask-drawer-btn { display:inline-block; }
}
@media (min-width:769px) { .ask-drawer-btn { display:none; } }
.chat-list a.on { color:var(--text); font-weight:600; }
.chat-head { justify-content:space-between; margin-bottom:12px; }
.msg-flow { display:flex; flex-direction:column; gap:10px; margin-bottom:14px; max-height:60vh; overflow-y:auto; }
.msg { max-width:85%; padding:10px 12px; border-radius:8px; }
.msg.user { align-self:flex-end; background:var(--bg2); border:1px solid var(--border); }
.msg.assistant { align-self:flex-start; background:transparent; }
.msg-body { font-size:14px; line-height:1.55; white-space:normal; }
.msg-body p { margin:0 0 .5em; } .msg-body pre { background:var(--bg2); padding:8px; border-radius:4px; overflow-x:auto; }
.msg-meta { font-size:11px; margin-top:4px; }
.composer input { min-height:44px; }
.stream-text { white-space:pre-wrap; }
.grow { flex:1; }
.pre { background:var(--bg2); padding:10px; border-radius:6px; overflow-x:auto; font-size:12px; }

textarea.editor{width:100%;font-family:var(--mono,monospace)}

/* [E] 证据抽屉 */
.ev-drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(24rem, 90vw); overflow-y: auto; z-index: 40; padding: .75rem; background: var(--bg); border-left: 1px solid var(--line); }
.ev-panel h3 { margin: .25rem 0 .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.input-sm { max-width: 10rem; }
.batch-bar { margin-bottom: .5rem; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort][aria-sort="ascending"]::after { content: " ↑"; }
th[data-sort][aria-sort="descending"]::after { content: " ↓"; }
