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

:root {
  --void: #050508;
  --surface: #0c0c12;
  --panel: #12121a;
  --border: #1e1e2e;
  --accent: #00ff88;
  --accent2: #7c3aed;
  --warn: #f59e0b;
  --danger: #ef4444;
  --font: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --header-h: 3rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --page-x: 1rem;
}

html { scroll-behavior: smooth; overflow-x: hidden; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--void);
  color: #fff;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0,255,136,.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(124,58,237,.06), transparent);
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(0,255,136,.3); }

a { color: inherit; text-decoration: none; }

/* layout */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(18,18,26,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0);
}
.header-inner {
  max-width: 72rem; margin: 0 auto; padding: 0 1rem;
  height: 3.5rem; display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .875rem; }
.logo-icon {
  width: 2rem; height: 2rem; border-radius: .5rem;
  background: rgba(0,255,136,.1); border: 1px solid rgba(0,255,136,.3);
  display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 1rem; height: 1rem; color: var(--accent); }
.logo .x { color: var(--accent); }
.footer {
  border-top: 1px solid var(--border); padding: 1.5rem;
  text-align: center; font-size: .75rem; color: rgba(255,255,255,.5);
}

.page {
  width: 100%; max-width: 48rem; margin: 0 auto;
  padding: 3rem var(--page-x) 7rem;
}
.page.narrow { max-width: 42rem; }
.grid-bg {
  width: 100%; max-width: 100%;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  min-height: calc(100vh - 8rem);
  min-height: calc(100dvh - 8rem);
}

/* typography */
.hero-tag {
  font-family: var(--mono); font-size: .75rem; text-transform: uppercase;
  letter-spacing: .2em; margin-bottom: .75rem;
}
.hero-title { font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 700; line-height: 1.25; margin-bottom: .5rem; word-break: break-word; }
.mobile-br { display: none; }
.hero-sub { font-size: .875rem; color: rgba(255,255,255,.72); }
.gradient-accent {
  background: linear-gradient(to right, var(--accent), #6ee7b7);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.gradient-warn {
  background: linear-gradient(to right, var(--warn), #fdba74);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.glow { text-shadow: 0 0 30px rgba(0,255,136,.5); }

/* cards */
.glass {
  background: rgba(18,18,26,.8); backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 1rem; padding: 1.5rem;
}
.label {
  display: block; font-family: var(--mono); font-size: .75rem;
  color: rgba(255,255,255,.65); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .75rem;
}

/* form */
textarea, input[type="text"] {
  width: 100%; background: rgba(5,5,8,.8); border: 1px solid var(--border);
  border-radius: .75rem; padding: .75rem 1rem; font-family: var(--mono); font-size: .875rem;
  color: rgba(255,255,255,.9); resize: none; transition: border-color .2s;
}
textarea:focus, input:focus { outline: none; border-color: rgba(0,255,136,.4); box-shadow: 0 0 0 1px rgba(0,255,136,.2); }
textarea:disabled, input:disabled { opacity: .5; }
.input-row { display: flex; gap: .75rem; }
.input-row input { flex: 1; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .625rem 1.5rem; border-radius: .75rem; border: none;
  font-family: var(--font); font-weight: 600; font-size: .875rem;
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.btn:disabled { opacity: .3; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: var(--void); }
.btn-accent:hover:not(:disabled) { background: rgba(0,255,136,.9); }
.btn-warn { background: var(--warn); color: var(--void); }
.btn-warn:hover:not(:disabled) { background: rgba(245,158,11,.9); }
.form-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; }
.hint { font-family: var(--mono); font-size: .625rem; color: rgba(255,255,255,.5); }

/* chain badges */
.chains { display: flex; justify-content: center; gap: .75rem; margin-bottom: 2rem; flex-wrap: wrap; }
.chain-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .375rem .75rem; border-radius: 9999px; border: none;
  background: transparent; color: #fff; font-size: .75rem; font-weight: 500;
  cursor: pointer; opacity: .6; transition: all .2s;
}
.chain-btn:hover { opacity: 1; }
.chain-btn.active { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }
.chain-dot { width: .5rem; height: .5rem; border-radius: 50%; }

/* terminal */
.terminal {
  border-radius: .75rem; overflow: hidden; border: 1px solid var(--border);
  background: #0a0a0f; box-shadow: 0 25px 50px rgba(0,0,0,.5);
  margin-bottom: 1.5rem;
}
.terminal-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .625rem 1rem; background: #111118; border-bottom: 1px solid var(--border);
}
.dot { width: .75rem; height: .75rem; border-radius: 50%; }
.dot-r { background: rgba(239,68,68,.8); }
.dot-y { background: rgba(245,158,11,.8); }
.dot-g { background: rgba(0,255,136,.8); }
.terminal-title { font-family: var(--mono); font-size: .75rem; color: rgba(255,255,255,.6); margin-left: .5rem; }
.terminal-body {
  padding: 1rem; height: 16rem; overflow-y: auto; overflow-x: hidden;
  font-family: var(--mono); font-size: .8125rem; line-height: 1.6;
  word-break: break-word; overflow-wrap: anywhere;
}
.terminal-body .ok { color: var(--accent); }
.terminal-body .warn { color: var(--warn); }
.terminal-body .info { color: #60a5fa; }
.terminal-body .tree { color: rgba(255,255,255,.5); }
.terminal-body .cmd .dollar { color: var(--accent); }
.cursor {
  display: inline-block; width: .5rem; height: 1rem;
  background: rgba(0,255,136,.8); vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* agent diagram */
.diagram {
  border-radius: .75rem; border: 1px solid var(--border);
  background: rgba(18,18,26,.5); padding: 1.5rem; position: relative; overflow: hidden;
  opacity: 0; transform: translateY(1rem); transition: all .7s;
}
.diagram.show { opacity: 1; transform: translateY(0); }
.diagram-scan {
  position: absolute; left: 0; right: 0; height: 1px;
  background: rgba(0,255,136,.2); top: 50%;
  animation: scan 3s linear infinite;
}
@keyframes scan { 0% { transform: translateY(-150px); } 100% { transform: translateY(150px); } }
.diagram-label { font-size: .75rem; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem; }
.diagram-core {
  width: 5rem; height: 5rem; margin: 0 auto 1.5rem; border-radius: 1rem;
  background: linear-gradient(135deg, rgba(0,255,136,.2), rgba(124,58,237,.2));
  border: 1px solid rgba(0,255,136,.4);
  display: flex; align-items: center; justify-content: center;
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }
.diagram-core svg { width: 2.5rem; height: 2.5rem; color: var(--accent); }
.diagram-name { text-align: center; font-family: var(--mono); font-size: .75rem; color: var(--accent); margin-bottom: 1rem; }
.diagram-modules { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.module {
  display: flex; flex-direction: column; align-items: center;
  opacity: 0; transform: scale(.75); transition: all .5s;
}
.module.show { opacity: 1; transform: scale(1); }
.module-box {
  width: 3.5rem; height: 3.5rem; border-radius: .75rem;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.module-box svg { width: 1.5rem; height: 1.5rem; color: rgba(255,255,255,.6); }
.module span { font-family: var(--mono); font-size: .625rem; color: rgba(255,255,255,.5); margin-top: .5rem; text-align: center; max-width: 5rem; }
.onchain-bar {
  text-align: center; padding-top: 1rem; border-top: 1px solid rgba(0,255,136,.2);
}
.onchain-pill {
  display: inline-flex; align-items: center; gap: .75rem;
  padding: .5rem 1rem; border-radius: .5rem;
  background: rgba(0,255,136,.05); border: 1px solid rgba(0,255,136,.2);
  font-family: var(--mono); font-size: .75rem; color: rgba(0,255,136,.8);
}
.pulse { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

/* sticky CTA */
.sticky-cta {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  padding: 1rem; transform: translateY(100%); opacity: 0;
  transition: all .5s;
}
.sticky-cta.show { transform: translateY(0); opacity: 1; }
.sticky-cta-inner { max-width: 32rem; margin: 0 auto; }
.sticky-cta button {
  width: 100%; padding: 1rem 1.5rem; border-radius: 1rem; border: none;
  font-family: var(--font); font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: all .2s;
}
.sticky-cta button .sub { display: block; font-size: .875rem; font-weight: 400; opacity: .7; margin-top: .125rem; }
.sticky-cta .cta-short { display: none; }
.cta-accent { background: var(--accent); color: var(--void); box-shadow: 0 0 40px rgba(0,255,136,.4); animation: glow-a 2s ease-in-out infinite; }
.cta-warn { background: var(--warn); color: var(--void); box-shadow: 0 0 40px rgba(245,158,11,.4); animation: glow-w 2s ease-in-out infinite; }
@keyframes glow-a { 50% { box-shadow: 0 0 60px rgba(0,255,136,.6); } }
@keyframes glow-w { 50% { box-shadow: 0 0 60px rgba(245,158,11,.6); } }

/* modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.show { display: flex; }
.modal {
  background: rgba(18,18,26,.95); border: 1px solid var(--border);
  border-radius: 1rem; padding: 1.5rem; width: 100%; max-width: 24rem;
}
.modal h3 { font-size: 1.125rem; margin-bottom: .25rem; }
.modal p { font-size: .75rem; color: rgba(255,255,255,.4); margin-bottom: 1.25rem; }
.modal-list { display: flex; flex-direction: column; gap: .5rem; }
.modal-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: .75rem 1rem; border-radius: .75rem;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; font-size: .875rem; transition: border-color .2s;
  font-family: var(--font); color: #fff; text-align: left;
}
.modal-item:hover { border-color: rgba(0,255,136,.3); }
.modal-item.warn:hover { border-color: rgba(245,158,11,.3); }
.modal-demo { font-family: var(--mono); font-size: .625rem; color: rgba(255,255,255,.25); text-align: center; margin-top: 1rem; }

.wallet-step.hidden { display: none; }
.wallet-loading { text-align: center; padding: 1.5rem 0; }
.wallet-spinner {
  width: 2.5rem; height: 2.5rem; margin: 0 auto 1rem;
  border: 2px solid rgba(0,255,136,.2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.wallet-loading-title { font-size: .9375rem; font-weight: 600; margin-bottom: .375rem; }
.wallet-loading-sub { font-size: .75rem; color: rgba(255,255,255,.45); }
.wallet-addr {
  font-family: var(--mono); font-size: .6875rem; color: var(--accent);
  margin-bottom: 1rem !important; margin-top: -.5rem;
}
.tx-preview {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: .75rem; padding: .75rem; margin-bottom: 1rem;
}
.tx-preview-success { margin-bottom: 1.25rem; }
.tx-row {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  padding: .5rem 0; font-size: .75rem; border-bottom: 1px solid rgba(255,255,255,.06);
}
.tx-row:last-child { border-bottom: none; }
.tx-row span { color: rgba(255,255,255,.45); flex-shrink: 0; }
.tx-row strong { color: #fff; text-align: right; word-break: break-all; font-weight: 500; }
.tx-link {
  font-family: var(--mono); font-size: .6875rem; color: var(--accent);
  text-decoration: underline; text-underline-offset: 2px;
}
.tx-status-live { color: var(--accent) !important; display: inline-flex; align-items: center; gap: .375rem; }
.btn-full { width: 100%; justify-content: center; margin-top: .5rem; }
.btn-full:first-of-type { margin-top: 0; }
.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: rgba(255,255,255,.6);
}
.btn-ghost:hover:not(:disabled) { border-color: rgba(255,255,255,.25); color: #fff; }
.wallet-success-icon {
  width: 3rem; height: 3rem; margin: 0 auto 1rem;
  border-radius: 50%; background: rgba(0,255,136,.15); border: 1px solid rgba(0,255,136,.4);
  color: var(--accent); font-size: 1.25rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 24px rgba(0,255,136,.25);
}
.wallet-success-sub { font-size: .8125rem !important; color: rgba(255,255,255,.55) !important; line-height: 1.5; margin-bottom: 1rem !important; }

.sticky-cta button.cta-pending {
  animation: none; opacity: .85; cursor: wait;
  box-shadow: 0 0 24px rgba(0,255,136,.25);
}
.sticky-cta button.cta-success {
  animation: none; background: rgba(0,255,136,.15); color: var(--accent);
  border: 1px solid rgba(0,255,136,.4); box-shadow: none; cursor: default;
}
.diagram .onchain-pill.active {
  border-color: rgba(0,255,136,.5); color: var(--accent);
  background: rgba(0,255,136,.1);
}

.hidden { display: none !important; }

.home-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .25rem .75rem; border-radius: 9999px;
  background: rgba(0,255,136,.1); border: 1px solid rgba(0,255,136,.2);
  font-family: var(--mono); font-size: .75rem; color: var(--accent); margin-bottom: 1rem;
}
.home-badge .pulse { width: .375rem; height: .375rem; }

.text-center { text-align: center; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-2 { margin-top: .5rem; }
.section-title { font-size: .75rem; color: rgba(255,255,255,.65); font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1rem; }

/* touch */
button, .btn, .chain-btn, .modal-item {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ========== Mobile App Shell ========== */
@media (max-width: 767px) {
  :root { --page-x: 1rem; }

  html, body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    position: fixed;
    width: 100%;
    touch-action: pan-x pan-y;
  }

  body {
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  .header {
    position: relative;
    flex-shrink: 0;
    padding-top: var(--safe-top);
  }
  .header-inner { height: var(--header-h); padding: 0 var(--page-x); }
  .footer { display: none; }

  main.grid-bg {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: unset;
  }

  /* 默认：一屏锁定，禁止整页拖动 */
  .page {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    padding: .5rem var(--page-x) .375rem;
  }

  .page-hero {
    flex-shrink: 0;
    text-align: center;
    margin-bottom: .375rem !important;
  }
  .page-hero .hero-sub {
    display: block;
    font-size: .6875rem;
    line-height: 1.35;
    margin-top: .25rem;
    color: rgba(255,255,255,.75);
  }
  .page-hero .hero-title { font-size: clamp(1rem, 4.2vw, 1.25rem); line-height: 1.25; margin-bottom: 0; }

  .page-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    justify-content: center;
    overflow: hidden;
  }

  .hero-tag { font-size: .625rem; letter-spacing: .1em; }
  .hero-title { font-size: clamp(1.125rem, 4.5vw, 1.5rem); }
  .hero-sub { font-size: .8125rem; line-height: 1.5; }
  .mb-10 { margin-bottom: 0 !important; }
  .glow { text-shadow: none; }

  .glass { padding: .75rem; border-radius: .875rem; max-width: 100%; flex-shrink: 0; }
  .label { font-size: .6875rem; margin-bottom: .375rem; }

  textarea, input[type="text"] {
    font-size: 16px;
    padding: .75rem; border-radius: .625rem; max-width: 100%;
  }
  textarea { min-height: 3.5rem; max-height: 4.5rem; }

  .input-row { flex-direction: column; gap: .625rem; }
  .input-row .btn { width: 100%; justify-content: center; padding: .875rem 1rem; min-height: 2.75rem; }

  .form-footer { flex-direction: column-reverse; gap: .375rem; align-items: stretch; margin-top: .625rem; }
  .form-footer .btn { width: 100%; justify-content: center; padding: .75rem; min-height: 2.5rem; }
  .form-footer .hint { text-align: center; font-size: .5625rem; }

  .chains {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: .375rem; margin-bottom: 0; flex-shrink: 0;
  }
  .chain-btn {
    justify-content: center; width: 100%;
    padding: .5rem .375rem; font-size: .6875rem;
    min-height: 2.375rem; opacity: .7;
    background: rgba(255,255,255,.03); border-radius: .625rem;
    outline: none;
  }
  .chain-btn.active {
    opacity: 1; background: rgba(0,255,136,.08);
    border: 1px solid rgba(0,255,136,.35);
    outline: none;
  }

  #output {
    flex: 1; min-height: 0; overflow: hidden;
    display: flex; flex-direction: column; gap: .375rem;
    margin-top: 0 !important;
  }
  #output.hidden { display: none !important; }

  .terminal {
    border-radius: .625rem; margin-bottom: 0; max-width: 100%;
    flex: 1; min-height: 0; display: flex; flex-direction: column;
  }
  .terminal-bar { padding: .5rem .75rem; flex-shrink: 0; }
  .terminal-title { font-size: .625rem; margin-left: .25rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .terminal-body {
    flex: 1; min-height: 0; height: auto !important;
    padding: .625rem; font-size: .6875rem;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  }

  body.page-expanded .chains { display: none; }

  .diagram {
    padding: .625rem; max-width: 100%; flex-shrink: 0;
    max-height: 38%; overflow: hidden;
  }
  .diagram .diagram-core { width: 2.5rem; height: 2.5rem; margin-bottom: .25rem; }
  .diagram .diagram-core svg { width: 1.25rem; height: 1.25rem; }
  .diagram .diagram-name { font-size: .5625rem; margin-bottom: .375rem; }
  .diagram .diagram-modules { gap: .375rem; margin-bottom: .375rem; }
  .diagram .module-box { width: 2.25rem; height: 2.25rem; }
  .diagram .module-box svg { width: 1rem; height: 1rem; }
  .diagram .module span { font-size: .5rem; margin-top: .25rem; }
  .diagram .onchain-bar { padding-top: .375rem; }
  .diagram .onchain-pill { font-size: .5rem; padding: .25rem .375rem; }
  .diagram .diagram-modules { display: grid; grid-template-columns: repeat(2, 1fr); gap: .375rem; }
  .diagram .module { width: 100%; }

  .sticky-cta {
    bottom: 0;
    padding: .5rem var(--page-x);
    padding-bottom: calc(.5rem + var(--safe-bottom));
    background: linear-gradient(to top, rgba(5,5,8,.98) 80%, transparent);
  }
  .sticky-cta button {
    padding: .875rem 1rem; font-size: .875rem; border-radius: .875rem; min-height: 2.75rem;
  }
  .sticky-cta button .sub { font-size: .75rem; }
  .sticky-cta .cta-long { display: none; }
  .sticky-cta .cta-short { display: inline; }

  /* 有结果后：压缩 hero，内容区内部滚动 */
  body.page-expanded .page-hero { display: none; }
  body.page-expanded .page-body { justify-content: flex-start; overflow: hidden; }
  body.page-expanded .page { padding-top: .375rem; }

  .sticky-cta:not(.show) { pointer-events: none; visibility: hidden; }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%; border-radius: 1rem 1rem 0 0;
    padding: 0 1rem calc(1rem + var(--safe-bottom));
    max-height: 85dvh; overflow-y: auto;
  }
  .modal::before {
    content: ''; display: block; width: 2.5rem; height: .25rem;
    background: rgba(255,255,255,.15); border-radius: 9999px;
    margin: .75rem auto 1rem;
  }
  .modal-item { padding: 1rem; min-height: 3rem; }

  .home-badge { font-size: .5625rem; margin-bottom: .375rem; max-width: 100%; }
}

@media (max-width: 380px) {
  :root { --page-x: .875rem; }
  .diagram-modules { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
}

@media (min-width: 768px) {
  .page.has-cta { padding-bottom: 7rem; }
}

/* ===== Agent Page Upper Section ===== */
.agent-page .grid-bg {
  background-image:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(0,255,136,.14), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 20%, rgba(124,58,237,.1), transparent),
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
}

.agent-page .page { padding-top: 2rem; }

.agent-page .page-hero {
  text-align: center;
  max-width: 34rem;
  margin: 0 auto 2rem;
  padding: 0 .5rem;
  overflow: visible;
}
.agent-page .page-hero-inner {
  transform: translateY(50px);
  margin-bottom: -50px;
}
.agent-page .page-hero .home-badge {
  font-size: .6875rem;
  margin-bottom: 1.125rem;
}
.agent-page .page-hero .hero-title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: .875rem;
}
.agent-page .page-hero .hero-sub {
  font-size: .9375rem;
  color: rgba(255,255,255,.62);
  line-height: 1.65;
  max-width: 28rem;
  margin: 0 auto;
}

.agent-page .agent-upper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: -50px;
}

.agent-page .agent-chains { margin-bottom: 0; gap: .625rem; }
.agent-page .chain-btn {
  opacity: 1;
  padding: .625rem 1rem;
  font-size: .875rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: .75rem;
  outline: none;
  transition: all .2s;
}
.agent-page .chain-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(0,255,136,.18), rgba(0,255,136,.06));
  border-color: rgba(0,255,136,.55);
  box-shadow: 0 0 20px rgba(0,255,136,.22);
  outline: none;
}
.agent-page .chain-dot { width: .625rem; height: .625rem; box-shadow: 0 0 8px currentColor; }

.agent-page .agent-prompt-card {
  border: 1px solid rgba(0,255,136,.35);
  background: linear-gradient(160deg, rgba(0,255,136,.08), rgba(18,18,26,.92));
  box-shadow: 0 0 32px rgba(0,255,136,.12), inset 0 1px 0 rgba(0,255,136,.18);
  padding: 1.25rem;
}
.agent-page .agent-prompt-card .label {
  color: var(--accent);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .08em;
  margin-bottom: .625rem;
}
.agent-page #prompt {
  font-size: 1.0625rem;
  line-height: 1.55;
  padding: 1rem 1.125rem;
  min-height: 5.5rem;
  color: #fff;
  background: linear-gradient(180deg, rgba(0,40,24,.75), rgba(5,5,8,.95));
  border: 1.5px solid rgba(0,255,136,.55);
  box-shadow:
    0 0 0 3px rgba(0,255,136,.14),
    0 0 28px rgba(0,255,136,.15),
    inset 0 0 24px rgba(0,255,136,.06);
  animation: prompt-glow 3s ease-in-out infinite;
}
.agent-page #prompt::placeholder { color: rgba(0,255,136,.45); }
.agent-page #prompt:focus {
  border-color: rgba(0,255,136,.75);
  box-shadow:
    0 0 0 4px rgba(0,255,136,.2),
    0 0 36px rgba(0,255,136,.25),
    inset 0 0 28px rgba(0,255,136,.08);
}
@keyframes prompt-glow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(0,255,136,.14), 0 0 28px rgba(0,255,136,.12), inset 0 0 24px rgba(0,255,136,.06); }
  50% { box-shadow: 0 0 0 3px rgba(0,255,136,.2), 0 0 36px rgba(0,255,136,.2), inset 0 0 28px rgba(0,255,136,.09); }
}
.agent-page .form-footer .hint { color: rgba(0,255,136,.55); font-size: .75rem; }
.agent-page .form-footer .btn { font-size: 1rem; padding: .875rem 1.75rem; }

@media (max-width: 767px) {
  .agent-page .page { padding-top: 1rem; }
  .agent-page .page-hero {
    margin-bottom: .875rem !important;
    padding: 0;
  }
  .agent-page .page-hero-inner {
    transform: translateY(50px);
    margin-bottom: -50px;
  }
  .agent-page .page-hero .home-badge { font-size: .5625rem; margin-bottom: .625rem; }
  .agent-page .page-hero .hero-title {
    font-size: clamp(1.375rem, 5.5vw, 1.625rem);
    line-height: 1.25;
    margin-bottom: .5rem;
  }
  .agent-page .page-hero .hero-sub {
    font-size: .75rem;
    line-height: 1.5;
    color: rgba(255,255,255,.55);
    max-width: 20rem;
  }
  .agent-page .agent-upper { gap: .625rem; margin-top: -50px; }
  .agent-page .agent-chains { gap: .375rem; }
  .agent-page .chain-btn { font-size: .8125rem; min-height: 2.5rem; padding: .5rem .375rem; }
  .agent-page .agent-prompt-card { padding: .875rem; }
  .agent-page .agent-prompt-card .label { font-size: .75rem; }
  .agent-page #prompt { font-size: 1rem; min-height: 4.25rem; max-height: 5rem; padding: .875rem; }
  .agent-page .form-footer .btn { font-size: .9375rem; }
  body.page-expanded .agent-upper { display: none; }
}
