:root {
  color-scheme: dark;
  --bg: #071019;
  --panel: #0d1823;
  --panel-2: #111f2d;
  --line: #213447;
  --line-soft: rgba(148, 174, 199, .13);
  --text: #edf5fb;
  --muted: #8da2b6;
  --blue: #42a5ff;
  --blue-2: #1478d4;
  --cyan: #64e5d2;
  --red: #ff6a79;
  --amber: #f1ba63;
  --shadow: 0 28px 80px rgba(0, 0, 0, .34);
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 75% 0%, rgba(33, 117, 180, .11), transparent 34%), var(--bg); color: var(--text); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.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; }
.eyebrow { margin: 0 0 .45rem; color: var(--cyan); font-size: .72rem; letter-spacing: .17em; font-weight: 800; }
.muted { color: var(--muted); }
.brand-mark { width: 4.5rem; height: 4.5rem; display: grid; place-items: center; border: 1px solid rgba(100,229,210,.55); background: linear-gradient(145deg, rgba(62,179,255,.17), rgba(100,229,210,.05)); color: var(--cyan); font-weight: 900; font-size: 1.45rem; letter-spacing: -.08em; border-radius: 1.35rem; box-shadow: inset 0 0 30px rgba(65,169,255,.08); }
.brand-mark.small { width: 2.8rem; height: 2.8rem; border-radius: .9rem; font-size: 1rem; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: min(28rem, 100%); padding: 2.5rem; border: 1px solid var(--line); border-radius: 1.6rem; background: linear-gradient(160deg, rgba(17,31,45,.98), rgba(9,20,30,.98)); box-shadow: var(--shadow); }
.login-card h1 { margin: 1.4rem 0 .55rem; font-size: 2rem; letter-spacing: -.04em; }
.login-card .brand-mark { margin-bottom: 1.35rem; }
.login-card .muted { margin: 0; line-height: 1.7; }
.login-form { display: grid; gap: 1rem; margin-top: 1.8rem; }
label { display: grid; gap: .5rem; color: #c7d6e2; font-size: .88rem; font-weight: 700; }
input { width: 100%; border: 1px solid var(--line); border-radius: .85rem; background: #09141e; color: var(--text); min-height: 3rem; padding: .75rem 1rem; outline: none; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(66,165,255,.13); }
.form-error { min-height: 1.4rem; margin: 1rem 0 0; color: var(--red); font-size: .87rem; }
.btn { min-height: 2.8rem; border-radius: .8rem; border: 1px solid transparent; padding: .65rem 1rem; font-weight: 800; cursor: pointer; transition: .2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: wait; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--blue-2)); box-shadow: 0 9px 28px rgba(20,120,212,.23); }
.btn-secondary { background: #122333; border-color: #29445d; }
.btn-wide { width: 100%; margin-top: .25rem; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 1.4rem 1.1rem; border-right: 1px solid var(--line-soft); background: rgba(7,16,25,.93); backdrop-filter: blur(18px); }
.brand-row { display: flex; align-items: center; gap: .85rem; padding: .3rem .35rem 1.7rem; }
.brand-row strong, .brand-row span { display: block; }
.brand-row strong { font-size: .98rem; }
.brand-row span { margin-top: .18rem; color: var(--muted); font-size: .72rem; }
nav { display: grid; gap: .45rem; }
.nav-item { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .78rem .9rem; border: 1px solid transparent; border-radius: .85rem; background: transparent; color: var(--muted); text-align: left; cursor: pointer; font-weight: 700; }
.nav-item span { width: 1.5rem; color: #668198; text-align: center; }
.nav-item:hover, .nav-item.active { color: var(--text); background: #101f2d; border-color: var(--line-soft); }
.nav-item.active span { color: var(--cyan); }
.side-foot { margin-top: auto; display: grid; gap: 1rem; }
.data-state { display: flex; gap: .7rem; align-items: center; padding: .8rem; border: 1px solid var(--line-soft); border-radius: .9rem; background: rgba(17,31,45,.62); }
.data-state i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 5px rgba(100,229,210,.08); }
.data-state span, .data-state strong { display: block; }
.data-state span { color: var(--muted); font-size: .7rem; }
.data-state strong { margin-top: .15rem; font-size: .84rem; }
.text-button { border: 0; background: transparent; color: var(--muted); padding: .6rem; cursor: pointer; text-align: left; }
.workspace { min-width: 0; padding: 1.7rem clamp(1rem, 3vw, 3rem) 3rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.7rem; }
.topbar h1 { margin: 0; font-size: clamp(1.45rem, 2.5vw, 2rem); letter-spacing: -.04em; }
.user-chip { display: flex; align-items: center; gap: .7rem; }
.user-chip > span { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: .8rem; background: #183149; color: var(--cyan); font-weight: 900; }
.user-chip strong, .user-chip small { display: block; }
.user-chip small { color: var(--muted); margin-top: .15rem; }
.view { display: none; }
.view.active { display: block; }
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.2rem; min-height: calc(100vh - 8.8rem); }
.chat-panel, .snapshot-panel, .table-card, .document-card, .action-card, .job-card { border: 1px solid var(--line-soft); background: linear-gradient(155deg, rgba(15,29,42,.98), rgba(10,21,31,.97)); box-shadow: 0 18px 60px rgba(0,0,0,.13); }
.chat-panel { min-width: 0; display: grid; grid-template-rows: 1fr auto; border-radius: 1.2rem; overflow: hidden; }
.chat-stream { min-height: 35rem; max-height: calc(100vh - 14.5rem); overflow-y: auto; padding: 1.25rem; }
.message { width: min(52rem, 93%); margin-bottom: 1rem; padding: 1.05rem 1.15rem; border-radius: 1rem; line-height: 1.7; }
.message.assistant { background: #101f2d; border: 1px solid var(--line-soft); }
.message.user { margin-left: auto; background: #12304b; border: 1px solid rgba(66,165,255,.18); }
.message.error { border-color: rgba(255,106,121,.35); }
.message-label { margin-bottom: .45rem; color: var(--cyan); font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.message h2 { margin: .15rem 0 .35rem; font-size: 1.35rem; }
.message p { margin: .3rem 0; }
.welcome-message { margin-top: clamp(2rem, 7vh, 5.5rem); }
.quick-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.quick-actions button { border: 1px solid #29445d; background: #122536; border-radius: 999px; padding: .55rem .85rem; cursor: pointer; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: .65rem; padding: 1rem; border-top: 1px solid var(--line-soft); background: rgba(7,16,25,.7); }
.composer input { min-height: 3.2rem; }
.send-button { min-width: 5rem; border: 0; border-radius: .85rem; background: var(--blue); color: white; font-weight: 900; cursor: pointer; }
.snapshot-panel { border-radius: 1.2rem; padding: 1.15rem; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.panel-heading h2 { margin: 0; font-size: 1.05rem; }
.icon-button { width: 2.2rem; height: 2.2rem; border: 1px solid var(--line); background: #102232; border-radius: .7rem; cursor: pointer; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 1rem; }
.metric-grid article { min-height: 7.3rem; display: flex; flex-direction: column; padding: .9rem; border: 1px solid var(--line-soft); border-radius: .9rem; background: rgba(7,16,25,.46); }
.metric-grid span { color: var(--muted); font-size: .78rem; }
.metric-grid strong { margin: .55rem 0 .25rem; color: var(--cyan); font-size: 1.8rem; }
.metric-grid small { color: #6f879c; margin-top: auto; line-height: 1.35; }
.metric-grid .risk strong { color: var(--red); }
.method-note { margin-top: .8rem; padding: 1rem; border-left: 2px solid var(--cyan); background: rgba(100,229,210,.035); }
.method-note span { color: var(--cyan); font-size: .75rem; font-weight: 800; }
.method-note p { margin: .45rem 0 0; color: var(--muted); line-height: 1.55; font-size: .82rem; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.2rem; }
.section-head h2 { margin: 0; font-size: 1.55rem; }
.section-head .muted { margin: .35rem 0 0; }
.tabs { display: flex; gap: .55rem; overflow-x: auto; margin-bottom: .8rem; }
.tab { white-space: nowrap; border: 1px solid var(--line-soft); border-radius: .8rem; background: #0d1b28; color: var(--muted); padding: .65rem .8rem; cursor: pointer; }
.tab b { margin-left: .35rem; color: #c6d7e4; }
.tab.active { border-color: rgba(66,165,255,.45); background: rgba(20,120,212,.18); color: var(--text); }
.table-card { border-radius: 1rem; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 58rem; }
th, td { padding: .78rem .85rem; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: .83rem; }
th { position: sticky; top: 0; background: #0c1a26; color: #8fa9be; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
td { color: #c6d6e2; }
tbody tr:hover { background: rgba(66,165,255,.035); }
.rank { color: var(--cyan); font-weight: 900; }
.score { font-variant-numeric: tabular-nums; color: #e9f5fd; font-weight: 800; }
.bucket { display: inline-flex; padding: .22rem .48rem; border-radius: .45rem; background: rgba(66,165,255,.11); color: #8dcbff; font-size: .72rem; }
.risk-label { color: var(--red); font-weight: 900; }
.empty-state { padding: 3rem; text-align: center; color: var(--muted); }
.disclaimer { color: #657b8f; font-size: .75rem; margin-top: .8rem; }
.document-card { border-radius: 1rem; padding: clamp(1rem, 2.5vw, 2rem); min-height: 30rem; }
.markdown-body { line-height: 1.72; color: #c8d7e2; }
.markdown-body h1 { font-size: 1.6rem; color: var(--text); }
.markdown-body h2 { margin-top: 1.7rem; font-size: 1.15rem; color: #edf5fb; }
.markdown-body ul { padding-left: 1.25rem; }
.markdown-body blockquote { margin: 1rem 0; padding: .7rem 1rem; border-left: 2px solid var(--blue); background: rgba(66,165,255,.05); color: var(--muted); }
.markdown-body code { padding: .12rem .28rem; border-radius: .3rem; background: #07121c; }
.markdown-table { overflow-x: auto; margin: .8rem 0; }
.markdown-table table { min-width: 42rem; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.action-card, .job-card { border-radius: 1rem; padding: 1.35rem; }
.action-card.accent { border-color: rgba(66,165,255,.35); }
.action-card h3 { margin: .5rem 0; }
.action-card p { color: var(--muted); line-height: 1.65; min-height: 5rem; }
.step-number { color: var(--cyan); font-size: .75rem; font-weight: 900; }
.job-card { grid-column: 1 / -1; }
.job-status { display: flex; align-items: center; gap: .6rem; margin: .8rem 0 .3rem; }
.job-status i { width: .65rem; height: .65rem; border-radius: 50%; background: #667d91; }
.job-status i.running { background: var(--amber); animation: pulse 1.2s infinite; }
.job-status i.succeeded { background: var(--cyan); }
.job-status i.failed { background: var(--red); }
.skeleton-lines { height: 17rem; background: repeating-linear-gradient(180deg, rgba(141,162,182,.08) 0 1rem, transparent 1rem 2rem); animation: fade 1.4s infinite alternate; }
.toast-region { position: fixed; right: 1rem; bottom: 1rem; z-index: 20; display: grid; gap: .5rem; }
.toast { max-width: 23rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: .8rem; background: #142536; box-shadow: var(--shadow); }
.toast.error { border-color: rgba(255,106,121,.5); }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes fade { to { opacity: .45; } }
@media (max-width: 1050px) { .chat-layout { grid-template-columns: 1fr; } .snapshot-panel { order: -1; } .metric-grid { grid-template-columns: repeat(4, 1fr); } .metric-grid article { min-height: 6rem; } }
@media (max-width: 760px) { .app-shell { display: block; } .sidebar { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; top: auto; height: auto; padding: .55rem; border-right: 0; border-top: 1px solid var(--line); } .brand-row, .side-foot { display: none; } nav { grid-template-columns: repeat(4, 1fr); gap: .25rem; } .nav-item { justify-content: center; padding: .65rem .2rem; font-size: .7rem; } .nav-item span { display: none; } .workspace { padding: 1rem 1rem 6rem; } .topbar { margin-bottom: 1.1rem; } .topbar .eyebrow, .user-chip div { display: none; } .chat-layout { min-height: calc(100vh - 10rem); } .chat-stream { min-height: 28rem; max-height: calc(100vh - 15rem); } .snapshot-panel { display: none; } .metric-grid { grid-template-columns: 1fr 1fr; } .admin-grid { grid-template-columns: 1fr; } .job-card { grid-column: auto; } .section-head { align-items: flex-start; } }

