﻿:root{
  --ink:#0e1b2c; --ink2:#334155; --muted:#64748b; --line:#e2e8f0; --bg:#f4f6fa;
  --navy:#0b1f33; --navy2:#132c47; --accent:#0f766e; --accent-soft:#e6f4f1;
  --up:#c0392b; --down:#0f9d76; --warn:#b45309;
  --radius:14px;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei","PingFang SC",sans-serif;
  font-size:14px;line-height:1.6;-webkit-font-smoothing:antialiased}
button{font-family:inherit;cursor:pointer}
.hidden{display:none !important}

/* header */
.topbar{background:linear-gradient(180deg,#0b1f33,#102a45);color:#fff;position:sticky;top:0;z-index:20}
.topbar-inner{max-width:1280px;margin:0 auto;height:62px;padding:0 24px;display:flex;align-items:center;justify-content:space-between}
.brand{display:flex;align-items:center;gap:10px}
.mark{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;background:rgba(255,255,255,.1);color:#7dd3c0}
.name{font-size:17px;letter-spacing:.3px}
.name b{font-weight:700;color:#7dd3c0;margin-left:2px}
.sub{font-size:12px;color:rgba(255,255,255,.55);padding-left:12px;border-left:1px solid rgba(255,255,255,.18)}
.meta{font-size:12px;color:rgba(255,255,255,.6)}

/* layout */
.wrap{max-width:1280px;margin:22px auto 36px;padding:0 24px;display:grid;grid-template-columns:420px minmax(0,1fr);gap:18px;align-items:start}
.panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 1px 3px rgba(16,24,40,.05)}
.input{padding:18px 18px 16px;position:sticky;top:80px}
.panel-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:10px}
.panel-head h2{margin:0;font-size:15px}
.hint{font-size:11.5px;color:var(--muted)}
.samples{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.chip{border:1px solid var(--line);background:#fafbfe;color:#334155;font-size:11.5px;padding:5px 9px;border-radius:999px;max-width:100%;text-align:left;transition:.15s}
.chip:hover{border-color:#b7c9e2;color:var(--navy)}
textarea{width:100%;min-height:210px;border:1px solid var(--line);border-radius:10px;padding:12px 14px;font-size:13.5px;line-height:1.9;color:#1e293b;resize:vertical;outline:none;background:#fcfdff}
textarea:focus{border-color:#9db3d0;box-shadow:0 0 0 3px rgba(15,118,110,.08)}
.foot{display:flex;align-items:center;justify-content:space-between;margin-top:12px;gap:10px}
.tip{font-size:10.5px;color:#94a3b8;max-width:62%;line-height:1.5}
.btn{background:var(--navy);color:#fff;border:none;border-radius:9px;padding:10px 20px;font-size:13.5px;transition:.15s;white-space:nowrap}
.btn:hover{background:#16385a}
.btn:disabled{opacity:.6;cursor:not-allowed}

/* result */
.result{min-height:640px;padding:20px}
.empty{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:560px;text-align:center;color:var(--muted)}
.empty h3{margin:12px 0 6px;font-size:16px;color:#1e3a5c}
.empty p{margin:0;max-width:420px;font-size:12.5px}
.steps-mini{margin-top:16px;display:flex;gap:8px;font-size:11.5px;color:#8fa1bc}
.steps-mini i{font-style:normal;color:#c3cfe0}
.loading{padding:80px 40px}
.loading-title{font-size:14px;color:#1e3a5c;font-weight:600;margin-bottom:14px}
.loading ul{list-style:none;margin:0;padding:0}
.loading li{color:#9aa9bf;font-size:12.5px;padding:5px 0;transition:.2s}
.loading li.done{color:#33507a}
.loading li.active{color:var(--accent);font-weight:600}

/* verdict */
.verdict{display:flex;gap:14px;align-items:flex-start;border:1px solid var(--line);border-radius:12px;padding:16px;background:linear-gradient(135deg,#fbfdff,#f4f9f8)}
.badge{flex-shrink:0;width:64px;height:64px;border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff}
.badge.high{background:#0f766e}
.badge.mid{background:#b45309}
.badge.low{background:#64748b}
.badge b{font-size:20px;line-height:1.1}
.badge span{font-size:10px;opacity:.85}
.verdict-main{flex:1;min-width:0}
.line1{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:6px}
.pill{font-size:11px;padding:2px 9px;border-radius:999px;background:#eef2f8;color:#475569}
.pill.type{background:#e6f4f1;color:#0f766e}
.pill.co{background:#fff4e6;color:#b45309}
.verdict-text{font-size:14.5px;line-height:1.7;color:#1b2c40}

/* chain */
.section{margin-top:18px}
.section-title{display:flex;align-items:baseline;gap:8px;margin-bottom:8px}
.section-title h3{margin:0;font-size:13.5px;color:#1e3a5c}
.section-title span{font-size:11px;color:#94a3b8}
.chain{display:grid;grid-template-columns:1fr 22px 1fr 22px 1fr;align-items:stretch;gap:0}
.col{border:1px solid var(--line);border-radius:11px;padding:10px;background:#fbfcff;position:relative;transition:.2s}
.col.active{border-color:#0f766e;box-shadow:0 0 0 3px rgba(15,118,110,.08);background:#fbfffd}
.col-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:6px}
.col-head b{font-size:12.5px}
.col-head i{font-style:normal;font-size:11px;color:#94a3b8}
.segs{display:flex;flex-wrap:wrap;gap:4px}
.seg{font-size:10.5px;padding:2px 6px;border-radius:5px;background:#eef2f8;color:#5b6b82}
.seg.on{background:#0f766e;color:#fff}
.arrow{display:grid;place-items:center;color:#c3cfe0;font-size:14px}

/* bars */
.bars{margin-top:6px}
.bar-row{display:grid;grid-template-columns:52px 1fr;align-items:center;gap:8px;margin:6px 0}
.bar-label{font-size:12px;color:#4b5a70}
.bar-area{position:relative;height:26px}
.bar-zero{position:absolute;top:0;bottom:0;width:1px;background:#cbd5e1}
.bar{position:absolute;top:6px;height:14px;border-radius:3px}
.bar.pos{background:var(--up)}
.bar.neg{background:var(--down)}
.bar-ci{position:absolute;top:12px;height:2px;background:rgba(71,85,105,.35)}
.bar-ci::before,.bar-ci::after{content:"";position:absolute;top:-3px;width:1px;height:8px;background:rgba(71,85,105,.5)}
.bar-ci::before{left:0}.bar-ci::after{right:0}
.bar-val{position:absolute;top:4px;font-size:10.5px;color:#475569;white-space:nowrap}
.legend{font-size:10.5px;color:#94a3b8;margin-top:6px}

/* table */
table{width:100%;border-collapse:collapse;margin-top:4px}
th,td{text-align:left;padding:7px 8px;font-size:11.5px;border-bottom:1px solid #eef2f8;vertical-align:top}
th{color:#64748b;font-weight:500;background:#fafbfe}
td.num{font-variant-numeric:tabular-nums;white-space:nowrap}
.pos{color:var(--up)}
.neg{color:var(--down)}

/* trace */
.trace{list-style:none;margin:0;padding:0}
.trace li{display:flex;gap:10px;padding:7px 0;border-bottom:1px dashed #eef2f8;font-size:12px}
.trace li:last-child{border-bottom:none}
.trace .n{flex-shrink:0;width:18px;height:18px;border-radius:50%;background:#e6f4f1;color:#0f766e;font-size:10.5px;display:grid;place-items:center;margin-top:1px}
.trace b{color:#334155;font-weight:600;margin-right:6px}
.trace span{color:#5b6b82}

.footer{max-width:1280px;margin:0 auto 28px;padding:0 24px;display:flex;gap:8px;color:#94a3b8;font-size:11px}

@media (max-width:980px){
  .wrap{grid-template-columns:1fr}
  .input{position:static}
  .chain{grid-template-columns:1fr;gap:8px}
  .arrow{transform:rotate(90deg);height:16px}
}

/* state matrix */
.matrix td .n{font-size:10px;color:#94a3b8;margin-left:5px}
.matrix td .t{display:block;font-size:9.5px;color:#a3b0c2;margin-top:1px}
.matrix th.hl{background:#e9f6f2;color:#0f766e}
.matrix td.hl{background:#f3fbf8}
.matrix td{font-variant-numeric:tabular-nums}


/* fact chips */
.facts{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.facts span{font-size:11.5px;background:#f4f7fb;border:1px solid #e2e8f0;border-radius:6px;padding:3px 9px;color:#334155}

/* state switch */
.statebar{display:flex;align-items:center;gap:8px;margin-top:16px;flex-wrap:wrap}
.statebar-label{font-size:11.5px;color:#94a3b8}
.statebtn{border:1px solid #e2e8f0;background:#fff;color:#475569;font-size:12px;padding:5px 12px;border-radius:999px;transition:.15s}
.statebtn:hover{border-color:#b7c9e2}
.statebtn.on{background:#0f766e;border-color:#0f766e;color:#fff}
.statebar-note{font-size:11px;color:#a3b0c2;margin-left:4px}

/* chain svg */
.chain-svg{display:block;width:100%;max-width:1000px}
.flow{animation:flow 1.1s linear infinite}
@keyframes flow{to{stroke-dashoffset:-32}}

/* evidence */
.evidence{display:grid;gap:8px;max-width:760px}
.ev-row{display:grid;grid-template-columns:72px 1fr 260px;align-items:center;gap:10px}
.ev-name{font-size:12px;color:#4b5a70}
.ev-bar{height:8px;background:#eef2f8;border-radius:99px;overflow:hidden}
.ev-bar i{display:block;height:100%;border-radius:99px;transition:width .5s}
.ev-bar i.strong{background:#0f766e}
.ev-bar i.mid{background:#d97706}
.ev-bar i.weak{background:#94a3b8}
.ev-note{font-size:11px;color:#94a3b8;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
td.flat{color:#94a3b8}

/* static event list */
.search{width:100%;border:1px solid var(--line);border-radius:9px;padding:9px 12px;font-size:13px;outline:none;margin-bottom:8px}
.search:focus{border-color:#9db3d0}
.chain-tabs{display:flex;gap:6px;margin-bottom:8px;flex-wrap:wrap}
.chain-tab{border:1px solid #e2e8f0;background:#fff;color:#475569;font-size:11.5px;padding:4px 10px;border-radius:999px}
.chain-tab.on{background:#0b1f33;border-color:#0b1f33;color:#fff}
.event-list{max-height:430px;overflow:auto;border-top:1px solid #eef2f8;margin:0 -4px}
.event-item{padding:9px 8px;border-bottom:1px solid #f1f5f9;cursor:pointer;border-left:3px solid transparent}
.event-item:hover{background:#f8fbff}
.event-item.on{background:#f2f9f7;border-left-color:#0f766e}
.ev-top{display:flex;justify-content:space-between;font-size:12.5px;color:#1e293b}
.ev-date{color:#94a3b8;font-size:11px}
.ev-title{font-size:11.5px;color:#5b6b82;margin:2px 0 4px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ev-meta{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.ev-fam{font-size:10px;padding:1px 6px;border-radius:4px;background:#eef2f8;color:#475569}
.ev-fam.f-supply{background:#fdf2f1;color:#b03a2e}
.ev-fam.f-demand{background:#eef4ff;color:#1d4ed8}
.ev-fam.f-supply_cut{background:#eefaf5;color:#0f766e}
.ev-fact{font-size:10px;color:#94a3b8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:170px}
.paste-toggle{margin-top:10px;width:100%;background:none;border:1px dashed #cbd5e1;color:#64748b;font-size:12px;padding:8px;border-radius:9px}
.paste-toggle:hover{border-color:#94a3b8;color:#334155}
.paste{margin-top:10px}

.infer-note{margin-top:8px;font-size:11.5px;color:#b45309;background:#fffbeb;border:1px solid #fde68a;border-radius:7px;padding:5px 9px;display:inline-block}

/* model card */
.model-card .section-title span{color:#94a3b8}
.model-box{background:#fbfcff;border:1px solid #e6ecf6;border-radius:11px;padding:14px 16px}
.model-hint{font-size:11px;color:#a3b0c2;margin-left:10px}
.model-loading{color:#0f766e;font-size:12.5px}
.model-text{font-size:13.5px;line-height:1.95;color:#1e2d40}
.model-foot{margin-top:8px;font-size:11px;color:#a3b0c2}
.model-err{font-size:12.5px;color:#b45309}

.note-card .note-body{background:#fbfcff;border:1px solid #e6ecf6;border-radius:11px;padding:12px 15px;font-size:13px;line-height:1.95;color:#26374d}
.note-card .section-title span{color:#a3b0c2}
/* followup */
.followup .chips{display:flex;flex-wrap:wrap;gap:8px}
.chip-q{background:#fff;border:1px solid #dbe4f0;border-radius:20px;padding:7px 13px;font-size:12.5px;color:#334155;cursor:pointer;transition:.15s;text-align:left}
.chip-q:hover{border-color:#0f766e;color:#0f766e;background:#f2fbfa}
.qa{margin-top:12px;border-left:3px solid #0f766e;padding-left:12px}
.qa-q{font-size:12.5px;color:#0f766e;margin-bottom:5px}
.qa-a{font-size:13px;line-height:1.9;color:#26374d}
