:root {
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: #20252b; background: #ffffff; font-size: 14px;
  --muted: #727a83; --line: #e5e8ec; --soft: #f6f7f9;
  --accent: #087d73; --accent-soft: #e8f5f1; --danger: #bd4353;
}
* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
button, a { touch-action: manipulation; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 8px 13px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: inherit; white-space: nowrap; }
button:hover { background: #edf0f3; }
button:focus-visible, a:focus-visible { outline: 3px solid #90cfc5; outline-offset: 2px; }
svg { width: 18px; height: 18px; flex: 0 0 auto; stroke-width: 1.8; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: #07695f; }
.secondary { border-color: #dbe0e5; background: white; }
.secondary:hover { background: var(--soft); }
.danger { background: var(--danger); color: white; }
.danger:hover { background: #a93646; }
.icon-button { width: 36px; height: 36px; padding: 8px; flex: 0 0 36px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 21px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
h2 { font-size: 17px; font-weight: 650; line-height: 1.5; }
h3 { font-size: 14px; font-weight: 650; }
a { color: var(--accent); text-decoration: none; }
small, .muted { color: var(--muted); }
label { display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 13px; font-weight: 550; }
input, textarea, select { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #d9dfe5; border-radius: 5px; outline: none; color: #20252b; background: white; font-weight: 400; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px #087d7315; }
textarea { resize: vertical; min-height: 130px; line-height: 1.7; }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: 0 0 16px; }
.check { display: flex; flex-direction: row; align-items: center; gap: 9px; font-weight: 400; }
.inline-field { display: flex; gap: 8px; }
.inline-field input { flex: 1; }
.segmented { display: flex; background: #f0f2f5; border-radius: 6px; padding: 3px; gap: 3px; }
.segmented button { flex: 1; min-height: 32px; border-radius: 4px; color: #69727d; }
.segmented .selected { background: white; color: #20252b; box-shadow: 0 1px 3px #1c26330c; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font-size: 17px; }
.brand-icon { display: grid; place-items: center; width: 32px; height: 32px; color: white; border-radius: 7px; background: var(--accent); }
.brand-icon svg { width: 20px; height: 20px; }
.shell { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; border-right: 1px solid var(--line); padding: 24px 14px 12px; background: #fafbfc; z-index: 20; }
.sidebar .brand { padding: 0 9px 24px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link { justify-content: flex-start; gap: 12px; min-height: 42px; padding: 10px 12px; width: 100%; color: #646d78; }
.nav-link:hover { color: #20252b; background: #eef1f4; }
.nav-link.active { color: #087769; background: var(--accent-soft); font-weight: 600; }
.nav-divider { margin: 18px 12px 8px; color: #9299a2; font-size: 11px; }
.sidebar-bottom { margin-top: auto; padding-top: 30px; }
.account { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); min-width: 0; }
.account > div { flex: 1; min-width: 0; }
.account strong { font-size: 12px; display: block; overflow-wrap: anywhere; }
.account small { font-size: 11px; display: block; margin-top: 3px; }
.avatar { width: 31px; height: 31px; display: grid; place-items: center; background: #e7ebf0; border-radius: 50%; flex: 0 0 auto; color: #6b7480; }
.account .icon-button { width: 30px; flex-basis: 30px; padding: 6px; }
.main { min-width: 0; }
.topbar { min-height: 91px; padding: 25px 34px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; }
.page-heading { min-width: 0; flex: 1; }
.page-heading > span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.menu-toggle { display: none; }
.view { padding: 25px 34px 40px; max-width: 1500px; margin: 0 auto; }
.toolbar { display: flex; align-items: center; gap: 10px; min-height: 38px; margin-bottom: 20px; }
.search { display: flex; flex-direction: row; align-items: center; gap: 8px; width: 260px; max-width: 100%; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; color: #88909a; }
.search input { border: 0; box-shadow: none; padding: 9px 0; background: transparent; }
.toolbar select { width: auto; max-width: 200px; }
.toolbar .segmented { margin-right: auto; }
.split-view { display: grid; grid-template-columns: minmax(245px, .85fr) minmax(0, 1.5fr); min-height: 480px; border-top: 1px solid var(--line); }
.list-pane { padding-right: 22px; border-right: 1px solid var(--line); min-width: 0; }
.detail-pane { padding-left: 26px; min-width: 0; }
.record-list { margin: 0; padding: 0; list-style: none; }
.record-row { border-bottom: 1px solid var(--line); min-width: 0; }
.record-button { padding: 17px 11px; width: 100%; min-height: 79px; border-radius: 0; display: flex; flex-direction: column; align-items: stretch; gap: 7px; white-space: normal; text-align: left; }
.record-button.selected { background: #f0f8f5; box-shadow: inset 3px 0 var(--accent); }
.row-title { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.row-title strong { font-size: 13px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.record-preview { color: #7c8590; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; line-height: 1.6; padding: 1px 6px; border-radius: 4px; background: #edf0f3; color: #69737e; flex: 0 0 auto; max-width: 100%; overflow-wrap: anywhere; }
.badge.good { background: #e5f4ed; color: #267252; }
.badge.wait { background: #fff1dc; color: #936522; }
.badge.rose { background: #fbecef; color: #a34a66; }
.badge.blue { background: #eaf0fc; color: #5376b1; }
.detail-header { display: flex; align-items: flex-start; gap: 10px; padding: 19px 0 17px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.detail-header > div { min-width: 0; flex: 1; }
.detail-header h2 { overflow-wrap: anywhere; }
.detail-header .row-meta { margin-top: 8px; }
.detail-actions { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.content-block { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.95; color: #434b55; }
.content-block.mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 27px 0 13px; }
.key-values { margin: 0; display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: 14px; font-size: 12px; line-height: 1.7; }
.key-values dt { color: var(--muted); }
.key-values dd { margin: 0; overflow-wrap: anywhere; }
.empty { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; color: #929aa3; text-align: center; padding: 30px 15px; }
.empty svg { width: 32px; height: 32px; stroke-width: 1.3; color: #adb5bd; }
.empty p { font-size: 13px; line-height: 1.7; }
.runtime-note { display: flex; align-items: center; gap: 8px; color: #9a752b; font-size: 12px; margin-bottom: 20px; min-width: 0; line-height: 1.7; }
.runtime-note svg { width: 15px; height: 15px; }
.transcript { display: flex; flex-direction: column; gap: 18px; }
.transcript-item { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.transcript-item .row-meta { margin-bottom: 7px; }
.conversation-tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.conversation-tabs [role=tab] { border-radius: 0; border-bottom: 2px solid transparent; padding: 9px 0; white-space: normal; text-align: left; }
.conversation-tabs [aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }
.archive-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.archive-toolbar select { max-width: 180px; }
.archive-meta { margin-bottom: 18px; }
.native-tool { border-left: 2px solid var(--line); padding-left: 12px; margin: 12px 0; min-width: 0; }
.native-tool summary { cursor: pointer; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; color: var(--accent); }
.native-tool h3 { font-size: 12px; margin: 12px 0 6px; }
.native-tool pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.8; max-height: 420px; overflow-y: auto; margin: 0; }
#native-records { overflow-wrap: anywhere; font-size: 13px; line-height: 1.8; }
.execution-list { display: flex; flex-direction: column; margin-bottom: 18px; }
.execution-item { border-bottom: 1px solid var(--line); padding: 10px 0; min-width: 0; }
.execution-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.execution-summary .row-meta { flex: 1; min-width: 100px; overflow-wrap: anywhere; }
.execution-warning { color: #936522; font-size: 12px; line-height: 1.7; margin: 9px 0 0; }
.live-output { margin-top: 12px; max-height: 260px; overflow-y: auto; }
.message-composer { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 22px; }
.message-composer textarea { width: 100%; min-height: 94px; max-height: 320px; resize: vertical; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 7px; }
.composer-actions [role=status] { font-size: 12px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: #7f8791; font-weight: 500; font-size: 11px; background: #fafbfc; }
td strong { font-weight: 550; }
td .icon-button { width: 30px; height: 30px; min-height: 30px; padding: 6px; }
.settings-layout { max-width: 740px; }
.input-list { max-width: 900px; }
.input-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.input-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.input-row .detail-actions { flex-shrink: 0; }
.input-row a { color: inherit; text-decoration: none; }
.settings-section { padding: 24px 0; border-bottom: 1px solid var(--line); }
.settings-section:first-child { padding-top: 0; }
.settings-section h2 { margin-bottom: 20px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
fieldset.settings-grid { min-width: 0; padding: 0; border: 0; margin-left: 0; margin-right: 0; }
.policy-status { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; line-height: 1.8; margin-bottom: 18px; }
.policy-status > span { color: var(--muted); }
.policy-status strong { font-weight: 500; overflow-wrap: anywhere; }
.settings-section .form-error:not(:empty) { margin-bottom: 14px; }
.settings-section > button { margin-top: 3px; }
.health-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.health-metric { padding: 10px 20px 24px 0; }
.health-metric small { font-size: 12px; }
.health-metric strong { display: block; font-size: 25px; font-weight: 550; margin-top: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.health-status { display: flex; flex-direction: column; }
.health-status > div { display: flex; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--line); gap: 20px; font-size: 13px; }
.health-status span:first-child { color: var(--muted); }
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 30px 24px; background: #f7f9fa; }
.login-form { display: flex; flex-direction: column; gap: 22px; width: 350px; max-width: 100%; }
.login-brand { margin-bottom: 16px; }
.login-form h1 { font-size: 25px; margin-bottom: 2px; }
.login-form > .primary { min-height: 42px; }
.form-error { color: var(--danger); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.form-error:empty { display: none; }
.environment { text-align: center; font-size: 11px; color: #939ba4; }
dialog { color: inherit; border: 1px solid #dce2e7; border-radius: 8px; padding: 0; box-shadow: 0 14px 70px #17233224; }
dialog::backdrop { background: #151f3140; }
.editor { width: 650px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 40px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 17px 23px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: white; z-index: 1; gap: 15px; }
.dialog-header h2 { min-width: 0; overflow-wrap: anywhere; }
.editor-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 24px; }
.editor-fields > .full { grid-column: 1 / -1; }
.editor-fields textarea.persona-content { min-height: 270px; }
.editor .form-error { padding: 0 24px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 17px 24px; border-top: 1px solid var(--line); margin-top: 4px; position: sticky; bottom: 0; background: white; }
.confirmation { width: 400px; max-width: calc(100vw - 32px); padding: 24px 24px 0; }
.confirmation h2 { margin-bottom: 14px; }
.confirmation p { color: var(--muted); line-height: 1.8; font-size: 13px; overflow-wrap: anywhere; }
.confirmation .dialog-footer { margin: 23px -24px 0; }
.toast { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: #23373a; color: white; padding: 12px 20px; border-radius: 6px; max-width: calc(100vw - 32px); z-index: 100; font-size: 13px; box-shadow: 0 5px 24px #18282b22; line-height: 1.7; overflow-wrap: anywhere; }
.sidebar-shade { display: none; }
@media (max-width: 1050px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .topbar { padding-left: 24px; padding-right: 24px; }
  .view { padding-left: 24px; padding-right: 24px; }
  .split-view { grid-template-columns: minmax(210px, .9fr) minmax(0, 1.3fr); }
  .detail-pane { padding-left: 18px; }
  .list-pane { padding-right: 14px; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: fixed; width: 235px; left: 0; transform: translateX(-100%); transition: transform .18s ease; }
  .shell.menu-open .sidebar { transform: translateX(0); }
  .sidebar-shade { display: block; position: fixed; inset: 0; background: #17223255; border: 0; border-radius: 0; z-index: 15; padding: 0; }
  .menu-toggle { display: inline-flex; margin-left: -7px; }
  .topbar { min-height: 78px; padding: 17px 18px; gap: 9px; }
  h1 { font-size: 19px; }
  .top-actions .primary { padding: 8px 10px; font-size: 12px; }
  .top-actions { gap: 4px; }
  .view { padding: 20px 18px 35px; }
  .split-view { display: flex; flex-direction: column; min-height: 300px; }
  .list-pane { border: 0; padding: 0; }
  .detail-pane { padding: 0; border-top: 1px solid var(--line); margin-top: 20px; }
  .list-pane .record-list { max-height: 310px; overflow-y: auto; }
  .record-button { min-height: 72px; }
  .detail-header { padding-top: 20px; }
  .toolbar { flex-wrap: wrap; gap: 9px; }
  .toolbar .search { flex: 1; min-width: 140px; }
  .toolbar select { max-width: 145px; font-size: 12px; padding: 9px 7px; }
  .health-grid { grid-template-columns: 1fr 1fr; }
  .health-metric { padding: 10px 15px 24px 0; }
  .health-metric strong { font-size: 23px; }
  .editor-fields { grid-template-columns: 1fr; padding: 20px; gap: 17px; }
  .editor-fields > .full { grid-column: auto; }
  .dialog-header { padding: 15px 18px; }
  .dialog-footer { padding: 15px 18px; }
  .settings-grid { grid-template-columns: 1fr; }
  th, td { padding: 13px 9px; }
  .key-values { grid-template-columns: 100px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.qq-account { margin-top: 24px; }
.qq-account-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.qq-account-toolbar .detail-actions { margin-left: auto; }
.qq-login-qr { display: block; width: 280px; max-width: 100%; height: auto; aspect-ratio: 1; margin: 24px auto 0; background: white; }
