:root {
  --bg: #11161f;
  --bg-soft: #171f2b;
  --panel: #1d2634;
  --panel-2: #222e40;
  --ink: #ecf2ff;
  --muted: #a7b2c7;
  --accent: #2ecad0;
  --accent-soft: rgba(46, 202, 208, 0.015);
  --accent-strong: rgba(46, 202, 208, 0.14);
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(46, 202, 208, 0.12), transparent 24%),
    radial-gradient(circle at bottom right, rgba(66, 120, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #0f141c 0%, var(--bg) 100%);
  overflow: hidden;
}

.layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  height: 100vh;
}

.sidebar {
  height: 100vh;
  overflow: auto;
  padding: 26px 20px 28px;
  border-right: 1px solid var(--border);
  background: rgba(18, 24, 34, 0.88);
  backdrop-filter: blur(16px);
}

.sidebar h1 {
  margin: 0 0 10px;
  font-size: 1.65rem;
  letter-spacing: 0.02em;
}

.subtitle,
.counter,
.screen-description,
.detail-panel p,
.screen-link-copy span {
  color: var(--muted);
}

.subtitle {
  margin: 0 0 10px;
  line-height: 1.45;
}

.counter {
  margin: 0 0 22px;
  font-size: 0.92rem;
}

.screen-list {
  display: grid;
  gap: 10px;
}

.screen-link {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  text-align: left;
  background: linear-gradient(180deg, rgba(34, 46, 64, 0.92), rgba(25, 34, 48, 0.92));
  color: inherit;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.screen-link:hover,
.screen-link.is-active {
  transform: translateY(-1px);
  border-color: rgba(46, 202, 208, 0.5);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.screen-link.is-active {
  background: linear-gradient(180deg, rgba(36, 61, 72, 0.98), rgba(23, 40, 50, 0.98));
}

.screen-link-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.screen-link-copy {
  display: grid;
  gap: 4px;
}

.screen-link-copy strong {
  font-size: 0.98rem;
  line-height: 1.2;
}

.screen-link-copy span {
  font-size: 0.87rem;
  line-height: 1.35;
}

.content {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 28px;
}

.content-header {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.content-header h2 {
  margin: 0 0 8px;
  font-size: 1.9rem;
}

.viewer {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: stretch;
  overflow: hidden;
}

.header-tools {
  display: flex;
  justify-content: flex-end;
}

.editor-toggle,
.editor-button,
.editor-select {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.editor-toggle,
.editor-button {
  padding: 10px 14px;
  cursor: pointer;
}

.editor-toggle:hover,
.editor-button:hover {
  border-color: rgba(46, 202, 208, 0.55);
}

.canvas-wrap,
.detail-panel {
  height: 100%;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.canvas-wrap {
  display: flex;
  flex-direction: column;
  background: #0f141c;
  overflow: hidden;
}

.canvas-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom-range {
  width: 180px;
}

.zoom-level {
  min-width: 54px;
  text-align: right;
  color: var(--muted);
  font-size: 0.92rem;
}

.canvas-scroll {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  padding: 14px;
}

.canvas-stage {
  position: relative;
  width: fit-content;
  margin: 0 auto;
}

.screen-image {
  display: block;
  width: 100%;
  max-width: none;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
}

.editor-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  cursor: crosshair;
}

.editor-box {
  position: absolute;
  display: none;
  border: 2px dashed #ff8f6b;
  background: rgba(255, 143, 107, 0.08);
  border-radius: 10px;
  pointer-events: none;
}

.editor-crosshair {
  position: absolute;
  display: none;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border: 2px solid #ff8f6b;
  border-radius: 999px;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  border: 2px solid rgba(46, 202, 208, 0.22);
  background: var(--accent-soft);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.hotspot:hover,
.hotspot.is-active {
  transform: scale(1.01);
  background: var(--accent-strong);
  border-color: #8df7fa;
  box-shadow: inset 0 0 0 1px rgba(141, 247, 250, 0.18);
}

.hotspot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  margin: 10px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(10, 15, 22, 0.82);
  color: #dffbfd;
  font-size: 0.84rem;
  font-weight: 700;
}

.detail-panel {
  min-height: 0;
  overflow: auto;
  padding: 20px;
  background: linear-gradient(180deg, rgba(28, 38, 52, 0.96), rgba(21, 29, 41, 0.96));
  backdrop-filter: blur(12px);
}

.detail-head {
  margin-bottom: 18px;
}

.detail-panel h3 {
  margin: 0 0 10px;
  font-size: 1.22rem;
}

.detail-panel p {
  margin: 0;
  line-height: 1.55;
}

.detail-meta {
  display: grid;
  gap: 10px;
}

.editor-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.editor-help {
  font-size: 0.94rem;
}

.editor-controls {
  display: grid;
  gap: 6px;
}

.editor-label {
  font-size: 0.88rem;
  color: var(--muted);
}

.editor-select {
  width: 100%;
  padding: 10px 12px;
}

.editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-output {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  color: #dffbfd;
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.hotspot.is-overridden {
  border-color: rgba(255, 143, 107, 0.55);
}

.hotspot-chip.is-overridden {
  border-color: rgba(255, 143, 107, 0.4);
  background: rgba(255, 143, 107, 0.12);
}

.meta-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

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

.hotspot-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.hotspot-chip:hover,
.hotspot-chip.is-active {
  border-color: rgba(46, 202, 208, 0.55);
  background: rgba(46, 202, 208, 0.14);
  transform: translateY(-1px);
}

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

  .sidebar {
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .viewer {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .detail-panel {
    height: auto;
    overflow: visible;
  }

  .content-header {
    flex-direction: column;
  }

  body {
    overflow: auto;
  }

  .content {
    height: auto;
    overflow: visible;
  }
}
