/* 密圈 Evaluation Kit — dark theme informed by AllView CIS hues
   (Formosa blue #0D3B66, dawn gold #F4A261, teal #2A9D8F / #7FD6CB,
   titanium white #F8F9FA), inverted to a dark sandbox surface.
   CIS tokens themselves remain draft; this is a prototype adaptation. */

:root {
  --bg: #070d16;
  --bg-elev: #0c1624;
  --surface: #101c2e;
  --surface-2: #16243a;
  --line: rgba(127, 214, 203, 0.16);
  --line-strong: rgba(244, 162, 97, 0.35);
  --text: #f8f9fa;
  --muted: #8aa0ae;
  --faint: #5d7382;
  --gold: #f4a261;
  --gold-dim: rgba(244, 162, 97, 0.16);
  --teal: #2a9d8f;
  --teal-bright: #7fd6cb;
  --teal-dim: rgba(127, 214, 203, 0.14);
  --formosa: #0d3b66;
  --ink: #264653;
  --danger: #e07a5f;
  --danger-dim: rgba(224, 122, 95, 0.16);
  --ok: #7fd6cb;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Noto Sans TC", "Noto Sans CJK TC", "Source Han Sans TC",
    "PingFang TC", "Microsoft JhengHei", "Noto Sans", sans-serif;
  --mono: "Noto Sans Mono CJK TC", "SFMono-Regular", "Menlo", "Consolas",
    ui-monospace, monospace;
  --header-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100%;
}

body {
  background-image:
    radial-gradient(1200px 600px at 12% -10%, rgba(13, 59, 102, 0.55), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(42, 157, 143, 0.16), transparent 55%),
    linear-gradient(180deg, #070d16 0%, #0a1522 100%);
  background-attachment: fixed;
}

a {
  color: var(--teal-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -40px;
  background: var(--gold);
  color: #1a1208;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  z-index: 20;
}
.skip-link:focus {
  top: 0.6rem;
}

.app-header {
  position: relative;
  top: auto;
  z-index: 20;
  min-height: var(--header-h);
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 1.25rem;
  background: rgba(7, 13, 22, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
  line-height: 1.2;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--line-strong);
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: none;
}

.badge-demo {
  border-color: var(--line);
  background: var(--teal-dim);
  color: var(--teal-bright);
}

.badge-warn {
  border-color: rgba(224, 122, 95, 0.35);
  background: var(--danger-dim);
  color: #f0b4a4;
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.lang-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.25rem 0.65rem;
  cursor: pointer;
}

.lang-toggle button[aria-pressed="true"] {
  background: var(--formosa);
  color: var(--text);
}

.screen {
  display: none;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.screen.active,
.screen.active[hidden] {
  display: block !important;
}

/* —— Landing —— */
.hero {
  text-align: center;
  padding: 2.2rem 0 1.5rem;
}

.kicker {
  color: var(--gold);
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  margin: 0 0 1rem;
}

.hero h1 {
  font-size: clamp(1.55rem, 3.4vw, 2.35rem);
  line-height: 1.35;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: 0.01em;
}

.tagline {
  font-size: 1.15rem;
  color: var(--teal-bright);
  margin: 0 0 0.85rem;
}

.lead {
  max-width: 40rem;
  margin: 0 auto 1rem;
  color: var(--text);
  font-size: 1.02rem;
}

.fine-print {
  max-width: 42rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.cta-row {
  margin: 1.75rem 0 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  font-weight: 650;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--teal-bright);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(180deg, #f6b277 0%, var(--gold) 100%);
  color: #1a1208;
  box-shadow: 0 8px 24px rgba(244, 162, 97, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(244, 162, 97, 0.4);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-2);
}

.btn-small {
  padding: 0.45rem 0.95rem;
  font-size: 0.9rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.4rem;
}

.card {
  background: linear-gradient(180deg, rgba(22, 36, 58, 0.9), rgba(16, 28, 46, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-footer {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  color: var(--faint);
  font-size: 0.78rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: grid;
  gap: 0.35rem;
}

/* —— Scenario pick —— */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.choice {
  text-align: left;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.3rem 1.15rem;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 0.45rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.choice:hover,
.choice:focus-visible {
  border-color: var(--gold);
  transform: translateY(-2px);
  outline: none;
}

.choice h3 {
  margin: 0;
  font-size: 1.2rem;
}

.choice p {
  margin: 0;
  color: var(--muted);
}

.choice .meta {
  color: var(--gold);
  font-size: 0.8rem;
}

/* —— Demo —— */
.demo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.progress-block {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: min(100%, 360px);
  flex: 1;
}

.ring {
  --p: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ring span {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-elev);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.progress-copy strong {
  display: block;
  font-size: 0.95rem;
}

.progress-copy span,
.progress-copy p {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pane-left {
  border-top: 3px solid var(--danger);
}

.pane-right {
  border-top: 3px solid var(--teal-bright);
}

.pane-head {
  padding: 0.9rem 1rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.pane-head h3 {
  margin: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pane-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.chat {
  flex: 1;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 220px;
  max-height: 320px;
  overflow: auto;
}

.bubble {
  max-width: 86%;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  animation: rise 0.35s ease;
}

.bubble .who {
  display: block;
  font-size: 0.7rem;
  color: var(--faint);
  margin-bottom: 0.15rem;
}

.bubble.you {
  align-self: flex-end;
  background: #1c334c;
  border: 1px solid rgba(127, 214, 203, 0.18);
}

.bubble.peer {
  align-self: flex-start;
  background: #1a2433;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pane-left .bubble {
  background: #2a1d1c;
  border-color: rgba(224, 122, 95, 0.25);
}

.pane-caption {
  padding: 0 1rem;
  color: var(--faint);
  font-size: 0.72rem;
}

.server-log {
  margin: 0.55rem 0.7rem 0.8rem;
  padding: 0.6rem 0.7rem;
  background: #080e16;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.45;
  color: #b7c4ce;
  min-height: 88px;
  max-height: 132px;
  overflow: auto;
}

.server-log .log-title {
  font-family: var(--font);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-transform: none;
}

.log-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
  animation: cipher-in 0.45s ease;
  word-break: break-all;
}

.log-line time {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.log-line.plain {
  color: #f0b4a4;
}

.log-line.cipher {
  color: var(--teal-bright);
}

.log-line.cipher.is-new {
  animation: cipher-in 0.45s ease, pulse-encrypt 0.9s ease;
}

.matching {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem;
  background: var(--bg-elev);
}

.matching h3 {
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.matching .lead-sim {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0 0 0.9rem;
}

.vectors {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.7rem;
  align-items: center;
}

.vector {
  background: #0a111b;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
}

.vector h4 {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.cells {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.25rem;
}

.cell {
  font-family: var(--mono);
  font-size: 0.58rem;
  text-align: center;
  padding: 0.35rem 0.1rem;
  border-radius: 6px;
  background: #132033;
  color: var(--teal-bright);
  border: 1px solid transparent;
}

.cell.locked::before {
  content: "🔒";
  display: block;
  font-size: 0.55rem;
  margin-bottom: 0.1rem;
}

.cell.compare {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(244, 162, 97, 0.35);
}

.cell.match-hi {
  background: rgba(42, 157, 143, 0.28);
}

.cell.match-lo {
  background: rgba(224, 122, 95, 0.22);
  color: #f0b4a4;
}

.compare-col {
  text-align: center;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 650;
}

.matching-status {
  margin: 0.85rem 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.sim-score {
  font-variant-numeric: tabular-nums;
  color: var(--teal-bright);
  font-weight: 700;
}

/* —— Result —— */
.result-wrap {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 1.4rem;
  align-items: start;
}

.score-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem 1.3rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.score-card .kicker {
  margin-bottom: 0.4rem;
}

.gauge {
  --p: 0;
  width: 180px;
  height: 180px;
  margin: 0.4rem auto 0.7rem;
  border-radius: 50%;
  background: conic-gradient(var(--gauge) calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0);
  display: grid;
  place-items: center;
}

.gauge-inner {
  width: 138px;
  height: 138px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-inner .num {
  font-size: 2.6rem;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.gauge-inner .den {
  color: var(--muted);
  font-size: 0.85rem;
}

.breakdown {
  display: grid;
  gap: 0.9rem;
}

.signal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.signal .row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
}

.signal .val {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--teal-bright);
}

.signal.risk .val {
  color: #f0b4a4;
}

.bar {
  margin: 0.45rem 0 0.35rem;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--teal-bright));
  transition: width 0.8s ease;
}

.signal.risk .bar > span {
  background: linear-gradient(90deg, #c96b54, #e07a5f);
}

.signal p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.result-note {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* —— Animations —— */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cipher-in {
  from {
    filter: blur(6px);
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    filter: none;
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse-encrypt {
  0% {
    box-shadow: 0 0 0 0 rgba(127, 214, 203, 0.45);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(127, 214, 203, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 860px) {
  .features,
  .choice-grid,
  .dual,
  .result-wrap,
  .vectors {
    grid-template-columns: 1fr;
  }

  .compare-col {
    transform: rotate(90deg);
    padding: 0.2rem 0;
  }

  .hero {
    padding-top: 1.2rem;
  }

  .chat {
    max-height: 260px;
  }

  .app-header {
    padding: 0 0.8rem;
  }

  .brand-sub {
    max-width: 42vw;
  }
}

@media (max-width: 420px) {
  .cells {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* —— v0.1.1 layout additions —— */
.site-top {
  position: sticky;
  top: 0;
  z-index: 30;
}

.site-banner {
  position: relative;
  top: auto;
  z-index: 30;
  text-align: center;
  background: #f4a261;
  color: #1a1208;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.8rem;
}

.body {
  padding-top: 0;
}

.trust-line {
  max-width: 44rem;
  margin: 0 auto 0.85rem;
  color: var(--teal-bright);
  font-size: 0.88rem;
}

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

.choice .emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.demo-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.step-bar {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  margin: 0 0 0.7rem;
  padding: 0;
}

.step-bar li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.55rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--surface);
}

.step-bar li.is-on {
  border-color: var(--gold);
  color: var(--text);
  background: var(--gold-dim);
  font-weight: 650;
}

.step-copy {
  margin-bottom: 0.85rem;
}

.step-micro {
  margin: 0 0 0.2rem;
  font-weight: 650;
}

.badge-sim {
  border-color: rgba(244, 162, 97, 0.55);
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.bubble.locked-bubble {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--teal-bright);
  word-break: break-all;
}

.matching.is-live {
  outline: 1px dashed rgba(244, 162, 97, 0.45);
}

.score-badges {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

.result-level {
  font-weight: 700;
  font-size: 0.95rem;
}

.field-label {
  margin: 1rem 0 0.35rem;
  font-size: 0.95rem;
}

.signal-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text);
}

.signal-list li {
  margin: 0.3rem 0;
}

.card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 860px) {
  .choice-grid-3,
  .step-bar {
    grid-template-columns: 1fr;
  }
}
