:root {
  --bg: #0e0e10; --panel: #17171a; --panel2: #1f1f23; --line: #2b2b30; --line2: #3a3a41; --row: #141417; --rowalt: #18181c;
  --text: #e6e6e6; --dim: #a0a0a8; --faint: #6a6a72;
  --accent: #f4b740; --link: #9ecbff; --red: #d0573c; --green: #4fbf6a;
  --server: #f4b740; --captured: #5aa9e6; --unavail: #6a6a72;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --dps: #c8e68b; --rdps: #c79bf2;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.4 "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif; }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.dim { color: var(--dim); } .faint { color: var(--faint); }
.empty, .loading { padding: 40px; text-align: center; color: var(--dim); }
.import-panel { margin: 18px 20px; padding: 18px 20px; border: 1px solid var(--line2); border-radius: 4px; background: var(--panel); }
.import-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.import-panel h2 { margin: 0; font-size: 18px; }
.import-panel p { margin: 6px 0; }
.import-panel ol { padding-left: 22px; line-height: 1.9; margin: 12px 0; }
.import-panel code { color: var(--accent); font-size: 13px; }
.import-button { padding: 8px 14px; border: 1px solid #756032; border-radius: 3px; background: #3a3220; color: var(--accent); cursor: pointer; font-weight: 600; }
.import-button:disabled { opacity: .5; cursor: wait; }
.import-hint { color: var(--dim); margin: 10px 0; }
.import-panel details { color: var(--dim); margin-top: 12px; }
.import-panel summary { cursor: pointer; color: var(--link); }
.import-panel ul { line-height: 1.8; }
.import-panel progress { width: 100%; height: 10px; margin-top: 16px; accent-color: var(--accent); }
.import-status { margin-top: 12px; overflow-wrap: anywhere; }
.import-status:empty { display: none; }
.import-status button { margin-left: 12px; }

/* site header */
.topbar { height: 48px; display: flex; align-items: center; gap: 18px; padding: 0 18px; background: #050506; border-bottom: 1px solid #000; position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.brand b { color: var(--accent); } .brand:hover { text-decoration: none; }
.topnav a { color: #cfcfcf; margin-right: 14px; font-weight: 600; }
.search { margin-left: auto; display: flex; }
.search input { width: 240px; background: #1b1b1f; border: 1px solid var(--line2); color: var(--text); padding: 5px 9px; border-radius: 3px; }
main { padding: 0 0 60px; }

/* report header */
.rheader { background: linear-gradient(#1a1a1e, #121215); border-bottom: 1px solid #000; padding: 12px 20px 10px; }
.rtitle { font-size: 22px; font-weight: 700; color: #fff; }
.rsub { color: var(--dim); font-size: 12px; margin-top: 2px; }
.fightline { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.fightname { font-size: 15px; font-weight: 700; color: #fff; }
.kill { color: var(--green); font-weight: 700; } .wipe { color: var(--red); font-weight: 700; } .unsettled { color: var(--accent); font-weight: 700; }
.viewbtns { display: flex; gap: 4px; margin-left: auto; }
.viewbtns a { padding: 5px 12px; background: #232328; border: 1px solid var(--line2); border-radius: 3px; color: #ddd; font-weight: 600; }
.viewbtns a.on { background: #3a3220; border-color: var(--accent); color: var(--accent); }
.viewbtns a:hover { text-decoration: none; border-color: #777; }

/* fight list (report overview) */
.fightgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; padding: 14px 20px; }
.fcard { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--green); padding: 8px 10px; border-radius: 3px; cursor: pointer; }
.fcard.unsettled { border-left-color: var(--accent); }
.fcard.wipe-card { border-left-color: var(--red); }
.fcard:hover { background: var(--panel2); }
.fcard .n { font-weight: 700; color: #fff; } .fcard .s { color: var(--dim); font-size: 12px; }

/* control rows */
.ctrl { display: flex; align-items: center; gap: 6px; padding: 8px 20px; background: #121215; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ctrl .grow { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 3px; overflow: hidden; }
.seg a, .seg button { padding: 4px 11px; background: #1d1d21; color: #ccc; border: none; border-right: 1px solid var(--line2); cursor: pointer; font-weight: 600; }
.seg a:last-child, .seg button:last-child { border-right: none; }
.seg .on { background: #3a3220; color: var(--accent); }
.seg a:hover { text-decoration: none; background: #2a2a2f; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 2px 8px; border-radius: 10px; background: #2a2620; color: var(--accent); font-size: 12px; }
.chip button { background: none; border: none; cursor: pointer; color: var(--dim); padding: 0; }

/* dropdowns */
.dd { position: relative; }
.ddbtn { background: #1d1d21; border: 1px solid var(--line2); border-radius: 3px; padding: 4px 10px; cursor: pointer; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; max-width: 520px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd.active .ddbtn { border-color: var(--accent); color: var(--accent); }
.ddbtn .plus { color: var(--accent); }
.ddpanel { display: none; position: absolute; left: 0; top: 100%; margin-top: 2px; z-index: 40; background: #1b1b1f; border: 1px solid var(--line2); border-radius: 3px; min-width: 280px; max-height: 480px; overflow: auto; box-shadow: 0 8px 24px #000a; padding: 4px 0; }
.dd.open .ddpanel { display: block; }
.ddpanel a, .ddpanel .item { display: flex; align-items: center; gap: 8px; padding: 4px 12px; color: var(--text); white-space: nowrap; cursor: pointer; }
.ddpanel a:hover, .ddpanel .item:hover { background: #2a2a30; text-decoration: none; }
.ddpanel .sel { background: #3a3220; }
.ddpanel .group { padding: 6px 12px 2px; color: var(--faint); font-size: 11px; }
.ddpanel .iconrow { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px 12px; border-top: 1px solid var(--line); margin-top: 4px; }
.ddpanel input { margin: 4px 10px; width: calc(100% - 20px); background: #0b0b0d; border: 1px solid var(--line2); color: var(--text); padding: 4px 6px; }

/* tabs */
.tabs { display: flex; padding: 0 20px; background: #121215; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { padding: 9px 14px; color: #bbb; font-weight: 600; border-bottom: 2px solid transparent; }
.tab:hover { color: #fff; text-decoration: none; }
.tab.on { color: #fff; border-bottom-color: var(--accent); }
.tab.off { color: #555; cursor: not-allowed; }

/* filter expression */
.filterbar { display: flex; align-items: center; gap: 8px; padding: 6px 20px; background: #101013; border-bottom: 1px solid var(--line); }
.filterbar label { color: var(--dim); font-size: 12px; white-space: nowrap; }
.filterbar input { flex: 1; background: #0b0b0d; border: 1px solid var(--line2); color: var(--text); padding: 5px 8px; font-family: var(--mono); border-radius: 3px; }
.filterbar .err { color: var(--red); font-size: 12px; }

.content { padding: 12px 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; margin-bottom: 12px; }
.panel > h3 { margin: 0; padding: 7px 12px; font-size: 13px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; color: #fff; }
.panel > .body { padding: 10px 12px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 12px; }

/* tables */
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-weight: 700; color: #ddd; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line2); background: #1c1c20; white-space: nowrap; user-select: none; }
table.grid th.num { text-align: right; }
table.grid th.sortable { cursor: pointer; } table.grid th.sorted { color: var(--accent); }
table.grid td { padding: 3px 8px; height: 26px; border-bottom: 1px solid #1f1f23; vertical-align: middle; }
table.grid tbody tr.row:nth-child(even) td { background: var(--rowalt); }
table.grid tr.row:hover td { background: #24242a !important; }
table.grid tr.clickable { cursor: pointer; }
table.grid tr.sub td { background: #0f0f12 !important; font-size: 12px; padding: 6px 30px; }
table.grid tr.total td { font-weight: 700; border-top: 1px solid var(--line2); background: #1c1c20; color: #fff; }
td.hastip { cursor: help; }
td.hastip > * { text-decoration: underline dotted #777; text-underline-offset: 3px; }

/* amount bar (percent and value over the bar) */
.amount { position: relative; min-width: 220px; height: 18px; display: flex; align-items: center; }
.abar { position: absolute; inset: 1px 0; background: #222226; border-radius: 1px; overflow: hidden; }
.abar i { position: absolute; left: 0; top: 0; bottom: 0; opacity: .9; }
.abar i.gap { background: repeating-linear-gradient(45deg, #0009 0 3px, #0003 3px 6px) !important; opacity: 1; }
.amount .apct, .amount .aval { position: relative; font-family: var(--mono); font-size: 12px; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.amount .apct { padding-left: 6px; width: 64px; } .amount .aval { margin-left: auto; padding-right: 6px; }

/* actors */
.who { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.who a { color: inherit; }
.aname { font-weight: 700; } .aname.unnamed { font-weight: 400; opacity: .85; }
.school { color: var(--dim); font-size: 11px; }
.sicon { display: inline-grid; place-items: center; border-radius: 2px; color: #111; font-weight: 800; flex: none; line-height: 1; }
.aicon { width: 18px; height: 18px; border-radius: 2px; background: #2c2c33; display: inline-grid; place-items: center; font-size: 10px; color: #ccc; flex: none; }
.parse { font-weight: 800; font-family: var(--mono); }

.tier { font-size: 10px; padding: 0 5px; border-radius: 2px; border: 1px solid; line-height: 15px; white-space: nowrap; font-weight: 400; }
.tier.server { color: var(--server); border-color: #6b5520; }
.tier.captured { color: var(--captured); border-color: #2c4f6e; }
.tier.unavail { color: var(--unavail); border-color: #3a3a40; }
.na { color: var(--unavail); }

/* aura timeline */
.tl { position: relative; height: 14px; background: #222226; min-width: 300px; }
.tl > i { position: absolute; top: 2px; bottom: 2px; background: #4fbf6a; opacity: .85; }
.tl.debuff > i { background: #d0573c; }

/* chart */
.chartbox { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; margin-bottom: 12px; }
.charthead { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 12px; }
.chart { position: relative; padding: 6px 10px 4px; }
.chart svg { display: block; width: 100%; height: 280px; user-select: none; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 4px 2px 2px; font-size: 12px; }
.chart .legend span { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; font-weight: 600; }
.chart .legend span.off { opacity: .3; }
.dot { width: 9px; height: 9px; border-radius: 1px; flex: none; display: inline-block; }

.tooltip { position: fixed; z-index: 50; pointer-events: none; background: #09090bf2; border: 1px solid #555; padding: 7px 9px; border-radius: 3px; font-size: 12px; max-width: 480px; box-shadow: 0 6px 20px #000c; }
.tooltip table { border-collapse: collapse; } .tooltip td { padding: 1px 8px 1px 0; }
.tooltip .tt-h { color: #fff; font-weight: 700; margin: 6px 0 2px; } .tooltip .tt-h:first-child { margin-top: 0; }
.tooltip .tt-total td { border-top: 1px solid #444; font-weight: 700; }
.tooltip .tt-note { color: var(--faint); font-size: 11px; margin-top: 6px; max-width: 260px; }
.tooltip.tooltip-rdps {
  width: 480px; height: 200px;
  max-width: calc(100vw - 24px); max-height: calc(100vh - 24px);
  padding: 8px; overflow: hidden;
  color-scheme: dark; scrollbar-width: thin; scrollbar-color: #595964 #19191f;
  pointer-events: auto; background: #272727; border: 1px solid #333; border-radius: 0;
  font-size: 12px;
}
.rdps-card { height: 100%; display: flex; flex-direction: column; gap: 6px; }
.rdps-sections { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #595964 #19191f; }
.tooltip-rdps .rdps-breakdown { width: 100%; table-layout: fixed; border-collapse: collapse; }
.rdps-breakdown + .rdps-breakdown { margin-top: 8px; }
.rdps-breakdown .effect-col { width: 33%; }
.rdps-breakdown .amount-col { width: 50%; }
.rdps-breakdown .dps-col { width: 17%; }
.tooltip-rdps .rdps-breakdown th { background: #222; border: 1px solid #444; height: 23px; padding: 2px 5px; color: #eee; font-weight: 400; text-align: center; }
.tooltip-rdps .rdps-breakdown td { border: 1px solid #333; padding: 1px 5px; height: 22px; background: #080808; vertical-align: middle; }
.tooltip-rdps .rdps-breakdown tr:nth-child(even) td { background: #111; }
.rdps-effect { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; }
.rdps-effect-name { overflow: hidden; text-overflow: ellipsis; }
.rdps-effect-icon { width: 14px; height: 14px; display: inline-grid; place-items: center; color: #171717; font-size: 10px; flex: none; border: 1px solid #ffffff40; }
.rdps-effect .tag { flex: none; margin: 0; font-size: 10px; color: #bbb; border-color: #666; }
.rdps-amount { display: flex; align-items: center; gap: 5px; height: 18px; font-variant-numeric: tabular-nums; }
.rdps-share { width: 48px; flex: none; text-align: right; color: #fff; }
.rdps-bar { flex: 1; height: 18px; position: relative; min-width: 0; }
.rdps-bar i { position: absolute; left: 0; top: 1px; bottom: 1px; max-width: 100%; }
.rdps-bar span { position: relative; display: block; text-align: right; padding-right: 2px; color: #fff; text-shadow: 0 1px 2px #000; }
.rdps-contribution { color: var(--rdps); }
.rdps-footer { display: flex; align-items: center; gap: 18px; flex: none; min-height: 20px; padding: 1px 5px; background: #050505; color: #eee; font-variant-numeric: tabular-nums; }
.rdps-footer strong { color: #ffff80; font-weight: 400; }
.rdps-estimate-note { margin-left: auto; color: #aaa; font-size: 11px; }
.metric-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.metric-dps { color: var(--dps); }
.metric-rdps { color: var(--rdps); }
td.hastip > .metric-value { text-decoration: none; }
.tag { display: inline-block; font-size: 10px; color: var(--faint); border: 1px solid var(--faint); border-radius: 3px; padding: 0 3px; margin-left: 4px; }
tr.reconstructed, .reconstructed-cell { opacity: .72; }

.notes { color: var(--faint); font-size: 12px; margin: 6px 0 0; padding-left: 18px; }
.notes li { margin: 2px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; font-size: 12px; }
.kv dt { color: var(--dim); } .kv dd { margin: 0; }
.ev-damage { color: #ffb4a1; } .ev-heal { color: #9be8a5; } .ev-buff { color: #a9d0ff; } .ev-taken { color: #f6c66f; }

/* character page */
.charhead { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: linear-gradient(#1a1a1e, #121215); border-bottom: 1px solid #000; }
.charhead .big { font-size: 24px; font-weight: 800; }
.bigparse { font-size: 34px; font-weight: 800; font-family: var(--mono); }
