﻿/* ==========================================================================
   Academic Station Wave1 · 燈下試席 / The Beacon Exam Desk
   --------------------------------------------------------------------------
   Scope: five Academic Station public trees only. Display layer only.
   No new palette: every colour is a Fleet Nocturnal Beacon token.
   No line-break markup, no emoji, no new font, no external asset.
   Hooks: never replaces an existing button/id; only skins and relabels.
   ========================================================================== */

#beacon-desk {
  position: relative;
  z-index: 25;
  box-sizing: border-box;
  width: min(var(--fleet-wrap, 1180px), calc(100% - 32px));
  margin: 14px auto 10px;
  padding: 18px 20px 16px;
  border: 1px solid var(--fleet-line-soft);
  border-radius: var(--fleet-r-card);
  background:
    linear-gradient(180deg, rgba(var(--fleet-amber-rgb), 0.045), transparent 42%),
    var(--fleet-surface);
  box-shadow: var(--fleet-shadow-panel);
  color: var(--fleet-text);
  font-family: var(--fleet-ui);
}

#beacon-desk *,
#beacon-pass *,
.beacon-cta-sub,
.beacon-ghost-note {
  box-sizing: border-box;
}

#beacon-desk::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  border-radius: var(--fleet-r-card) var(--fleet-r-card) 0 0;
  background: var(--fleet-amber);
  opacity: 0.85;
}

.bk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.bk-kicker,
.bk-pass-kicker,
.bk-ghost-kicker {
  margin: 0 0 5px;
  color: var(--fleet-amber-soft);
  font-size: var(--fleet-fs-micro);
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.bk-title {
  margin: 0;
  color: var(--fleet-text);
  font-family: var(--fleet-display);
  font-size: clamp(22px, 2.8vw, 31px);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.15;
}

.bk-sub {
  margin: 7px 0 0;
  color: var(--fleet-body);
  font-size: var(--fleet-fs-small);
  line-height: 1.55;
}

.bk-sub b {
  color: var(--fleet-amber-soft);
  font-weight: 700;
}

.bk-station {
  flex: 0 0 auto;
  max-width: 250px;
  padding: 6px 9px;
  border: 1px solid var(--fleet-line);
  border-radius: var(--fleet-r-chip);
  color: var(--fleet-amber-soft);
  font-size: var(--fleet-fs-micro);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-align: right;
}

.bk-ruler {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 15px 0 0;
  padding: 9px 0 0;
  border-top: 1px solid var(--fleet-line-soft);
}

.bk-ruler::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--fleet-line-cool) 0 1px,
    transparent 1px 12px
  );
  opacity: 0.55;
  pointer-events: none;
}

.bk-step {
  position: relative;
  min-width: 0;
  padding: 8px 9px 7px;
  border: 1px solid var(--fleet-line-soft);
  border-radius: var(--fleet-r-control);
  background: var(--fleet-bg);
  color: var(--fleet-muted-strong);
}

.bk-step::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: transparent;
}

.bk-step.is-done {
  border-color: var(--fleet-line-cool);
  color: var(--fleet-body);
}

.bk-step.is-current {
  border-color: var(--fleet-line);
  background: var(--fleet-raised);
  color: var(--fleet-text);
  box-shadow: inset 0 0 0 1px rgba(var(--fleet-amber-rgb), 0.08);
}

.bk-step.is-current::before {
  background: var(--fleet-amber);
}

.bk-step-top {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.bk-num {
  color: var(--fleet-muted);
  font-family: var(--fleet-ui-en);
  font-size: var(--fleet-fs-micro);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.bk-step.is-done .bk-num {
  color: var(--fleet-jade-text);
}

.bk-step.is-current .bk-num {
  color: var(--fleet-amber-soft);
}

.bk-step-label {
  color: inherit;
  font-size: var(--fleet-fs-ui);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.bk-step-hint {
  display: block;
  margin: 3px 0 0;
  color: var(--fleet-muted);
  font-size: 10.5px;
  line-height: 1.35;
}

.bk-step.is-current .bk-step-hint {
  color: var(--fleet-body);
}

.bk-annotations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 11px 0 0;
}

.bk-ann-label {
  margin-right: 2px;
  color: var(--fleet-muted);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.bk-ann {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--fleet-line-cool);
  border-radius: var(--fleet-r-chip);
  background: var(--fleet-bg);
  color: var(--fleet-body);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
}

.bk-ann::before {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid var(--fleet-amber);
  border-radius: 1px;
  transform: rotate(45deg);
}

.bk-state {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-left: 2px solid var(--fleet-line);
  background: var(--fleet-bg);
  color: var(--fleet-body);
  font-size: var(--fleet-fs-small);
  line-height: 1.55;
}

.bk-state[data-tone="done"] {
  border-left-color: var(--fleet-jade-text);
}

.bk-state[data-tone="error"] {
  border-left-color: var(--fleet-line-cool);
  color: var(--fleet-muted-strong);
}

.bk-state b {
  color: var(--fleet-amber-soft);
  font-weight: 700;
}

/* The one primary CTA. Existing id/listener kept; only the label and skin change. */
[data-beacon-primary="1"] {
  position: relative;
  min-height: var(--fleet-touch) !important;
  border: 1px solid var(--fleet-amber) !important;
  border-radius: var(--fleet-r-control) !important;
  background: var(--fleet-amber) !important;
  color: var(--fleet-ink) !important;
  box-shadow: var(--fleet-shadow-amber) !important;
  font-size: var(--fleet-fs-ui) !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
}

[data-beacon-primary="1"]:hover {
  background: var(--fleet-amber-soft) !important;
  border-color: var(--fleet-amber-soft) !important;
}

[data-beacon-primary="1"]:focus-visible {
  outline: 2px solid var(--fleet-focus);
  outline-offset: 2px;
}

.beacon-cta-sub {
  margin: 7px 0 0;
  color: var(--fleet-muted-strong);
  font-family: var(--fleet-ui);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  line-height: 1.45;
}

/* Five-seat pass, always a card — never a blocking paywall. */
#beacon-pass {
  position: relative;
  z-index: 24;
  box-sizing: border-box;
  width: min(var(--fleet-wrap, 1180px), calc(100% - 32px));
  margin: 10px auto 14px;
  padding: 14px 16px;
  border: 1px solid var(--fleet-line-soft);
  border-radius: var(--fleet-r-card);
  background: var(--fleet-bg);
  color: var(--fleet-body);
  font-family: var(--fleet-ui);
}

.bk-pass-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bk-pass-title {
  margin: 0;
  color: var(--fleet-text);
  font-family: var(--fleet-display);
  font-size: var(--fleet-fs-title);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.25;
}

.bk-pass-kicker {
  margin: 0;
}

.bk-pass-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 11px 0 0;
}

.bk-pass-row {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--fleet-line-cool);
  border-radius: var(--fleet-r-control);
  background: var(--fleet-surface);
}

.bk-pass-row b {
  display: block;
  margin: 0 0 3px;
  color: var(--fleet-amber-soft);
  font-size: var(--fleet-fs-small);
  font-weight: 800;
  letter-spacing: 0.06em;
}

.bk-pass-row p {
  margin: 0;
  color: var(--fleet-body);
  font-size: 11px;
  line-height: 1.55;
}

.bk-pass-note {
  margin: 10px 0 0;
  color: var(--fleet-muted-strong);
  font-size: 10.5px;
  line-height: 1.6;
}

.bk-pass-note b {
  color: var(--fleet-body);
  font-weight: 700;
}

.bk-pass-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-top: 8px;
  color: var(--fleet-amber-soft);
  font-size: 11px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bk-pass-link:hover {
  color: var(--fleet-text);
}

.bk-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 4px;
  padding: 2px 7px;
  border: 1px solid var(--fleet-line-cool);
  border-radius: var(--fleet-r-chip);
  color: var(--fleet-muted-strong);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* Ghost marking entrance: existing button, dashed skin, no second amber fill. */
[data-beacon-ghost="1"] {
  border-style: dashed !important;
  border-color: var(--fleet-line-cool) !important;
  background: transparent !important;
  color: var(--fleet-body) !important;
  box-shadow: none !important;
}

[data-beacon-ghost="1"]::before {
  content: "GHOST";
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-right: 7px;
  padding: 1px 5px;
  border: 1px solid var(--fleet-line-cool);
  border-radius: var(--fleet-r-chip);
  color: var(--fleet-muted-strong);
  font-family: var(--fleet-ui-en);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  vertical-align: middle;
}

.beacon-ghost-note {
  position: static;
  display: block;
  clear: both;
  float: none;
  width: auto;
  max-width: 100%;
  margin: 12px 0 8px;
  padding: 7px 9px;
  border-left: 2px solid var(--fleet-line);
  background: var(--fleet-surface);
  color: var(--fleet-muted-strong);
  font-family: var(--fleet-ui);
  font-size: 10.5px;
  line-height: 1.55;
  inset: auto;
  transform: none;
}

#writing-submode-toggle-wrap > .beacon-ghost-note {
  position: static !important;
  display: block;
  width: 100%;
  margin: 12px 0 0 !important;
}

.beacon-ghost-note b {
  color: var(--fleet-amber-soft);
  font-weight: 700;
}

@media (max-width: 720px) {
  #beacon-desk,
  #beacon-pass {
    width: calc(100% - 24px);
    margin-left: auto;
    margin-right: auto;
  }
  #beacon-desk {
    margin-top: 10px;
    padding: 15px 14px 13px;
  }
  .bk-head {
    display: block;
  }
  .bk-station {
    display: inline-block;
    max-width: 100%;
    margin-top: 8px;
    text-align: left;
  }
  .bk-ruler {
    gap: 5px;
  }
  .bk-step {
    padding: 7px 6px 6px;
  }
  .bk-step-label {
    font-size: 12px;
  }
  .bk-step-hint {
    font-size: 9.5px;
  }
  .bk-pass-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .bk-title {
    font-size: 22px;
  }
  .bk-step-hint {
    display: none;
  }
  .bk-annotations {
    gap: 5px;
  }
  .bk-ann {
    font-size: 9.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #beacon-desk,
  #beacon-pass,
  [data-beacon-primary="1"] {
    transition: none !important;
  }
}

/* Secondary solid actions stay available, but never compete with 開卷做一練. */
#forgeBtn,
#focusForgeBtn,
#action-btn,
.btn-decode,
.btn-forge {
  background: transparent !important;
  background-image: none !important;
  color: var(--fleet-text) !important;
  border: 1px solid var(--fleet-line-cool) !important;
  box-shadow: none !important;
}

#forgeBtn:hover,
#focusForgeBtn:hover,
#action-btn:hover,
.btn-decode:hover,
.btn-forge:hover {
  border-color: var(--fleet-line) !important;
  background: var(--fleet-raised) !important;
  color: var(--fleet-text) !important;
}

