:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  background: #f7f8fb;
  color: #202938;
  --line: #e3e8f0;
  --muted: #626e83;
  --accent: #244cca;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid #3158d4; outline-offset: 2px; }
.layout { display: grid; grid-template-columns: minmax(300px, 346px) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.sidebar, .reader { min-height: 0; display: flex; flex-direction: column; }
.sidebar { background: #fff; border-right: 1px solid var(--line); }
.brand { padding: 26px 24px 22px; display: flex; gap: 13px; align-items: center; }
.brand-icon { width: 41px; height: 41px; display: grid; place-content: center; grid-auto-flow: column; border-radius: 12px; background: #233e95; color: #fff; font: 700 24px/1 system-ui, sans-serif; }
.brand-icon span { color: #9cbaff; }
.brand h1 { font-size: 19px; margin: 0 0 3px; }
.brand p, .thread-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.threads { overflow: auto; min-height: 0; flex: 1; padding: 0 12px 12px; }
.thread { width: 100%; padding: 14px 13px; display: block; text-align: left; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 10px; }
.thread + .thread { margin-top: 3px; }
.thread:hover { background: #f3f5f9; }
.thread[aria-current="true"] { background: #edf2ff; border-color: #d8e3ff; }
.thread-title, .preview, .meta { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.thread-title { font-size: 14px; font-weight: 650; }
.meta { margin-top: 6px; color: var(--accent); font-size: 11px; }
.preview { margin-top: 7px; color: var(--muted); font-size: 12px; }
.status { border-top: 1px solid var(--line); padding: 13px 24px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.reader { position: relative; background: #f7f8fb; }
.reader-header { min-height: 58px; display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 0 30px; background: #fff; border-bottom: 1px solid var(--line); }
.reader-label { font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.read-only { font-size: 12px; color: #51617e; flex: 0 0 auto; }
.scroll-area { overflow: auto; flex: 1; }
.transcript { width: min(100%, 900px); margin: 0 auto; padding: 40px 46px 80px; }
.empty-detail { color: var(--muted); padding: 48px 0; text-align: center; }
.thread-heading { padding-bottom: 27px; margin-bottom: 23px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.thread-heading h2 { margin: 10px 0 0; font-size: clamp(24px, 3vw, 33px); line-height: 1.3; letter-spacing: -.02em; }
.message { margin: 0 0 22px; background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 20px 24px; overflow-wrap: anywhere; }
.message.user { border-color: #d9e3fb; background: #f0f4fd; }
.message header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.message header strong { color: #263f8f; font-size: 13px; }
.message header time { color: var(--muted); font-size: 11px; }
.message-body { font-size: 14px; line-height: 1.75; }
.message-body > :first-child { margin-top: 0; }
.message-body > :last-child { margin-bottom: 0; }
.message-body p { white-space: pre-wrap; margin: .8em 0; }
.message-body h3, .message-body h4, .message-body h5 { margin: 1em 0 .5em; }
.message-body a { color: var(--accent); }
.message-body pre { overflow: auto; background: #17243b; color: #eaf0ff; padding: 16px; border-radius: 9px; font-size: 13px; line-height: 1.55; }
.message-body :not(pre) > code { background: #e8edf8; border-radius: 4px; padding: 1px 4px; }
.message-body ul, .message-body ol { padding-left: 1.6em; }
.message-body blockquote { margin-left: 0; border-left: 3px solid #91a8ec; padding-left: 13px; color: #455571; white-space: pre-wrap; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: .94em; }
td, th { border: 1px solid var(--line); padding: 7px 11px; text-align: left; vertical-align: top; }
th { background: #eef2f8; }
.secondary, .jump { border: 1px solid #d3ddec; border-radius: 8px; padding: 7px 11px; background: #fff; color: var(--accent); font-size: 12px; }
.secondary:hover { background: #edf2ff; }
.older { display: block; margin: 0 auto 22px; }
.more-threads { margin: 0 23px 14px; }
.jump { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 10px 15px; background: #244cca; color: white; border: 0; box-shadow: 0 3px 14px #233e9550; }
.back { display: none; }
.sidebar-empty { padding: 25px 13px; color: var(--muted); font-size: 13px; }
@media (max-width: 740px) {
  .layout { display: block; }
  .sidebar, .reader { height: 100%; }
  .layout:not(.reading) .reader, .layout.reading .sidebar { display: none; }
  .back { display: inline-block; white-space: nowrap; }
  .reader-header { padding: 0 13px; }
  .transcript { padding: 23px 12px 65px; }
  .message { padding: 16px; }
  .brand { padding: 18px 23px; }
}
