:root {
  color-scheme: dark;
  --bg: #0b1119;
  --rail: #111927;
  --side: #182130;
  --panel: #202c3d;
  --panel-soft: #26364b;
  --panel-deep: #141d2b;
  --line: #35465b;
  --line-soft: rgba(115, 137, 166, 0.24);
  --text: #eef5ff;
  --muted: #94a5ba;
  --blue: #44a2ff;
  --cyan: #4ad7c8;
  --amber: #ffc34d;
  --green: #52d884;
  --violet: #b47cff;
  --rose: #ee6f9f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(74, 215, 200, 0.08), transparent 360px),
    linear-gradient(90deg, rgba(11, 17, 25, 0.92), rgba(11, 17, 25, 0.96)),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 64px 232px minmax(0, 1fr);
}

.game-rail {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  height: 100vh;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-right: 1px solid var(--line-soft);
  background: #101827;
}

.game-mark {
  appearance: none;
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-weight: 850;
  font-size: 12px;
  line-height: 0;
  letter-spacing: 0;
  opacity: 0.62;
  transition: opacity 150ms ease, box-shadow 150ms ease;
}

.game-mark.active {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--blue), 0 0 0 3px #101827;
}

.game-mark:hover {
  opacity: 1;
}

.game-mark img {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  object-fit: cover;
}

.game-mark img[src$="endfield.svg"] {
  background: #f4f6f3;
  padding: 4px;
}

.game-mark[data-fallback]::after {
  content: attr(data-fallback);
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(68, 162, 255, 0.22), rgba(238, 111, 159, 0.18));
}

.side {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 100vh;
  padding: 24px 16px;
  border-right: 1px solid var(--line-soft);
  background: rgba(24, 33, 48, 0.92);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-logo {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #e8f6ff;
  color: #101827;
  font-weight: 900;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.side-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 6px 0;
  padding: 0 14px;
  border-radius: 8px;
  color: #b9c7d8;
  font-size: 16px;
}

.side-link.active,
.side-link:hover {
  background: rgba(68, 162, 255, 0.18);
  color: #65b4ff;
}

.side-foot {
  position: absolute;
  bottom: 22px;
  left: 16px;
  right: 16px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.main {
  min-width: 0;
  padding: 26px 28px 48px;
}

.topbar,
.control-strip,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  min-height: 108px;
  border-bottom: 1px solid var(--line-soft);
}

.kicker {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 42px);
  letter-spacing: 0;
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.top-actions,
.panel-tools,
.file-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost-button,
.tool-button,
.icon-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: #dce8f6;
  font-weight: 750;
  white-space: nowrap;
}

.ghost-button {
  padding: 0 14px;
}

.tool-button {
  padding: 0 13px;
}

.tool-button.disabled {
  pointer-events: none;
  opacity: 0.42;
}

.ghost-button:hover,
.tool-button:hover,
.icon-button:hover {
  border-color: rgba(105, 181, 255, 0.75);
  background: #304158;
}

.icon-button.mirror-link {
  border-color: rgba(82, 216, 132, 0.4);
  color: #a6f1c0;
}

.icon-button.stale-link {
  border-color: rgba(255, 195, 77, 0.3);
  color: #dfbd76;
  opacity: 0.72;
}

.control-strip {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 74px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11, 17, 25, 0.86);
  backdrop-filter: blur(18px);
}

.version-picker {
  position: relative;
  display: grid;
  gap: 6px;
}

.version-picker label,
.search-box span {
  color: var(--muted);
  font-size: 13px;
}

.select-button {
  display: inline-flex;
  min-width: 116px;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1e2b3d;
  color: var(--text);
  padding: 0 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.chevron {
  color: var(--muted);
}

.version-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 420px;
  max-height: min(520px, 64vh);
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #1b2636;
  box-shadow: var(--shadow);
}

.version-group + .version-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.version-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 8px 8px;
}

.version-group-head strong {
  color: #f2f7ff;
  font-size: 14px;
}

.version-group-head span {
  color: var(--muted);
  font-size: 12px;
}

.version-row {
  display: grid;
  width: 100%;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.version-row:hover,
.version-row.selected {
  background: rgba(68, 162, 255, 0.15);
}

.version-row.disabled {
  color: #607185;
}

.version-number {
  color: #95c9ff;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 17px;
  font-weight: 850;
}

.caps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cap,
.pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 850;
}

.cap.blue,
.pill {
  background: rgba(68, 162, 255, 0.18);
  color: #74bdff;
}

.cap.amber {
  background: rgba(255, 195, 77, 0.18);
  color: var(--amber);
}

.cap.violet {
  background: rgba(180, 124, 255, 0.18);
  color: #d3b6ff;
}

.cap.green {
  background: rgba(82, 216, 132, 0.18);
  color: #7df0a7;
}

.cap.slate {
  background: rgba(148, 165, 186, 0.14);
  color: #bdcad8;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

.mode-tabs {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-deep);
}

.mode-tab {
  min-height: 40px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0 16px;
  font-weight: 800;
}

.mode-tab:last-child {
  border-right: 0;
}

.mode-tab.active {
  background: rgba(68, 162, 255, 0.2);
  color: #8dccff;
}

.search-box {
  display: grid;
  min-width: 280px;
  gap: 6px;
}

.search-box input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1724;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--blue);
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.stat {
  min-height: 76px;
  border: 1px solid rgba(52, 70, 91, 0.88);
  border-radius: 8px;
  background: rgba(26, 37, 55, 0.82);
  padding: 13px 14px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #9fd0ff;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics {
  margin: 0 0 18px;
  border: 1px solid rgba(52, 70, 91, 0.82);
  border-radius: 8px;
  background: rgba(20, 29, 43, 0.78);
  padding: 14px;
}

.analytics-head,
.rank-head,
.trend-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(78, 96, 121, 0.76);
  border-radius: 999px;
  color: #c9d7ea;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.legend::before {
  content: "";
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.legend.full::before {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.legend.delta::before {
  background: var(--amber);
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.95fr);
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}

.trend-panel,
.rank-panel {
  min-width: 0;
  border: 1px solid rgba(52, 70, 91, 0.68);
  border-radius: 8px;
  background: rgba(26, 37, 55, 0.78);
}

.trend-panel {
  padding: 10px 12px 12px;
}

.trend-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.trend-chart text {
  stroke: none;
}

.chart-grid {
  stroke: rgba(148, 165, 186, 0.2);
  stroke-width: 1;
}

.chart-axis,
.chart-x-tick {
  stroke: rgba(201, 215, 234, 0.42);
  stroke-width: 1;
}

.chart-zero {
  stroke: rgba(255, 195, 77, 0.3);
  stroke-dasharray: 5 7;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-line.full {
  stroke: url(#fullLineGlow);
}

.chart-line.delta {
  stroke: var(--amber);
  stroke-width: 2;
  opacity: 0.78;
}

.chart-dot {
  fill: #9fd0ff;
  stroke: #0f1724;
  stroke-width: 2;
}

.chart-label {
  fill: #eef5ff;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 14px;
  font-weight: 650;
}

.chart-y-label,
.chart-axis-title {
  fill: #d3dfef;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  font-weight: 600;
}

.chart-y-label.right {
  fill: #f2cc60;
}

.chart-axis-title {
  fill: #dbeafe;
  font-size: 14px;
  font-weight: 700;
}

.chart-axis-title.right {
  fill: #ffd981;
}

.trend-meta {
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  padding-top: 10px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

.trend-meta strong {
  color: var(--green);
}

.rank-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
}

.rank-head strong,
.rank-head span,
.rank-head small {
  display: block;
}

.rank-head strong {
  color: #f2f7ff;
}

.rank-head span,
.rank-head small {
  color: var(--muted);
  font-size: 12px;
}

.rank-head small {
  color: #f2cc60;
  text-align: right;
}

.rank-list {
  display: grid;
  gap: 8px;
}

.rank-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(78, 96, 121, 0.58);
  border-radius: 8px;
  background: rgba(15, 23, 36, 0.5);
  padding: 10px;
}

.rank-index {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  background: rgba(68, 162, 255, 0.16);
  color: #8dccff;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-weight: 900;
}

.rank-body {
  min-width: 0;
}

.rank-body strong,
.rank-body span,
.rank-body em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-body strong {
  color: #edf6ff;
  font-family: Consolas, "SFMono-Regular", monospace;
}

.rank-body span {
  color: #9fb0c5;
  font-size: 12px;
}

.rank-body em {
  color: #f2cc60;
  font-size: 12px;
  font-style: normal;
}

.rank-loading {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.notice {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 18px 0;
  border: 1px solid rgba(255, 195, 77, 0.28);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: rgba(255, 195, 77, 0.1);
  padding: 12px 14px;
  color: #d6c28c;
}

.notice-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.notice strong {
  color: var(--amber);
  white-space: nowrap;
}

.source-links {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.source-link {
  flex: 0 0 auto;
  max-width: min(420px, 42vw);
  overflow: hidden;
  border: 1px solid rgba(255, 195, 77, 0.34);
  border-radius: 8px;
  background: rgba(255, 195, 77, 0.08);
  color: #ffe0a0;
  padding: 7px 10px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-link:hover {
  border-color: rgba(255, 195, 77, 0.72);
  background: rgba(255, 195, 77, 0.16);
}

.file-panel,
.commands {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(26, 37, 55, 0.76);
}

.panel-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.file-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.chunk-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}

.chunk-summary div {
  min-height: 70px;
  border: 1px solid rgba(52, 70, 91, 0.76);
  border-radius: 8px;
  background: rgba(15, 23, 36, 0.72);
  padding: 11px 12px;
}

.chunk-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.chunk-summary strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #9be7d8;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 18px;
  align-items: end;
  margin-bottom: 4px;
  border: 1px solid rgba(52, 70, 91, 0.76);
  border-radius: 8px;
  background: rgba(15, 23, 36, 0.72);
  padding: 14px;
}

.compare-toolbar span,
.compare-toolbar p {
  color: var(--muted);
  font-size: 12px;
}

.compare-toolbar strong {
  display: block;
  margin-top: 4px;
  color: #9be7d8;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 18px;
}

.compare-toolbar label {
  display: grid;
  min-width: 170px;
  gap: 6px;
}

.compare-toolbar select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1724;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-weight: 800;
}

.compare-toolbar p {
  grid-column: 1 / -1;
  margin: 0;
}

.compare-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.compare-stat {
  min-height: 70px;
  border: 1px solid rgba(52, 70, 91, 0.76);
  border-radius: 8px;
  background: rgba(15, 23, 36, 0.72);
  padding: 11px 12px;
}

.compare-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.compare-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.compare-stat small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-stat.green strong {
  color: var(--green);
}

.compare-stat.rose strong {
  color: var(--rose);
}

.compare-stat.violet strong {
  color: var(--violet);
}

.compare-stat.amber strong {
  color: var(--amber);
}

.compare-section {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.compare-section-head {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  color: #dce8f6;
}

.compare-section-head span {
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
}

.diff-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 2px;
  border: 1px solid rgba(52, 70, 91, 0.68);
  border-radius: 8px;
  background: rgba(15, 23, 36, 0.52);
  padding: 10px;
}

.diff-filter button {
  min-height: 34px;
  border: 1px solid rgba(78, 96, 121, 0.76);
  border-radius: 8px;
  background: rgba(31, 43, 61, 0.84);
  color: #c9d7ea;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.diff-filter button:hover,
.diff-filter button.active {
  border-color: rgba(96, 165, 250, 0.84);
  background: rgba(39, 68, 108, 0.92);
  color: #f7fbff;
}

.diff-table {
  display: grid;
  gap: 8px;
}

.diff-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  overflow: hidden;
  border: 1px solid rgba(78, 96, 121, 0.58);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 11px 14px 11px 11px;
}

.diff-added {
  border-left-color: #2ea043;
  background: rgba(46, 160, 67, 0.16);
}

.diff-removed {
  border-left-color: #f85149;
  background: rgba(248, 81, 73, 0.16);
}

.diff-modified {
  border-left-color: #bb8009;
  background: rgba(187, 128, 9, 0.16);
}

.diff-marker {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: rgba(9, 14, 22, 0.44);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 18px;
  font-weight: 900;
}

.diff-added .diff-marker {
  color: #7ee787;
}

.diff-removed .diff-marker {
  color: #ff938a;
}

.diff-modified .diff-marker {
  color: #f2cc60;
}

.diff-body {
  min-width: 0;
}

.diff-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.diff-title strong {
  overflow: hidden;
  color: #f2f7ff;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diff-title span {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

.diff-path {
  overflow: hidden;
  margin-top: 3px;
  color: #93a4ba;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diff-change {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: #c7d3e4;
  font-size: 12px;
}

.diff-change code {
  max-width: min(560px, 48vw);
  overflow: hidden;
  border-radius: 5px;
  background: rgba(7, 12, 20, 0.38);
  color: #dbeafe;
  padding: 2px 5px;
  font-family: Consolas, "SFMono-Regular", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diff-change em {
  color: #f2cc60;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-style: normal;
  font-weight: 800;
}

.diff-change.muted {
  color: #77869a;
}

.diff-actions {
  display: flex;
  justify-content: flex-end;
}

.file-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  border: 1px solid rgba(78, 96, 121, 0.72);
  border-radius: 8px;
  background: rgba(31, 43, 61, 0.94);
  padding: 12px 16px;
}

.file-card:hover {
  border-color: rgba(96, 165, 250, 0.82);
  background: #233249;
}

.file-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--blue);
}

.file-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.file-title strong {
  min-width: 0;
  overflow: hidden;
  color: #f3f8ff;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.count {
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
  color: #8798ab;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
}

.file-path {
  margin-top: 2px;
  overflow: hidden;
  color: #75869a;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  min-width: 108px;
  padding: 0 12px;
}

.empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
}

.empty.compact {
  min-height: 64px;
}

.commands {
  margin-top: 18px;
  padding: 18px 20px 20px;
}

.commands pre {
  margin: 14px 0 0;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0f1724;
  padding: 14px;
}

.commands code {
  color: #9be7d8;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 14px;
  white-space: pre;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  transform: translateY(12px);
  border: 1px solid rgba(82, 216, 132, 0.42);
  border-radius: 8px;
  background: #10241d;
  color: #96f2b7;
  opacity: 0;
  padding: 10px 14px;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) {
  .app {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .side {
    display: none;
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chunk-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .compare-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app {
    grid-template-columns: 1fr;
  }

  .game-rail {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    width: 100%;
    height: 58px;
    flex-direction: row;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 9px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .main {
    padding: 18px 14px 34px;
  }

  .topbar,
  .control-strip,
  .panel-head,
  .notice {
    align-items: stretch;
    flex-direction: column;
  }

  .notice-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .source-link {
    width: 100%;
    max-width: none;
  }

  .source-links {
    width: 100%;
    justify-content: stretch;
  }

  .control-strip {
    position: static;
    padding-bottom: 14px;
  }

  .version-menu {
    width: min(420px, calc(100vw - 28px));
  }

  .mode-tabs {
    width: 100%;
  }

  .mode-tab {
    flex: 1;
    padding: 0 8px;
  }

  .search-box {
    min-width: 0;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .chunk-summary {
    grid-template-columns: 1fr;
  }

  .analytics-head,
  .trend-meta,
  .rank-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .rank-head small {
    text-align: left;
  }

  .rank-row {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
  }

  .rank-row .icon-button {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .compare-toolbar,
  .compare-summary {
    grid-template-columns: 1fr;
  }

  .diff-row {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
  }

  .diff-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .diff-change code {
    max-width: 100%;
  }

  .file-card {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .file-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .panel-tools {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}
