@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #f1efe9;
  --bg-elevated: rgba(255, 255, 255, 0.62);
  --panel: rgba(255, 255, 255, 0.4);
  --panel-strong: rgba(255, 255, 255, 0.55);
  --border: rgba(40, 30, 20, 0.1);
  --border-strong: rgba(40, 30, 20, 0.18);
  --text-main: #1c1a22;
  --text-muted: #6f6a75;
  --text-faint: #a6a0a8;
  --accent-a: #5b35e0;
  --accent-b: #e0635b;
  --accent-c: #d9a32a;
  --accent-warn: #c4711a;
  --accent-green: #1f9d6b;
  --radius: 18px;
  --radius-sm: 10px;
  --sidebar-w: 252px;
  --font-sans: "Manrope", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* HXFlow Agent 安装中心 */
.agent-cloud-main {
  max-width: 1240px;
}

.agent-install-center {
  display: grid;
  gap: 22px;
}

.agent-install-center[hidden],
.agent-install-detail[hidden] {
  display: none;
}

.agent-install-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(100, 71, 224, 0.14);
  border-radius: 26px;
  background:
    radial-gradient(circle at 84% 16%, rgba(91, 53, 224, 0.17), transparent 34%),
    radial-gradient(circle at 12% 92%, rgba(224, 99, 91, 0.13), transparent 32%),
    rgba(255, 255, 255, 0.62);
  box-shadow: 0 24px 70px rgba(52, 38, 82, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.agent-install-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -70px;
  right: -42px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(91, 53, 224, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(91, 53, 224, 0.025), 0 0 0 72px rgba(224, 99, 91, 0.02);
}

.agent-install-kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--accent-a);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.agent-install-hero h2,
.agent-install-detail h2,
.agent-workbench-intro h2 {
  margin: 0;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.agent-install-hero h2 {
  font-size: clamp(25px, 3.5vw, 38px);
}

.agent-install-hero p {
  max-width: 660px;
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.agent-install-stat {
  flex: 0 0 auto;
  min-width: 104px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  text-align: center;
  box-shadow: 0 14px 40px rgba(52, 38, 82, 0.08);
}

.agent-install-stat strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.agent-install-stat span {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.agent-directory-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(119, 112, 132, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 12px 34px rgba(45, 37, 64, 0.06);
}

.agent-directory-toolbar label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid rgba(119, 112, 132, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.agent-directory-toolbar label > span {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
}

.agent-directory-toolbar input,
.agent-directory-toolbar select {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-main);
  font: 600 13px var(--font-sans);
}

.agent-install-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.agent-install-card {
  position: relative;
  display: flex;
  min-height: 290px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid rgba(119, 112, 132, 0.16);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.52)),
    radial-gradient(circle at 12% 0%, rgba(91, 53, 224, 0.08), transparent 38%);
  box-shadow: 0 16px 44px rgba(45, 37, 64, 0.07);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.agent-install-card:hover,
.agent-install-card.selected {
  transform: translateY(-2px);
  border-color: rgba(91, 53, 224, 0.3);
  box-shadow: 0 22px 56px rgba(55, 38, 110, 0.12);
}

.agent-install-card.selected::after {
  content: "当前选择";
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(91, 53, 224, 0.1);
  color: var(--accent-a);
  font-size: 10px;
  font-weight: 800;
}

.agent-install-card-top,
.agent-install-card-foot,
.agent-install-detail-head,
.agent-install-actions,
.agent-command-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-install-icon {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(45, 37, 64, 0.16);
}

.agent-install-icon-orange {
  background: linear-gradient(135deg, #ef8e38, #d35f45);
}

.agent-install-icon-violet {
  background: linear-gradient(135deg, #7250ee, #9f5cc8);
}

.agent-install-version {
  display: grid;
  justify-items: end;
  gap: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.agent-install-version strong {
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 12px;
}

.agent-install-card h3 {
  margin: 24px 0 8px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.agent-install-card > p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.agent-install-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0;
}

.agent-install-tags span {
  padding: 5px 9px;
  border: 1px solid rgba(119, 112, 132, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.agent-install-card-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(119, 112, 132, 0.12);
}

.agent-install-card-foot > span {
  color: var(--text-faint);
  font-size: 11px;
}

.agent-install-empty {
  grid-column: 1 / -1;
  padding: 44px 20px;
  border: 1px dashed rgba(119, 112, 132, 0.24);
  border-radius: 18px;
  color: var(--text-muted);
  text-align: center;
}

.agent-install-detail {
  scroll-margin-top: 20px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(91, 53, 224, 0.2);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 24px 64px rgba(52, 38, 82, 0.1);
}

.agent-install-detail h2 {
  font-size: clamp(22px, 3vw, 30px);
}

.agent-install-detail h2 small {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 12px;
}

.agent-install-detail-head p {
  margin: 8px 0 0;
  color: var(--text-muted);
}

.agent-detail-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(119, 112, 132, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-main);
  cursor: pointer;
  font-size: 22px;
}

.agent-install-actions {
  justify-content: flex-start;
  margin: 24px 0 16px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(91, 53, 224, 0.06);
}

.agent-install-actions > span {
  color: var(--text-muted);
  font-size: 12px;
}

.agent-download-btn {
  text-decoration: none;
}

.agent-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.agent-command-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(119, 112, 132, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.agent-command-head strong {
  font-size: 15px;
}

.agent-command-head span {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
}

.agent-command-card pre {
  min-height: 138px;
  margin: 12px 0;
  overflow: auto;
  padding: 14px;
  border-radius: 12px;
  background: #17151d;
  color: #f3effa;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent-command-card code {
  font: 11px/1.7 var(--font-mono);
}

.agent-command-card .btn {
  width: 100%;
}

.agent-install-feedback {
  min-height: 20px;
  margin: -8px 0 0;
  color: var(--accent-green);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 820px) {
  .agent-install-grid,
  .agent-command-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .agent-install-hero {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 20px;
  }

  .agent-install-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    padding: 10px 14px;
  }

  .agent-install-stat strong,
  .agent-install-stat span {
    display: inline;
    margin: 0;
  }

  .agent-directory-toolbar {
    grid-template-columns: 1fr;
  }

  .agent-install-card {
    min-height: 270px;
    padding: 18px;
  }

  .agent-install-card-foot,
  .agent-install-detail-head,
  .agent-install-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-detail-close {
    position: absolute;
    right: 20px;
  }

  .agent-install-detail {
    position: relative;
  }

  .agent-install-actions .btn {
    text-align: center;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  font-size: 14px;
  position: relative;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 0.45s ease;
}

html[data-world="cyber"] body::before {
  opacity: 0.22;
  filter: none;
  background-image:
    radial-gradient(circle at 18% 10%, rgba(18, 46, 138, 0.26), transparent 34%),
    radial-gradient(circle at 84% 16%, rgba(170, 196, 255, 0.10), transparent 30%),
    linear-gradient(110deg, rgba(3, 7, 15, 0.98), rgba(7, 14, 30, 0.92) 50%, rgba(3, 7, 15, 0.98));
}

html[data-world="forest"] body::before {
  opacity: 0;
  filter: none;
  background-image:
    linear-gradient(90deg, rgba(2, 8, 5, 0.54), rgba(5, 18, 10, 0.16));
}

html[data-world="cyber"] .bg-glow,
html[data-world="forest"] .bg-glow {
  opacity: 0.12;
}

html[data-world="cyber"] .bg-glow {
  display: none;
}

html[data-world="cyber"] .app,
html[data-world="forest"] .app,
html[data-world="cyber"] .access-bar,
html[data-world="forest"] .access-bar,
html[data-world="cyber"] .modal-backdrop,
html[data-world="forest"] .modal-backdrop {
  display: none !important;
}

html[data-world="real"] .world-stage-shell {
  display: none;
}

.world-stage-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  color: #f7fbff;
}

.world-space {
  min-height: 100vh;
  padding: clamp(32px, 7vw, 84px);
  position: relative;
  overflow: hidden;
}

.world-space[hidden] {
  display: none;
}

.world-hud {
  position: fixed;
  inset: 22px 28px auto 28px;
  display: grid;
  grid-template-columns: 1fr 0.42fr 0.2fr;
  gap: 12px;
  pointer-events: none;
  opacity: 0.62;
}

.world-hud span {
  height: 1px;
  background: linear-gradient(90deg, rgba(34,215,255,0), rgba(34,215,255,0.9), rgba(123,97,255,0));
  box-shadow: 0 0 16px rgba(34,215,255,0.7);
}

.world-hero {
  width: min(760px, calc(100vw - 56px));
  padding-top: 6vh;
}

.world-kicker {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(143, 236, 255, 0.82);
}

.world-hero h1 {
  margin: 0;
  font-size: clamp(42px, 9vw, 106px);
  line-height: 0.9;
  letter-spacing: 0;
  text-shadow: 0 0 30px rgba(34,215,255,0.32);
}

.world-hero p:not(.world-kicker) {
  max-width: 680px;
  margin: 22px 0 0;
  color: rgba(245, 250, 255, 0.78);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.75;
}

.world-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(1080px, calc(100vw - 56px));
  margin-top: clamp(34px, 6vw, 78px);
}

.world-panel {
  min-height: 180px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 22px;
  background: rgba(6, 13, 28, 0.48);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 18px 48px rgba(0,0,0,0.26);
}

.world-panel-primary {
  border-color: rgba(34, 215, 255, 0.42);
  background: linear-gradient(145deg, rgba(18, 88, 136, 0.38), rgba(7, 13, 30, 0.52));
}

.world-panel-index {
  display: block;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  color: rgba(143, 236, 255, 0.8);
}

.world-panel h2 {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: 0;
}

.world-panel p {
  margin: 0;
  color: rgba(245,250,255,0.72);
  line-height: 1.65;
}

.cyber-space {
  --cyber-ink: #f5efea;
  --cyber-muted: rgba(245, 239, 234, 0.62);
  --cyber-base: #050914;
  --cyber-panel: rgba(9, 15, 32, 0.84);
  --cyber-purple: #122e8a;
  --cyber-yellow: #9bbcff;
  --cyber-line: rgba(142, 178, 255, 0.15);
  overflow: visible;
  padding: clamp(20px, 3vw, 34px) clamp(18px, 4vw, 58px) 144px;
  background:
    radial-gradient(circle at 18% 12%, rgba(18, 46, 138, 0.18), transparent 30%),
    radial-gradient(circle at 82% 8%, rgba(155, 188, 255, 0.08), transparent 28%),
    radial-gradient(circle at 52% 94%, rgba(57, 83, 160, 0.12), transparent 30%),
    linear-gradient(rgba(155, 188, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 239, 234, 0.03) 1px, transparent 1px),
    #040812;
  background-size: 100% 100%, 100% 100%, 100% 100%, 34px 34px, 34px 34px, 100% 100%;
}

.cyber-space::before,
.cyber-space::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.cyber-space::before {
  inset: 0;
  background:
    linear-gradient(118deg, transparent 0 47%, rgba(155, 188, 255, 0.035) 48%, transparent 50%),
    linear-gradient(180deg, rgba(18, 46, 138, 0.08), rgba(5, 9, 20, 0.02));
  opacity: 0.18;
}

.cyber-space::after {
  inset: 0;
  opacity: 0.14;
  background-image:
    linear-gradient(120deg, transparent 0 48%, rgba(155, 188, 255, 0.035) 49%, transparent 50%),
    radial-gradient(circle, rgba(245, 239, 234, 0.26) 1px, transparent 1.5px);
  background-size: 260px 260px, 42px 42px;
}

.cyber-card-nav,
.cyber-vault {
  position: relative;
  z-index: 1;
}

.cyber-card-nav {
  width: min(860px, 100%);
  margin: 0 auto clamp(38px, 5vw, 74px);
  height: 62px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(142, 178, 255, 0.26);
  border-radius: 14px;
  background: rgba(6, 10, 22, 0.88);
  box-shadow:
    0 18px 48px rgba(0, 3, 12, 0.3),
    0 0 0 1px rgba(245, 239, 234, 0.05) inset;
  transition: height 0.42s cubic-bezier(.2,.82,.2,1), background 0.24s ease, box-shadow 0.24s ease;
}

.cyber-card-nav.open {
  height: 252px;
  background: rgba(6, 10, 22, 0.94);
  box-shadow:
    0 22px 58px rgba(0, 3, 12, 0.34),
    0 0 0 1px rgba(142, 178, 255, 0.1) inset;
}

.cyber-nav-top {
  height: 62px;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 8px 10px 8px 16px;
  position: relative;
  z-index: 2;
}

.cyber-menu-button,
.cyber-nav-action,
.cyber-nav-card {
  border: 1px solid rgba(202, 208, 230, 0.16);
  color: var(--cyber-ink);
  background: rgba(245, 239, 234, 0.06);
  cursor: pointer;
}

.cyber-menu-button {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-content: center;
  gap: 6px;
  color: var(--cyber-ink);
  box-shadow: 0 8px 22px rgba(8, 4, 12, 0.22);
}

.cyber-menu-button span {
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform 0.24s ease, opacity 0.2s ease;
}

.cyber-menu-button.open span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.cyber-menu-button.open span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.cyber-nav-title {
  justify-self: center;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 800;
  letter-spacing: 0;
  color: var(--cyber-ink);
}

.cyber-nav-title span {
  color: rgba(245, 239, 234, 0.5);
  font-size: 0.58em;
  font-weight: 600;
  margin-left: 8px;
}

.cyber-nav-action {
  min-height: 38px;
  border-radius: 10px;
  padding: 0 14px;
  font-weight: 700;
  color: #f5efea;
  background: #122e8a;
  border-color: rgba(142, 178, 255, 0.26);
}

.cyber-nav-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 10px 12px 12px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(24px);
  transition: opacity 0.32s ease, transform 0.38s cubic-bezier(.2,.82,.2,1), visibility 0s linear 0.32s;
}

.cyber-card-nav.open .cyber-nav-cards {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0.06s, 0.06s, 0s;
}

.cyber-nav-card {
  min-height: 164px;
  border-radius: 12px;
  padding: 18px 20px;
  text-align: left;
  display: grid;
  align-content: end;
  gap: 8px;
  color: #fff;
  background:
    radial-gradient(circle at 15% 10%, rgba(142, 178, 255, 0.13), transparent 34%),
    #0b1226;
  transition: border-color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.cyber-nav-card:nth-child(2),
.cyber-nav-card:nth-child(3) {
  background:
    radial-gradient(circle at 15% 10%, rgba(142, 178, 255, 0.1), transparent 34%),
    #0e1630;
}

.cyber-nav-card:hover,
.cyber-nav-card.active {
  border-color: rgba(142, 178, 255, 0.64);
  transform: translateY(-2px) scale(0.992);
}

.cyber-nav-card span {
  font-family: var(--font-mono);
  color: rgba(142, 178, 255, 0.9);
  font-size: 12px;
}

.cyber-nav-card strong {
  font-size: 18px;
  color: #ffffff;
}

.cyber-nav-card small {
  color: rgba(236, 239, 249, 0.62);
  font-size: 13px;
}

.cyber-vault {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.cyber-vault-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.cyber-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: rgba(142, 178, 255, 0.72);
}

.cyber-vault-head h1 {
  margin: 0;
  color: var(--cyber-ink);
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1;
  letter-spacing: 0;
}

.cyber-vault-head > p {
  margin: 0;
  color: var(--cyber-muted);
  line-height: 1.72;
  font-size: 15px;
}

.cyber-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  margin-bottom: 28px;
  padding: 0 14px 0 18px;
  border: 1px solid rgba(245, 239, 234, 0.12);
  border-radius: 14px;
  background: rgba(245, 239, 234, 0.07);
  box-shadow:
    0 12px 34px rgba(8, 4, 12, 0.18),
    inset 0 1px 0 rgba(245, 239, 234, 0.08);
}

.cyber-search span {
  color: rgba(142, 178, 255, 0.78);
  font-size: 26px;
}

.cyber-search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--cyber-ink);
  font: 600 16px var(--font-sans);
}

.cyber-search input::placeholder {
  color: rgba(245, 239, 234, 0.42);
}

.cyber-search button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(142, 178, 255, 0.24);
  background: rgba(18, 46, 138, 0.22);
  color: rgba(245, 239, 234, 0.9);
  font-weight: 700;
  cursor: pointer;
  padding: 0 14px;
}

.cyber-search button.active {
  background: rgba(18, 46, 138, 0.34);
}

.cyber-category-rail {
  display: flex;
  gap: 10px;
  margin: -10px 0 24px;
  overflow-x: auto;
  padding: 0 2px 8px;
  scrollbar-width: thin;
}

.cyber-category-rail button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid rgba(245, 239, 234, 0.12);
  border-radius: 999px;
  background: rgba(245, 239, 234, 0.08);
  color: rgba(245, 239, 234, 0.72);
  cursor: pointer;
  font: 800 13px var(--font-sans);
  padding: 0 13px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.cyber-category-rail button:hover {
  transform: scale(0.97);
  background: rgba(245, 239, 234, 0.12);
}

.cyber-category-rail button.active {
  border-color: rgba(142, 178, 255, 0.38);
  background: rgba(18, 46, 138, 0.26);
  color: rgba(245, 239, 234, 0.94);
}

.cyber-masonry {
  display: flex;
  justify-content: center;
  align-items: start;
  gap: 18px;
  max-width: 1380px;
  margin: 0 auto;
  padding-bottom: 32px;
}

.cyber-masonry-column {
  flex: 0 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cyber-resource {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 18px;
  min-height: 256px;
  border: 1px solid rgba(245, 239, 234, 0.14);
  border-radius: 16px;
  color: var(--cyber-ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(142, 178, 255, 0.065), transparent 30%),
    linear-gradient(150deg, rgba(11, 18, 38, 0.88), rgba(5, 9, 20, 0.8));
  box-shadow:
    0 12px 30px rgba(8, 4, 12, 0.22),
    inset 0 1px 0 rgba(245, 239, 234, 0.08);
  animation: cyber-card-rise 0.26s ease;
  animation-delay: calc(var(--i) * 10ms);
  transform-origin: center;
  will-change: transform;
  transition: transform 0.18s cubic-bezier(.2,.8,.2,1), border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.cyber-resource-feature,
.cyber-resource-tall {
  min-height: 354px;
}

.cyber-resource-wide {
  min-height: 300px;
}

.cyber-resource-small {
  min-height: 226px;
}

.cyber-resource:hover {
  transform: scale(0.965);
  border-color: rgba(142, 178, 255, 0.42);
  background:
    radial-gradient(circle at 18% 12%, rgba(142, 178, 255, 0.1), transparent 34%),
    linear-gradient(150deg, rgba(14, 24, 50, 0.92), rgba(6, 11, 24, 0.86));
  box-shadow:
    0 10px 26px rgba(0, 3, 12, 0.26),
    inset 0 1px 0 rgba(142, 178, 255, 0.12);
}

@media (hover: none) {
  .cyber-resource:hover {
    transform: none;
  }
}

.cyber-resource-top,
.cyber-resource-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cyber-resource-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 239, 234, 0.12);
  background: rgba(245, 239, 234, 0.08);
}

.cyber-resource-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 6px;
}

.cyber-resource-type {
  font-family: var(--font-mono);
  color: rgba(142, 178, 255, 0.84);
  font-size: 12px;
  text-transform: uppercase;
}

.cyber-resource h2 {
  margin: 18px 0 10px;
  font-size: 22px;
  letter-spacing: 0;
}

.cyber-resource p {
  margin: 0;
  color: var(--cyber-muted);
  line-height: 1.72;
}

.cyber-resource-preview {
  position: relative;
  height: 112px;
  margin: 18px 0 0;
  overflow: hidden;
  border: 1px solid rgba(245, 239, 234, 0.1);
  border-radius: 12px;
  background:
    radial-gradient(circle at 24% 30%, rgba(142, 178, 255, 0.12), transparent 28%),
    radial-gradient(circle at 78% 58%, rgba(18, 46, 138, 0.24), transparent 32%),
    linear-gradient(135deg, rgba(245, 239, 234, 0.08), rgba(245, 239, 234, 0.03)),
    repeating-linear-gradient(90deg, rgba(245, 239, 234, 0.055) 0 1px, transparent 1px 20px),
    #081022;
  box-shadow: inset 0 1px 0 rgba(245, 239, 234, 0.08);
}

.cyber-resource-preview::before,
.cyber-resource-preview::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.cyber-resource-preview::before {
  inset: 16px 18px;
  border: 1px solid rgba(142, 178, 255, 0.22);
  border-radius: 10px;
  transform: skewX(-9deg);
}

.cyber-resource-preview::after {
  left: 18px;
  right: 18px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(142, 178, 255, 0.42), transparent);
  box-shadow: 0 18px 0 rgba(18, 46, 138, 0.16), 0 -18px 0 rgba(18, 46, 138, 0.12);
}

.cyber-resource-preview span {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: rgba(142, 178, 255, 0.78);
  box-shadow: 0 0 14px rgba(142, 178, 255, 0.24);
}

.cyber-resource-preview span:nth-child(1) {
  width: 7px;
  height: 7px;
  left: 22%;
  top: 34%;
}

.cyber-resource-preview span:nth-child(2) {
  width: 46px;
  height: 2px;
  right: 18%;
  top: 42%;
  opacity: 0.64;
}

.cyber-resource-preview span:nth-child(3) {
  width: 9px;
  height: 9px;
  right: 26%;
  bottom: 24%;
  opacity: 0.8;
}

.cyber-resource-feature .cyber-resource-preview {
  height: 176px;
  background:
    radial-gradient(circle at 50% 46%, rgba(142, 178, 255, 0.13), transparent 18%),
    conic-gradient(from 160deg at 50% 50%, transparent 0 16%, rgba(142, 178, 255, 0.14) 17% 20%, transparent 21% 48%, rgba(18, 46, 138, 0.22) 49% 52%, transparent 53%),
    linear-gradient(145deg, rgba(245,239,234,0.08), rgba(245,239,234,0.02)),
    #050914;
}

.cyber-resource-tall .cyber-resource-preview {
  height: 154px;
}

.cyber-resource-wide .cyber-resource-preview {
  height: 84px;
}

.cyber-resource-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.cyber-resource-tags span {
  border-radius: 999px;
  padding: 5px 10px;
  color: rgba(245, 239, 234, 0.7);
  background: rgba(245, 239, 234, 0.08);
  font-size: 12px;
}

.cyber-resource-foot {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(245, 239, 234, 0.1);
}

.cyber-resource-foot span {
  color: rgba(245, 239, 234, 0.48);
  font-size: 13px;
}

.cyber-resource-foot a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid rgba(142, 178, 255, 0.24);
  color: rgba(245, 239, 234, 0.92);
  text-decoration: none;
  font-weight: 700;
  background: rgba(18, 46, 138, 0.24);
}

.cyber-empty {
  width: min(100%, 720px);
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed rgba(245, 239, 234, 0.18);
  border-radius: 12px;
  color: var(--cyber-muted);
}

@keyframes cyber-card-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.forest-space {
  color: #eef7ea;
  min-height: 100vh;
  padding: 0;
  background: #050806;
  isolation: isolate;
}

.forest-lobby {
  --forest-x: 58%;
  --forest-y: 48%;
  --forest-focus: 0.36;
}

.forest-vital-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #050806;
  contain: layout paint style;
}

.forest-vital-scene::before,
.forest-vital-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.forest-vital-scene::before {
  opacity: 0.42;
  background:
    radial-gradient(circle at var(--forest-x, 58%) var(--forest-y, 48%), rgba(147, 255, 136, 0.16), rgba(12, 42, 18, 0.04) 28vmax, transparent 38vmax),
    linear-gradient(90deg, rgba(0, 0, 0, 0.54), transparent 42%, rgba(0, 0, 0, 0.28));
  mix-blend-mode: screen;
}

.forest-vital-scene::after {
  background:
    radial-gradient(circle at center, transparent 24%, rgba(0, 0, 0, 0.28) 62%, rgba(0, 0, 0, 0.66) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.48), transparent 40%);
}

.forest-wood {
  position: absolute;
  inset: -2%;
  width: 104%;
  height: 104%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  transform: scale(1.02);
  animation: forest-drift 18s ease-in-out infinite alternate;
}

.forest-wood-dead {
  filter: saturate(0.9) contrast(1.08) brightness(0.74);
}

.forest-wood-moss {
  opacity: var(--forest-focus, 0.36);
  filter: saturate(1.08) contrast(1.06) brightness(0.88);
  -webkit-mask-image: radial-gradient(circle at var(--forest-x, 58%) var(--forest-y, 48%), #000 0 13vmax, rgba(0,0,0,0.9) 19vmax, rgba(0,0,0,0.36) 27vmax, transparent 38vmax);
  mask-image: radial-gradient(circle at var(--forest-x, 58%) var(--forest-y, 48%), #000 0 13vmax, rgba(0,0,0,0.9) 19vmax, rgba(0,0,0,0.36) 27vmax, transparent 38vmax);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition: opacity 0.36s ease, filter 0.36s ease;
  will-change: opacity, mask-image;
}

.forest-content {
  min-height: 100vh;
  padding: clamp(24px, 4vw, 54px);
  position: relative;
  z-index: 1;
}

.forest-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(223, 246, 214, 0.68);
  text-transform: uppercase;
}

.forest-heading {
  position: absolute;
  left: clamp(24px, 4vw, 54px);
  top: clamp(96px, 14vh, 148px);
  width: min(620px, 100%);
}

.forest-heading p {
  margin: 0 0 10px;
  color: rgba(199, 229, 187, 0.72);
  font-size: 15px;
  letter-spacing: 0;
}

.forest-heading h1 {
  margin: 0;
  font-size: clamp(54px, 11vw, 142px);
  line-height: 0.88;
  letter-spacing: 0;
  color: rgba(244, 255, 235, 0.94);
  text-shadow: 0 0 26px rgba(126, 255, 112, 0.16), 0 20px 70px rgba(0, 0, 0, 0.46);
}

.forest-card-nav {
  position: absolute;
  right: clamp(24px, 4vw, 54px);
  top: clamp(78px, 10vh, 112px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  width: min(340px, calc(100vw - 48px));
}

.forest-nav-card {
  min-height: 68px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: rgba(241, 249, 235, 0.8);
  border: 1px solid rgba(231, 255, 219, 0.18);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(8, 17, 10, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 34px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, color 0.22s ease;
}

.forest-nav-card:hover,
.forest-nav-card.active {
  transform: translateY(-2px);
  color: #f8fff2;
  border-color: rgba(154, 255, 138, 0.44);
  background: linear-gradient(145deg, rgba(36, 78, 35, 0.48), rgba(8, 17, 10, 0.56));
}

.forest-nav-card span {
  font-family: var(--font-mono);
  color: rgba(168, 228, 148, 0.76);
  font-size: 12px;
}

.forest-nav-card strong {
  display: block;
  font-size: 21px;
  letter-spacing: 0;
}

.forest-nav-card small {
  font-family: var(--font-mono);
  color: rgba(221, 244, 211, 0.56);
  letter-spacing: 0.08em;
}

.forest-section-preview {
  position: absolute;
  left: clamp(24px, 4vw, 54px);
  bottom: clamp(34px, 6vh, 70px);
  width: min(520px, calc(100vw - 48px));
  border: 1px solid rgba(231, 255, 219, 0.16);
  border-radius: 8px;
  padding: 15px 17px;
  background: rgba(5, 10, 7, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 42px rgba(0, 0, 0, 0.24);
}

.forest-section-preview span {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(173, 241, 150, 0.76);
  letter-spacing: 0.08em;
}

.forest-section-preview p {
  margin: 0;
  color: rgba(242, 250, 235, 0.78);
  line-height: 1.72;
}

@keyframes forest-drift {
  from {
    transform: scale(1.02) translate3d(-0.4%, -0.2%, 0);
  }
  to {
    transform: scale(1.04) translate3d(0.5%, 0.25%, 0);
  }
}

@media (max-width: 820px) {
  .world-space {
    padding: 28px 20px 132px;
  }

  .cyber-space {
    padding: 16px 14px 132px;
  }

  .cyber-card-nav,
  .cyber-vault {
    width: 100%;
  }

  .cyber-card-nav {
    margin-bottom: 28px;
  }

  .cyber-card-nav.open {
    height: 340px;
  }

  .cyber-nav-top {
    grid-template-columns: 44px 1fr;
  }

  .cyber-nav-action {
    display: none;
  }

  .cyber-nav-title {
    justify-self: start;
    font-size: 21px;
  }

  .cyber-nav-title span {
    display: block;
    margin: 2px 0 0;
    font-size: 11px;
  }

  .cyber-nav-cards {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cyber-nav-card {
    min-height: 76px;
    padding: 13px 16px;
  }

  .cyber-vault-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
  }

  .cyber-vault-head h1 {
    font-size: 40px;
  }

  .cyber-search {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 54px;
  }

  .cyber-search button {
    grid-column: 1 / -1;
    width: 100%;
    margin-bottom: 10px;
  }

  .cyber-masonry {
    display: flex;
    flex-direction: column;
    max-width: 520px;
  }

  .cyber-masonry-column {
    width: 100%;
    flex-basis: auto;
  }

  .cyber-resource,
  .cyber-resource-feature,
  .cyber-resource-tall,
  .cyber-resource-wide,
  .cyber-resource-small {
    min-height: auto;
  }

  .world-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .world-panel {
    min-height: 142px;
  }

  .forest-content {
    padding: 22px 18px 130px;
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    gap: 16px;
  }

  .forest-topline {
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .forest-heading,
  .forest-card-nav,
  .forest-section-preview {
    position: static;
  }

  .forest-card-nav {
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
  }

  .forest-nav-card {
    min-height: 82px;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    align-content: center;
  }

  .forest-nav-card strong {
    font-size: 21px;
  }

  .forest-section-preview {
    width: 100%;
  }

  .forest-wood {
    object-position: center;
  }

  .forest-wood-moss {
    -webkit-mask-image: radial-gradient(circle at var(--forest-x, 58%) var(--forest-y, 48%), #000 0 18vmax, rgba(0,0,0,0.86) 26vmax, rgba(0,0,0,0.3) 36vmax, transparent 48vmax);
    mask-image: radial-gradient(circle at var(--forest-x, 58%) var(--forest-y, 48%), #000 0 18vmax, rgba(0,0,0,0.86) 26vmax, rgba(0,0,0,0.3) 36vmax, transparent 48vmax);
  }
}

/* Ambient background glow + noise, Radium-style */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}

.bg-glow-1 {
  width: 560px;
  height: 560px;
  top: -180px;
  left: -160px;
  background: radial-gradient(circle, var(--accent-a), transparent 72%);
}

.bg-glow-2 {
  width: 520px;
  height: 520px;
  bottom: -220px;
  right: -160px;
  background: radial-gradient(circle, var(--accent-b), transparent 72%);
  opacity: 0.45;
}

.bg-glow-3 {
  width: 480px;
  height: 480px;
  top: 35%;
  left: 45%;
  background: radial-gradient(circle, var(--accent-c), transparent 72%);
  opacity: 0.3;
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--panel-strong);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-right: 1px solid var(--border);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.5);
  padding: 24px 16px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  padding: 4px 8px 24px;
  letter-spacing: -0.02em;
}

.brand-dim { color: var(--text-muted); font-weight: 600; margin-left: 2px; }

.brand .logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  box-shadow: 0 4px 14px rgba(100, 71, 224, 0.3);
  flex-shrink: 0;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.nav-item:hover { background: var(--panel-strong); color: var(--text-main); }
.nav-item.active {
  background: var(--panel-strong);
  color: var(--text-main);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.nav-item .icon { width: 18px; text-align: center; }

.soon {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  background: rgba(255,255,255,0.05);
  padding: 2px 6px;
  border-radius: 999px;
}

/* Main */
.main {
  flex: 1;
  padding: 36px 48px 80px;
  max-width: 1180px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}

.grad-text {
  background: linear-gradient(120deg, var(--accent-a), var(--accent-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-header p.subtitle {
  color: var(--text-muted);
  margin: 0 0 28px;
  font-size: 14.5px;
  max-width: 640px;
  line-height: 1.6;
}

/* Mode switch */
.mode-switch {
  display: inline-flex;
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
  gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.mode-switch button {
  border: none;
  background: transparent;
  padding: 9px 20px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-sans);
  transition: background .15s, color .15s;
}

.mode-switch button.active {
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(100, 71, 224, 0.3);
}

/* Dimension chips */
.dimension-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
}

.chip {
  border: 1px solid rgba(255,255,255,0.5);
  background: var(--panel);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.chip:hover { border-color: var(--border-strong); color: var(--text-main); }

.chip.active {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(100,71,224,0.1), rgba(15,184,138,0.1));
  color: var(--accent-a);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(100, 71, 224, 0.25);
}

.chip.placeholder {
  border-style: dashed;
  color: var(--text-faint);
}

.dim-chip {
  cursor: grab;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dim-chip.dragging {
  opacity: 0.4;
}

.dim-chip .drag-dot {
  font-size: 10px;
  color: var(--text-faint);
}

/* Stage tabs */
.stage-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.stage-tab {
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}

.stage-tab:hover { color: var(--text-main); }

.stage-tab.active {
  color: var(--text-main);
  border-bottom-color: var(--accent-b);
}

.agent-channel-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  border-bottom: 0;
  margin-bottom: 30px;
}

.agent-channel-rail {
  border-right: 1px solid rgba(119, 112, 132, 0.2);
  padding: 4px 18px 4px 0;
}

.agent-channel-kicker {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 18px;
}

.agent-channel-title {
  color: var(--text-main);
  font-size: 20px;
  font-weight: 850;
  margin-bottom: 12px;
}

.agent-channel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-channel-btn {
  position: relative;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  padding: 12px 44px 12px 14px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.agent-channel-btn:hover {
  background: rgba(255, 255, 255, 0.58);
  color: var(--text-main);
}

.agent-channel-btn.active {
  background: rgba(233, 248, 238, 0.94);
  border-color: rgba(48, 167, 102, 0.16);
  color: #18945c;
}

.agent-channel-btn[data-agent-channel="1688"].active {
  background: rgba(255, 247, 232, 0.94);
  border-color: rgba(242, 153, 74, 0.2);
  color: #b96a13;
}

.agent-channel-label {
  display: block;
  font-size: 15px;
  font-weight: 850;
}

.agent-channel-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-faint);
}

.agent-channel-count {
  position: absolute;
  right: 12px;
  top: 12px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 850;
}

.agent-tab-panel {
  min-width: 0;
  border: 1px solid rgba(119, 112, 132, 0.16);
  background: rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 16px 40px rgba(45, 37, 64, 0.06);
}

.agent-tab-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.agent-tab-title {
  color: var(--text-main);
  font-size: 18px;
  font-weight: 850;
}

.agent-tab-subtitle,
.agent-tab-count {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
}

.agent-tabs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
}

.agent-tabs-row .stage-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}

.agent-tabs-row .qa-add-tab {
  border: 1px dashed rgba(119, 112, 132, 0.32);
  border-radius: 999px;
  padding-inline: 16px;
  margin-bottom: 5px;
}

.stage-section { display: none; }
.stage-section.active { display: block; }

.stage-intro {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.stage-intro a {
  color: var(--accent-a);
  font-weight: 600;
  text-decoration: underline;
}

.stage-intro strong, .qa-answer strong {
  font-weight: 800;
  color: var(--text-main);
}

.intro-quote {
  display: block;
  margin: 8px 0;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
}

.intro-inline-img {
  height: 64px;
  width: auto;
  max-width: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  vertical-align: middle;
  margin: 2px 4px;
  cursor: zoom-in;
  transition: transform .15s;
}

.intro-inline-img:hover {
  transform: scale(1.05);
}

#lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 6, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
}

#lightbox-overlay.open {
  display: flex;
}

#lightbox-overlay img {
  max-width: 88vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.stage-intro-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.stage-intro-row .stage-intro {
  margin-bottom: 0;
  flex: 1;
}

.intro-edit-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.intro-edit-btn:hover {
  border-color: var(--accent-a);
  color: var(--accent-a);
}

.intro-edit-wrap {
  margin-bottom: 16px;
}

.stage-intro-edit {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-main);
  border: 1px solid var(--accent-a);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  resize: vertical;
  min-height: 64px;
  box-shadow: 0 0 0 3px rgba(91,53,224,0.1);
}

.intro-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.intro-toolbar .btn-primary {
  margin-left: auto;
}

.keyword-bar {
  margin-bottom: 24px;
}

.keyword-chip {
  background: linear-gradient(135deg, rgba(91,53,224,0.08), rgba(224,99,91,0.08));
  border-color: rgba(91,53,224,0.18);
  color: var(--accent-a);
  font-weight: 600;
}

.group-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 32px 0 14px;
}

.group-title:first-child { margin-top: 0; }

/* Skill grid */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.skill-card {
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  background: var(--bg-elevated);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 1px 2px rgba(40,30,20,0.05), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}

.skill-card:hover {
  border-color: rgba(255,255,255,0.8);
  box-shadow: 0 16px 36px rgba(40,30,20,0.12), inset 0 1px 0 rgba(255,255,255,0.7);
  transform: translateY(-2px);
}

.skill-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.skill-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  overflow: hidden;
}

.skill-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.skill-meta { flex: 1; min-width: 0; }

.skill-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.skill-name { font-weight: 700; font-size: 14px; letter-spacing: -0.01em; }

.badge {
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge.required { background: rgba(31, 157, 107, 0.14); color: var(--accent-green); }
.badge.optional { background: rgba(40,30,20,0.06); color: var(--text-muted); }
.badge.todo { background: rgba(196, 113, 26, 0.14); color: var(--accent-warn); }

.skill-desc {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-top: 5px;
  line-height: 1.55;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skill-card.open .skill-desc {
  white-space: pre-wrap;
  display: block;
  -webkit-line-clamp: unset;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 6px;
}

.ref-tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

.ref-tag-chip {
  font-size: 11px;
  padding: 3px 8px;
}

.ref-tag-add {
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-faint);
  border-radius: 999px;
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--font-sans);
}

.skill-detail {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.skill-card.open .skill-detail { display: block; }
.skill-card.open { border-color: rgba(100,71,224,0.35); }

.skill-detail h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin: 0 0 8px;
  font-weight: 700;
}

.prompt-box {
  background: #f6f6fa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  color: #34344a;
  white-space: pre-wrap;
  line-height: 1.65;
  margin: 0 0 10px;
  font-family: var(--font-mono);
}

.placeholder-text {
  color: var(--text-faint);
  font-style: italic;
}

.disclaimer {
  margin-top: 48px;
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}

/* Card action buttons (edit / drag handle) */
.skill-card {
  position: relative;
}

.card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}

.skill-card:hover .card-actions { opacity: 1; }

.card-action-btn {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
}

.card-action-btn:hover { color: var(--text-main); border-color: var(--border-strong); }

.drag-handle {
  cursor: grab;
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 13px;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity .15s;
  cursor: grab;
}

.skill-card:hover .drag-handle { opacity: 1; }

.skill-card.dragging { opacity: 0.4; }

.skill-card[draggable="true"] { padding-top: 22px; }

.add-card {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  transition: border-color .15s, color .15s, background .15s;
}

.add-card:hover {
  border-color: var(--accent-a);
  color: var(--accent-a);
  background: rgba(91, 53, 224, 0.04);
}

/* Tag / dimension add + remove */
.chip-x {
  margin-left: 6px;
  opacity: 0.5;
  font-weight: 700;
}

.chip-x:hover { opacity: 1; color: var(--accent-warn); }

.chip-add {
  border: 1.5px dashed var(--border-strong);
  background: transparent;
  color: var(--text-faint);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.chip-add:hover { border-color: var(--accent-a); color: var(--accent-a); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 10, 0.35);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-backdrop.open { display: flex; }

.modal {
  width: 440px;
  max-width: 92vw;
  max-height: 86vh;
  overflow-y: auto;
  background: #fffdf9;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 24px 60px rgba(20,15,10,0.25);
}

.modal.modal-wide {
  width: 600px;
}

.ag-file-tabs {
  margin: 4px 0 0;
}

.ag-file-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0 6px;
}

.ag-file-textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  resize: vertical;
  background: #f6f6fa;
  color: #34344a;
}

.ag-file-textarea:focus {
  outline: none;
  border-color: var(--accent-a);
  box-shadow: 0 0 0 3px rgba(91,53,224,0.1);
}

#ag-plugin-list, #ag-skill-list {
  max-height: 160px;
}

.ag-vars-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.ag-var-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ag-var-row input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  font-size: 12.5px;
  font-family: var(--font-sans);
}

.ag-var-name { flex: 0 0 38%; }
.ag-var-value { flex: 1; }

.ag-var-remove {
  position: static;
  flex-shrink: 0;
}

.ag-preview-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-right: auto;
}

.ag-var-config-row {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--bg-elevated);
}

.ag-cfg-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.ag-cfg-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ag-cfg-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  font-size: 12.5px;
  font-family: var(--font-sans);
  background: #fff;
}

.ag-cfg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ag-cfg-chip {
  cursor: pointer;
  user-select: none;
}

.ag-cfg-chip.preserved {
  border-style: dashed;
}

.ag-cfg-hint {
  font-size: 11px;
  color: var(--text-faint);
}

.ag-cfg-custom {
  width: 100%;
}

.ag-files-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin: 0 0 8px;
}

.ag-reason-textarea {
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12.5px;
  background: #fff;
  font-family: var(--font-sans);
  resize: vertical;
}

.ag-reason-textarea:focus {
  outline: none;
  border-color: var(--accent-a);
  box-shadow: 0 0 0 3px rgba(91,53,224,0.1);
}

.ag-reason-detail h4 {
  margin: 0 0 6px;
}

.ag-file-preview {
  width: 100%;
  min-height: 120px;
  max-height: 280px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: pre-wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--accent-soft);
  color: #34344a;
}

.modal h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 800;
}

.modal label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin: 14px 0 6px;
}

.modal label:first-of-type { margin-top: 0; }

.modal input,
.modal select,
.modal textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: #fff;
  resize: vertical;
}

.modal textarea { font-family: var(--font-mono); font-size: 12.5px; }

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  outline: none;
  border-color: var(--accent-a);
  box-shadow: 0 0 0 3px rgba(91,53,224,0.12);
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.modal-actions-right { display: flex; gap: 8px; }

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text-main); }

.btn-danger {
  background: transparent;
  color: var(--accent-warn);
}
.btn-danger:hover { background: rgba(196,113,26,0.08); }

.modal-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0 0 14px;
  line-height: 1.5;
}

.icon-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.icon-preview {
  width: 44px;
  height: 44px;
  font-size: 20px;
  flex-shrink: 0;
}

.icon-edit-row input[type="file"] {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
}

.picker-search {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 13px;
  font-family: var(--font-sans);
  margin-bottom: 10px;
}

.picker-search:focus {
  outline: none;
  border-color: var(--accent-a);
  box-shadow: 0 0 0 3px rgba(91,53,224,0.1);
}

.picker-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.picker-item:hover { background: var(--panel); }
.picker-item input { margin: 0; }
.picker-item .skill-icon { width: 26px; height: 26px; font-size: 13px; border-radius: 7px; }
.picker-item.already-added { opacity: 0.45; cursor: default; }

.picker-empty {
  padding: 14px 8px;
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
}

.picker-group {
  border-bottom: 1px solid var(--border);
}

.picker-group:last-child { border-bottom: none; }

.picker-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.picker-group-head:hover { background: var(--panel); }

.picker-group-chevron {
  width: 14px;
  color: var(--text-faint);
  font-size: 11px;
}

.picker-group-name { flex: 1; }

.picker-group-count {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-faint);
}

.picker-group-check { margin: 0; }

.picker-group-body {
  padding-left: 18px;
}

.picker-quick-add input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: var(--font-sans);
}

.modal-link a {
  font-size: 12.5px;
  color: var(--accent-a);
  text-decoration: none;
  font-weight: 600;
}
.modal-link a:hover { text-decoration: underline; }

.level-select {
  border: none;
  background: transparent;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 6px 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.level-select.required { background: rgba(31, 157, 107, 0.14); color: var(--accent-green); }
.level-select.optional { background: rgba(40,30,20,0.06); color: var(--text-muted); }
.level-select.todo { background: rgba(196, 113, 26, 0.14); color: var(--accent-warn); }

.link-edit {
  font-size: 11px;
  color: var(--text-faint);
  text-decoration: none;
}
.link-edit:hover { color: var(--accent-a); }

/* QA 问题解答页 */
.qa-tab {
  position: relative;
  padding-right: 26px;
}

.qa-tab .tab-x {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.4;
  font-weight: 700;
  font-size: 13px;
}

.qa-tab .tab-x:hover { opacity: 1; color: var(--accent-warn); }

.qa-add-tab {
  color: var(--text-faint);
  border-bottom-color: transparent !important;
}

.qa-add-tab:hover { color: var(--accent-a); }

#qa-list { display: flex; flex-direction: column; gap: 14px; }

.qa-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: var(--bg-elevated);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 1px 2px rgba(40,30,20,0.05), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: box-shadow .15s, border-color .15s;
}

.qa-card:hover {
  border-color: rgba(255,255,255,0.8);
  box-shadow: 0 10px 28px rgba(40,30,20,0.08), inset 0 1px 0 rgba(255,255,255,0.7);
}

.qa-card[draggable="true"] { padding-left: 34px; }
.qa-card:hover .drag-handle { opacity: 1; }

.qa-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.qa-question {
  font-size: 15.5px;
  font-weight: 700;
  margin: 0;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.qa-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s;
}

.qa-card:hover .qa-card-actions { opacity: 1; }

.qa-action-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 9px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  font-family: var(--font-sans);
  transition: border-color .15s, color .15s, background .15s;
}

.qa-action-btn:hover {
  border-color: var(--accent-a);
  color: var(--accent-a);
  background: rgba(91,53,224,0.06);
}

.qa-action-btn.qa-action-danger:hover {
  border-color: var(--accent-warn);
  color: var(--accent-warn);
  background: rgba(196,113,26,0.08);
}

.qa-answer {
  margin-top: 12px;
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.qa-add-card {
  width: 100%;
}

.qa-card-editing {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qa-question-edit {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 700;
  border: 1px solid var(--accent-a);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  box-shadow: 0 0 0 3px rgba(91,53,224,0.1);
}

.mobile-nav-toggle { display: none; }
.mobile-nav-backdrop { display: none; }
.mobile-page-switch { display: none; }

@media (max-width: 760px) {
  .skill-grid { grid-template-columns: 1fr; }
  html, body { width: 100%; overflow-x: hidden; }
  .app { display: block; min-height: 100vh; }
  .main {
    width: 100%;
    max-width: none;
    padding: 76px 14px 120px;
  }

  .page-header h1 {
    font-size: 24px;
    line-height: 1.15;
  }

  .page-header p.subtitle {
    font-size: 13px;
    margin-bottom: 18px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.mobile-open { transform: translateX(0); }

  .mobile-nav-toggle {
    display: none !important;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--panel-strong);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    z-index: 1220;
    font-size: 18px;
    cursor: pointer;
  }

  .mobile-page-switch {
    display: block;
    position: fixed;
    top: 14px;
    left: 14px;
    right: 16px;
    z-index: 1220;
  }

  .mobile-page-switch select {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--text-main);
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    backdrop-filter: blur(18px);
    font: 800 14px var(--font-sans);
    padding: 0 34px 0 12px;
  }

  .mode-switch,
  .stage-tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mode-switch button,
  .stage-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .agent-channel-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
  }

  .agent-channel-rail {
    border-right: 0;
    padding: 0;
  }

  .agent-channel-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .agent-channel-btn {
    min-width: 190px;
    flex: 0 0 auto;
  }

  .agent-tab-panel {
    padding: 14px;
    border-radius: 14px;
  }

  .agent-tab-panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .agent-tabs-row {
    overflow-x: auto;
  }

  .dimension-bar {
    gap: 7px;
    margin-bottom: 20px;
  }

  .chip {
    padding: 7px 12px;
    font-size: 12px;
  }

  .skill-card {
    border-radius: 14px;
    padding: 14px;
  }

  .skill-card-top {
    gap: 10px;
  }

  .skill-name-row {
    align-items: flex-start;
  }

  .ag-var-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ag-var-name,
  .ag-var-value {
    flex: none;
    width: 100%;
  }

  .ag-var-config-row {
    padding: 12px;
  }

  .ag-cfg-select,
  .ag-var-row input,
  .ag-file-textarea,
  .ag-file-preview {
    font-size: 13px;
  }

  .ag-file-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .ag-file-toolbar .btn {
    width: 100%;
    justify-content: center;
  }

  .mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 16, 40, 0.4);
    z-index: 1190;
  }
  .mobile-nav-backdrop.show { display: block; }
}

/* Gatekeeper widget (三世界系统 step 1) */
.gk-widget {
  --gk-accent: #5b35e0;
  --gk-accent-2: #ffcf52;
  --gk-aura: rgba(91, 53, 224, 0.2);
  --gk-shadow: rgba(20, 16, 40, 0.18);
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 500;
  width: 108px;
  height: 108px;
}

.gk-world-cyber {
  --gk-accent: #22d7ff;
  --gk-accent-2: #7b61ff;
  --gk-aura: rgba(34, 215, 255, 0.28);
  --gk-shadow: rgba(15, 88, 140, 0.28);
}

.gk-world-forest {
  --gk-accent: #4dff9a;
  --gk-accent-2: #173d2a;
  --gk-aura: rgba(77, 255, 154, 0.22);
  --gk-shadow: rgba(0, 28, 18, 0.34);
}

.gk-figure {
  position: relative;
  width: 108px;
  height: 108px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 8px 14px var(--gk-shadow));
  isolation: isolate;
  transform-origin: 50% 100%;
  will-change: transform;
}

.gk-figure::before {
  content: "";
  position: absolute;
  inset: 17px 13px 8px;
  z-index: -1;
  border-radius: 999px;
  background:
    radial-gradient(circle, var(--gk-aura) 0 44%, rgba(255,255,255,0) 70%);
  filter: blur(8px);
  animation: gk-aura 2.8s ease-in-out infinite;
}

.gk-figure::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.gk-bob {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  animation: gk-float 4.8s ease-in-out infinite;
  transform-origin: 50% 94%;
  filter: saturate(1.06);
  will-change: transform;
}

.gk-orbit {
  position: absolute;
  inset: 18px 10px 6px;
  z-index: 1;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--gk-accent), transparent 48%);
  opacity: 0.5;
  transform: rotate(-8deg);
  animation: gk-orbit 8s linear infinite;
}

.gk-signal {
  position: absolute;
  right: 22px;
  bottom: 20px;
  z-index: 3;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--gk-accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--gk-accent), transparent 76%), 0 0 18px var(--gk-accent);
}

@keyframes gk-float {
  0%, 100% { transform: translateY(0) rotate(-0.3deg); }
  50% { transform: translateY(-3px) rotate(0.3deg); }
}

@keyframes gk-aura {
  0%, 100% { opacity: 0.72; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.06); }
}

@keyframes gk-orbit {
  from { transform: rotate(-8deg); }
  to { transform: rotate(352deg); }
}

.gk-figure:hover .gk-bob {
  filter: saturate(1.16) brightness(1.03);
}

.gk-figure:active {
  animation-play-state: paused;
  transform: translateY(1px) scale(0.97);
}

.gk-listening .gk-figure {
  animation: gk-listen 1.2s ease-in-out infinite;
}

.gk-speaking .gk-figure {
  animation: gk-talk 0.34s ease-in-out 3;
}

.gk-denied .gk-figure {
  animation: gk-denied 0.24s ease-in-out 2;
}

.gk-unlocked .gk-figure {
  animation: gk-unlocked 0.9s ease-out;
}

@keyframes gk-listen {
  0%, 100% { transform: translateY(0) rotate(-0.6deg); }
  50% { transform: translateY(-2px) rotate(1.2deg); }
}

@keyframes gk-talk {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-1px) scale(1.018); }
}

@keyframes gk-denied {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-4px) rotate(-3deg); }
  70% { transform: translateX(4px) rotate(3deg); }
}

@keyframes gk-unlocked {
  0% { transform: scale(1); filter: drop-shadow(0 8px 14px var(--gk-shadow)); }
  42% { transform: scale(1.1) translateY(-5px); filter: drop-shadow(0 0 30px var(--gk-accent)); }
  100% { transform: scale(1); filter: drop-shadow(0 8px 14px var(--gk-shadow)); }
}

.gk-world-cyber .gk-figure::after {
  opacity: 0.86;
  left: 34px;
  top: 35px;
  width: 42px;
  height: 9px;
  border: 1px solid rgba(34, 215, 255, 0.8);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(34,215,255,0.2), rgba(123,97,255,0.42));
  box-shadow: 0 0 14px rgba(34, 215, 255, 0.7);
  transform: rotate(-8deg);
  mix-blend-mode: screen;
}

.gk-world-cyber .gk-bob {
  filter: saturate(1.16) hue-rotate(8deg) drop-shadow(0 0 10px rgba(34, 215, 255, 0.18));
}

.gk-world-forest .gk-figure::after {
  opacity: 0.22;
  left: 25px;
  top: 18px;
  width: 58px;
  height: 40px;
  border-radius: 44% 52% 38% 46%;
  background:
    radial-gradient(circle at 62% 28%, rgba(111,255,171,0.36), transparent 30%),
    linear-gradient(140deg, rgba(10,34,23,0.72), rgba(60,132,83,0.22));
  transform: rotate(-10deg);
  mix-blend-mode: multiply;
}

.gk-world-forest .gk-bob {
  filter: saturate(1.08) brightness(0.98) drop-shadow(0 0 12px rgba(77, 255, 154, 0.2));
}

.gk-bubble {
  position: absolute;
  right: 0;
  bottom: 118px;
  width: min(258px, calc(100vw - 44px));
  background: var(--panel-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid color-mix(in srgb, var(--gk-accent), var(--border-strong) 70%);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 10px 28px var(--gk-shadow);
  animation: gk-pop 0.16s ease-out;
  transform-origin: bottom right;
}

.gk-bubble-left .gk-bubble {
  left: 0;
  right: auto;
  transform-origin: bottom left;
}

.gk-bubble-below .gk-bubble {
  top: 118px;
  bottom: auto;
  transform-origin: top right;
}

.gk-bubble-left.gk-bubble-below .gk-bubble {
  transform-origin: top left;
}
@keyframes gk-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gk-bubble-msg {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.gk-thinking .gk-bubble-msg::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: gk-thinking-dots 1.1s steps(3, end) infinite;
}

@keyframes gk-thinking-dots {
  0% { content: ""; }
  34% { content: "."; }
  67% { content: ".."; }
  100% { content: "..."; }
}

.gk-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 9px;
}

.gk-choice-row[hidden] {
  display: none;
}

.gk-choice {
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--gk-accent), transparent 42%);
  border-radius: 10px;
  padding: 6px 10px;
  background: color-mix(in srgb, var(--gk-accent), white 90%);
  color: color-mix(in srgb, var(--gk-accent), #111 16%);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.gk-choice:hover {
  background: color-mix(in srgb, var(--gk-accent), white 82%);
}

.gk-bubble-form {
  display: flex;
  align-items: center;
  gap: 7px;
}

.gk-bubble-input {
  flex: 1;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--gk-accent), var(--border-strong) 72%);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 13px;
  font-family: var(--font-sans);
  background: rgba(255,255,255,0.7);
  color: var(--text-main);
}
.gk-bubble-input:focus {
  outline: none;
  border-color: var(--gk-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gk-accent), transparent 82%);
}

.gk-bubble-input:disabled {
  cursor: not-allowed;
  color: var(--text-faint);
  background: rgba(255,255,255,0.46);
}

.gk-bubble-send {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--gk-accent), transparent 38%);
  border-radius: 10px;
  background: color-mix(in srgb, var(--gk-accent), white 88%);
  color: var(--gk-accent);
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.gk-bubble-send:hover {
  background: color-mix(in srgb, var(--gk-accent), white 80%);
}

.gk-bubble-send:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.gk-loader {
  --gk-origin-x: 92vw;
  --gk-origin-y: 86vh;
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  gap: 12px;
  color: white;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 54%, color-mix(in srgb, var(--gk-accent), transparent 72%), transparent 24%),
    linear-gradient(135deg, rgba(8, 9, 18, 0.92), rgba(21, 18, 42, 0.88));
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
}

.gk-loader-cyber-sequence {
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 60%),
    radial-gradient(circle, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 1) 100%),
    #000;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: gk-cyber-screen-pulse 3.3s steps(1, end) both;
}

.gk-loader[hidden] {
  display: none;
}

.gk-loader-content {
  position: relative;
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0 24px;
  text-align: center;
}

.gk-letter-field {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
  overflow: hidden;
  padding: 0;
  color: rgba(97, 220, 163, 0.74);
  font-family: var(--font-mono);
  font-size: clamp(14px, 1.45vw, 25px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
  opacity: 0;
  transform: translateZ(0);
  text-shadow:
    0 0 12px rgba(97, 220, 163, 0.18),
    0 0 28px rgba(55, 181, 220, 0.1);
}

.gk-letter-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  pointer-events: none;
  background: #000;
}

.gk-letter-field::before,
.gk-letter-field::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.gk-letter-field::before {
  background:
    radial-gradient(circle at 50% 50%, rgba(3, 2, 8, 0.72) 0 16%, rgba(3, 2, 8, 0.18) 39%, transparent 62%),
    radial-gradient(ellipse at 50% 50%, transparent 0 46%, rgba(4, 3, 10, 0.7) 86%, rgba(4, 3, 10, 0.94) 100%);
}

.gk-letter-field::after {
  opacity: 0.38;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 5px),
    linear-gradient(90deg, rgba(138, 89, 196, 0.2), transparent 24%, transparent 76%, rgba(63, 177, 220, 0.14));
  mix-blend-mode: screen;
}

.gk-letter-field span {
  display: block;
  width: max-content;
  min-width: 220vw;
  white-space: nowrap;
  opacity: 0.72;
  transform: translateX(calc(-36vw + (var(--row) % 5) * -4vw));
  animation: gk-letter-row var(--speed, 3s) linear infinite;
}

.gk-letter-field span:nth-child(2n) {
  color: rgba(74, 181, 217, 0.74);
  opacity: 0.64;
}

.gk-letter-field span:nth-child(3n) {
  color: rgba(92, 218, 178, 0.56);
  animation-direction: reverse;
}

.gk-letter-field span:nth-child(4n) {
  opacity: 0.36;
}

.gk-letter-field span:nth-child(5n) {
  color: rgba(124, 96, 178, 0.5);
}

.gk-loader-cyber-sequence .gk-letter-field {
  display: none;
  opacity: 1;
  animation: gk-letter-field-in 3.3s ease both;
}

.gk-loader-cyber-sequence .gk-letter-canvas {
  opacity: 1;
  animation: gk-letter-field-in 3.3s ease both;
}

.gk-loader-dot-field,
.gk-loader-orb,
.gk-loader-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gk-loader-dot-field {
  z-index: 1;
  opacity: 0.22;
  background-image:
    radial-gradient(circle, rgba(110, 232, 255, 0.7) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(133, 94, 255, 0.45) 0 1px, transparent 1.5px);
  background-position: 0 0, 14px 18px;
  background-size: 36px 36px, 52px 52px;
}

.gk-loader-orb {
  z-index: 2;
}

.gk-loader-orb::before,
.gk-loader-orb::after {
  content: "";
  position: absolute;
  left: var(--gk-origin-x);
  top: var(--gk-origin-y);
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.gk-loader-orb::before {
  width: min(120vw, 120vh);
  height: min(120vw, 120vh);
  background:
    radial-gradient(circle at 42% 38%, rgba(255,255,255,0.95) 0 3%, rgba(113,245,255,0.86) 5%, rgba(82,49,224,0.62) 19%, rgba(15,18,40,0.78) 43%, transparent 68%),
    conic-gradient(from 90deg, rgba(34,215,255,0.82), rgba(124,75,255,0.82), rgba(255,61,154,0.62), rgba(34,215,255,0.82));
  box-shadow:
    0 0 44px rgba(44, 225, 255, 0.38),
    0 0 110px rgba(108, 75, 255, 0.32);
  opacity: 0;
  mix-blend-mode: screen;
}

.gk-loader-orb::after {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(151, 113, 255, 0.72);
  box-shadow:
    0 0 22px rgba(34, 215, 255, 0.76),
    inset 0 0 20px rgba(34, 215, 255, 0.24);
  opacity: 0;
}

.gk-loader-scan {
  z-index: 4;
  opacity: 0.22;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.18) 0 1px, transparent 1px 7px),
    linear-gradient(90deg, transparent, rgba(34,215,255,0.28), transparent);
  background-size: auto, 34% 100%;
  background-position: 0 0, -42% 0;
  mix-blend-mode: screen;
}

.gk-loader-flash {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%, white 0 12%, rgba(255,255,255,0.94) 24%, rgba(255,255,255,0.42) 42%, transparent 70%),
    linear-gradient(90deg, transparent, rgba(255,255,255,0.74), transparent);
}

.gk-loader-cyber-sequence .gk-loader-flash {
  animation: gk-cyber-whiteout 3.3s cubic-bezier(.2,.9,.12,1) both;
}

.gk-loader-kicker {
  color: rgba(184, 244, 255, 0.72);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.gk-loader-title {
  position: relative;
  font-size: clamp(24px, 7vw, 64px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 2px 0 rgba(34, 215, 255, 0.75), -2px 0 rgba(255, 70, 132, 0.62);
  animation: gk-glitch 0.72s steps(2, end) infinite;
}

.gk-loader-cyber-sequence .gk-loader-content {
  gap: 0;
  min-height: 38vh;
  animation: gk-cyber-content-final 3.3s ease both;
}

.gk-loader-cyber-sequence .gk-loader-title {
  min-width: min(92vw, 980px);
  min-height: clamp(86px, 15vw, 176px);
  display: grid;
  place-items: center;
  font-size: 0;
  letter-spacing: 0;
  text-shadow: none;
  animation: none;
}

.gk-loader-cyber-sequence .gk-loader-title::before,
.gk-loader-cyber-sequence .gk-loader-title::after {
  display: none;
}

.gk-cn-word,
.gk-en-word {
  grid-area: 1 / 1;
}

.gk-cn-word {
  display: inline-flex;
  gap: clamp(8px, 1.4vw, 18px);
  color: rgba(255,255,255,0.96);
  font-size: clamp(32px, 7.4vw, 82px);
  font-weight: 800;
  letter-spacing: 0;
  filter: drop-shadow(0 0 22px rgba(99, 255, 224, 0.16));
  animation: gk-cn-word-exit 3.3s ease both;
}

.gk-cn-word span {
  opacity: 0;
  transform: translateY(14px);
  animation: gk-cn-char-in 0.54s cubic-bezier(.2,.92,.18,1) forwards;
  animation-delay: calc(0.58s + var(--i) * 0.16s);
}

.gk-en-word {
  position: relative;
  color: #fff;
  font-family: var(--font-sans);
  font-size: clamp(42px, 9vw, 104px);
  font-weight: 900;
  letter-spacing: 0;
  opacity: 0;
  transform: scale(0.88);
  text-transform: none;
  user-select: none;
  cursor: default;
  white-space: nowrap;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.12);
  animation: gk-en-word-sequence 3.3s cubic-bezier(.18,.86,.12,1) both;
}

.gk-en-word::before,
.gk-en-word::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  color: #fff;
  background-color: #120f17;
  overflow: hidden;
  clip-path: inset(0 0 0 0);
  pointer-events: none;
  opacity: 0;
}

.gk-en-word::before {
  left: -10px;
  text-shadow: 10px 0 cyan;
  animation: gk-en-glitch-before 3.3s linear both;
}

.gk-en-word::after {
  left: 10px;
  text-shadow: -10px 0 red;
  animation: gk-en-glitch-after 3.3s linear both;
}

.gk-loader-title::before,
.gk-loader-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gk-loader-title::before {
  color: rgba(34, 215, 255, 0.76);
  transform: translate(-2px, -1px);
  clip-path: inset(0 0 55% 0);
}

.gk-loader-title::after {
  color: rgba(255, 72, 164, 0.62);
  transform: translate(2px, 1px);
  clip-path: inset(48% 0 0 0);
}

.gk-loader-sub {
  color: rgba(255,255,255,0.72);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gk-loader-cyber-entry {
  background:
    radial-gradient(circle at var(--gk-origin-x) var(--gk-origin-y), rgba(58, 236, 255, 0.28), transparent 18%),
    linear-gradient(135deg, rgba(4, 6, 18, 0.94), rgba(15, 13, 46, 0.93) 42%, rgba(3, 22, 38, 0.92));
  animation: gk-loader-flicker 1.48s steps(1, end) both;
}

.gk-loader-cyber-entry .gk-loader-content {
  animation: gk-cyber-content 1.48s cubic-bezier(.2,.85,.2,1) both;
}

.gk-loader-cyber-entry .gk-loader-dot-field {
  animation: gk-cyber-dots 1.48s linear both;
}

.gk-loader-cyber-entry .gk-loader-orb::before {
  animation: gk-cyber-orb-expand 1.48s cubic-bezier(.16,.9,.18,1) both;
}

.gk-loader-cyber-entry .gk-loader-orb::after {
  animation: gk-cyber-orb-core 1.48s cubic-bezier(.18,.88,.22,1) both;
}

.gk-loader-cyber-entry .gk-loader-scan {
  animation: gk-cyber-scan 1.48s linear both;
}

@keyframes gk-letter-row {
  0% { transform: translateX(calc(-18vw + (var(--row) % 5) * -4vw)); }
  100% { transform: translateX(calc(-62vw + (var(--row) % 5) * -4vw)); }
}

@keyframes gk-letter-field-in {
  0% { opacity: 0; filter: blur(3px) saturate(0.8); transform: scale(1.01); }
  12% { opacity: 0.9; filter: blur(0) saturate(1); }
  62% { opacity: 0.86; filter: blur(0); }
  84% { opacity: 0.62; filter: blur(1px); }
  100% { opacity: 0; filter: blur(7px); transform: scale(1.045); }
}

@keyframes gk-cn-char-in {
  0% { opacity: 0; transform: translateY(14px) scale(0.96); filter: blur(8px); }
  72% { opacity: 1; transform: translateY(0) scale(1.01); filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes gk-cn-word-exit {
  0%, 44% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  52% { opacity: 1; transform: translateY(-2px) scale(1.01); filter: blur(0); }
  64%, 100% { opacity: 0; transform: translateY(-14px) scale(0.98); filter: blur(10px); }
}

@keyframes gk-en-word-sequence {
  0%, 52% { opacity: 0; transform: scale(0.88); filter: blur(9px); }
  59% { opacity: 1; transform: scale(1); filter: blur(0); }
  72% { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
  75% { transform: translateX(-5px) scale(1.01); }
  78% { transform: translateX(4px) scale(1); }
  82% { opacity: 1; transform: translateX(0) scale(1.02); filter: blur(0); }
  94% { opacity: 1; transform: scale(1.64); filter: blur(0); }
  100% { opacity: 0; transform: scale(2.55); filter: blur(18px); }
}

@keyframes gk-en-glitch-before {
  0%, 57% { opacity: 0; clip-path: inset(20% 0 50% 0); }
  58%, 90% { opacity: 1; }
  59% { clip-path: inset(20% 0 50% 0); }
  63% { clip-path: inset(10% 0 60% 0); }
  67% { clip-path: inset(15% 0 55% 0); }
  71% { clip-path: inset(25% 0 35% 0); }
  75% { clip-path: inset(30% 0 40% 0); }
  79% { clip-path: inset(40% 0 20% 0); }
  83% { clip-path: inset(10% 0 60% 0); }
  87% { clip-path: inset(15% 0 55% 0); }
  91%, 100% { opacity: 0; clip-path: inset(30% 0 40% 0); }
}

@keyframes gk-en-glitch-after {
  0%, 58% { opacity: 0; clip-path: inset(30% 0 40% 0); }
  59%, 91% { opacity: 1; }
  60% { clip-path: inset(10% 0 60% 0); }
  64% { clip-path: inset(15% 0 55% 0); }
  68% { clip-path: inset(25% 0 35% 0); }
  72% { clip-path: inset(30% 0 40% 0); }
  76% { clip-path: inset(20% 0 50% 0); }
  80% { clip-path: inset(10% 0 60% 0); }
  84% { clip-path: inset(40% 0 20% 0); }
  88% { clip-path: inset(25% 0 35% 0); }
  92%, 100% { opacity: 0; clip-path: inset(30% 0 40% 0); }
}

@keyframes gk-cyber-whiteout {
  0%, 78% { opacity: 0; transform: scale(0.72); filter: blur(10px); }
  88% { opacity: 0.18; transform: scale(1); filter: blur(4px); }
  96% { opacity: 1; transform: scale(1.38); filter: blur(0); }
  100% { opacity: 0.9; transform: scale(1.8); filter: blur(0); }
}

@keyframes gk-cyber-content-final {
  0%, 88% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes gk-cyber-screen-pulse {
  0%, 100% { opacity: 1; }
  12% { opacity: 0.96; }
  13% { opacity: 1; }
  61% { opacity: 0.9; }
  63% { opacity: 1; }
  76% { opacity: 0.94; }
}

@keyframes gk-glitch {
  0%, 100% { transform: translate(0); filter: hue-rotate(0deg); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(2px, -1px); filter: hue-rotate(18deg); }
  62% { transform: translate(-1px, -2px); }
  80% { transform: translate(1px, 2px); filter: hue-rotate(-18deg); }
}

@keyframes gk-cyber-orb-expand {
  0% {
    opacity: 0.02;
    transform: translate(-50%, -50%) scale(0.03) rotate(0deg);
    filter: blur(0);
  }
  24% {
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(0.2) rotate(18deg);
  }
  67% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1.58) rotate(96deg);
    filter: blur(0.2px);
  }
  100% {
    opacity: 0.34;
    transform: translate(-50%, -50%) scale(2.8) rotate(150deg);
    filter: blur(10px);
  }
}

@keyframes gk-cyber-orb-core {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.32); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.8); }
  42% { opacity: 0.62; transform: translate(-50%, -50%) scale(4.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(12); }
}

@keyframes gk-cyber-dots {
  0% { opacity: 0; transform: scale(0.98); background-position: 0 0, 14px 18px; }
  26% { opacity: 0.2; }
  72% { opacity: 0.38; }
  100% { opacity: 0.18; transform: scale(1.05); background-position: 72px 36px, -38px 70px; }
}

@keyframes gk-cyber-scan {
  0% { opacity: 0; background-position: 0 0, -42% 0; transform: skewX(0deg); }
  25% { opacity: 0.28; }
  52% { opacity: 0.46; background-position: 0 -28px, 54% 0; transform: skewX(-4deg); }
  100% { opacity: 0.12; background-position: 0 -72px, 142% 0; transform: skewX(0deg); }
}

@keyframes gk-cyber-content {
  0% { opacity: 0; transform: translateY(10px) scale(0.98); filter: blur(8px); }
  28% { opacity: 0; transform: translateY(10px) scale(0.98); filter: blur(8px); }
  42% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  78% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translateY(-7px) scale(1.02); filter: blur(5px); }
}

@keyframes gk-loader-flicker {
  0%, 100% { opacity: 1; }
  18% { opacity: 0.96; }
  20% { opacity: 1; }
  43% { opacity: 0.92; }
  45% { opacity: 1; }
  66% { opacity: 0.97; }
}

/* Access mode */
.access-bar {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 420;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(440px, calc(100vw - 36px));
  padding: 9px 10px 9px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  box-shadow: 0 12px 32px rgba(25, 18, 45, 0.12);
}

.access-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.access-copy strong {
  font-size: 12px;
  line-height: 1.1;
}

.access-copy span {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.access-switch {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel-strong);
  color: var(--text-main);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
}

.access-switch:hover {
  background: rgba(255, 255, 255, 0.86);
}

.realworld-sync-button {
  border-color: rgba(110, 78, 225, 0.28);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(243, 239, 255, 0.86));
  color: #4f38b8;
}

.realworld-sync-button[data-sync-state="busy"] {
  cursor: progress;
  opacity: 0.72;
}

.realworld-sync-button[data-sync-state="ok"] {
  border-color: rgba(34, 150, 105, 0.28);
  color: #16805c;
}

.realworld-sync-button[data-sync-state="error"] {
  border-color: rgba(199, 71, 83, 0.34);
  color: #b43848;
}

.accio-user-mode .skill-card,
.accio-user-mode .qa-card {
  user-select: text;
}

.accio-user-mode .disclaimer {
  display: none !important;
}

/* AgentHub external resources */
.accio-readonly .agenthub-admin-panel {
  display: none !important;
}

.agenthub-admin-panel,
.agenthub-public-panel {
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 38px rgba(28, 20, 48, 0.1);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.agenthub-head,
.agenthub-toolbar,
.agenthub-summary,
.agenthub-titleline,
.agenthub-meta,
.agenthub-tags,
.agenthub-actions,
.agenthub-switches {
  display: flex;
  align-items: center;
}

.agenthub-head {
  justify-content: space-between;
  gap: 16px;
}

.agenthub-head-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.agenthub-head h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.agenthub-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.agenthub-view-all {
  flex: 0 0 auto;
  border: 1px solid rgba(107, 78, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 900;
  padding: 9px 14px;
}

.agenthub-view-all:hover {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(91, 69, 210, 0.12);
}

.agenthub-toolbar {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.agenthub-switches {
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(120, 108, 150, 0.2);
  border-radius: 12px;
  background: rgba(248, 247, 252, 0.74);
}

.agenthub-switches button,
.agenthub-actions button,
.agenthub-open-link {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
}

.agenthub-switches button.active,
.agenthub-actions button:hover,
.agenthub-open-link:hover {
  border-color: rgba(107, 78, 255, 0.22);
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent);
}

.agenthub-toolbar input {
  min-width: min(360px, 100%);
  flex: 1;
  border: 1px solid rgba(120, 108, 150, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 11px 12px;
}

.agenthub-summary {
  justify-content: space-between;
  gap: 12px;
  margin: 13px 0 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.agenthub-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.agenthub-public-panel .agenthub-list {
  display: block;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.agenthub-shelf {
  display: grid;
  grid-auto-columns: minmax(238px, 0.32fr);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.agenthub-shelf-card {
  min-height: 178px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
  border: 1px solid rgba(120, 108, 150, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.58)),
    radial-gradient(circle at 12% 0%, rgba(119, 95, 255, 0.1), transparent 38%);
  box-shadow: 0 12px 30px rgba(30, 22, 52, 0.08);
}

.agenthub-shelf-card:hover {
  border-color: rgba(107, 78, 255, 0.26);
  box-shadow: 0 16px 34px rgba(52, 34, 120, 0.12);
  transform: translateY(-1px);
}

.agenthub-shelf-top,
.agenthub-shelf-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.agenthub-shelf-card h3 {
  margin: 0;
  color: var(--text-main);
  font-size: 16px;
}

.agenthub-shelf-card p {
  display: -webkit-box;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.agenthub-shelf-card .agenthub-tags {
  min-height: 25px;
  margin-bottom: 0;
}

.agenthub-shelf-foot {
  margin-top: auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.agenthub-shelf-foot .agenthub-open-link {
  flex: 0 0 auto;
}

.agenthub-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(120, 108, 150, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
}

.agenthub-row-public {
  grid-template-columns: minmax(0, 1fr) auto;
}

.agenthub-titleline {
  flex-wrap: wrap;
  gap: 8px;
}

.agenthub-titleline strong {
  font-size: 15px;
}

.agenthub-type,
.agenthub-status,
.agenthub-tags span {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
}

.agenthub-type {
  background: rgba(88, 206, 168, 0.12);
  color: #168768;
}

.agenthub-status {
  background: rgba(130, 120, 150, 0.12);
  color: var(--text-muted);
}

.agenthub-status-approved,
.agenthub-status-merged {
  background: rgba(84, 196, 140, 0.14);
  color: #168768;
}

.agenthub-status-ignored,
.agenthub-status-archived {
  background: rgba(178, 171, 190, 0.18);
  color: #766f82;
}

.agenthub-row p {
  margin: 8px 0 10px;
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.55;
}

.agenthub-tags {
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 9px;
}

.agenthub-tags span {
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-muted);
}

.agenthub-meta {
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.agenthub-actions {
  align-content: start;
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
  min-width: 92px;
}

.agenthub-row-public .agenthub-actions {
  min-width: 104px;
}

.agenthub-actions button,
.agenthub-open-link {
  border-color: rgba(120, 108, 150, 0.18);
  background: rgba(255, 255, 255, 0.74);
}

.agenthub-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.agenthub-empty {
  padding: 22px;
  border: 1px dashed rgba(120, 108, 150, 0.24);
  border-radius: 14px;
  color: var(--text-muted);
  text-align: center;
}

.agenthub-admin-panel.is-busy {
  opacity: 0.76;
  pointer-events: none;
}

.agenthub-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9400;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28, 22, 42, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.agenthub-drawer-backdrop[hidden] {
  display: none;
}

.agenthub-drawer {
  width: min(980px, 96vw);
  max-height: min(760px, 88vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(120, 108, 150, 0.2);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 30px 90px rgba(30, 22, 52, 0.24);
  overflow: hidden;
}

.agenthub-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(120, 108, 150, 0.14);
}

.agenthub-drawer-head h3 {
  margin: 0 0 4px;
  color: var(--text-main);
  font-size: 18px;
}

.agenthub-drawer-head span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.agenthub-drawer-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(120, 108, 150, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-main);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.agenthub-drawer-list {
  max-height: none;
  overflow: auto;
  padding: 14px;
}

.agenthub-drawer-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .access-bar {
    top: auto;
    right: 12px;
    bottom: 12px;
    flex-wrap: wrap;
  }

  .gk-widget {
    bottom: 86px;
  }

  .agenthub-row {
    grid-template-columns: 1fr;
  }

  .agenthub-admin-panel,
  .agenthub-public-panel {
    padding: 14px;
    border-radius: 14px;
  }

  .agenthub-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .agenthub-head-actions {
    width: 100%;
  }

  .agenthub-head-actions .btn {
    flex: 1 1 140px;
  }

  .agenthub-view-all {
    width: 100%;
  }

  .agenthub-shelf {
    grid-auto-columns: minmax(248px, 84vw);
    margin-right: -14px;
    padding-right: 14px;
  }

  .agenthub-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agenthub-drawer-backdrop {
    align-items: end;
    padding: 0;
  }

  .agenthub-drawer {
    width: 100vw;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
  }

  .agenthub-drawer-list {
    padding: 12px;
  }

}
