:root{
  --bg:#F4F4FA; --card:#FFFFFF; --text:#1E1B2E; --sub:#5B5870; --muted:#8C8AA3;
  --line:#E7E6F2; --primary:#6D3BFF; --accent:#2B5BFF; --hover:#1D51DB;
  --ok:#2E9E6B; --warn:#C9821F; --danger:#C0392B; --danger-bg:#FBECEA;
  --btn:#EAEAF1; --btn-text:#29263C;
  --shadow:0 1px 2px rgba(30,27,46,.04),0 8px 24px rgba(30,27,46,.05);
  --grid:#EDECF6; --lane:#FBFBFE;
  --p1:#F2ECFF; --p2:#EAF0FF; --p3:#E9F6EF; --p4:#FDF2E3;
  --p1b:#6D3BFF; --p2b:#2B5BFF; --p3b:#2E9E6B; --p4b:#C9821F;
  --font:-apple-system,"PingFang SC","Helvetica Neue",Arial,sans-serif;
}
html[data-theme="dark"]{
  --bg:#141322; --card:#1C1A2B; --text:#F2F1F8; --sub:#B4B1C6; --muted:#8A87A0;
  --line:#2C2940; --primary:#9B7BFF; --accent:#7B96FF; --hover:#4E7BFF;
  --btn:#2A2740; --btn-text:#E9E7F2; --danger-bg:#3A2020;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 10px 30px rgba(0,0,0,.35);
  --grid:#2A2740; --lane:#191728;
  --p1:#241E3D; --p2:#1D2440; --p3:#182C25; --p4:#2E2618;
  --p1b:#A98BFF; --p2b:#7B96FF; --p3b:#4FBF8C; --p4b:#E0A758;
}
*{box-sizing:border-box}
[hidden]{display:none !important}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--text); font-family:var(--font);
  font-size:14px; line-height:1.6; -webkit-font-smoothing:antialiased;
  min-height:100vh; display:flex; flex-direction:column;
}
h1,h2,h3,p{margin:0}
button{font-family:var(--font)}
::selection{background:rgba(109,59,255,.18)}

/* ---------- 顶栏 ---------- */
.topbar{
  height:64px; display:flex; align-items:center; gap:22px; padding:0 24px;
  background:var(--card); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:30;
}
.topbar::before{
  content:""; position:absolute; left:0; right:0; top:0; height:3px;
  background:linear-gradient(90deg,#E100FF 0%,#8B3DFF 34%,#2B5BFF 68%,#00CFFF 100%);
}
.brand{display:flex; align-items:center; gap:9px; flex:none}
.brand-mark{width:30px; height:30px; display:block; flex:none}
.brand-mark img{width:30px; height:30px; display:block; filter:drop-shadow(0 4px 10px rgba(120,40,220,.30))}
.brand-name{font-weight:700; font-size:15px; letter-spacing:.2px; white-space:nowrap}

.menu{flex:1; min-width:0; display:flex; align-items:center; justify-content:center; gap:10px}
.menu-group{position:relative}
.menu-btn{
  display:inline-flex; align-items:center; gap:6px; border:0; background:transparent;
  color:var(--sub); font-size:13.5px; font-weight:600; padding:20px 12px 18px;
  cursor:pointer; font-family:var(--font); position:relative; white-space:nowrap;
}
.menu-btn:hover{color:var(--text)}
.menu-btn.active{color:var(--text)}
.menu-btn.active::after{
  content:""; position:absolute; left:12px; right:12px; bottom:9px; height:2px; border-radius:2px;
  background:linear-gradient(90deg,#6D3BFF,#2B5BFF);
}
.caret{transform:translateY(1px); transition:transform .15s ease; opacity:.7}
.menu-group.open>.menu-btn .caret{transform:rotate(180deg)}
.menu-drop{
  position:absolute; top:calc(100% - 10px); left:50%; transform:translateX(-50%);
  min-width:158px; padding:6px; background:var(--card); border:1px solid var(--line);
  border-radius:12px; box-shadow:0 16px 44px rgba(30,27,46,.18); display:none; z-index:50;
}
.menu-group.open .menu-drop,.menu-group:hover .menu-drop{display:block}
.menu-drop button{
  display:block; width:100%; text-align:left; border:0; background:transparent;
  color:var(--sub); font-size:13px; font-weight:600; padding:8px 12px; border-radius:8px;
  cursor:pointer; font-family:var(--font); white-space:nowrap;
}
.menu-drop button:hover{background:var(--bg); color:var(--text)}
.menu-drop button.active{color:var(--primary); background:rgba(109,59,255,.09)}
html[data-theme="dark"] .menu-drop button.active{background:rgba(155,123,255,.16)}
.topbar-right{margin-left:auto; display:flex; align-items:center; gap:8px; flex:none}
.top-btn{
  display:inline-flex; align-items:center; gap:6px; height:32px; padding:0 10px;
  border:1px solid var(--line); background:var(--bg); border-radius:9px; color:var(--sub);
  font-size:12.5px; font-weight:600; font-family:var(--font); cursor:pointer;
  transition:color .15s ease, border-color .15s ease;
}
.top-btn:hover{color:var(--text); border-color:rgba(109,59,255,.45)}
.top-btn .caret{opacity:.65}
.theme-btn{width:34px; padding:0; justify-content:center}
.theme-btn .ico-sun, .theme-btn .ico-moon{display:none}
.theme-btn:not(.is-dark) .ico-moon{display:block}
.theme-btn.is-dark .ico-sun{display:block}
.lang{position:relative}
.lang-drop{
  position:absolute; right:0; top:calc(100% + 6px); min-width:124px; padding:5px;
  background:var(--card); border:1px solid var(--line); border-radius:11px;
  box-shadow:0 16px 40px rgba(30,27,46,.2); display:none; z-index:60;
}
.lang.open .lang-drop{display:block}
.lang-drop button{
  display:block; width:100%; text-align:left; border:0; background:transparent;
  color:var(--sub); font-size:13px; font-weight:600; padding:7px 10px; border-radius:7px;
  cursor:pointer; font-family:var(--font);
}
.lang-drop button:hover{background:var(--bg); color:var(--text)}
.lang-drop button.active{color:var(--primary); background:rgba(109,59,255,.09)}
html[data-theme="dark"] .lang-drop button.active{background:rgba(155,123,255,.16)}

/* 二级子视图 */
.subnav{display:inline-flex; gap:4px; padding:3px; margin-bottom:14px;
  background:var(--card); border:1px solid var(--line); border-radius:11px}
.subnav-item{
  border:0; background:transparent; color:var(--sub); font-size:13px; font-weight:600;
  padding:6px 18px; border-radius:8px; cursor:pointer; font-family:var(--font);
}
.subnav-item:hover{color:var(--text)}
.subnav-item.active{background:var(--bg); color:var(--text); box-shadow:0 1px 3px rgba(30,27,46,.1)}

/* ---------- 布局 ---------- */
.wrap{width:100%; max-width:1400px; margin:0 auto; padding:24px 28px 32px; flex:1}
.tab-panel{display:none; animation:fade .25s ease}
.tab-panel.active{display:block}
@keyframes fade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.narrow{max-width:860px; margin:0 auto}
.grid-2{display:grid; grid-template-columns:1.15fr .85fr; gap:18px; align-items:start}
.grid-3{display:grid; grid-template-columns:repeat(3,1fr); gap:14px}
.row-2{display:grid; grid-template-columns:1fr 1fr; gap:14px}
.card{
  background:var(--card); border:1px solid var(--line); border-radius:18px;
  padding:22px 24px; box-shadow:var(--shadow); margin-bottom:18px;
}
.card-head{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px}
.card-head h2{
  font-size:14px; font-weight:700; padding-left:11px; position:relative; line-height:1.4;
}
.card-head h2::before{
  content:""; position:absolute; left:0; top:2px; bottom:2px; width:3px; border-radius:2px;
  background:linear-gradient(180deg,#6D3BFF,#2B5BFF);
}

/* ---------- 表单 ---------- */
.field{display:flex; flex-direction:column; gap:7px; margin-bottom:14px; min-width:0}
.field-head{display:flex; align-items:center; justify-content:space-between; gap:10px}
.link-btn{
  border:0; background:transparent; color:var(--accent); font-size:12px; font-weight:600;
  cursor:pointer; padding:2px 4px; border-radius:6px; font-family:var(--font);
}
.link-btn:hover{background:var(--bg); text-decoration:underline}
.status-pill{
  font-size:11px; font-weight:600; padding:2px 8px; border-radius:6px; white-space:nowrap;
  background:var(--bg); color:var(--muted); border:1px solid var(--line);
}
.status-pill.ok{color:var(--ok); background:rgba(46,158,107,.12); border-color:transparent}
.status-pill.fail{color:var(--danger); background:var(--danger-bg); border-color:transparent}
.status-pill.unknown{color:var(--muted)}
.label{font-size:12.5px; color:var(--sub); font-weight:600}
input[type=text],input[type=password],input[type=number],select,textarea{
  width:100%; font-family:var(--font); font-size:14px; color:var(--text);
  background:var(--bg); border:1px solid var(--line); border-radius:11px;
  padding:0 12px; height:38px; outline:none; transition:border-color .15s, box-shadow .15s;
  appearance:none; -webkit-appearance:none;
}
textarea{height:auto; padding:10px 12px; line-height:1.6; resize:vertical}
input:focus,select:focus,textarea:focus{border-color:var(--primary); box-shadow:0 0 0 3px rgba(109,59,255,.12)}
select{
  background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238C8AA3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center; padding-right:32px;
}
html[data-theme="dark"] select{
  background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238A87A0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.range-wrap{display:flex; align-items:center; gap:12px}
input[type=range]{
  -webkit-appearance:none; appearance:none; flex:1; height:38px; background:transparent; margin:0;
}
input[type=range]::-webkit-slider-runnable-track{height:5px; border-radius:3px; background:var(--line)}
input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none; width:17px; height:17px; border-radius:50%; background:var(--card);
  border:5px solid var(--primary); margin-top:-6px; box-shadow:0 1px 5px rgba(109,59,255,.35);
}
output{font-size:13px; font-weight:600; color:var(--text); min-width:52px; text-align:right; font-variant-numeric:tabular-nums}

/* ---------- 按钮 ---------- */
.btn{
  -webkit-appearance:none; appearance:none; border:1px solid var(--line);
  background:var(--btn); color:var(--btn-text); border-radius:11px; height:38px; padding:0 18px;
  font-size:14px; font-weight:600; cursor:pointer; white-space:nowrap;
  transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover{background:var(--hover); color:#fff; border-color:var(--hover)}
.btn:active{filter:brightness(.94)}
.btn:disabled,.btn[disabled]{opacity:.65; cursor:not-allowed}
.btn:disabled:hover{background:var(--btn); color:var(--btn-text); border-color:var(--line)}
.btn-sm{height:32px; padding:0 14px; font-size:12.5px; border-radius:9px}
.btn-danger{color:var(--danger); background:var(--danger-bg); border-color:transparent}
.btn-danger:hover{background:var(--danger); color:#fff; border-color:var(--danger)}
.icon-btn{
  border:0; background:transparent; color:var(--sub); font-size:22px; line-height:1;
  width:32px; height:32px; border-radius:8px; cursor:pointer;
}
.icon-btn:hover{background:var(--bg); color:var(--text)}
.act-group{
  display:inline-grid; grid-auto-flow:column; grid-auto-columns:minmax(max-content,1fr);
  gap:8px; align-items:center;
}

/* ---------- 来源勾选 ---------- */
.source-picks{display:flex; flex-wrap:wrap; gap:8px}
.src-chip{
  display:inline-flex; align-items:center; gap:7px; height:34px; padding:0 12px;
  border:1px solid var(--line); border-radius:9px; background:var(--bg);
  font-size:13px; color:var(--sub); cursor:pointer; user-select:none;
}
.src-chip input{display:none}
.src-chip .dot{width:7px; height:7px; border-radius:50%; background:var(--muted)}
.src-chip.on{color:var(--text); border-color:rgba(109,59,255,.45); background:rgba(109,59,255,.07)}
.src-chip.on .dot{background:var(--primary)}

/* ---------- 进度 ---------- */
.progress-line{display:flex; justify-content:space-between; align-items:baseline; font-size:13px; color:var(--sub); margin-bottom:8px}
.progress-line b{color:var(--text); font-variant-numeric:tabular-nums; font-size:14px}
.progress-bar{height:6px; border-radius:4px; background:var(--line); overflow:hidden}
.progress-bar i{display:block; height:100%; border-radius:4px; background:linear-gradient(90deg,#6D3BFF,#2B5BFF); transition:width .4s ease}
.log{
  margin-top:14px; height:286px; overflow:auto; background:var(--bg); border:1px solid var(--line);
  border-radius:12px; padding:12px 14px; font-size:12.5px; line-height:1.75; color:var(--sub);
}
.log p{margin:0 0 2px}
.log time{color:var(--muted); font-variant-numeric:tabular-nums; margin-right:8px}
.result-strip{
  margin-top:14px; display:flex; gap:18px; flex-wrap:wrap; font-size:13px; color:var(--sub);
}
.result-strip b{color:var(--text)}
.empty{color:var(--muted); font-size:13px; padding:10px 0}

/* ---------- 情报分析：左配置 右图谱 ---------- */
.analysis{
  display:grid; grid-template-columns:minmax(276px, 1fr) 4fr; gap:18px;
  align-items:stretch; height:calc(100vh - 220px); min-height:520px;
}
.analysis-side{min-width:0; min-height:0; display:flex}
.analysis-main{min-width:0; min-height:0; display:flex; flex-direction:column}
.side-card{
  width:100%; height:100%; margin-bottom:0; padding:18px 16px;
  overflow-y:auto; display:flex; flex-direction:column;
}
.side-card::-webkit-scrollbar{width:6px}
.side-card::-webkit-scrollbar-thumb{background:var(--line); border-radius:3px}
.side-head{display:flex; align-items:center; gap:8px; font-size:13.5px; font-weight:700; margin-bottom:12px}
.side-head .step-chip{margin-right:0}
.side-sep{height:1px; background:var(--line); margin:16px 0}
.side-card .field{margin-bottom:12px}
.side-card .label{font-size:12px}
.side-card input[type=text], .side-card select{height:34px; font-size:13px}
.side-card textarea{font-size:13px; padding:8px 10px}
.side-card .act-group{display:grid; grid-template-columns:1fr; width:100%}
.side-card .act-group .btn{width:100%}
.source-picks{gap:6px}
.side-card .src-chip{height:30px; font-size:12px; padding:0 10px}
.side-progress{margin-top:14px; padding-top:14px; border-top:1px dashed var(--line)}
.log.mini{height:150px; margin-top:10px; font-size:11.5px; padding:8px 10px; line-height:1.65}
.side-progress .progress-line{font-size:12px}
.side-progress .result-strip{font-size:11.5px; gap:10px; margin-top:10px}

.pane-head{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; flex-wrap:wrap; flex:none}
.analysis-main .graph-card{
  flex:1; min-height:0; padding:18px 20px 10px; display:flex; flex-direction:column; margin-bottom:0;
}
.analysis-main .graph-card .graph-scroll{flex:1; min-height:0; overflow:auto}
.analysis-main .graph-card .graph-empty{height:100%; display:flex; align-items:center; justify-content:center}
.analysis-main .graph-card .graph-empty .empty{padding:0}

#view-docs{flex:1; min-height:0; display:flex; flex-direction:column; margin-bottom:0}
#view-docs .card-head{flex:none}
#view-docs .table-wrap{flex:1; min-height:0; overflow:auto}
#view-docs .table thead th{position:sticky; top:0; background:var(--card); z-index:2; box-shadow:inset 0 -1px 0 var(--line)}
#view-docs .empty{flex:none}

/* 内部滚动条：暗色下用半透明白，避免看不见 */
.side-card::-webkit-scrollbar,
.graph-scroll::-webkit-scrollbar,
#view-docs .table-wrap::-webkit-scrollbar{width:10px; height:10px}
.side-card::-webkit-scrollbar-track,
.graph-scroll::-webkit-scrollbar-track,
#view-docs .table-wrap::-webkit-scrollbar-track{background:transparent}
.side-card::-webkit-scrollbar-thumb,
.graph-scroll::-webkit-scrollbar-thumb,
#view-docs .table-wrap::-webkit-scrollbar-thumb{
  background:rgba(30,27,46,.18); border-radius:6px; border:2px solid transparent; background-clip:content-box;
}
html[data-theme="dark"] .side-card::-webkit-scrollbar-thumb,
html[data-theme="dark"] .graph-scroll::-webkit-scrollbar-thumb,
html[data-theme="dark"] #view-docs .table-wrap::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.32); background-clip:content-box;
}
html[data-theme="dark"] .side-card::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .graph-scroll::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] #view-docs .table-wrap::-webkit-scrollbar-thumb:hover{
  background:rgba(255,255,255,.45); background-clip:content-box;
}

@media (max-width:1180px){
  .analysis{grid-template-columns:1fr; height:auto; min-height:0}
  .side-card{height:auto; overflow:visible}
  .analysis-main .graph-card{height:520px}
}

/* ---------- 步骤引导 ---------- */
.steps-grid{grid-template-columns:1.04fr .96fr; align-items:stretch}
.step-col{display:flex; flex-direction:column}
.step-col>.card{flex:1; display:flex; flex-direction:column}
#panel-search .step-col>.card:first-child{flex:0 0 auto}
.step-col>.card>.act-group{align-self:flex-start}
.step-col .log{flex:1; min-height:180px}
#progressCard{height:520px; flex:0 0 520px; overflow:hidden}
#progressCard .log{flex:1; min-height:0; overflow-y:auto}
#progressCard .result-strip{flex:none}
#progressCard .act-group{flex:none}
@media (max-width:1180px){ #progressCard{height:470px; flex-basis:470px} }
@media (max-width:820px){ #progressCard{height:420px; flex-basis:420px} }
.step-chip{
  display:inline-block; margin-right:9px; padding:2px 8px; border-radius:7px;
  font-size:11.5px; font-weight:700; letter-spacing:.3px; vertical-align:2px;
  color:var(--primary); background:rgba(109,59,255,.1);
}
html[data-theme="dark"] .step-chip{background:rgba(155,123,255,.16)}

/* ---------- 历史记录（横向层叠卡片） ---------- */
.stack{
  display:flex; align-items:stretch; overflow-x:auto; overflow-y:visible;
  padding:8px 8px 20px; scrollbar-width:thin;
}
.stack::-webkit-scrollbar{height:8px}
.stack::-webkit-scrollbar-thumb{background:var(--line); border-radius:4px}
.stack::-webkit-scrollbar-track{background:transparent}
.stack .empty{padding:14px 0}
.proj-item{
  position:relative; flex:0 0 244px; margin-left:-44px; padding:16px 18px 14px 20px;
  background:var(--card); border:1px solid var(--line); border-radius:14px; cursor:pointer;
  box-shadow:-8px 2px 20px rgba(30,27,46,.08);
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.proj-item:first-child{margin-left:0}
.proj-item::before{
  content:""; position:absolute; left:0; top:16px; bottom:16px; width:3px; border-radius:2px;
  background:linear-gradient(180deg,#6D3BFF,#2B5BFF);
}
.proj-item:hover{
  transform:translateY(-8px); z-index:5; border-color:rgba(109,59,255,.42);
  box-shadow:0 18px 40px rgba(30,27,46,.18);
}
.proj-item h4{margin:0 0 6px; font-size:13.5px; font-weight:700; padding-right:18px; line-height:1.5}
.proj-item .meta{display:block; font-size:11.5px; color:var(--muted); margin-top:2px}
.proj-item .del{
  position:absolute; top:10px; right:10px; width:20px; height:20px; line-height:18px; text-align:center;
  font-size:14px; color:var(--muted); border-radius:6px; opacity:0; transition:opacity .15s ease;
}
.proj-item:hover .del{opacity:1}
.proj-item .del:hover{color:var(--danger); background:var(--danger-bg)}

/* ---------- 图谱 ---------- */
.graph-card{padding:20px 22px 14px}
.graph-head{display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:10px}
.graph-title h2{font-size:16px; font-weight:700}
.graph-title p{font-size:12.5px; color:var(--muted); margin-top:3px}
.graph-scroll{position:relative; overflow-x:auto; overflow-y:hidden; border-radius:14px; background:var(--lane)}
.graph-scroll::-webkit-scrollbar{height:9px}
.graph-scroll::-webkit-scrollbar-thumb{background:var(--line); border-radius:5px}
.graph-empty{padding:80px 0; text-align:center}
#graphStage{min-width:100%}
.graph-svg{display:block; width:100%; height:auto}

.node-card{cursor:pointer}
.node-card .orb-halo,.node-card .node-plate{transition:opacity .18s ease}
.node-card .orb-halo{animation:orbPulse 4.5s ease-in-out infinite}
@keyframes orbPulse{0%,100%{opacity:.24}50%{opacity:.42}}
.node-card:hover .orb-halo{opacity:.62; animation:none}
.node-card:hover .node-plate{opacity:1}
.node-card .node-title{font-weight:700; letter-spacing:.1px}
.node-card .node-label-wrap{opacity:0; transition:opacity .18s ease}
.node-card.pinned .node-label-wrap{opacity:1}
.node-card:hover .node-label-wrap{opacity:1}
.edge{fill:none; stroke-linecap:round; transition:opacity .18s ease, stroke-width .18s ease}
.edge-glow{fill:none; stroke-linecap:round; pointer-events:none; transition:opacity .18s ease}
.tick-label,.axis-label{fill:var(--muted)}

.gtip{
  position:fixed; z-index:60; pointer-events:none; max-width:340px;
  background:var(--card); border:1px solid var(--line); border-radius:12px;
  box-shadow:0 14px 44px rgba(30,27,46,.22); padding:12px 14px; font-size:12.5px;
  color:var(--sub); line-height:1.55;
}
.gtip h5{margin:0 0 4px; font-size:13.5px; color:var(--text); font-weight:700}
.gtip .gt-meta{color:var(--muted); font-size:11.5px; margin-bottom:6px}
.gtip ul{margin:6px 0 0; padding-left:15px}
.gtip li{margin-bottom:3px; color:var(--sub)}
.legend{display:flex; flex-wrap:wrap; gap:16px; align-items:center; padding:12px 4px 4px; font-size:12px; color:var(--muted)}
.legend i{display:inline-block; vertical-align:middle; margin-right:7px}
.legend .lg-ribbon{width:28px; height:7px; border-radius:4px}
.legend .lg-dash{width:24px; height:0; border-top:2px dashed #2B7BFF}
.legend .lg-dot{width:24px; height:0; border-top:2px dotted #2FBF71}
.legend .sw{width:11px; height:11px; border-radius:3px}

/* ---------- 表格 ---------- */
.table-wrap{width:100%; overflow-x:auto}
.table{width:100%; border-collapse:collapse; font-size:13px}
.table th{
  text-align:center; font-weight:600; color:var(--sub); font-size:12.5px;
  padding:10px 10px; border-bottom:1px solid var(--line); white-space:nowrap;
}
.table td{padding:11px 10px; border-bottom:1px solid var(--line); text-align:center; vertical-align:middle}
.table td.title-cell{text-align:left; max-width:520px}
.table td.title-cell span{
  display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text);
}
.table tbody tr{cursor:pointer; transition:background .15s}
.table tbody tr:hover{background:var(--bg)}
.table .num{font-variant-numeric:tabular-nums; text-align:right; padding-right:14px}
.score-badge{
  display:inline-block; min-width:38px; padding:2px 8px; border-radius:7px; font-size:12px;
  font-weight:600; font-variant-numeric:tabular-nums;
}
.score-hi{background:rgba(46,158,107,.13); color:var(--ok)}
.score-mid{background:rgba(201,130,31,.14); color:var(--warn)}
.score-low{background:var(--bg); color:var(--muted)}
.ghost-link{color:var(--accent); font-size:12.5px; background:none; border:0; cursor:pointer; padding:2px 4px}
.ghost-link:hover{text-decoration:underline}

/* ---------- 来源管理 ---------- */
.source-list{display:flex; flex-direction:column; gap:10px}
.source-row{border:1px solid var(--line); border-radius:12px; padding:12px 14px; background:var(--bg)}
.source-row-top{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.source-row-top .name{font-weight:600; font-size:13.5px}
.kind-badge{font-size:11.5px; color:var(--muted); border:1px solid var(--line); border-radius:6px; padding:1px 7px; background:var(--card)}
.source-fields{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:12px; max-width:100%}
.source-fields .field{margin-bottom:0}
.source-fields .span2{grid-column:span 2}
.source-fields .span3{grid-column:1 / -1}
.source-fields.maps{grid-template-columns:repeat(4,minmax(0,1fr))}
.source-fields textarea{height:auto; min-height:38px; padding:8px 12px; font-size:12.5px; resize:vertical}
.name-input{flex:0 1 200px; min-width:120px; height:32px !important; font-size:12.5px !important}
.mini-select{width:120px; height:32px !important; font-size:12.5px !important; padding:0 26px 0 10px !important}
.hint{font-size:11.5px; color:var(--muted); margin-top:8px}
.path-line{font-size:11.5px; color:var(--muted); margin-top:12px; word-break:break-all}
.path-row{display:flex; gap:8px; align-items:center}
.path-row input{flex:1; min-width:0}
.switch{display:inline-flex; align-items:center; gap:7px; font-size:12.5px; color:var(--sub); cursor:pointer}
.switch input{appearance:none; -webkit-appearance:none; width:34px; height:20px; border-radius:10px; background:var(--line); position:relative; cursor:pointer; transition:background .18s}
.switch input::after{content:""; position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.2); transition:transform .18s}
.switch input:checked{background:var(--primary)}
.switch input:checked::after{transform:translateX(14px)}

/* ---------- 关于 ---------- */
#panel-about{display:none; align-items:center; justify-content:center; min-height:calc(100vh - 230px)}
#panel-about.active{display:flex}
.about-card{
  width:100%; max-width:560px; margin:0 auto; padding:34px 40px 30px;
  display:flex; flex-direction:column; align-items:center; text-align:center;
}
.about-head{
  display:flex; flex-direction:column; align-items:center; gap:12px;
  padding-bottom:20px; border-bottom:1px solid var(--line); width:100%; max-width:400px;
}
.about-mark{width:56px; height:56px; display:block; flex:none}
.about-mark img{width:56px; height:56px; display:block; filter:drop-shadow(0 8px 18px rgba(120,40,220,.32))}
.about-name{font-size:18px; font-weight:700; line-height:1.3}
.about-en{font-size:12.5px; color:var(--muted); letter-spacing:1.2px; margin-top:4px; text-transform:uppercase}
.about-version{
  font-size:12px; color:var(--sub); background:var(--bg);
  border:1px solid var(--line); border-radius:7px; padding:3px 10px;
}
.about-list{margin:0; padding:8px 0 0; width:100%; max-width:400px}
.about-list div{display:flex; gap:14px; padding:10px 0; border-bottom:1px solid var(--line); text-align:left}
.about-list div:last-child{border-bottom:0; padding-bottom:0}
.about-list dt{width:76px; flex:none; color:var(--muted); font-size:12.5px; text-align:right}
.about-list dd{margin:0; font-size:13.5px; color:var(--text); flex:1; overflow-wrap:anywhere}

/* ---------- 弹窗 ---------- */
.overlay{
  position:fixed; inset:0; z-index:100; background:rgba(20,18,32,.42);
  display:flex; align-items:center; justify-content:center; padding:32px; backdrop-filter:blur(2px);
}
.overlay[hidden]{display:none}
.modal{
  background:var(--card); border:1px solid var(--line); border-radius:18px; width:100%;
  max-height:86vh; display:flex; flex-direction:column; box-shadow:0 24px 70px rgba(20,18,32,.3);
  animation:pop .22s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes pop{from{opacity:0; transform:scale(.97) translateY(6px)}to{opacity:1; transform:none}}
.modal-sm{max-width:420px}
.modal-md{max-width:760px}
.modal-lg{max-width:940px}
.modal-head{display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:20px 24px 12px}
.modal-head h3{font-size:15.5px; font-weight:700; line-height:1.45}
.modal-sub{font-size:12.5px; color:var(--muted); margin-top:4px}
.modal-body{padding:6px 24px 18px; overflow:auto}
.modal-foot{display:flex; justify-content:flex-end; gap:8px; padding:14px 24px 20px; border-top:1px solid var(--line)}
.doc-meta{display:flex; flex-wrap:wrap; gap:8px 14px; font-size:12.5px; color:var(--sub); margin-bottom:14px}
.doc-abstract{font-size:13.5px; line-height:1.85; color:var(--text)}
.doc-abstract p{margin-bottom:10px; color:var(--sub)}
.doc-link{font-size:12.5px; color:var(--accent); word-break:break-all}
.node-doc{display:flex; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); cursor:pointer}
.node-doc:last-child{border-bottom:0}
.node-doc:hover .nd-title{color:var(--primary)}
.nd-title{font-size:13.5px; font-weight:600; line-height:1.5}
.node-doc .nd-meta{font-size:11.5px; color:var(--muted); margin-top:3px}
.nd-score{font-size:12px; font-weight:600; color:var(--ok); white-space:nowrap; font-variant-numeric:tabular-nums}

.toast{
  position:fixed; left:50%; bottom:34px; transform:translateX(-50%);
  background:var(--text); color:var(--card); padding:10px 18px; border-radius:10px;
  font-size:13px; z-index:200; box-shadow:0 10px 30px rgba(0,0,0,.2); animation:pop .2s ease;
}

/* ---------- 页脚 ---------- */
.footer{
  border-top:1px solid var(--line); padding:14px 28px; text-align:left;
  font-size:12px; color:var(--muted); background:var(--card); white-space:nowrap; overflow:hidden;
}

/* ---------- 响应式 ---------- */
@media (max-width:1180px){
  .grid-2{grid-template-columns:1fr}
  .grid-3{grid-template-columns:1fr 1fr}
  .wrap{padding:20px 20px 26px}
}
@media (max-width:820px){
  .topbar{height:auto; flex-wrap:wrap; gap:10px; padding:12px 16px 0}
  .topbar-right{margin-left:0; order:3; padding-bottom:10px}
  .brand{min-width:0}
  .tabs{order:2; width:100%; overflow-x:auto}
  .grid-3,.row-2{grid-template-columns:1fr}
  .table td.title-cell{max-width:240px}
  .modal{max-height:92vh}
}
@media (prefers-reduced-motion:reduce){
  *{animation:none !important; transition:none !important}
}

/* ---------- 登录 ---------- */
.auth-overlay{background:radial-gradient(1200px 600px at 20% 0%, rgba(225,0,255,.16), transparent 60%), radial-gradient(900px 500px at 90% 20%, rgba(0,207,255,.16), transparent 60%), var(--bg)}
.auth-card{
  width:100%; max-width:380px; padding:30px 30px 26px; background:var(--card);
  border:1px solid var(--line); border-radius:20px; box-shadow:0 24px 60px rgba(20,18,32,.18);
}
.auth-brand{display:flex; align-items:center; gap:12px; margin-bottom:22px}
.auth-brand h1{font-size:16px; font-weight:700}
.auth-brand p{font-size:12px; color:var(--muted); letter-spacing:1px; text-transform:uppercase; margin-top:2px}
.auth-card .field{margin-bottom:14px}
.auth-btn{width:100%; height:40px; margin-top:6px}
.auth-tip{min-height:18px; font-size:12px; color:var(--danger); margin-bottom:6px}
.auth-tip.info{color:var(--muted)}

/* ---------- 用户菜单 ---------- */
.user-btn{padding:0 10px 0 6px}
.avatar{
  width:22px; height:22px; border-radius:50%; display:grid; place-items:center;
  font-size:11px; font-weight:700; color:#fff;
  background:linear-gradient(135deg,#E100FF 0%,#8B3DFF 34%,#2B5BFF 68%,#00CFFF 100%);
}
.role-tag{font-size:10.5px; font-weight:600; color:var(--sub); background:var(--bg); border:1px solid var(--line); border-radius:5px; padding:0 5px}
.user-drop{right:0; left:auto; min-width:150px}

/* ---------- 用户管理 ---------- */
.users-wrap{max-height:calc(100vh - 300px); overflow:auto}
#panel-users .table td{text-align:left}
#panel-users .table th{text-align:left}
#panel-users .table .role-admin{color:var(--primary); font-weight:600}
#panel-users .table .st-off{color:var(--danger)}
.ghost-btn{border:0; background:none; color:var(--accent); font-size:12.5px; cursor:pointer; padding:2px 6px; font-family:var(--font)}
.ghost-btn:hover{text-decoration:underline}
.ghost-danger{color:var(--danger)}

.ghost-btn{border:0; background:var(--btn); color:var(--sub); font-size:12px; font-weight:600;
  padding:5px 10px; border-radius:7px; cursor:pointer; font-family:var(--font); white-space:nowrap}
.ghost-btn:hover{background:var(--hover); color:#fff}
