/* Copyright © 2025 彩事通. All rights reserved. */
:root {
  color-scheme: light;
  --bg: #f1f4ed;
  --bg-glow: #e5ebdf;
  --surface: #fffdf7;
  --surface-raised: #fffefa;
  --surface-2: #f6f8f2;
  --surface-3: #edf2e9;
  --text: #14211c;
  --muted: #64766e;
  --faint: #8b9b93;
  --line: #dbe4da;
  --line-strong: #c6d3c7;
  --lime: #a9d83d;
  --lime-soft: rgba(169, 216, 61, 0.14);
  --mint: #159d77;
  --mint-soft: rgba(21, 157, 119, 0.10);
  --coral: #e4644f;
  --coral-soft: rgba(228, 100, 79, 0.10);
  --cyan: #1f8fc4;
  --cyan-soft: rgba(31, 143, 196, 0.10);
  --gold: #c88b10;
  --danger: #c53f37;
  --shadow: 0 14px 32px rgba(33, 55, 44, 0.065), 0 3px 10px rgba(33, 55, 44, 0.035);
  --shadow-soft: 0 18px 46px rgba(33, 55, 44, 0.07), 0 2px 8px rgba(33, 55, 44, 0.035);
  --shadow-hover: 0 22px 54px rgba(33, 55, 44, 0.10), 0 4px 12px rgba(33, 55, 44, 0.045);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --tile-1: rgba(127, 177, 86, 0.14);
  --tile-2: rgba(54, 160, 128, 0.11);
  --tile-3: rgba(62, 139, 190, 0.10);
  --tile-4: rgba(212, 102, 81, 0.09);
  --tile-5: rgba(194, 151, 46, 0.11);
  --tile-6: rgba(151, 103, 171, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  color: var(--text);
  background:
    radial-gradient(circle at 76% 4%, var(--bg-glow) 0, transparent 32rem),
    radial-gradient(circle at 20% 52%, rgba(21, 157, 119, 0.04) 0, transparent 28rem),
    var(--bg);
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in srgb, var(--lime) 36%, transparent);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--line-strong) 78%, transparent) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line-strong) 84%, transparent);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--mint) 48%, var(--line-strong));
  background-clip: padding-box;
}

.app-shell {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 24px 12px 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(16px);
  z-index: 5;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 46px;
  place-items: center;
  background: var(--lime);
  color: #101a13;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -1px;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(10, 30, 20, 0.24);
  clip-path: inherit;
}

.rail-nav {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
}

.rail-link {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}

.rail-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.rail-link.active {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--lime);
}

.rail-glyph {
  position: relative;
  width: 17px;
  height: 17px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
}

.rail-glyph::before,
.rail-glyph::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.rail-glyph::before {
  width: 1px;
  height: 11px;
  left: 5px;
  top: 2px;
}

.rail-glyph::after {
  width: 7px;
  height: 1px;
  left: 5px;
  bottom: 3px;
}

.rail-link[data-nav="metrics"] .rail-glyph {
  border-radius: 4px;
}

.rail-link[data-nav="metrics"] .rail-glyph::before {
  width: 2px;
  height: 4px;
  left: 3.5px;
  top: auto;
  bottom: 4px;
  border-radius: 1px 1px 0 0;
  box-shadow: 3.5px -2px 0 currentColor, 7px -4px 0 currentColor;
}

.rail-link[data-nav="metrics"] .rail-glyph::after {
  width: 10px;
  height: 1px;
  left: 2.5px;
  bottom: 3px;
}

.rail-link[data-nav="guide"] .rail-glyph {
  transform: none;
  border-radius: 4px;
}

.rail-link[data-nav="guide"] .rail-glyph::before,
.rail-link[data-nav="guide"] .rail-glyph::after {
  display: none;
}

.rail-guide-symbol {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: currentColor;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.workspace {
  width: 100%;
  min-width: 0;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 34px 32px;
}

.topbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breadcrumb strong {
  color: var(--text);
  font-weight: 600;
}

.cloud-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.cloud-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px var(--mint-soft);
}

.date-label {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.top-action,
.text-action,
.primary-action,
.ghost-action,
.sample-action,
.icon-action {
  border: 0;
  cursor: pointer;
}

.top-action {
  --license-accent: #b6df50;
  --license-accent-strong: #118565;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--lime) 28%, var(--line));
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--lime-soft) 82%, var(--surface)),
    var(--surface)
  );
  color: var(--text);
  box-shadow: 0 5px 14px rgba(33, 55, 44, 0.06);
  font-size: 12px;
  font-weight: 500;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.top-action-help-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--lime) 26%, var(--surface));
  color: var(--mint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.top-action::after {
  content: none !important;
  display: none !important;
}

.top-action:hover {
  border-color: color-mix(in srgb, var(--lime) 58%, var(--line));
  box-shadow: 0 8px 20px rgba(33, 55, 44, 0.10);
  transform: translateY(-1px);
}

.top-action:active {
  transform: translateY(0);
}

.hive-pill-label {
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 18px;
  white-space: nowrap;
}

.top-action-label {
  display: block;
  flex: 0 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 48px;
  align-items: end;
  padding: 58px 0 42px;
  min-width: 0;
}

.hero > div {
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
  color: var(--mint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
  font-size: clamp(38px, 5vw, 66px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.03;
}

h1 span {
  display: block;
  color: var(--lime);
}

.hero-copy {
  max-width: 620px;
  margin: 21px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.hero-readout {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-self: stretch;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 96% 4%, color-mix(in srgb, var(--lime) 12%, transparent), transparent 10rem),
    linear-gradient(145deg, var(--surface-raised), color-mix(in srgb, var(--surface-2) 88%, var(--surface)));
  box-shadow: var(--shadow-soft);
  min-width: 0;
  isolation: isolate;
}

.hero-readout::after {
  content: "";
  position: absolute;
  top: -44px;
  right: -44px;
  z-index: 0;
  width: 132px;
  height: 132px;
  border: 1px solid color-mix(in srgb, var(--lime) 18%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 18px color-mix(in srgb, var(--lime) 4%, transparent),
    0 0 0 36px color-mix(in srgb, var(--lime) 2.5%, transparent);
  pointer-events: none;
}

.hero-readout > * {
  position: relative;
  z-index: 1;
}

.hero-readout > .readout-item {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.hero-readout::before {
  display: none;
}

.hero-readout-head {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 6px;
}

.hero-readout-head strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 650;
}

.readout-eyebrow {
  color: var(--faint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.readout-live {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--mint);
  font-size: 10px;
}

.readout-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 13%, transparent);
}

.readout-label {
  display: block;
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.readout-value {
  display: flex;
  min-height: 30px;
  align-items: baseline;
  gap: 8px;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.readout-value small {
  color: var(--muted);
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
}

.readout-status {
  border-color: color-mix(in srgb, var(--lime) 36%, var(--line)) !important;
  background:
    linear-gradient(135deg, var(--lime-soft), color-mix(in srgb, var(--surface) 96%, transparent)) !important;
}

.readout-status .readout-value {
  color: var(--text);
  font-size: 19px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(390px, 25vw, 440px);
  gap: 18px;
  align-items: stretch;
  min-width: 0;
}

.map-panel,
.control-panel,
.locations-panel,
.trend-panel,
.method-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-raised) 98%, transparent), color-mix(in srgb, var(--surface) 96%, transparent));
  box-shadow: var(--shadow-soft);
}

.map-panel {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.panel-head {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-raised) 78%, transparent), transparent);
}

.panel-title-row {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.step-index {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 40px;
  place-items: center;
  border: 0;
  background: var(--lime);
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  color: #101a13;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -1px;
  isolation: isolate;
  filter: drop-shadow(0 5px 8px color-mix(in srgb, var(--lime) 24%, transparent));
}

.step-index::before {
  display: none;
}

.panel-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.panel-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.chart-badge {
  display: inline-flex;
  max-width: min(240px, 34vw);
  min-height: 31px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: color-mix(in srgb, var(--surface-raised) 82%, transparent);
}

.chart-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
}

.map-toolbar {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--surface-2) 82%, transparent), color-mix(in srgb, var(--surface-raised) 76%, transparent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.legend-dot.anchor {
  background: var(--lime);
  box-shadow: 0 0 0 3px var(--lime-soft);
}

.legend-dot.all {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--gold);
}

.legend-dot.ring {
  background: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.legend-dot.route {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 211, 110, 0.12);
}

.legend-dot.second {
  background: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.icon-action {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.icon-action:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.chart-picker {
  position: relative;
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  padding-left: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--faint);
  font-size: 9px;
  white-space: nowrap;
}

.chart-select {
  position: relative;
  flex: 1;
  min-width: 0;
}

.chart-select-button {
  display: flex;
  width: min(170px, 32vw);
  height: 32px;
  max-width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 9px;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
  text-align: left;
}

.chart-select-button:hover {
  background: var(--surface-3);
}

.chart-select-button > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-select-arrow {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  transition: transform 160ms ease;
}

.chart-select-button[aria-expanded="true"] .chart-select-arrow {
  transform: rotate(180deg);
}

.chart-select-button:focus-visible {
  outline-offset: -2px;
}

.chart-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: max(100%, 220px);
  max-height: 280px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.chart-select-menu[hidden] {
  display: none;
}

.chart-select-option {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.chart-select-option:hover,
.chart-select-option:focus-visible {
  background: var(--surface-2);
}

.chart-select-option[aria-selected="true"] {
  background: var(--lime-soft);
  color: var(--lime);
}

.chart-select-option-main {
  min-width: 0;
}

.chart-select-option-main strong,
.chart-select-option-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-select-option-main strong {
  font-size: 12px;
  font-weight: 600;
}

.chart-select-option-main small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
}

.chart-select-check {
  flex: 0 0 auto;
  color: currentColor;
  font-size: 12px;
}

.draw-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 18px 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.draw-toolbar[hidden] {
  display: none;
}

.draw-tool-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-right: 8px;
  border-right: 1px solid var(--line);
}

.draw-tool-group:last-child {
  padding-right: 0;
  border-right: 0;
}

.draw-tool-button,
.draw-action-button,
.draw-color-button,
.draw-width-button {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.draw-tool-button {
  font-size: 16px;
}

.draw-tool-button:hover,
.draw-action-button:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.draw-tool-button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--coral) 36%, var(--line));
  background: var(--coral);
  color: #24110d;
}

.draw-color-button span {
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--draw-swatch);
  box-shadow: 0 0 0 1px var(--line);
}

.draw-color-button[aria-pressed="true"] {
  border-color: var(--text);
}

.draw-width-button span {
  display: block;
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 50%;
  background: currentColor;
}

.draw-width-button[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.draw-actions {
  margin-left: auto;
}

.draw-action-button {
  font-size: 17px;
}

.draw-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

.map-scroll {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 22px 16px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: center;
}

.map-stage {
  position: relative;
  width: min(100%, 720px);
  min-width: 0;
  margin-inline: auto;
  aspect-ratio: 1060 / 864;
}

.map-scroll::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 35%, rgba(103, 227, 179, 0.08), transparent 38%),
    linear-gradient(180deg, transparent 80%, color-mix(in srgb, var(--bg) 32%, transparent));
}

#hiveMap,
.annotation-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#hiveMap {
  z-index: 1;
}

.annotation-layer {
  z-index: 3;
  overflow: visible;
  pointer-events: none;
  touch-action: none;
}

.annotation-layer.is-active {
  pointer-events: auto;
  cursor: crosshair;
}

.annotation-layer.is-eraser {
  cursor: not-allowed;
}

.draw-shape {
  pointer-events: stroke;
  vector-effect: non-scaling-stroke;
}

.annotation-layer.is-eraser .draw-shape:hover {
  opacity: 0.45;
}

.draw-shape-text {
  pointer-events: all;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 4px;
  stroke-linejoin: round;
  font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 600;
}

.draw-text-input {
  position: absolute;
  z-index: 4;
  min-width: 150px;
  max-width: min(260px, calc(100% - 20px));
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--lime);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 16px;
}

.hive-cell {
  cursor: pointer;
}

.hive-cell polygon {
  fill: var(--cell-tone, var(--tile-1));
  stroke: color-mix(in srgb, var(--line-strong) 76%, transparent);
  stroke-width: 1;
  transition: fill 180ms ease, stroke 180ms ease, opacity 180ms ease;
}

.hive-cell:hover polygon {
  fill: color-mix(in srgb, var(--mint) 20%, var(--cell-tone, var(--surface-2)));
  stroke: var(--mint);
}

.hive-cell.is-empty {
  cursor: default;
}

.hive-cell.is-empty polygon {
  fill: color-mix(in srgb, var(--surface) 48%, transparent);
  stroke: color-mix(in srgb, var(--line) 78%, transparent);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.hive-cell.is-triple-cell polygon {
  fill: color-mix(in srgb, var(--gold) 10%, var(--cell-tone, var(--surface-2)));
  stroke: color-mix(in srgb, var(--gold) 72%, var(--line));
  stroke-width: 1.5;
}

.hive-cell.is-active-triple polygon {
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--gold) 28%, transparent));
}

.hive-cell.is-other-period-cell polygon {
  fill: color-mix(in srgb, var(--cyan) 12%, var(--cell-tone, var(--surface-2)));
  stroke: color-mix(in srgb, var(--cyan) 72%, var(--line));
  stroke-width: 1.5;
}

.hive-cell.is-ring-0 polygon,
.hive-cell.is-ring-1 polygon,
.hive-cell.is-ring-2 polygon {
  fill: color-mix(in srgb, var(--ring-color) 18%, var(--surface));
  stroke: color-mix(in srgb, var(--ring-color) 58%, var(--line));
  stroke-width: 1.2;
}

.hive-cell.is-cross polygon {
  fill: color-mix(in srgb, var(--gold) 20%, var(--surface));
  stroke: var(--gold);
  stroke-width: 1.4;
}

.hive-cell.is-anchor polygon {
  fill: color-mix(in srgb, var(--anchor-color) 72%, var(--surface));
  stroke: var(--anchor-color);
  stroke-width: 2.2;
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--anchor-color) 42%, transparent));
}

.hive-cell.is-selected-pattern polygon {
  stroke: var(--gold);
  stroke-width: 2.6;
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--gold) 44%, transparent));
}

.hive-cell.is-selected-anchor polygon {
  fill: color-mix(in srgb, var(--selected-anchor-color) 72%, var(--surface));
  stroke: var(--selected-anchor-color);
  stroke-width: 2.5;
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--selected-anchor-color) 38%, transparent));
}

.hive-cell.is-active-candidate polygon {
  stroke: #116b50;
  stroke-width: 3.6;
  filter: drop-shadow(0 0 8px rgba(17, 107, 80, 0.34));
}

.hive-text {
  fill: var(--text);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 20px;
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.hive-text.is-anchor {
  fill: #0b1a13;
  font-weight: 700;
}

.hive-text.is-selected-anchor {
  fill: #0b1a13;
  font-weight: 700;
}

.hive-text.is-active-candidate {
  fill: #092f24;
  font-weight: 800;
}

.anchor-pin {
  fill: var(--anchor-color);
  stroke: var(--surface);
  stroke-width: 2;
}

.triple-pin {
  fill: var(--gold);
  stroke: var(--surface);
  stroke-width: 2;
}

.second-triple-pin {
  fill: var(--cyan);
  stroke: var(--surface);
  stroke-width: 2;
}

.candidate-pin {
  fill: var(--surface);
  stroke: var(--lime);
  stroke-width: 2;
}

.route-line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.2;
  stroke-dasharray: 5 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
  filter: drop-shadow(0 0 4px rgba(255, 211, 110, 0.44));
}

.candidate-route-line {
  fill: none;
  stroke: #116b50;
  stroke-width: 3.4;
  stroke-dasharray: 3 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgba(17, 107, 80, 0.3));
}

.map-footer {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.map-footer-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.map-zoom-controls {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.map-zoom-button,
.map-zoom-level {
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
}

.map-zoom-button {
  width: 28px;
  font-size: 16px;
  line-height: 1;
}

.map-zoom-level {
  min-width: 44px;
  border-inline: 1px solid var(--line);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.map-zoom-button:hover:not(:disabled),
.map-zoom-level:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.map-zoom-button:disabled,
.map-zoom-level:disabled {
  cursor: default;
  opacity: 0.4;
}

.map-caption {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.map-caption::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--mint);
}

.map-distance {
  flex: 0 0 auto;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.side-stack {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  contain: none;
  overflow: visible;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.selected-anchor-pin {
  fill: #fff;
  stroke: var(--selected-anchor-color);
  stroke-width: 2.5;
  filter: drop-shadow(0 1px 3px rgba(23, 40, 31, 0.24));
}

.active-candidate-pin {
  fill: #116b50;
  stroke: #fff;
  stroke-width: 2;
}

.control-panel,
.locations-panel,
.candidates-panel {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.control-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 20px;
}

.side-stack > .control-panel {
  box-shadow: none;
}

.locations-panel {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 20px 22px 22px;
}

.locations-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 2px;
}

.control-head,
.candidate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}

.control-title,
.candidate-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.control-kicker,
.candidate-kicker {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.draw-field {
  margin-top: 14px;
}

.period-fields {
  --period-width-compensation: 0px;
  display: grid;
  width: calc(100% + var(--period-width-compensation));
  margin-right: calc(-1 * var(--period-width-compensation));
  gap: 10px;
  max-height: min(34vh, 260px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-gutter: stable;
}

.period-fields .draw-field {
  margin-top: 10px;
}

.period-fields .period-entry {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}

.period-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.period-entry-name {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.period-fields .period-input {
  width: 100%;
  min-height: 46px;
  padding: 0 45px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.26em;
}

.period-fields .period-input::placeholder {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.period-fields .draw-length {
  right: 11px;
}

.period-remove {
  min-height: 26px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
  font-size: 9px;
  cursor: pointer;
}

.period-remove:hover {
  border-color: color-mix(in srgb, var(--coral) 50%, var(--line));
  color: var(--coral);
}

.add-period-button {
  width: 100%;
  min-height: 35px;
  margin-top: 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.add-period-button:hover {
  border-color: var(--mint);
  color: var(--text);
}

.add-period-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
}

.sample-action {
  padding: 0;
  background: transparent;
  color: var(--mint);
  font-size: 11px;
}

.sample-action:hover {
  color: var(--lime);
}

.draw-input-wrap {
  position: relative;
}

#drawInput,
#previousDrawInput {
  width: 100%;
  min-height: 62px;
  padding: 0 58px 0 17px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.34em;
  font-variant-numeric: tabular-nums;
}

#drawInput::placeholder,
#previousDrawInput::placeholder {
  color: var(--faint);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.draw-length {
  position: absolute;
  right: 16px;
  top: 50%;
  color: var(--faint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 11px;
  transform: translateY(-50%);
}

.mode-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.form-message {
  display: none;
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--coral-soft);
  color: var(--danger);
  font-size: 11px;
  line-height: 1.55;
}

.form-message.show {
  display: block;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 13px;
}

.primary-action {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--lime) 86%, #e9ffb6), var(--lime));
  color: #101a13;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--lime) 22%, transparent);
  font-size: 13px;
  font-weight: 700;
  transition: filter 160ms ease, box-shadow 160ms ease, transform 160ms var(--ease-out);
}

.primary-action:hover {
  filter: brightness(1.035) saturate(1.04);
  box-shadow: 0 11px 24px color-mix(in srgb, var(--lime) 28%, transparent);
  transform: translateY(-1px);
}

.primary-action:active {
  box-shadow: 0 5px 14px color-mix(in srgb, var(--lime) 18%, transparent);
  transform: translateY(0);
}

.ghost-action {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.ghost-action:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

.section-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 12px;
  color: var(--faint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.section-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.anchor-list-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.anchor-list-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.anchor-list-toolbar .section-rule {
  flex: 1;
}

.anchor-list-actions > button {
  flex: 0 0 auto;
}

.anchor-mode-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.anchor-mode-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.anchor-mode-switch {
  position: relative;
  width: 64px;
  height: 32px;
  flex: 0 0 64px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f48670, #df6855);
  box-shadow:
    0 5px 12px rgba(223, 104, 85, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #fff;
  cursor: pointer;
  transition: background 180ms ease, box-shadow 180ms ease;
}

.anchor-mode-switch[aria-checked="true"] {
  background: linear-gradient(180deg, #7bd24d, #5cbb36);
  box-shadow:
    0 5px 14px rgba(92, 187, 54, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.anchor-mode-switch:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.anchor-mode-switch:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--mint) 42%, transparent);
  outline-offset: 3px;
}

.anchor-mode-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 2px 6px rgba(23, 40, 31, 0.2),
    inset 0 0 0 2px rgba(255, 255, 255, 0.8);
  transition: transform 180ms var(--ease-out);
}

.anchor-mode-switch[aria-checked="true"] .anchor-mode-thumb {
  transform: translateX(32px);
}

.anchor-mode-state {
  position: absolute;
  top: 50%;
  right: 7px;
  color: #fff;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  transform: translateY(-50%);
}

.anchor-mode-switch[aria-checked="true"] .anchor-mode-state {
  right: auto;
  left: 9px;
}

.anchor-list {
  display: grid;
  gap: 7px;
}

#anchorList {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: var(--line-strong) transparent;
}

.locations-panel #anchorList {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
  padding-right: 0;
}

.anchor-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms var(--ease-out);
}

.anchor-row:hover {
  border-color: var(--line-strong);
  box-shadow: 0 7px 18px rgba(33, 55, 44, 0.055);
  transform: translateY(-1px);
}

.anchor-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--swatch) 15%, transparent);
}

.anchor-name {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.anchor-digit {
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
}

.anchor-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anchor-location {
  color: var(--faint);
  font-size: 10px;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
}

.anchor-location strong {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

.triple-row {
  height: max-content;
  grid-template-columns: 10px minmax(0, 1fr);
  grid-template-areas:
    "swatch name"
    ". location";
  row-gap: 7px;
  align-items: start;
  padding: 10px;
}

.triple-row .anchor-swatch {
  grid-area: swatch;
  margin-top: 7px;
}

.triple-row .anchor-name {
  grid-area: name;
  display: block;
  min-width: 0;
}

.triple-row .anchor-label {
  display: block;
  overflow: visible;
  padding-top: 3px;
  line-height: 1.5;
  white-space: normal;
}

.triple-row .anchor-location {
  grid-area: location;
  min-width: 0;
  padding-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  text-align: left;
  white-space: normal;
}

.triple-number {
  display: block;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  line-height: 1.15;
}

.triple-row.is-current {
  border-color: color-mix(in srgb, var(--lime) 52%, var(--line));
  background: var(--lime-soft);
  box-shadow: inset 3px 0 0 var(--lime), 0 7px 18px color-mix(in srgb, var(--lime) 9%, transparent);
}

.candidates-panel {
  margin-top: 18px;
  padding: 20px 24px 18px;
}

.candidate-head {
  margin: 0 0 13px;
}

  .candidate-count {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 28px;
    min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--lime-soft);
  color: var(--lime);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 10px;
  white-space: nowrap;
}

.candidate-method {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px;
  margin: 0 0 14px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-raised) 72%, transparent), var(--surface-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.picker-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.picker-label {
  padding-top: 5px;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.core-picker,
.target-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.target-picker {
  justify-content: flex-end;
}

.target-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
}

.target-row .picker-label {
  padding-top: 6px;
  white-space: nowrap;
}

.target-row .target-picker {
  flex: 0 1 auto;
}

.core-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
}

.core-row .picker-label {
  padding-top: 6px;
  white-space: nowrap;
}

.core-row .core-picker {
  flex: 0 1 auto;
}

.core-chip,
.target-chip {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms var(--ease-out);
}

.core-chip {
  width: 28px;
  padding: 0;
}

.core-chip.is-auto {
  width: auto;
  padding: 0 8px;
}

.target-chip {
  padding: 0 11px;
}

.core-chip:hover,
.target-chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.core-chip[aria-pressed="true"],
.target-chip[aria-pressed="true"] {
  border-color: var(--lime);
  background: var(--lime-soft);
  color: var(--lime);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lime) 8%, transparent);
}

.common-radiation {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  background: var(--cyan-soft);
  color: var(--muted);
  font-size: 9px;
  grid-column: 1 / -1;
}

.common-radiation span {
  color: var(--cyan);
  white-space: nowrap;
}

.common-radiation strong {
  overflow: hidden;
  color: var(--text);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 500;
  text-align: right;
  text-overflow: ellipsis;
}

.candidate-copy-row {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.candidate-copy-row > span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.candidate-copy-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.candidate-copy-button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.candidate-copy-button:hover {
  border-color: var(--lime);
  color: var(--lime);
  background: color-mix(in srgb, var(--lime-soft) 54%, var(--surface));
  box-shadow: 0 5px 12px rgba(33, 55, 44, 0.05);
}

.candidate-copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.candidate-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 5px;
  max-height: 620px;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  padding: 2px 5px 2px 2px;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-gutter: stable;
}

.candidate-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 57px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms var(--ease-out);
}

.candidate-row:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: 0 7px 18px rgba(33, 55, 44, 0.055);
  transform: translateY(-1px);
}

.candidate-row[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--lime) 48%, var(--line));
  background: var(--lime-soft);
  box-shadow: inset 3px 0 0 var(--lime), 0 7px 18px color-mix(in srgb, var(--lime) 8%, transparent);
}

.candidate-rank {
  color: var(--faint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.candidate-main {
  min-width: 0;
}

.candidate-number {
  display: block;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  line-height: 1.15;
  white-space: nowrap;
}

.candidate-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.candidate-score {
  min-width: 38px;
  text-align: right;
}

.candidate-score strong {
  display: block;
  color: var(--lime);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.candidate-score small {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 9px;
}

.candidate-empty {
  grid-column: 1 / -1;
  width: 100%;
  padding: 28px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.candidate-empty strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.candidate-detail {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.detail-kicker {
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.detail-number {
  margin: 3px 0 0;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.copy-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.copy-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.direct-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.direct-chip {
  min-width: 35px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.factor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 12px;
}

.factor-item {
  min-width: 0;
}

.factor-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
}

.factor-track {
  height: 3px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.factor-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
}

.trend-grid {
  display: grid;
  grid-template-columns: 1.08fr 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.trend-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 320px;
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms var(--ease-out);
}

.trend-panel:hover {
  border-color: color-mix(in srgb, var(--line-strong) 86%, var(--mint));
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.trend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.trend-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.trend-note {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.trend-index {
  color: var(--faint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.trend-keyline {
  display: flex;
  min-height: 31px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.trend-keyline span {
  min-width: 0;
}

.trend-keyline span:last-child {
  text-align: right;
}

.trend-keyline strong {
  margin-right: 3px;
  color: var(--text);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.radar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
}

.radar-chart {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 auto;
}

.radar-grid {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}

.radar-axis {
  stroke: var(--line);
  stroke-width: 1;
}

.radar-shape {
  fill: color-mix(in srgb, var(--mint) 16%, transparent);
  stroke: var(--mint);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.radar-point {
  fill: var(--mint);
  stroke: var(--surface);
  stroke-width: 2;
}

.radar-label {
  fill: var(--muted);
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 10px;
  text-anchor: middle;
}

.radar-value {
  fill: var(--mint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.radar-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 2px;
}

.radar-breakdown span {
  display: grid;
  gap: 2px;
  padding: 5px 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 8px;
  text-align: center;
}

.radar-breakdown strong {
  color: var(--text);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.radar-score {
  text-align: center;
}

.radar-score strong {
  display: block;
  color: var(--text);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 31px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.radar-score span {
  display: block;
  margin-top: 7px;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.heat-chart {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
  min-height: 164px;
  align-items: end;
}

.heat-col {
  display: grid;
  grid-template-rows: 1fr 17px 15px;
  gap: 4px;
  min-width: 0;
  height: 164px;
  align-items: end;
  text-align: center;
}

.heat-track {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 102px;
  overflow: hidden;
  border-radius: 5px 5px 2px 2px;
  background: color-mix(in srgb, var(--surface-3) 60%, transparent);
}

.heat-bar {
  position: absolute;
  right: 18%;
  bottom: 0;
  left: 18%;
  min-height: 3px;
  border-radius: 4px 4px 1px 1px;
  background: color-mix(in srgb, var(--mint) 62%, var(--surface));
  transition: height 220ms ease, background 180ms ease;
}

.heat-col.is-signal .heat-bar {
  background: var(--lime);
}

.heat-digit {
  color: var(--text);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 17px;
}

.heat-count {
  color: var(--faint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 15px;
}

.chart-footnote {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.5;
}

.position-list {
  display: grid;
  gap: 14px;
}

.position-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.position-label {
  padding-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.position-label strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.position-match {
  display: inline-flex;
  margin-top: 5px;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.position-items {
  display: grid;
  gap: 6px;
}

.position-item {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) 20px;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
}

.position-digit {
  color: var(--text);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.position-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.position-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--swatch);
}

.position-count {
  color: var(--faint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.trend-panel > .chart-footnote {
  margin-top: auto;
  padding-top: 12px;
}

.method-section {
  margin-top: 42px;
}

.method-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.method-heading h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.method-heading p {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.method-card {
  position: relative;
  overflow: hidden;
  min-height: 236px;
  padding: 22px;
  border-radius: var(--radius-lg);
  box-shadow: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms var(--ease-out);
}

.method-card:hover {
  border-color: color-mix(in srgb, var(--method-color) 24%, var(--line));
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.method-card::after {
  content: attr(data-index);
  position: absolute;
  right: 15px;
  bottom: -20px;
  color: color-mix(in srgb, var(--text) 4%, transparent);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 100px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.method-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--method-tint);
  color: var(--method-color);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.method-card h3 {
  margin: 15px 0 8px;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.method-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.method-card ul {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 7px;
  margin: 13px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  list-style: none;
}

.method-card li {
  padding-left: 13px;
}

.method-card li::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 9px 2px -13px;
  border-radius: 50%;
  background: var(--method-color);
}

.research-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.7;
}

.research-sources strong {
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.research-sources a {
  color: var(--mint);
  text-decoration: none;
}

.research-sources a:hover {
  color: var(--lime);
  text-decoration: underline;
}

.method-card.group-six {
  --method-color: var(--mint);
  --method-tint: var(--mint-soft);
}

.method-card.group-three {
  --method-color: var(--coral);
  --method-tint: var(--coral-soft);
}

.method-card.boundary {
  --method-color: var(--gold);
  --method-tint: rgba(255, 211, 110, 0.10);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10px;
}

.seo-summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  gap: 28px;
  margin-top: 30px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  overflow: hidden;
}

.seo-summary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--lime), color-mix(in srgb, var(--mint) 70%, transparent));
}

.seo-summary-kicker {
  color: var(--mint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.seo-summary h2 {
  margin: 5px 0 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.seo-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.footer-note {
  max-width: 760px;
  line-height: 1.6;
}

.footer-mark {
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.copyright-footer {
  margin-top: 12px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

.copyright-footer p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 13px;
  margin: 0;
}

.copyright-footer a {
  color: var(--muted);
  text-decoration: none;
}

.copyright-footer a:hover {
  color: var(--mint);
  text-decoration: underline;
}

.copyright-footer i {
  width: 1px;
  height: 12px;
  background: var(--line-strong);
}

.copyright-record {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.copyright-record svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(86vh, 760px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.44);
}

dialog::backdrop {
  background: rgba(2, 9, 6, 0.72);
  backdrop-filter: blur(7px);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 19px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.dialog-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dialog-close {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}

.dialog-close:hover {
  color: var(--text);
}

.dialog-body {
  padding: 24px 26px 28px;
}

.guide-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.guide-step:first-child {
  padding-top: 0;
}

.guide-step:last-child {
  border-bottom: 0;
}

.guide-number {
  color: var(--lime);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.guide-step h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.guide-step p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.guide-callout {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--gold) 26%, var(--line));
  border-radius: 12px;
  background: rgba(255, 211, 110, 0.07);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.guide-callout strong {
  color: var(--gold);
  font-weight: 500;
}

#chartDialog {
  width: min(980px, calc(100vw - 28px));
}

.chart-editor-body {
  padding: 22px 26px 26px;
}

.chart-catalog {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
}

.chart-catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.chart-catalog-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.chart-catalog-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--faint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.chart-catalog-count {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.chart-catalog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 7px;
}

.chart-catalog-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.chart-catalog-item:hover {
  border-color: var(--line-strong);
}

.chart-catalog-item.is-current {
  border-color: color-mix(in srgb, var(--lime) 48%, var(--line));
  background: var(--lime-soft);
}

.chart-catalog-main {
  min-width: 0;
}

.chart-catalog-main strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-catalog-main span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.chart-catalog-state {
  color: var(--faint);
  font-size: 10px;
  white-space: nowrap;
}

.chart-catalog-item.is-current .chart-catalog-state {
  color: var(--lime);
}

.chart-editor-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.chart-editor-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--faint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.chart-editor-topline strong {
  font-size: 14px;
  font-weight: 600;
}

.chart-editor-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chart-access-badge {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--lime-soft);
  color: var(--lime);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 8px;
  letter-spacing: 0.06em;
}

.chart-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.chart-load-button,
.chart-ocr-button,
.chart-upload-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  text-align: center;
}

.chart-load-button:hover,
.chart-ocr-button:hover,
.chart-upload-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.chart-load-button:disabled,
.primary-action:disabled,
.ghost-action:disabled,
.chart-upload-button.is-disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.chart-upload-button.is-disabled {
  pointer-events: none;
}

.chart-ocr-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.chart-editor-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(0, 1.22fr);
  gap: 16px;
  align-items: start;
}

.chart-source-panel,
.chart-data-panel {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
}

.chart-source-panel h3 {
  margin: 0;
  font-size: 14px;
}

.chart-source-panel > p {
  margin: 5px 0 13px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.chart-upload-button {
  width: 100%;
  border-style: dashed;
  border-color: var(--line-strong);
}

.chart-image-preview {
  display: grid;
  max-height: 210px;
  margin-top: 10px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.chart-image-preview[hidden] {
  display: none;
}

.chart-image-preview img {
  display: block;
  width: 100%;
  max-height: 210px;
  object-fit: contain;
}

.chart-ocr-button {
  width: 100%;
  margin-top: 10px;
}

.chart-ocr-status {
  min-height: 32px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.chart-ocr-status.is-working {
  color: var(--mint);
}

.chart-ocr-status.is-error {
  color: var(--danger);
}

.chart-field {
  display: grid;
  gap: 6px;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 10px;
}

.chart-field input,
.chart-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.chart-field input:read-only,
.chart-field textarea:read-only {
  cursor: not-allowed;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}

.chart-field input {
  min-height: 38px;
  padding: 0 10px;
}

.chart-field textarea {
  min-height: 218px;
  padding: 10px;
  resize: vertical;
  font-family: "Bahnschrift", "Cascadia Mono", "Consolas", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  line-height: 1.65;
}

.chart-data-editor {
  position: relative;
  display: block;
  min-width: 0;
}

.chart-data-highlight {
  position: absolute;
  inset: 0;
  display: none;
  margin: 0;
  padding: 10px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text);
  font-family: "Bahnschrift", "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  pointer-events: none;
}

.chart-data-editor.has-unknown {
  border-radius: 9px;
  background: var(--surface);
}

.chart-data-editor.has-unknown .chart-data-highlight {
  display: block;
}

.chart-field .chart-data-editor textarea.has-unknown {
  position: relative;
  z-index: 1;
  border-color: color-mix(in srgb, var(--danger) 26%, var(--line));
  background: transparent;
  color: transparent;
  caret-color: var(--text);
}

.chart-field .chart-data-editor textarea.has-unknown::selection {
  background: rgba(197, 63, 55, 0.18);
}

.chart-unknown-question {
  border-radius: 3px;
  background: rgba(197, 63, 55, 0.10);
  color: var(--danger);
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(197, 63, 55, 0.13);
}

.chart-dimensions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
}

.chart-dimensions strong {
  color: var(--text);
  font-weight: 500;
}

.chart-row-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.chart-row-token {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--faint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.chart-row-offset {
  color: var(--muted);
}

.chart-row-offset-controls {
  display: inline-flex;
  gap: 2px;
}

.chart-row-offset-button {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.chart-row-offset-button:hover:not(:disabled) {
  border-color: var(--mint);
  color: var(--text);
}

.chart-row-offset-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.chart-dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.chart-dialog-actions .primary-action {
  flex: 1;
}

.chart-delete-button:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: color-mix(in srgb, var(--coral) 42%, var(--line));
  color: var(--coral);
}

.chart-delete-button:not([hidden]):hover {
  border-color: var(--coral);
  background: var(--coral-soft);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 44px));
  padding: 11px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Readability pass: keep secondary text legible without enlarging headings. */
.eyebrow,
.readout-label,
.readout-value small,
.map-legend,
.candidate-kicker,
.mode-hint,
.form-message,
.anchor-label,
.anchor-location,
.candidate-meta,
.trend-note,
.heat-digit,
.position-label,
.position-item,
.position-digit,
.method-card ul,
.guide-callout,
.chart-source-panel > p,
.method-heading p {
  font-size: 12px;
}

.icon-action,
.chart-select-button,
.add-period-button,
.sample-action,
.target-chip,
.candidate-copy-button,
.copy-button,
.direct-chip,
.chart-load-button,
.chart-ocr-button,
.chart-upload-button {
  font-size: 11px;
}

.chart-picker,
.period-remove,
.section-rule,
.candidate-count,
.picker-label,
.common-radiation,
.candidate-copy-row > span,
.candidate-rank,
.candidate-score small,
.detail-kicker,
.factor-label,
.trend-index,
.trend-keyline,
.trend-keyline strong,
.radar-value,
.radar-breakdown span,
.radar-score span,
.heat-count,
.chart-footnote,
.position-match,
.position-count,
.method-tag,
.research-sources,
.footer,
.chart-editor-kicker,
.chart-access-badge,
.chart-ocr-status,
.chart-field,
.chart-dimensions,
.chart-row-token {
  font-size: 11px;
}

.common-radiation strong,
.radar-breakdown strong {
  font-size: 12px;
}

.position-row {
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
}

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

  .locations-panel #anchorList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    padding-inline: 24px;
  }

  .hero {
    gap: 30px;
  }

  .trend-grid {
    grid-template-columns: 1fr 1fr;
  }

  .trend-panel:first-child {
    grid-column: 1 / -1;
    min-height: 260px;
  }

  .radar-layout {
    grid-template-columns: minmax(0, 1fr) 120px;
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: fixed;
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    display: flex;
    width: min(300px, calc(100vw - 24px));
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: var(--shadow);
    transform: translateX(-50%);
    transition: transform 180ms ease, opacity 180ms ease;
    z-index: 30;
  }

  .app-shell.is-editing .rail {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(100% + 32px));
  }

  .brand-mark {
    display: none;
  }

  .rail-nav {
    display: grid;
    flex: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: auto;
    margin: 0;
  }

  .rail-link {
    min-height: 42px;
  }

  .workspace {
    padding-inline: 20px;
    padding-bottom: 100px;
  }

  .toast {
    top: 50vh;
    right: auto;
    bottom: auto;
    left: 50vw;
    z-index: 40;
    max-width: min(360px, calc(100vw - 32px));
    text-align: center;
    transform: translate(-50%, calc(-50% + 8px));
  }

  .toast.show {
    transform: translate(-50%, -50%);
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 42px 0 32px;
  }

  .hero-readout {
    padding-top: 18px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .hero-readout::before {
    top: -1px;
    left: 0;
    width: 38px;
    height: 1px;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .locations-panel #anchorList {
    grid-template-columns: 1fr;
  }

  .side-stack {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
    contain: none;
    overflow: visible;
    align-items: start;
  }

  #anchorList {
    flex: 0 1 auto;
    max-height: 390px;
  }

  .locations-panel #anchorList {
    max-height: none;
  }

  .method-grid {
    grid-template-columns: 1fr;
  }

  .method-card {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .workspace {
    padding-inline: 13px;
  }

  .topbar {
    min-height: 62px;
  }

  .breadcrumb,
  .cloud-status,
  .date-label {
    display: none;
  }

  .topbar-left::after {
    content: "蜂巢研判";
    font-size: 14px;
    font-weight: 600;
  }

  .hero {
    padding: 28px 0 24px;
  }

  h1 {
    font-size: clamp(31px, 10vw, 40px);
  }

  .hero-copy {
    margin-top: 14px;
    font-size: 12px;
    line-height: 1.65;
  }

  .hero-readout {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .side-stack,
  .trend-grid {
    grid-template-columns: 1fr;
  }

  .trend-panel:first-child {
    grid-column: auto;
  }

  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding-block: 11px;
  }

  .map-legend {
    gap: 11px;
  }

  .panel-head {
    padding-inline: 16px;
  }

  #anchorList {
    max-height: min(36vh, 300px);
  }

  .locations-panel #anchorList {
    max-height: none;
  }

  .triple-row {
    row-gap: 4px;
    padding: 8px 9px;
  }

  .triple-row .anchor-swatch {
    margin-top: 5px;
  }

  .triple-row .anchor-label {
    padding-top: 1px;
    font-size: 11px;
    line-height: 1.4;
  }

  .triple-row .anchor-location {
    padding-top: 4px;
    font-size: 11px;
    line-height: 1.35;
  }

  .triple-number {
    font-size: 16px;
  }

  .step-index {
    display: none;
  }

  .map-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding-inline: 16px;
  }

  .map-footer-meta {
    width: 100%;
    justify-content: space-between;
  }

  .map-scroll {
    padding-inline: 12px;
  }

  .control-panel {
    padding: 18px;
  }

  .method-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .radar-layout {
    grid-template-columns: minmax(0, 1fr) 82px;
  }
}

@media (max-width: 680px) {
  .chart-picker {
    width: 100%;
  }

  .chart-select {
    flex: 1;
  }

  .chart-select-button {
    width: 100%;
  }

  .chart-select-menu {
    right: auto;
    left: 0;
    width: 100%;
  }

  .chart-editor-grid {
    grid-template-columns: 1fr;
  }

  .candidate-method {
    grid-template-columns: 1fr;
  }

  .target-picker {
    justify-content: flex-start;
  }

  .core-row,
  .target-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
  }

  #drawInput,
  #previousDrawInput {
    min-height: 46px;
    height: 46px;
    padding: 0 46px 0 12px;
    border-radius: 10px;
    font-size: 20px;
    letter-spacing: 0.26em;
  }

  #drawInput::placeholder,
  #previousDrawInput::placeholder {
    font-size: 14px;
  }

  .period-fields .period-entry {
    padding: 9px;
  }

  .period-fields {
    max-height: 230px;
    gap: 8px;
  }

  .period-fields .period-input {
    min-height: 42px;
    height: 42px;
    font-size: 19px;
  }

  .draw-length {
    right: 11px;
    font-size: 10px;
    white-space: nowrap;
  }

  .chart-editor-body {
    padding: 18px;
  }

  .chart-editor-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .research-sources {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 7px;
  }

  .research-sources > strong {
    grid-column: 1 / -1;
  }

  .research-sources > a {
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 7px 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    text-align: center;
    white-space: nowrap;
  }
}

    @media (max-width: 520px) {
  .workspace {
    padding-inline: 10px;
  }

  .topbar {
    gap: 10px;
  }

  .topbar-right {
    gap: 8px;
  }

  .top-action {
    min-height: 34px;
    padding-inline: 8px;
  }

  .hero {
    gap: 16px;
    padding: 20px 0 18px;
  }

  .eyebrow {
    display: none;
  }

  h1 {
    font-size: clamp(28px, 8.8vw, 34px);
    line-height: 1.1;
  }

  .hero-readout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    padding-top: 12px;
  }

  .readout-status,
  .readout-candidates {
    padding-top: 8px;
  }

  .readout-label {
    font-size: 10px;
  }

  .readout-value {
    min-height: 24px;
    font-size: 18px;
    white-space: nowrap;
  }

  .readout-value small {
    display: none;
  }

  .map-panel,
  .control-panel,
  .candidates-panel,
  .trend-panel,
  .method-card {
    border-radius: 17px;
  }

  .panel-head {
    min-height: 66px;
    padding: 14px 13px;
  }

  .chart-badge {
    display: none;
  }

  .map-scroll {
    padding: 4px;
  }

  .draw-toolbar {
    margin: 8px 12px 0;
    padding: 7px;
  }

  .draw-tool-group {
    padding-right: 6px;
  }

  .draw-actions {
    margin-left: 0;
  }

  .hive-text {
    font-size: 24px;
  }

  .map-toolbar {
    padding-inline: 13px;
  }

  .map-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .draw-tool-button,
  .draw-action-button,
  .draw-color-button,
  .draw-width-button {
    width: 34px;
    height: 34px;
  }

  .control-panel,
  .candidates-panel {
    padding: 14px;
  }

  .field-label-row {
    flex-wrap: wrap;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  .ghost-action {
    min-height: 38px;
  }

  #drawInput,
  #previousDrawInput {
    min-height: 38px;
    height: 38px;
    font-size: 18px;
    letter-spacing: 0.22em;
  }

  .period-fields .period-input {
    min-height: 38px;
    height: 38px;
    font-size: 18px;
  }

  .anchor-row,
  .triple-row {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .anchor-location {
    grid-column: 2;
    text-align: left;
    white-space: normal;
  }

  .candidate-list {
    grid-template-columns: minmax(0, 1fr);
    max-height: 470px;
  }

  .candidate-row {
    grid-template-columns: 22px minmax(0, 1fr) 42px;
    gap: 7px;
  }

  .candidate-number {
    font-size: 16px;
  }

  .common-radiation {
    align-items: flex-start;
    flex-direction: column;
  }

  .common-radiation strong {
    text-align: left;
  }

  .candidate-copy-row {
    align-items: stretch;
    flex-direction: column;
  }

  .candidate-copy-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .candidate-copy-button {
    width: 100%;
    min-height: 36px;
  }

  .factor-grid {
    grid-template-columns: 1fr 1fr;
  }

  .trend-panel {
    padding: 16px;
  }

  .radar-layout {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .method-grid {
    gap: 10px;
  }

  .method-card {
    padding: 17px;
  }

  .method-heading p {
    font-size: 11px;
  }

  .research-sources {
    gap: 6px;
    padding: 10px;
      }
    }

    @media (max-width: 680px) {
      html {
        scroll-padding-top: 66px;
      }

      body {
        overscroll-behavior-y: contain;
        -webkit-tap-highlight-color: transparent;
      }

      .app-shell {
        min-height: 100svh;
      }

      .workspace {
        padding-inline: 12px;
        padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
      }

      .topbar {
        position: sticky;
        top: 0;
        z-index: 25;
        min-height: 58px;
        margin-inline: -12px;
        padding-inline: 12px;
        border-bottom: 1px solid var(--line);
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        box-shadow: 0 4px 18px rgba(33, 55, 44, 0.05);
        backdrop-filter: blur(16px);
      }

      .topbar-left {
        gap: 9px;
      }

      .topbar-left::before {
        content: "H";
        display: grid;
        width: 30px;
        height: 34px;
        place-items: center;
        background: var(--lime);
        color: #101a13;
        clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
        font-family: "Bahnschrift", "Segoe UI", sans-serif;
        font-size: 14px;
        font-weight: 800;
      }

      .hero {
        gap: 0;
        padding: 14px 0 16px;
      }

      .hero > div:first-child {
        display: none;
      }

      .hero-readout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
      }

      .hero-readout::before {
        display: none;
      }

      .hero-readout-head {
        display: none;
      }

      .hero-readout > .readout-item {
        min-height: 65px;
        padding: 10px 11px;
        border: 1px solid var(--line);
        border-radius: 13px;
        background:
          linear-gradient(145deg, color-mix(in srgb, var(--surface-raised) 98%, transparent), color-mix(in srgb, var(--surface-2) 82%, var(--surface)));
      }

      .readout-status,
      .readout-candidates {
        padding-top: 10px;
        border-top: 1px solid var(--line);
      }

      .readout-value small {
        display: none;
      }

      .readout-value {
        min-height: 24px;
        font-size: 19px;
        white-space: nowrap;
      }

      #workbench,
      #trendSection,
      #methodSection {
        scroll-margin-top: 66px;
      }

      .rail {
        width: min(360px, calc(100vw - 20px));
        padding: 7px 9px calc(7px + env(safe-area-inset-bottom, 0px));
        border-color: color-mix(in srgb, var(--line-strong) 64%, transparent);
        border-radius: 20px;
        background: color-mix(in srgb, var(--surface-raised) 91%, transparent);
        box-shadow:
          0 18px 42px rgba(33, 55, 44, 0.16),
          0 2px 7px rgba(33, 55, 44, 0.06),
          inset 0 1px 0 rgba(255, 255, 255, 0.88);
        backdrop-filter: blur(20px) saturate(1.15);
      }

      .rail-nav {
        gap: 4px;
      }

      .rail-link {
        position: relative;
        display: flex;
        min-height: 51px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        overflow: hidden;
        border-radius: 13px;
        transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
      }

      .rail-link::after {
        content: attr(data-mobile-label);
        color: currentColor;
        font-size: 10px;
        font-weight: 500;
        letter-spacing: 0.02em;
        line-height: 1;
      }

      .rail-link.active {
        border-color: color-mix(in srgb, var(--lime) 28%, var(--line));
        background:
          linear-gradient(180deg, color-mix(in srgb, var(--lime-soft) 68%, var(--surface-raised)), color-mix(in srgb, var(--surface-2) 76%, var(--surface)));
        color: var(--mint);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
      }

      .rail-link.active::before {
        content: "";
        position: absolute;
        top: 1px;
        left: 50%;
        width: 24px;
        height: 2px;
        border-radius: 999px;
        background: var(--lime);
        transform: translateX(-50%);
      }

      .rail-link.active .rail-glyph {
        transform: translateY(-1px);
      }

      .rail-link:active {
        transform: scale(0.98);
      }

      .seo-summary {
        grid-template-columns: 1fr;
        gap: 9px;
        margin-top: 18px;
        padding: 18px 18px 18px 20px;
        box-shadow: 0 10px 26px rgba(33, 55, 44, 0.045);
      }

      .candidate-method,
      .candidate-copy-row,
      .candidate-copy-actions,
      .core-row,
      .target-row {
        min-width: 0;
        max-width: 100%;
      }

      .core-picker,
      .target-picker {
        width: 100%;
        max-width: 100%;
      }

      .common-radiation {
        align-items: flex-start;
        flex-direction: column;
      }

      .common-radiation span,
      .common-radiation strong {
        width: 100%;
        overflow-wrap: anywhere;
        white-space: normal;
        text-align: left;
      }

      .candidate-copy-row > span {
        overflow-wrap: anywhere;
      }

      .candidate-copy-button {
        min-width: 0;
        white-space: normal;
      }

      body[data-mobile-view="workbench"] .trend-grid,
      body[data-mobile-view="workbench"] .method-section {
        display: none;
      }

      body[data-mobile-view="metrics"] .hero,
      body[data-mobile-view="metrics"] #workbench,
      body[data-mobile-view="metrics"] .candidates-panel,
      body[data-mobile-view="metrics"] .method-section {
        display: none;
      }

      body[data-mobile-view="method"] .hero,
      body[data-mobile-view="method"] #workbench,
      body[data-mobile-view="method"] .candidates-panel,
      body[data-mobile-view="method"] .trend-grid {
        display: none;
      }

      body[data-mobile-view="metrics"] .trend-grid {
        margin-top: 12px;
        gap: 12px;
      }

      body[data-mobile-view="method"] .method-section {
        margin-top: 0;
        padding-top: 14px;
      }

      body[data-mobile-view="workbench"] .hero,
      body[data-mobile-view="workbench"] .analysis-grid,
      body[data-mobile-view="workbench"] .candidates-panel,
      body[data-mobile-view="metrics"] .trend-grid,
      body[data-mobile-view="method"] .method-section {
        animation: mobile-view-in 220ms var(--ease-out) both;
      }
    }

    @keyframes mobile-view-in {
      from {
        opacity: 0;
        transform: translateY(6px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body.hive-locked {
  overflow: hidden;
}

body.hive-locked .app-shell {
  visibility: hidden;
  pointer-events: none;
}

.hive-license-button {
  --license-accent: #a9d83d;
  --license-accent-strong: #159d77;
  --license-icon-ink: #164f3c;
  position: relative;
  display: inline-flex;
  width: auto;
  min-width: 118px;
  height: 38px;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 7px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--license-accent) 32%, var(--line));
  border-radius: 999px;
  background:
    radial-gradient(circle at 7% -5%, rgba(255, 255, 255, 0.96), transparent 43%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-raised) 92%, var(--license-accent) 8%), var(--surface-2));
  color: var(--text);
  box-shadow:
    0 5px 14px rgba(33, 55, 44, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  cursor: pointer;
  isolation: isolate;
  transition:
    border-color 180ms ease,
    box-shadow 200ms ease,
    transform 180ms var(--ease-out);
}

.hive-license-button::before {
  content: "";
  position: absolute;
  top: -28px;
  right: -24px;
  z-index: -1;
  width: 66px;
  height: 52px;
  border: 1px solid color-mix(in srgb, var(--license-accent) 15%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 10px color-mix(in srgb, var(--license-accent) 4%, transparent),
    0 0 0 20px color-mix(in srgb, var(--license-accent) 2%, transparent);
}

.hive-license-button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.42) 49%, transparent 63%);
  opacity: 0;
  transform: translateX(-65%);
  transition: opacity 180ms ease, transform 500ms var(--ease-out);
}

.hive-license-button:hover {
  border-color: color-mix(in srgb, var(--license-accent-strong) 48%, var(--line));
  box-shadow:
    0 8px 20px rgba(33, 55, 44, 0.11),
    inset 0 1px 0 #fff;
  transform: translateY(-1px);
}

.hive-license-button:hover::after {
  opacity: 1;
  transform: translateX(65%);
}

.hive-license-button:active {
  transform: translateY(0) scale(0.985);
}

.hive-license-badge-icon {
  position: relative;
  display: grid;
  width: 22px;
  height: 25px;
  flex: 0 0 22px;
  place-items: center;
  filter: drop-shadow(0 3px 4px color-mix(in srgb, var(--license-accent-strong) 20%, transparent));
}

.hive-license-badge-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hive-license-hex-shell {
  fill: var(--license-accent);
  stroke: color-mix(in srgb, var(--license-accent-strong) 30%, var(--license-accent));
  stroke-width: 0.8;
}

.hive-license-hex-cell {
  fill: var(--license-icon-ink);
  stroke: rgba(255, 255, 255, 0.52);
  stroke-width: 0.55;
}

.hive-license-badge-copy {
  display: grid;
  min-width: 0;
  align-content: center;
  text-align: left;
}

.hive-license-badge-copy strong {
  display: block;
  white-space: nowrap;
}

.hive-license-badge-arrow {
  display: grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--license-accent) 12%, var(--surface));
  color: var(--license-accent-strong);
  font-family: "Segoe UI", sans-serif;
  font-size: 0;
  font-weight: 600;
  line-height: 1;
  transition: background 160ms ease, transform 180ms var(--ease-out);
}

.hive-license-badge-arrow::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: -2px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.hive-license-button:hover .hive-license-badge-arrow {
  background: color-mix(in srgb, var(--license-accent) 20%, var(--surface));
  transform: translateX(1px);
}

.hive-license-button.is-ok {
  --license-accent: #b6df50;
  --license-accent-strong: #118565;
  --license-icon-ink: #155642;
}

.hive-license-button[data-state="warning"] {
  --license-accent: #e8b84e;
  --license-accent-strong: #b8740c;
  --license-icon-ink: #694b18;
  border-color: color-mix(in srgb, #d79b2e 42%, var(--line));
  background:
    radial-gradient(circle at 7% -5%, rgba(255, 255, 255, 0.98), transparent 43%),
    linear-gradient(135deg, #fffdf5, #fbf3df);
}

.hive-license-button[data-state="locked"] {
  --license-accent: #c7d0c8;
  --license-accent-strong: #75837a;
  --license-icon-ink: #58655d;
  border-color: var(--line-strong);
  background:
    radial-gradient(circle at 7% -5%, rgba(255, 255, 255, 0.9), transparent 43%),
    linear-gradient(135deg, var(--surface-raised), var(--surface-3));
  box-shadow:
    0 4px 12px rgba(33, 55, 44, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.hive-license-button[data-state="checking"] .hive-license-badge-icon {
  animation: licenseBadgeBreathe 1.8s ease-in-out infinite;
}

@keyframes licenseBadgeBreathe {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.96);
  }

  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

body.wechat-guide-open {
  overflow: hidden;
}

.wechat-open-guide {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 220ms ease,
    visibility 0s linear 260ms;
}

.wechat-open-guide.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.wechat-open-guide-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 8%, rgba(169, 216, 61, 0.16), transparent 25rem),
    linear-gradient(180deg, rgba(12, 28, 21, 0.50), rgba(7, 20, 14, 0.72));
  backdrop-filter: blur(11px) saturate(0.85);
}

.wechat-open-pointer {
  position: absolute;
  top: max(8px, env(safe-area-inset-top, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 2;
  width: clamp(126px, 34vw, 168px);
  aspect-ratio: 160 / 170;
  pointer-events: none;
  filter: drop-shadow(0 7px 13px rgba(9, 36, 24, 0.26));
}

.wechat-open-pointer svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.wechat-open-arrow-trail,
.wechat-open-arrow-head {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wechat-open-arrow-trail {
  stroke: rgba(214, 241, 140, 0.88);
  stroke-width: 2.1;
  stroke-dasharray: 3 9;
  animation: wechatArrowFlow 1.5s linear infinite;
}

.wechat-open-arrow-head {
  stroke: #d9f58b;
  stroke-width: 2.4;
}

.wechat-open-pointer-label {
  position: absolute;
  bottom: 13px;
  left: 1px;
  padding: 5px 9px;
  border: 1px solid rgba(229, 248, 177, 0.35);
  border-radius: 999px;
  background: rgba(16, 51, 36, 0.72);
  color: #f7ffe8;
  box-shadow: 0 7px 16px rgba(6, 27, 17, 0.2);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.04em;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.wechat-open-pointer-label::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: #bdea5c;
  box-shadow: 0 0 0 3px rgba(189, 234, 92, 0.14);
  vertical-align: 1px;
}

.wechat-open-pointer-target {
  position: absolute;
  top: -1px;
  right: 7px;
  display: flex;
  width: 43px;
  height: 28px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(228, 248, 173, 0.64);
  border-radius: 12px;
  background: rgba(20, 61, 42, 0.74);
  box-shadow:
    0 0 0 5px rgba(191, 232, 100, 0.08),
    0 7px 17px rgba(5, 25, 15, 0.22);
  backdrop-filter: blur(8px);
  animation: wechatTargetGlow 2.1s ease-in-out infinite;
}

.wechat-open-pointer-target i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #efffcf;
}

@keyframes wechatArrowFlow {
  to {
    stroke-dashoffset: -24;
  }
}

@keyframes wechatTargetGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 4px rgba(191, 232, 100, 0.07),
      0 7px 17px rgba(5, 25, 15, 0.22);
  }

  50% {
    box-shadow:
      0 0 0 9px rgba(191, 232, 100, 0.13),
      0 9px 21px rgba(5, 25, 15, 0.25);
  }
}

.wechat-open-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  max-height: calc(100dvh - 36px);
  max-height: calc(100svh - 36px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px;
  border: 1px solid rgba(185, 218, 118, 0.62);
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 0%, rgba(183, 224, 80, 0.24), transparent 13rem),
    radial-gradient(circle at 6% 96%, rgba(21, 157, 119, 0.08), transparent 15rem),
    linear-gradient(155deg, #fffefa 0%, #f8faf1 56%, #f1f5e9 100%);
  box-shadow:
    0 34px 90px rgba(3, 17, 11, 0.34),
    0 10px 28px rgba(3, 17, 11, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  isolation: isolate;
  transform: translateY(18px) scale(0.975);
  transition: transform 340ms var(--ease-out);
}

.wechat-open-card::before {
  content: "";
  position: absolute;
  top: -98px;
  right: -84px;
  z-index: -1;
  width: 214px;
  height: 214px;
  border: 1px solid rgba(154, 199, 67, 0.17);
  border-radius: 50%;
  box-shadow:
    0 0 0 24px rgba(169, 216, 61, 0.035),
    0 0 0 48px rgba(169, 216, 61, 0.02);
}

.wechat-open-guide.is-open .wechat-open-card {
  transform: translateY(0) scale(1);
}

.wechat-open-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wechat-open-mark {
  position: relative;
  display: grid;
  width: 46px;
  height: 50px;
  flex: 0 0 46px;
  place-items: center;
  background: linear-gradient(145deg, #d8f18f, #a9d83d 68%, #7fc85c);
  clip-path: polygon(50% 0, 94% 24%, 94% 76%, 50% 100%, 6% 76%, 6% 24%);
  color: #174f3b;
  filter: drop-shadow(0 8px 13px rgba(86, 142, 47, 0.24));
}

.wechat-open-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(31, 91, 59, 0.2);
  clip-path: inherit;
}

.wechat-open-mark svg {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 27px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wechat-open-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid rgba(21, 157, 119, 0.15);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.7);
  color: #52665b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.wechat-open-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #19a77b;
  box-shadow: 0 0 0 4px rgba(25, 167, 123, 0.1);
}

.wechat-open-kicker {
  display: block;
  margin-top: 20px;
  color: #169a72;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.wechat-open-card h2 {
  margin: 5px 0 7px;
  color: #14231b;
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.wechat-open-intro {
  margin: 0;
  color: #64776c;
  font-size: 12px;
  line-height: 1.7;
}

.wechat-open-route {
  display: grid;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid rgba(131, 157, 135, 0.22);
  border-radius: 18px;
  background: rgba(255, 254, 250, 0.76);
  box-shadow:
    0 10px 24px rgba(33, 55, 44, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.wechat-open-step {
  position: relative;
  display: grid;
  min-height: 70px;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
}

.wechat-open-step + .wechat-open-step {
  border-top: 1px solid rgba(131, 157, 135, 0.16);
}

.wechat-open-step + .wechat-open-step::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 28px;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid #7bad72;
  border-bottom: 1.5px solid #7bad72;
  background: #fbfcf7;
  transform: rotate(45deg);
}

.wechat-open-step-index {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(151, 190, 77, 0.32);
  border-radius: 11px;
  background: linear-gradient(145deg, #f3f9df, #e8f3cd);
  color: #376b3d;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.wechat-open-step-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.wechat-open-step-copy strong,
.wechat-open-step-copy small {
  display: block;
}

.wechat-open-step-copy strong {
  color: #1b2a22;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.wechat-open-step-copy small {
  color: #76867d;
  font-size: 10px;
  line-height: 1.45;
}

.wechat-more {
  display: flex;
  width: 48px;
  height: 32px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(21, 157, 119, 0.17);
  border-radius: 12px;
  background: linear-gradient(145deg, #f9fcff, #e9f5ec);
  box-shadow: 0 4px 12px rgba(21, 87, 64, 0.08);
}

.wechat-more i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #197b60;
  box-shadow: 0 0 0 2px rgba(25, 123, 96, 0.055);
}

.wechat-browser-icon {
  display: grid;
  width: 42px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(21, 157, 119, 0.17);
  border-radius: 12px;
  background: linear-gradient(145deg, #f9fcff, #e7f4ec);
  color: #14785d;
  box-shadow: 0 4px 12px rgba(21, 87, 64, 0.08);
}

.wechat-browser-icon svg {
  width: 25px;
  height: 25px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wechat-open-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(21, 157, 119, 0.06);
  color: #65776c;
  font-size: 9px;
  line-height: 1.55;
}

.wechat-open-note svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
  overflow: visible;
  fill: none;
  stroke: #168966;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wechat-open-lock {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 9px 14px;
  border: 1px solid rgba(21, 157, 119, 0.14);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(21, 157, 119, 0.08), rgba(169, 216, 61, 0.07));
}

.wechat-open-lock-dot {
  position: relative;
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #159d77;
  box-shadow: 0 0 0 5px rgba(21, 157, 119, 0.10);
}

.wechat-open-lock-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(21, 157, 119, 0.3);
  border-radius: inherit;
  animation: wechatWaitingPulse 2s ease-out infinite;
}

.wechat-open-lock > span:last-child {
  display: grid;
  gap: 1px;
}

.wechat-open-lock strong {
  color: #1e4e3b;
  font-size: 11px;
  font-weight: 650;
}

.wechat-open-lock small {
  color: #6b7f74;
  font-size: 9px;
}

@keyframes wechatWaitingPulse {
  0% {
    opacity: 0.8;
    transform: scale(0.72);
  }

  80%,
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

body.wechat-guide-open .hive-wx-fab {
  display: none;
}

@media (max-width: 520px) {
  .wechat-open-guide {
    padding: 11px;
  }

  .wechat-open-pointer {
    top: max(5px, env(safe-area-inset-top, 0px));
    right: max(7px, env(safe-area-inset-right, 0px));
    width: 128px;
  }

  .wechat-open-pointer-label {
    bottom: 9px;
    padding: 4px 8px;
    font-size: 8px;
  }

  .wechat-open-card {
    max-height: calc(100dvh - 22px);
    max-height: calc(100svh - 22px);
    padding: 20px 18px 18px;
    border-radius: 24px;
  }

  .wechat-open-mark {
    width: 42px;
    height: 46px;
    flex-basis: 42px;
  }

  .wechat-open-kicker {
    margin-top: 16px;
  }

  .wechat-open-card h2 {
    font-size: 25px;
  }

  .wechat-open-intro {
    font-size: 11px;
  }

  .wechat-open-route {
    margin-top: 15px;
    border-radius: 16px;
  }

  .wechat-open-step {
    min-height: 66px;
    padding: 10px 11px;
  }

  .wechat-open-step + .wechat-open-step::before {
    left: 26px;
  }

  .wechat-open-step-copy strong {
    font-size: 12px;
  }

  .wechat-open-note {
    margin-top: 11px;
  }

  .wechat-open-lock {
    min-height: 46px;
    margin-top: 11px;
  }
}

@media (max-width: 520px) and (max-height: 720px) {
  .wechat-open-pointer {
    width: 96px;
  }

  .wechat-open-pointer-label {
    bottom: 0;
    padding: 3px 6px;
    font-size: 7px;
  }

  .wechat-open-pointer-target {
    right: 4px;
    width: 37px;
    height: 24px;
  }
}

.hive-license-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hive-license-gate.is-open {
  display: flex;
}

.hive-license-shade {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 21, 0.58);
  backdrop-filter: blur(8px);
}

.hive-license-panel {
  position: relative;
  width: min(410px, 100%);
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--lime) 30%, var(--line));
  border-radius: 22px;
  background: var(--surface-raised);
  box-shadow: 0 24px 70px rgba(11, 28, 19, 0.28);
}

.hive-license-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}

.hive-license-mark {
  display: grid;
  width: 48px;
  height: 52px;
  place-items: center;
  margin-bottom: 13px;
  background: var(--lime);
  clip-path: polygon(50% 0, 94% 25%, 94% 75%, 50% 100%, 6% 75%, 6% 25%);
  color: var(--ink);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 900;
}

.hive-license-kicker {
  color: var(--mint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.hive-license-panel h2 {
  margin: 4px 0 6px;
  font-size: 21px;
}

.hive-license-intro {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.hive-license-panel label {
  display: block;
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 11px;
}

.hive-license-row {
  display: flex;
  gap: 7px;
}

.hive-license-panel input,
.hive-license-panel textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-family: "Consolas", "Microsoft YaHei UI", monospace;
  font-size: 12px;
  outline: none;
}

.hive-license-panel input {
  height: 42px;
  padding: 0 12px;
}

.hive-license-panel textarea {
  min-height: 86px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}

.hive-license-panel input:focus,
.hive-license-panel textarea:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 12%, transparent);
}

.hive-license-row button,
.hive-license-activate {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
}

.hive-license-row button {
  flex: 0 0 66px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
}

.hive-license-status {
  min-height: 40px;
  margin: 11px 0;
  padding: 9px 11px;
  border-left: 3px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.hive-license-status.is-ok {
  border-color: var(--mint);
  color: var(--mint);
}

.hive-license-status.is-error {
  border-color: var(--coral);
  color: var(--danger);
}

.hive-license-activate {
  width: 100%;
  min-height: 44px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--lime) 88%, #eeffbf), var(--lime));
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.hive-license-activate:disabled {
  cursor: wait;
  opacity: 0.55;
}

.hive-license-support {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--mint) 18%, var(--line));
  border-radius: 13px;
  background:
    radial-gradient(circle at 10% 10%, rgba(169, 216, 61, 0.12), transparent 52%),
    linear-gradient(145deg, var(--surface-2), color-mix(in srgb, var(--surface) 88%, var(--lime-soft)));
}

.hive-license-support + .hive-license-support {
  margin-top: 8px;
}

.hive-license-support.is-wechat .hive-license-support-icon {
  background: linear-gradient(145deg, #39d98a, #07b65c);
  box-shadow: 0 5px 12px rgba(7, 182, 92, 0.2);
}

.hive-license-support-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.hive-license-support-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #35b98e, #168f6c);
  box-shadow: 0 5px 12px rgba(21, 157, 119, 0.2);
  color: #fff;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.hive-license-support-icon svg {
  display: block;
  width: 25px;
  height: 25px;
  overflow: visible;
}

.hive-license-support.is-qq .hive-license-support-icon {
  border: 1px solid rgba(57, 142, 190, 0.22);
  background: linear-gradient(145deg, #f6fcff, #d8effa);
  box-shadow: 0 5px 12px rgba(38, 127, 185, 0.18);
}

.qq-body {
  fill: #173f59;
}

.qq-face {
  fill: #fffef9;
}

.qq-eye {
  fill: #173f59;
}

.qq-beak {
  fill: #f4bd45;
}

.qq-scarf {
  fill: #ed6b75;
}

.qq-tinge {
  fill: #c44255;
}

.wechat-bubble-back {
  fill: rgba(255, 255, 255, 0.82);
}

.wechat-bubble-front {
  fill: #fff;
  filter: drop-shadow(0 1px 1px rgba(6, 67, 36, 0.2));
}

.wechat-eye-back,
.wechat-eye-front {
  fill: #148c60;
}

.hive-license-support-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.hive-license-support-copy small {
  color: var(--faint);
  font-size: 9px;
  line-height: 1.3;
}

.hive-license-support-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hive-license-support-copy b {
  color: var(--mint);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-weight: 700;
}

.hive-license-copy-qq {
  min-width: 64px;
  height: 32px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--mint) 30%, var(--line));
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--mint);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out);
}

.hive-license-copy-qq:hover {
  border-color: var(--mint);
  background: color-mix(in srgb, var(--mint-soft) 72%, var(--surface));
  transform: translateY(-1px);
}

.hive-license-copy-qq:active {
  transform: translateY(0) scale(0.97);
}

.hive-wx-fab {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 90;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--mint) 26%, var(--line));
  border-radius: 19px;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.96), transparent 38%),
    linear-gradient(145deg, #fffefa 8%, #edf5e5 100%);
  box-shadow:
    0 15px 34px rgba(33, 55, 44, 0.16),
    0 4px 11px rgba(33, 55, 44, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  cursor: pointer;
  user-select: none;
  isolation: isolate;
  animation: hiveWxFloat 3.2s ease-in-out infinite;
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.hive-wx-fab::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: 0;
  border: 1px solid rgba(166, 203, 127, 0.35);
  border-radius: 15px;
  pointer-events: none;
}

body.hive-locked .hive-wx-fab,
body.hive-license-open .hive-wx-fab {
  display: none;
}

body.hive-locked .toast,
body.hive-license-open .toast {
  z-index: 140;
}

.hive-wx-fab:hover {
  border-color: color-mix(in srgb, var(--lime) 58%, var(--line));
  box-shadow:
    0 18px 38px rgba(33, 55, 44, 0.19),
    0 5px 14px rgba(33, 55, 44, 0.09),
    inset 0 1px 0 #fff;
  animation-play-state: paused;
}

.hive-wx-fab:active {
  transform: scale(0.94);
}

.hive-wx-fab:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--lime) 42%, transparent);
  outline-offset: 3px;
}

.hive-wx-tip {
  position: absolute;
  top: 50%;
  right: calc(100% + 11px);
  display: grid;
  min-width: 106px;
  padding: 8px 11px;
  border: 1px solid color-mix(in srgb, var(--mint) 20%, var(--line));
  border-radius: 11px;
  background: rgba(255, 254, 250, 0.97);
  box-shadow: 0 10px 24px rgba(33, 55, 44, 0.13);
  opacity: 0;
  pointer-events: none;
  transform: translate(6px, -50%);
  transition: opacity 160ms ease, transform 180ms var(--ease-out);
}

.hive-wx-tip::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -5px;
  width: 9px;
  height: 9px;
  border-top: 1px solid color-mix(in srgb, var(--mint) 20%, var(--line));
  border-right: 1px solid color-mix(in srgb, var(--mint) 20%, var(--line));
  background: #fffefa;
  transform: translateY(-50%) rotate(45deg);
}

.hive-wx-tip strong,
.hive-wx-tip small {
  white-space: nowrap;
}

.hive-wx-tip strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.hive-wx-tip small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.hive-wx-fab:hover .hive-wx-tip,
.hive-wx-fab:focus-visible .hive-wx-tip {
  opacity: 1;
  transform: translate(0, -50%);
}

.hive-wx-hex-rim {
  position: relative;
  z-index: 2;
  display: block;
  width: 42px;
  height: 46px;
  padding: 2px;
  background: linear-gradient(145deg, #d9ee9d 0%, #a9d83d 52%, #55b985 100%);
  clip-path: polygon(50% 0, 94% 24%, 94% 76%, 50% 100%, 6% 76%, 6% 24%);
  filter: drop-shadow(0 5px 7px rgba(24, 88, 60, 0.2));
}

.hive-wx-hex-face {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 32% 23%, rgba(137, 225, 180, 0.3), transparent 31%),
    linear-gradient(155deg, #1c604c 0%, #168a68 60%, #105c47 100%);
  clip-path: polygon(50% 0, 94% 24%, 94% 76%, 50% 100%, 6% 76%, 6% 24%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.hive-wx-bubble {
  position: absolute;
  display: block;
}

.hive-wx-bubble-back {
  top: 10px;
  left: 7px;
  width: 23px;
  height: 18px;
  border: 1px solid rgba(219, 255, 232, 0.62);
  border-radius: 50%;
  background: rgba(108, 214, 153, 0.42);
}

.hive-wx-bubble-front {
  top: 19px;
  left: 17px;
  width: 21px;
  height: 17px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fffefa, #dff4e7);
  box-shadow:
    0 2px 5px rgba(5, 44, 31, 0.25),
    inset 0 1px 0 #fff;
}

.hive-wx-bubble-back::after,
.hive-wx-bubble-front::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 4px;
  width: 7px;
  height: 6px;
  border-radius: 0 0 0 5px;
  background: inherit;
  transform: rotate(20deg);
}

.hive-wx-eye {
  position: absolute;
  width: 3.5px;
  height: 4.8px;
  border-radius: 50%;
  background: #167a5e;
}

.hive-wx-eye-left {
  top: 6px;
  left: 5px;
}

.hive-wx-eye-right {
  top: 5px;
  left: 13px;
}

.hive-wx-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 9px;
  height: 9px;
  border: 2px solid #fffefa;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(169, 216, 61, 0.15);
}

.hive-wx-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(169, 216, 61, 0.5);
  border-radius: 50%;
  animation: hiveWxPulse 2.4s ease-out infinite;
}

@keyframes hiveWxFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

@keyframes hiveWxPulse {
  0%,
  45% {
    opacity: 0;
    transform: scale(0.7);
  }

  65% {
    opacity: 0.8;
  }

  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@media (max-width: 520px) {
  .hive-license-gate {
    align-items: center;
    padding: 10px;
  }

  .hive-license-panel {
    max-height: calc(100svh - 20px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    padding: 20px 17px;
    border-radius: 20px;
  }

  .hive-license-button {
    width: auto;
    height: 34px;
    min-width: 0;
    min-height: 34px;
    gap: 7px;
    padding: 0 8px;
    border-radius: 999px;
  }

  .hive-license-badge-icon {
    width: 22px;
    height: 25px;
    flex-basis: 22px;
  }

  .hive-license-badge-arrow {
    display: grid;
    width: auto;
    height: auto;
    flex: 0 0 auto;
    color: var(--license-accent-strong);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
  }

  .hive-license-badge-arrow::before {
    display: none;
  }

  .hive-wx-fab {
    right: 14px;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  body.hive-locked .hive-wx-fab {
    top: 14px;
    right: 14px;
    bottom: auto;
  }
}

@media (max-width: 360px) {
  .topbar-left {
    min-width: 0;
    white-space: nowrap;
  }

  .hive-license-button {
    width: auto;
    min-width: 0;
    max-width: none;
    gap: 7px;
    padding-inline: 8px;
  }

  .hive-license-badge-icon {
    width: 20px;
    height: 23px;
    flex-basis: 20px;
  }

  .top-action {
    width: 34px;
    min-height: 34px;
    flex: 0 0 34px;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    font-size: 0;
  }

  .top-action-label {
    display: none;
  }

  .top-action-arrow {
    display: none;
  }
}

@media (max-width: 920px) {
  .topbar {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--surface);
  }

  .hive-license-button {
    overflow: visible;
    isolation: auto;
  }

  .hive-license-button::before,
  .hive-license-button::after,
  .hero-readout::after {
    display: none;
  }

  .hive-license-badge-icon {
    filter: none;
  }

  .hero-readout {
    overflow: visible;
    isolation: auto;
  }

  .hero-readout > .readout-item {
    background: var(--surface-raised);
  }
}

@media (max-width: 680px) {
  .locations-panel {
    padding: 16px 14px 18px;
    border-radius: 18px;
  }

  .locations-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 3px 10px;
    margin-bottom: 0;
  }

  .locations-head > div {
    min-width: 0;
  }

  .locations-head .control-title {
    font-size: 18px;
  }

  .locations-head .control-kicker {
    grid-column: 1 / -1;
    margin-top: 3px;
    line-height: 1.45;
  }

  .locations-head .candidate-count {
    align-self: start;
  }

  .anchor-list-toolbar {
    display: block;
    margin-top: 10px;
  }

  .anchor-list-toolbar .section-rule {
    display: none;
  }

  .anchor-list-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px;
    width: 100%;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
  }

  .anchor-mode-control {
    min-width: 0;
    justify-content: flex-start;
  }

  .anchor-mode-label {
    font-size: 12px;
  }

  .anchor-list-actions > .anchor-select-all {
    width: 100%;
    min-height: 32px;
    padding-inline: 8px;
  }

  .locations-panel #anchorList {
    gap: 9px;
    margin-top: 10px;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    padding-right: 4px;
    scrollbar-color: var(--line-strong) transparent;
    scrollbar-gutter: stable;
  }
}
