/* ===================== PEvision 视觉样式 ===================== */
:root {
  --bg: #070a0f;
  --bg-soft: #0b1017;
  --card: #0f161e;
  --card-2: #121b24;
  --line: #1b2530;
  --line-2: #25333f;
  --txt: #d8e4ef;
  --txt-2: #95a8b9;
  --txt-3: #647a8d;
  --cyan: #35c8e8;
  --violet: #a78bfa;
  --amber: #f5b942;
  --red: #ff5d73;
  --green: #3ddc97;
  --orange: #ff9f45;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, "Microsoft YaHei", sans-serif;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(53,200,232,.10), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(167,139,250,.08), transparent 55%),
    var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
::selection { background: rgba(53,200,232,.3); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #22303c; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2f4353; }

/* ---------------- 顶栏 ---------------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 22px;
  background: rgba(8,12,17,.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(145deg, #35c8e8, #7b61ff 70%);
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(53,200,232,.28);
}
.brand-mark svg { width: 17px; height: 17px; }
.brand-txt b { font-size: 15px; letter-spacing: .3px; display: block; line-height: 1.1; }
.brand-txt span { font-size: 10.5px; color: var(--txt-3); letter-spacing: 1.4px; text-transform: uppercase; }

.filechip {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 6px 12px; border-radius: 9px;
  background: var(--card); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px;
  overflow: hidden;
}
.filechip .fname { color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.filechip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); flex-shrink: 0; box-shadow: 0 0 8px var(--green); }
.filechip .meta { color: var(--txt-3); white-space: nowrap; }
.appbar .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--card-2); color: var(--txt);
  font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  transition: .16s ease; white-space: nowrap;
}
.btn:hover { border-color: #33465a; background: #182430; transform: translateY(-1px); }
.btn svg { width: 14px; height: 14px; }
.btn.primary {
  background: linear-gradient(160deg, #1d7f96, #1a5f80);
  border-color: #2b93ad; color: #eafaff; font-weight: 600;
}
.btn.primary:hover { background: linear-gradient(160deg, #2395b0, #1f6f95); }
.btn.ghost { background: transparent; }

/* ---------------- 标签栏 ---------------- */
.tabs {
  position: sticky; top: 55px; z-index: 30;
  display: flex; gap: 2px; padding: 0 18px;
  background: rgba(7,10,15,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; padding: 11px 15px 10px; cursor: pointer;
  color: var(--txt-3); font-size: 13px; font-weight: 500;
  border: none; background: none; font-family: var(--sans);
  white-space: nowrap; transition: color .15s;
}
.tab:hover { color: var(--txt-2); }
.tab.active { color: var(--cyan); }
.tab.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  border-radius: 2px 2px 0 0;
  box-shadow: 0 0 12px rgba(53,200,232,.6);
}
.tab .count {
  display: inline-block; margin-left: 6px; padding: 0 5px;
  font-family: var(--mono); font-size: 10px; line-height: 15px;
  border-radius: 4px; background: #1a2530; color: var(--txt-3);
}
.tab.active .count { background: rgba(53,200,232,.14); color: var(--cyan); }

main { padding: 20px 22px 60px; max-width: 1560px; margin: 0 auto; }

/* ---------------- 卡片 ---------------- */
.card {
  background: linear-gradient(180deg, rgba(19,28,38,.9), rgba(13,20,27,.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 16px;
  overflow: hidden;
}
.card > header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; letter-spacing: .3px;
  color: var(--txt);
}
.card > header .ico { color: var(--cyan); display: flex; }
.card > header .ico svg { width: 14px; height: 14px; }
.card > header .hint { margin-left: auto; font-weight: 400; color: var(--txt-3); font-size: 11.5px; }
.card > .body { padding: 16px; }
.card > .body.tight { padding: 10px 12px; }
.card > .body.flush { padding: 0; }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
.grid-2.even { grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .grid-2, .grid-2.even, .grid-3 { grid-template-columns: 1fr; } }

/* ---------------- 指标 ---------------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); }
.stat { background: var(--card); padding: 12px 14px; }
.stat .k { font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--txt-3); }
.stat .v { font-family: var(--mono); font-size: 15px; color: var(--txt); margin-top: 3px; word-break: break-all; }
.stat .v small { color: var(--txt-3); font-size: 11px; }
.stat .v.cy { color: var(--cyan); }
.stat .v.vi { color: var(--violet); }
.stat .v.am { color: var(--amber); }

/* ---------------- 文件布局图 ---------------- */
.filemap {
  display: flex; height: 62px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line-2); background: #0a1017;
}
.seg {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-width: 2px; cursor: pointer; overflow: hidden;
  font-family: var(--mono); font-size: 10.5px; color: rgba(0,0,0,.72);
  font-weight: 600; white-space: nowrap;
  transition: filter .15s, box-shadow .15s;
  border-right: 1px solid rgba(0,0,0,.35);
}
.seg:last-child { border-right: none; }
.seg:hover { filter: brightness(1.22); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); z-index: 2; }
.seg.selected { box-shadow: inset 0 0 0 2px #fff; z-index: 3; }
.seg.head { background: #7c8ea0; }
.seg.section.exec { background: #ff6b81; }
.seg.section.execwrite { background: #ff9f45; }
.seg.section.data { background: #3fc9e8; }
.seg.section.bss { background: #4a5b6b; color: #b9c9d8; }
.seg.section.other { background: #8b7bd8; }
.seg.overlay { background: #a78bfa; }
.seg.gap { background: repeating-linear-gradient(45deg, #1b232c, #1b232c 4px, #141b23 4px, #141b23 8px); color: var(--txt-3); }
.seg .seg-label { padding: 0 5px; pointer-events: none; overflow: hidden; text-overflow: ellipsis; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 11.5px; color: var(--txt-3); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------------- 图表容器 ---------------- */
.chart-wrap { position: relative; width: 100%; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.tooltip {
  position: fixed; z-index: 100; pointer-events: none; opacity: 0;
  padding: 7px 10px; border-radius: 7px;
  background: rgba(8,13,19,.96); border: 1px solid var(--line-2);
  box-shadow: 0 8px 28px rgba(0,0,0,.55);
  font-family: var(--mono); font-size: 11.5px; color: var(--txt);
  transition: opacity .1s; max-width: 340px; line-height: 1.6;
}
.tooltip b { color: var(--cyan); font-weight: 600; }
.tooltip .t-dim { color: var(--txt-3); }

/* ---------------- 表格 ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left; padding: 9px 12px; font-weight: 600;
  font-size: 11px; letter-spacing: .6px; text-transform: uppercase;
  color: var(--txt-3); background: #0d141b;
  border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0;
}
td { padding: 8px 12px; border-bottom: 1px solid rgba(27,37,48,.7); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(53,200,232,.045); }
tbody tr.selected { background: rgba(53,200,232,.09); box-shadow: inset 2px 0 0 var(--cyan); }
tbody tr.clickable { cursor: pointer; }
.mono { font-family: var(--mono); font-size: 11.8px; }
.dim { color: var(--txt-3); }
.nowrap { white-space: nowrap; }
.tbl-scroll { max-height: 460px; overflow: auto; }

/* ---------------- 标签 / 徽章 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px; border-radius: 5px; font-size: 10.5px;
  font-family: var(--mono); font-weight: 600; line-height: 17px;
  background: #1a2530; color: var(--txt-2); border: 1px solid transparent;
  white-space: nowrap;
}
.badge.r { background: rgba(255,93,115,.13); color: #ff8b9c; border-color: rgba(255,93,115,.28); }
.badge.w { background: rgba(245,185,66,.12); color: #f7c96a; border-color: rgba(245,185,66,.26); }
.badge.x { background: rgba(255,159,69,.13); color: #ffb878; border-color: rgba(255,159,69,.26); }
.badge.g { background: rgba(61,220,151,.12); color: #6ee7b7; border-color: rgba(61,220,151,.26); }
.badge.c { background: rgba(53,200,232,.12); color: #79dcf2; border-color: rgba(53,200,232,.26); }
.badge.v { background: rgba(167,139,250,.13); color: #c4b1fd; border-color: rgba(167,139,250,.26); }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------------- 熵条 ---------------- */
.ent-bar { display: flex; align-items: center; gap: 8px; min-width: 128px; }
.ent-bar .track { flex: 1; height: 5px; border-radius: 3px; background: #1a2530; overflow: hidden; }
.ent-bar .fill { height: 100%; border-radius: 3px; transition: width .3s; }
.ent-bar .num { font-family: var(--mono); font-size: 11px; color: var(--txt-2); width: 30px; text-align: right; }

/* ---------------- 导入表 ---------------- */
.dll-bars { display: grid; gap: 6px; }
.dll-bar { display: grid; grid-template-columns: 250px 1fr 46px; align-items: center; gap: 10px; font-size: 11.5px; }
.dll-bar .nm { font-family: var(--mono); color: var(--txt-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dll-bar .track { height: 7px; background: #151f28; border-radius: 4px; overflow: hidden; }
.dll-bar .fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #2b8fa8, #35c8e8); }
.dll-bar .ct { font-family: var(--mono); color: var(--txt-3); text-align: right; }

.dll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(390px, 1fr)); gap: 12px; }
.dll-card { border: 1px solid var(--line); border-radius: 10px; background: #0d141b; overflow: hidden; }
.dll-card > .dh {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: #111a23; border-bottom: 1px solid var(--line);
}
.dll-card .dn { font-family: var(--mono); font-size: 12px; color: var(--cyan); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dll-card .dc { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--txt-3); }
.funcs { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 12px; max-height: 190px; overflow: auto; }
.func {
  font-family: var(--mono); font-size: 10.5px; padding: 1.5px 6px; border-radius: 4px;
  background: #16202a; color: var(--txt-2); border: 1px solid #1e2b37; cursor: default;
}
.func:hover { border-color: #33465a; color: var(--txt); }
.func.ord { color: var(--txt-3); font-style: italic; }
.func.risk { background: rgba(255,93,115,.1); border-color: rgba(255,93,115,.35); color: #ff9aa8; }
.func.more { background: transparent; border-style: dashed; color: var(--txt-3); cursor: pointer; }

/* ---------------- 安全面板 ---------------- */
.gauge { display: flex; align-items: center; gap: 16px; }
.gauge-ring { position: relative; width: 92px; height: 92px; flex-shrink: 0; }
.gauge-ring svg { transform: rotate(-90deg); }
.gauge-ring .val {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: 21px; font-weight: 600;
}
.issues { display: grid; gap: 8px; }
.issue {
  display: flex; gap: 10px; padding: 9px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: #0d141b;
  border-left-width: 3px;
}
.issue.high { border-left-color: var(--red); }
.issue.med { border-left-color: var(--amber); }
.issue.low { border-left-color: var(--cyan); }
.issue.info { border-left-color: #46596b; }
.issue .it { font-size: 12.5px; font-weight: 600; }
.issue .id { font-size: 11.5px; color: var(--txt-3); margin-top: 1px; }
.issue .lv { margin-left: auto; flex-shrink: 0; }

.mitig { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.mitig .m {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px;
  border-radius: 8px; border: 1px solid var(--line); background: #0d141b;
  font-size: 12px;
}
.mitig .m .led { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.mitig .m.on .led { background: var(--green); box-shadow: 0 0 8px rgba(61,220,151,.7); }
.mitig .m.off .led { background: #46596b; }
.mitig .m .st { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--txt-3); }
.mitig .m.on .st { color: var(--green); }

/* ---------------- 键值表 ---------------- */
.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; font-size: 12px; }
.kv > div { padding: 6px 12px; border-bottom: 1px solid rgba(27,37,48,.65); }
.kv > .k { color: var(--txt-3); font-family: var(--mono); font-size: 11.5px; }
.kv > .v { font-family: var(--mono); color: var(--txt); word-break: break-all; }
.kv > .v .sub { color: var(--txt-3); font-family: var(--sans); font-size: 11px; margin-left: 6px; }


/* ---------------- 十六进制视图 ---------------- */
.hexview { font-family: var(--mono); font-size: 11.5px; line-height: 1.7; color: var(--txt-2); overflow: auto; max-height: 300px; padding: 12px 14px; }
.hexview .row { display: flex; gap: 14px; white-space: pre; }
.hexview .addr { color: var(--txt-3); }
.hexview .bytes { letter-spacing: .5px; }
.hexview .asc { color: var(--cyan); opacity: .8; }
.hexview .zero { color: #3a4a58; }

/* ---------------- 空状态 ---------------- */
.empty { display: grid; place-items: center; min-height: 74vh; padding: 24px; }
.drop {
  width: min(620px, 100%); text-align: center;
  border: 1.5px dashed #24333f; border-radius: 18px;
  background: radial-gradient(600px 260px at 50% 0%, rgba(53,200,232,.07), transparent 70%), var(--card);
  padding: 46px 34px 40px;
  transition: .2s;
}
.drop.hot { border-color: var(--cyan); background: radial-gradient(600px 260px at 50% 0%, rgba(53,200,232,.16), transparent 70%), var(--card); transform: scale(1.005); }
.drop .icon {
  width: 68px; height: 68px; margin: 0 auto 20px; border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, rgba(53,200,232,.16), rgba(167,139,250,.14));
  border: 1px solid rgba(53,200,232,.25);
}
.drop .icon svg { width: 32px; height: 32px; color: var(--cyan); }
.drop h1 { margin: 0 0 8px; font-size: 21px; font-weight: 600; letter-spacing: .2px; }
.drop p { margin: 0 0 22px; color: var(--txt-3); font-size: 13px; }
.drop .tips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 24px; }
.drop .tips span {
  font-size: 11px; color: var(--txt-3); padding: 3px 9px; border-radius: 20px;
  border: 1px solid var(--line); background: #0c1219;
}
.drag-overlay {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(5,9,13,.78); backdrop-filter: blur(3px);
  place-items: center;
}
.drag-overlay.on { display: grid; }
.drag-overlay .zone {
  padding: 60px 90px; border: 2px dashed var(--cyan); border-radius: 20px;
  font-size: 16px; color: var(--cyan); background: rgba(53,200,232,.06);
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 10px 18px; border-radius: 9px; z-index: 300;
  background: #14202b; border: 1px solid var(--line-2); color: var(--txt);
  font-size: 12.5px; opacity: 0; transition: .22s; pointer-events: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.section-title { font-size: 12px; color: var(--txt-3); text-transform: uppercase; letter-spacing: 1px; margin: 18px 0 9px; }
.section-title:first-child { margin-top: 0; }

.empty-note { padding: 26px; text-align: center; color: var(--txt-3); font-size: 12.5px; }

/* 概览小卡 */
.facts { display: grid; gap: 0; }
.fact { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dashed rgba(27,37,48,.8); font-size: 12px; }
.fact:last-child { border-bottom: none; }
.fact .fk { color: var(--txt-3); width: 96px; flex-shrink: 0; font-size: 11.5px; }
.fact .fv { font-family: var(--mono); color: var(--txt); word-break: break-all; }

.pdb-path { font-family: var(--mono); font-size: 11.5px; color: var(--violet); word-break: break-all; }
.res-group { border-bottom: 1px solid var(--line); }
.res-group:last-child { border-bottom: none; }
.res-group summary {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer;
  font-size: 12.5px; list-style: none;
}
.res-group summary::-webkit-details-marker { display: none; }
.res-group summary:hover { background: rgba(53,200,232,.04); }
.res-group summary .caret { color: var(--txt-3); transition: .15s; font-size: 10px; }
.res-group[open] summary .caret { transform: rotate(90deg); }
.res-group summary .cnt { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--txt-3); }
