
/* ---------- 焦点可见性增强 ---------- */

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible {
  outline-offset: -2px;
}

input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 240, 192, 0.2);
}

/* ---------- 按钮交互增强 ---------- */

button {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

/* ---------- 输入框增强 ---------- */

input, select {
  transition: all 0.2s ease;
}

input:focus, select:focus {
  transform: scale(1.005);
}

/* ---------- 卡片交互增强 ---------- */

.card {
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}

.card:hover {
  transform: translateX(2px);
  border-color: rgba(124, 240, 192, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.card:hover::before {
  opacity: 0.5;
}

/* ---------- 加载状态动画 ---------- */

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.loading {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ---------- 平滑滚动 ---------- */

html, .panel {
  scroll-behavior: smooth;
}
:root {
  --bg: #070a12;
  --panel: rgba(17, 24, 39, 0.82);
  --panel-solid: #111827;
  --border: rgba(120, 150, 200, 0.18);
  --text: #e8f1ff;  /* 提高可读性 */
  --muted: #95a5bd;  /* 增强次要文本对比度 */
  --accent: #7cf0c0;
  --accent-dim: rgba(124, 240, 192, 0.15);
  --high: #4fb3ff;
  --low: #ffb454;
  --null: #ff6b6b;  /* 警告色更醒目 */
  --flag: #ffd166;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Noto Sans SC", sans-serif;
  font-size: 14px;
  overflow: hidden;
}

body { display: flex; flex-direction: column; }

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 24, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(124, 240, 192, 0.08),
              0 4px 16px rgba(0, 0, 0, 0.3);
  flex: none;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { color: var(--accent); font-size: 20px; }
.brand b { font-size: 15px; letter-spacing: 0.08em; }
.brand i { color: var(--accent); font-style: normal; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: 0.04em; }

#status { color: var(--muted); font-size: 12px; text-align: right; }
#status b { color: var(--text); }
#status.error { color: var(--null); }

/* ---------- layout ---------- */

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 300px 1fr 360px;
  min-height: 0;
}

.panel {
  background: var(--panel);
  overflow-y: auto;
  padding: 14px;
  border-right: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.panel.right { border-right: none; border-left: 1px solid var(--border); }

.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: rgba(120, 150, 200, 0.25); border-radius: 4px; }

.block { margin-bottom: 18px; }
.block + .block { padding-top: 16px; border-top: 1px solid var(--border); }

h2 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- controls ---------- */

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.mode-tabs button {
  padding: 8px 6px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  transition: 0.15s;
}
.mode-tabs button:hover { color: var(--text); border-color: rgba(124, 240, 192, 0.4); }
.mode-tabs button.active {
  color: #04120d;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.field { margin-bottom: 10px; position: relative; }
.field > label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--muted);
}

input, select {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
input::placeholder { color: #55647c; }
select option { background: var(--panel-solid); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid2 .field { margin-bottom: 8px; }

.row { display: flex; gap: 8px; margin-top: 12px; }

button.primary, button.ghost {
  flex: 1;
  padding: 9px;
  font-size: 13px;
  font-family: inherit;
  border-radius: 7px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: 0.15s;
}
button.primary {
  background: var(--accent);
  color: #04120d;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(124, 240, 192, 0.2),
              0 4px 12px rgba(0, 0, 0, 0.4);
}
button.primary:hover { 
  filter: brightness(1.1); 
  box-shadow: 0 0 28px rgba(124, 240, 192, 0.35),
              0 6px 16px rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}
button.primary:active {
  transform: translateY(0);
}
button.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
button.ghost:hover { color: var(--text); border-color: rgba(124, 240, 192, 0.4); }

.check {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}
.check input { width: auto; accent-color: var(--accent); }

.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.seg button {
  padding: 6px 2px;
  font-size: 11px;
  font-family: inherit;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.seg button.active { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }

.hint { margin: 8px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
.muted { color: var(--muted); font-size: 12px; }

/* ---------- map ---------- */

#stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #101a2e 0%, #070a12 70%);
}

#map { display: block; width: 100%; height: 100%; }

.map-controls {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(10, 16, 28, 0.88);
  border: 1px solid var(--border);
  border-radius: 8px;
  backdrop-filter: blur(6px);
}
.map-controls button {
  width: 30px;
  height: 30px;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.map-controls button:hover { background: rgba(124, 240, 192, 0.15); color: var(--accent); }
#zoom-label {
  min-width: 52px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#tooltip {
  position: absolute;
  pointer-events: none;
  padding: 7px 10px;
  max-width: 180px;
  background: rgba(8, 14, 24, 0.96);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  z-index: 5;
}
#tooltip b { color: var(--text); }

/* ---------- results ---------- */

.card {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.card.warn { border-color: rgba(255, 93, 93, 0.4); color: #ffb3b3; }
.card.day { border-left: 2px solid var(--accent); }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.card-head b { font-size: 13px; }
.card .muted + .muted { margin-top: 2px; }
.card .row { margin-top: 8px; }

button.mini {
  flex: 1;
  padding: 5px 4px;
  font-size: 11px;
  font-family: inherit;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
button.mini:hover { color: var(--accent); border-color: var(--accent); }

.hops { margin-top: 8px; }
.hop {
  display: grid;
  grid-template-columns: 22px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.hop:hover { background: rgba(124, 240, 192, 0.08); }
.hop .idx {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 50%;
}
.hop .names { min-width: 0; }
.hop .names b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hop .names small { color: var(--muted); font-size: 10px; }
.hop .dist { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.hop .sec { font-size: 11px; font-variant-numeric: tabular-nums; }

.high { color: var(--high); }
.low { color: var(--low); }
.null { color: var(--null); }

.days { margin-top: 8px; }

/* ---------- suggest ---------- */

.suggest-wrap { position: relative; }
.suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: 3px;
  max-height: 260px;
  overflow-y: auto;
  background: #0d1523;
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.suggest button {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 12px;
  text-align: left;
  color: var(--text);
  background: none;
  border: none;
  border-bottom: 1px solid rgba(120, 150, 200, 0.09);
  cursor: pointer;
}
.suggest button:last-child { border-bottom: none; }
.suggest button:hover { background: rgba(124, 240, 192, 0.1); }
.suggest small { color: var(--muted); font-size: 10px; }

/* ---------- toast ---------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  padding: 9px 16px;
  font-size: 12px;
  color: #04120d;
  background: var(--accent);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 50;
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .layout { grid-template-columns: 270px 1fr 320px; }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 62vh auto;
  }
  .panel { border-right: none; border-bottom: 1px solid var(--border); }
  .panel.right { border-left: none; }
}

/* ---------- move type badges (EVEMTK-style) ---------- */

.segs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.seg-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.4;
  border-radius: 5px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.seg-badge small { font-size: 10px; opacity: 0.75; }
.seg-badge.small { padding: 1px 6px; font-size: 10px; }

.seg-badge.is-dirt {
  color: #f5b95d;
  background: rgba(245, 185, 93, 0.12);
  border-color: rgba(245, 185, 93, 0.35);
}
.seg-badge.is-standard {
  color: #77e6e0;
  background: rgba(119, 230, 224, 0.12);
  border-color: rgba(119, 230, 224, 0.35);
}
.seg-badge.is-induction {
  color: #4fc3f7;
  background: rgba(79, 195, 247, 0.12);
  border-color: rgba(79, 195, 247, 0.35);
}
.seg-badge.is-lowsec-induction {
  color: #ffb454;
  background: rgba(255, 180, 84, 0.12);
  border-color: rgba(255, 180, 84, 0.35);
}
.seg-badge.is-nullsec-induction {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.4);
}

.hop { grid-template-columns: 22px 1fr auto auto auto; }

/* ---------- compass ---------- */

.compass {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgba(10, 16, 28, 0.8);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  pointer-events: none;
}
.compass b { color: var(--accent); line-height: 1; }
.compass i {
  position: absolute;
  bottom: 5px;
  width: 1px;
  height: 7px;
  background: rgba(124, 240, 192, 0.5);
}

/* ---------- security pass-through ---------- */

.pass-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.pass {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 4px;
  font-size: 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: 0.15s;
}
.pass input { display: none; }
.pass::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
}
.pass.high { color: var(--high); }
.pass.low { color: var(--low); }
.pass.null { color: var(--null); }

.pass:has(input:checked) {
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-weight: 500;
}
.pass.high:has(input:checked) { color: var(--high); background: rgba(79, 179, 255, 0.14); }
.pass.low:has(input:checked) { color: var(--low); background: rgba(255, 180, 84, 0.14); }
.pass.null:has(input:checked) { color: var(--null); background: rgba(255, 93, 93, 0.14); }
.pass:has(input:checked)::before { opacity: 1; }
.pass:has(input:not(:checked)) { opacity: 0.45; }


.pass.locked {
  cursor: not-allowed;
  opacity: 0.3;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.pass.locked::before { display: none; }

/* search match counter inside the filter label */
.count {
  margin-left: 6px;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0;
  text-transform: none;
}

/* straight-line distance readout under the route inputs */
.direct {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 10px;
  padding: 7px 11px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(120, 160, 255, 0.08);
  border: 1px dashed rgba(150, 180, 255, 0.32);
  border-radius: 7px;
}
.direct b {
  font-size: 13px;
  color: #a8c4ff;
  font-variant-numeric: tabular-nums;
}

.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg button[data-sov="npc"].active { color: #ff9d7a; border-color: #ff9d7a; background: rgba(255,157,122,0.12); }
.seg button[data-sov="claim"].active { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.hint-inline { font-size: 9px; color: #5f6f88; letter-spacing: 0; text-transform: none; font-weight: 400; }