:root {
  --bg: #0b0e14;
  --bg2: #0f131b;
  --panel: #141924;
  --panel2: #1a2030;
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.15);
  --text: #e9edf5;
  --muted: #94a1b6;
  --dim: #6d798c;
  --gold: #d8b25c;
  --gold-soft: rgba(216, 178, 92, 0.12);
  --blue: #6ea8fe;
  --q0: #9d9d9d;
  --q1: #ffffff;
  --q2: #1eff00;
  --q3: #0a84ff;
  --q4: #a335ee;
  --q5: #ff8000;
  --q6: #e6cc80;
  --q7: #00ccff;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(110, 168, 254, 0.12), transparent 60%),
    radial-gradient(900px 480px at 88% -6%, rgba(216, 178, 92, 0.09), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 100%;
}

svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(14px, 3vw, 34px) 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 14, 20, 0.75);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 40px; height: 40px; padding: 8px;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(216, 178, 92, 0.32);
  border-radius: 11px;
}
.logo svg { fill: currentColor; stroke: none; }
.brand-text h1 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: 0.4px; }
.brand-text p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.stats { display: flex; gap: 20px; }
.stat { text-align: right; }
.stat b { display: block; font-size: 17px; color: var(--gold); font-weight: 650; }
.stat span { font-size: 11px; color: var(--muted); letter-spacing: 0.8px; }

/* ---------------- 标签页 ---------------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 8px clamp(14px, 3vw, 34px) 0;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 14, 20, 0.5);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  padding: 9px 18px 11px;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  cursor: pointer;
  transition: 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: #f4e3bb; border-bottom-color: var(--gold); }

/* ---------------- 布局 ---------------- */
.layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 336px;
  gap: 14px;
  padding: 14px clamp(14px, 3vw, 34px) 30px;
  align-items: start;
  max-width: 1720px;
  margin: 0 auto;
}

/* ---------------- 侧栏 ---------------- */
.sidebar {
  position: sticky;
  top: 62px;
  max-height: calc(100vh - 78px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 7px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.13); border-radius: 4px; }

.sbox { padding: 9px 0 12px; border-bottom: 1px solid var(--line); }
.sbox:last-child { border-bottom: 0; padding-bottom: 2px; }
.sbox > h4 {
  margin: 0 0 8px;
  font-size: 11.5px;
  letter-spacing: 1px;
  color: var(--dim);
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sbox > h4 b { color: var(--gold); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: #cbd5e4;
  border-radius: 7px;
  font-size: 12px;
  padding: 3px 8px;
  font-family: inherit;
  cursor: pointer;
  transition: 0.13s;
  white-space: nowrap;
}
.chip:hover { background: rgba(255, 255, 255, 0.06); }
.chip.on { background: rgba(216, 178, 92, 0.16); border-color: rgba(216, 178, 92, 0.5); color: #f3e2b9; }
.chip .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

.linklist { display: flex; flex-direction: column; gap: 1px; }
.linklist button {
  text-align: left;
  border: 0;
  background: transparent;
  color: #c2ccdb;
  font-size: 12.5px;
  padding: 5px 8px;
  border-radius: 6px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.linklist button:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.linklist button.on { background: rgba(216, 178, 92, 0.14); color: #f3e2b9; }
.linklist button span { color: var(--dim); font-size: 11.5px; }
.linklist button span.lvl { color: #d8b25c; font-size: 11px; margin-left: 6px; }

.sgroup-title {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.6px;
  margin: 8px 0 3px 4px;
  opacity: 0.9;
}

.range { display: flex; align-items: center; gap: 6px; }
.range input[type=number] {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
}
.range span { color: var(--dim); }

select {
  width: 100%;
  height: 31px;
  padding: 0 26px 0 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5l5-5' fill='none' stroke='%2394a1b6' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 9px center / 10px;
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  appearance: none;
  cursor: pointer;
}
select:focus { outline: none; border-color: rgba(216, 178, 92, 0.45); }

.switches { display: flex; flex-direction: column; gap: 7px; }
.switch { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #c6d0df; cursor: pointer; }
.switch input { accent-color: var(--gold); width: 15px; height: 15px; }

.reset {
  width: 100%;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  margin-top: 4px;
}
.reset:hover { background: rgba(255, 255, 255, 0.07); }

/* ---------------- 内容区 ---------------- */
.content { min-width: 0; }

.toolbar {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 10px;
}
.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
}
.search:focus-within { border-color: rgba(216, 178, 92, 0.45); box-shadow: 0 0 0 3px rgba(216, 178, 92, 0.1); }
.search svg { width: 16px; height: 16px; flex: none; }
.search input {
  flex: 1;
  border: 0; outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
}
.search input::placeholder { color: var(--dim); }
.toolbar select { width: 132px; height: 36px; }
.count { color: var(--muted); font-size: 12.5px; white-space: nowrap; padding-left: 4px; }
.count b { color: var(--gold); font-weight: 600; }

/* ---------------- 表格 ---------------- */
.tablecard {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.itable { width: 100%; border-collapse: collapse; }
.itable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.8px;
  color: var(--dim);
  font-weight: 500;
  padding: 9px 10px;
  background: #171d29;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.itable tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition: background 0.12s;
}
.itable tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.012); }
.itable tbody tr:hover { background: rgba(216, 178, 92, 0.07); }
.itable tbody tr.sel { background: rgba(216, 178, 92, 0.13); box-shadow: inset 2px 0 0 var(--gold); }
.itable td {
  padding: 6px 10px;
  font-size: 13px;
  color: #c8d2e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itable td.c-name { max-width: 340px; }
.namecell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.iconbox {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--qc, var(--line2));
  color: var(--qc, #cfd8e6);
  position: relative;
}
.iconbox svg { width: 14px; height: 14px; }
.iconbox .cnt {
  position: absolute;
  right: -4px; bottom: -4px;
  font-size: 9px;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 4px;
  background: #2a3348;
  border: 1px solid var(--line2);
  color: #dfe7f3;
}
.nametext { color: var(--qc, var(--q1)); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.socket-dots { display: inline-flex; gap: 2px; margin-left: 5px; vertical-align: 1px; }
.socket-dots i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.qcell { display: inline-flex; align-items: center; gap: 5px; }
.qcell i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.src { color: #9fb4d6; }

/* 测试服暂无（GearInsight 实测）：沿用深色暗金，不用中性灰/红色 */
.badge-unavail {
  display: inline-block;
  flex: 0 0 auto;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 10.5px;
  line-height: 1.55;
  white-space: nowrap;
  vertical-align: 1px;
  color: var(--gold);
  border: 1px solid rgba(216, 178, 92, 0.42);
  border-radius: 4px;
  background: rgba(216, 178, 92, 0.1);
}
.badge-unavail.sm { font-size: 10px; padding: 0 4px; margin-left: 4px; }

/* ---------------- 分页 ---------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 0 4px;
  color: var(--muted);
  font-size: 12.5px;
  flex-wrap: wrap;
}
.pager button {
  min-width: 32px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: #c9d3e2;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
}
.pager button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.pager button.on { border-color: rgba(216, 178, 92, 0.55); background: rgba(216, 178, 92, 0.16); color: #f3e2b9; }
.pager button:disabled { opacity: 0.35; cursor: default; }
.pager .info { padding: 0 8px; }

/* ---------------- 详情卡片 ---------------- */
.tipcol { position: sticky; top: 62px; }
.tip-empty {
  border: 1px dashed var(--line2);
  border-radius: var(--radius);
  background: rgba(20, 25, 36, 0.5);
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--dim);
}
.tip-empty-inner svg { width: 34px; height: 34px; margin: 0 auto 10px; color: #4a5468; }
.tip-empty-inner p { margin: 3px 0; font-size: 12.5px; }
.tip-empty-inner .hint { color: #546075; font-size: 11.5px; }

.tooltip {
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #171d28, #10141c);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5);
  padding: 16px 17px 18px;
  position: relative;
  overflow: hidden;
}
.tooltip::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--qc, var(--gold));
  opacity: 0.85;
}
.t-head { display: flex; gap: 11px; align-items: flex-start; }
.t-icon {
  flex: none;
  width: 46px; height: 46px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--qc, var(--line2));
  color: var(--qc, #cfd8e6);
}
.t-icon svg { width: 22px; height: 22px; }
.t-title { font-size: 16px; font-weight: 650; color: var(--qc, var(--q1)); line-height: 1.35; }
.t-sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
.t-hr { height: 1px; background: var(--line); margin: 11px 0; }

.t-line { font-size: 13px; color: #d3dbe8; margin: 2px 0; }
.t-line small { color: var(--muted); }
.t-green { color: #35d07f; }
.t-gold { color: var(--gold); }

.t-sockets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 2px; }
.sockets { display: inline-flex; gap: 5px; }
.socket {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset, 0 0 8px rgba(0, 0, 0, 0.45);
  display: inline-block;
}
.socket.meta { background: conic-gradient(#ff4d4d, #ffd400, #3ddc84, #3d7bff, #b24dff, #ff4d4d); }
.socket.red { background: radial-gradient(circle at 35% 30%, #ff8a8a, #d01818 65%); }
.socket.yellow { background: radial-gradient(circle at 35% 30%, #ffe98a, #d8a400 65%); }
.socket.blue { background: radial-gradient(circle at 35% 30%, #9ec4ff, #1c53c9 65%); }
.socket.prismatic { background: conic-gradient(#ff4d4d, #ffd400, #3ddc84, #3d7bff, #b24dff, #ff4d4d); }
.socket.none { background: #2b3244; }

.t-stats { display: flex; flex-direction: column; gap: 1px; }
.t-stats .row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: #35d07f; }
.t-stats .row span:last-child { font-weight: 600; }
.t-badge {
  display: inline-block;
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #c8d2e0;
  margin: 2px 3px 0 0;
}
.diffbtn { cursor: pointer; font-family: inherit; font-size: 11.5px; }
.diffbtn.on {
  color: #ffd98a;
  border-color: rgba(216, 178, 92, 0.55);
  background: rgba(216, 178, 92, 0.1);
}.t-src { font-size: 12.5px; color: #9fb4d6; line-height: 1.7; }
.t-src b { color: #d6e2f5; font-weight: 500; }

/* ---------------- 副本 / 套装 ---------------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px 18px;
}
.inst-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.inst-head h2 { margin: 0; font-size: 20px; color: #f6e9c8; font-weight: 650; }
.inst-meta { color: var(--muted); font-size: 12.5px; }
.phasebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; font-size: 12.5px; color: var(--muted); }
.phasebar b { color: #e9d9ae; font-weight: 600; }

.boss {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.boss h3 { margin: 0 0 9px; font-size: 14.5px; color: #e6d3a3; font-weight: 600; }
.boss h3 span { color: var(--dim); font-size: 11.5px; font-weight: 400; margin-left: 8px; }

.itemgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 6px;
}
.mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  transition: 0.13s;
  min-width: 0;
}
.mini:hover { background: rgba(255, 255, 255, 0.055); border-color: var(--line2); }
.mini.extra { cursor: pointer; border-style: dashed; background: rgba(255, 255, 255, 0.03); }
.mini.extra:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--line); }
.mini .iconbox { width: 22px; height: 22px; }
.mini .iconbox svg { width: 12px; height: 12px; }
.mini .nm { color: var(--qc, var(--q1)); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .il { margin-left: auto; color: var(--dim); font-size: 11px; white-space: nowrap; }

.setrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}
.setrow:hover { background: rgba(255, 255, 255, 0.04); }
.setrow .nm { color: #ffe6b3; font-size: 13.5px; }
.setrow .meta { color: var(--dim); font-size: 12px; }

.about h2 { margin: 0 0 14px; font-size: 17px; color: #f2e2bb; font-weight: 650; }
.about dt { color: var(--gold); font-size: 12px; letter-spacing: 1px; margin-top: 13px; }
.about dd { margin: 4px 0 0; color: #c6cfdd; font-size: 13px; line-height: 1.75; }
.about code { background: rgba(255, 255, 255, 0.06); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.empty { padding: 50px 10px; text-align: center; color: var(--dim); font-size: 13px; }

footer { text-align: center; color: #556072; font-size: 11.5px; padding: 18px; }
footer a { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(255, 255, 255, 0.22); }
footer a:hover { color: #d8b25c; border-bottom-color: rgba(216, 178, 92, 0.6); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1280px) {
  .layout { grid-template-columns: 210px minmax(0, 1fr); }
  .tipcol {
    position: fixed;
    right: 14px;
    bottom: 14px;
    top: auto;
    width: 340px;
    z-index: 40;
  }
  .tip-empty { display: none; }
  .tooltip { max-height: 70vh; overflow: auto; }
}

/* 顶栏右侧分组（统计与页面信息） */
.topbar-right { display: flex; align-items: center; gap: 18px; }

@media (max-width: 900px) {
  .stats { display: none; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
  .itable td.c-req, .itable th.c-req, .itable td.c-src, .itable th.c-src { display: none; }
  .tipcol { width: calc(100vw - 24px); right: 12px; left: 12px; }
  .tooltip { max-height: 62vh; }
}
