/* 异界天赋树 · 3.30 中文版 —— 样式 */
:root {
  --bg: #0b0a09;
  --bg-2: #100e0c;
  --bg-3: #15120f;
  --line: #2a2521;
  --txt: #e9e3d7;
  --muted: #9a917f;
  --gold: #e0b563;
  --gold-2: #f4d79b;
  --ember: #c8642b;
  --blue: #8f96ff;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--txt);
  font: 15px/1.65 "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 9px 18px;
  background: rgba(11, 10, 9, .9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand .mark {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: grid; place-items: center;
  border: 1px solid #3c3226; border-radius: 50%;
  color: var(--gold); font-size: 18px;
  background: radial-gradient(circle at 50% 40%, rgba(224,181,99,.22), transparent 70%);
}
.brand h1 { margin: 0; font-size: 16.5px; letter-spacing: .04em; font-weight: 600; white-space: nowrap; }
.brand p { margin: 0; font-size: 11.5px; color: var(--muted); letter-spacing: .08em; white-space: nowrap; }
.topnav { display: flex; gap: 2px; }
.topnav a { padding: 5px 11px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.topnav a:hover { background: #1b1713; color: var(--gold-2); }
.spacer { flex: 1 1 auto; }
.counter { display: flex; align-items: baseline; gap: 3px; font-variant-numeric: tabular-nums; }
.counter b { font-size: 21px; color: var(--gold-2); line-height: 1; font-weight: 600; }
.counter span { color: var(--muted); font-size: 13px; }
.counter .lbl { margin-left: 5px; letter-spacing: .1em; }

/* ---------------- stage ---------------- */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  height: calc(100vh - 56px);
  min-height: 540px;
}
.canvas {
  position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 50% 42%, #171310 0%, #0c0b0a 62%, #080807 100%);
}
.canvas svg { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.canvas svg.dragging { cursor: grabbing; }

.links path { fill: none; stroke: #332f2a; stroke-width: 14; }
.links path.on { stroke: #8a6a2f; stroke-width: 19; }

.node circle { fill: rgba(150,150,150,.07); stroke: #6f6a62; stroke-width: 17; cursor: pointer; }
.node.t1 circle { stroke: #9a7d3f; stroke-width: 27; }
.node.t2 circle { stroke: #b06a2c; stroke-width: 40; }
.node.t3 circle { stroke: #3a342c; stroke-width: 2; stroke-dasharray: 8 12; }
.node:hover circle { stroke: #d7dde6; }
.node.on circle { stroke: var(--gold-2); fill: rgba(224,181,99,.24); }
.node.t1.on circle { stroke: #ffd98a; }
.node.t2.on circle { stroke: #ffb877; }
.node.hit circle { stroke: #ff5b45; stroke-width: 64; }
.node.dim { opacity: .16; }
.node .lbl { fill: #b3a893; font-size: 32px; text-anchor: middle; pointer-events: none; opacity: 0; paint-order: stroke; stroke: #0b0a09; stroke-width: 8px; stroke-linejoin: round; }
.node .lblk { fill: #e2bd79; font-size: 46px; text-anchor: middle; pointer-events: none; font-weight: 600; opacity: 0; paint-order: stroke; stroke: #0b0a09; stroke-width: 10px; stroke-linejoin: round; }
.node .lblh { fill: #9c9079; font-size: 38px; text-anchor: middle; pointer-events: none; letter-spacing: .06em; }
.node.t3 { display: none; }
svg.zoomed .node .lbl, svg.zoomed .node .lblk { opacity: 1; }
svg.zoomed .node.t3 { display: block; }
svg.zoomed .node.on circle { filter: drop-shadow(0 0 7px rgba(224,181,99,.6)); }
.hubbox { fill: rgba(10,9,8,.92); stroke: #322d27; stroke-width: 2; }
.node.flash circle { stroke: #fff; }

.toolbar { position: absolute; z-index: 5; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.toolbar > * { pointer-events: auto; }
.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search input {
  width: 100%; padding: 9px 32px; background: rgba(20,17,14,.94); color: var(--txt);
  border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; outline: none;
}
.search input::placeholder { color: #6b6459; }
.search input:focus { border-color: #5b4a2f; box-shadow: 0 0 0 3px rgba(224,181,99,.08); }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.search .clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px; display: none; }
.search.has .clear { display: block; }

.btn {
  padding: 8px 13px; border-radius: 999px; font-size: 13px;
  background: rgba(20,17,14,.94); color: var(--txt);
  border: 1px solid var(--line); cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #5b4a2f; color: var(--gold-2); }
.btn:active { transform: translateY(1px); }

.zoomctl { position: absolute; z-index: 5; right: 12px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.zoomctl button {
  width: 33px; height: 33px; border-radius: 8px; font-size: 15px;
  background: rgba(20,17,14,.94); color: var(--txt); border: 1px solid var(--line); cursor: pointer;
}
.zoomctl button:hover { color: var(--gold-2); border-color: #5b4a2f; }
.hint { position: absolute; z-index: 4; left: 14px; bottom: 12px; font-size: 11.5px; color: #625b50; pointer-events: none; letter-spacing: .04em; }
.legend { position: absolute; z-index: 4; left: 14px; bottom: 34px; display: flex; gap: 12px; font-size: 11.5px; color: #7d7466; pointer-events: none; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; border: 2px solid #6f6a62; }
.legend i.ln { border-color: #9a7d3f; }
.legend i.lk { border-color: #b06a2c; width: 10px; height: 10px; }
.legend i.lh { border-color: #3a342c; border-style: dashed; border-radius: 3px; }

.tip {
  position: absolute; z-index: 30; max-width: 360px;
  padding: 11px 13px; border-radius: var(--radius);
  background: rgba(14,12,10,.97); border: 1px solid #3a3128;
  box-shadow: 0 18px 40px rgba(0,0,0,.55);
  font-size: 12.5px; line-height: 1.6; pointer-events: none; opacity: 0; transition: opacity .1s;
}
.tip.show { opacity: 1; }
.tip h3 { margin: 0 0 3px; font-size: 14.5px; color: var(--gold-2); font-weight: 600; }
.tip .kind { font-size: 10.5px; letter-spacing: .14em; color: var(--muted); margin-bottom: 6px; }
.tip .st { color: var(--blue); }
.tip .vr { color: #8f96ff; }
.tip .vr b { color: #c9b273; font-weight: 500; }
.tip .fl { margin-top: 7px; color: #6f6656; font-style: italic; }
.tip .rm { margin-top: 6px; color: #7b7263; font-size: 12px; }

/* ---------------- panel ---------------- */
.panel { border-left: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; min-height: 0; }
.panel-head { padding: 13px 15px 9px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 8px; }
.panel-head h2 { margin: 0; font-size: 13.5px; font-weight: 600; letter-spacing: .04em; }
.panel-head em { font-style: normal; color: var(--muted); font-size: 12px; }
.bar { height: 3px; background: #221e19; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8a6a2c, var(--gold)); transition: width .18s; }
.picked { overflow-y: auto; flex: 1 1 auto; padding-bottom: 12px; }
.pick { display: flex; gap: 8px; padding: 8px 13px 8px 15px; border-bottom: 1px solid #1b1815; cursor: pointer; }
.pick:hover { background: #1a1613; }
.pick .dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 7px; flex: 0 0 7px; background: #6f6a62; }
.pick.a .dot { background: #b06a2c; }
.pick.b .dot { background: #9a7d3f; }
.pick .body { min-width: 0; flex: 1 1 auto; }
.pick .nm { font-size: 13px; color: var(--txt); }
.pick .ef { font-size: 11.5px; color: #6f6759; margin-top: 1px; overflow: hidden; }
.pick .del { color: #5c554b; font-size: 14px; border: 0; background: none; cursor: pointer; padding: 0 2px; }
.pick .del:hover { color: #ff8a72; }
.empty { padding: 24px 18px; color: #6b6459; font-size: 12.5px; line-height: 1.9; }
.panel-foot { padding: 9px 13px; border-top: 1px solid var(--line); display: flex; gap: 7px; }

/* ---------------- documents ---------------- */
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 22px; }
section.doc { padding: 62px 0 6px; border-top: 1px solid var(--line); }
.kicker { font-size: 11.5px; letter-spacing: .22em; color: var(--gold); }
h2.big { font-size: 27px; margin: 8px 0 14px; letter-spacing: .02em; font-weight: 600; }
.lead { color: #b8b0a0; font-size: 15.5px; max-width: 74ch; margin: 0 0 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 13px; margin: 26px 0 8px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; background: var(--bg-3); }
.card h3 { margin: 0 0 5px; font-size: 14px; color: var(--gold-2); font-weight: 600; }
.card p { margin: 0; font-size: 13px; color: #a49b8b; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 20px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.facts b { color: var(--gold-2); font-weight: 600; font-variant-numeric: tabular-nums; }

.idxbar { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin: 20px 0 13px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.chip.on { border-color: #6d562c; color: var(--gold-2); background: rgba(224,181,99,.08); }
.idxcount { margin-left: auto; font-size: 12px; color: #625b50; font-variant-numeric: tabular-nums; }
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: 72vh; }
.idxtbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.idxtbl thead th {
  position: sticky; top: 0; z-index: 2;
  background: #17130f; text-align: left; padding: 10px 14px; font-weight: 600;
  color: #cbbfa8; border-bottom: 1px solid var(--line); font-size: 12px; letter-spacing: .06em;
}
.idxtbl td { padding: 8px 14px; border-bottom: 1px solid #1c1815; vertical-align: top; }
.idxtbl tr:hover td { background: #161310; }
.idxtbl td.nm { width: 200px; color: var(--txt); }
.idxtbl td.nm small { display: block; color: #5b5449; font-size: 10.5px; }
.idxtbl td.kind { width: 84px; color: var(--muted); font-size: 11.5px; }
.idxtbl td.ef { color: #8f96ff; font-size: 12px; line-height: 1.6; }
.idxmore { display: block; margin: 18px auto 0; }
footer { padding: 36px 0 56px; color: #5f584d; font-size: 12px; border-top: 1px solid var(--line); margin-top: 46px; }
footer a { color: #8a7c62; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  background: #1d1813; border: 1px solid #4a3c28; color: var(--gold-2);
  padding: 9px 16px; border-radius: 999px; font-size: 12.5px; opacity: 0; pointer-events: none;
  transition: .2s; z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; height: auto; }
  .canvas { height: 66vh; }
  .panel { border-left: 0; border-top: 1px solid var(--line); max-height: 44vh; }
  .topnav { display: none; }
  .idxtbl thead th { top: 0; }
  .idxtbl td.nm { width: 130px; }
  .idxtbl td.kind { display: none; }
}
@media (max-width: 640px) {
  .search { flex: 1 1 100%; max-width: none; }
  .toolbar { gap: 6px; }
  .toolbar .btn { padding: 7px 11px; font-size: 12.5px; }
  .brand h1 { font-size: 15px; }
  .counter b { font-size: 19px; }
  .legend, .hint { font-size: 10.5px; }
  .wrap { padding: 0 16px; }
}
@media print {
  .stage, .toolbar, .zoomctl, .topbar, .panel { display: none; }
  body { background: #fff; color: #111; }
  .idxtbl td.ef { color: #333; }
}
