:root {
  --red: #b91c1c;
  --red-dark: #7f1d1d;
  --gold: #f59e0b;
  --ink: #1c1917;
  --muted: #57534e;
  --paper: #fffbf5;
  --line: #e7e0d6;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", sans-serif; color: var(--ink); background: var(--paper); line-height: 1.5; }
a { color: var(--red); }
.hero { position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% -20%, #7c2d12 0%, #1c1917 65%); color: #fff; text-align: center; padding: 72px 20px 48px; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 4rem); margin: 8px 0; letter-spacing: -0.02em; }
.hero h1 span { display: block; font-size: 0.5em; color: #fde68a; letter-spacing: 0.1em; }
.lede { max-width: 640px; margin: 0 auto 20px; font-size: 1.1rem; color: #e7e5e4; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; color: var(--gold); margin: 0; }
.hero-links a { color: #fde68a; margin: 0 8px; }
.hero-links .cta { display: inline-block; background: var(--gold); color: #1c1917; padding: 10px 22px; border-radius: 999px; font-weight: 700; text-decoration: none; }
.lanterns { position: absolute; inset: 0 0 auto; display: flex; justify-content: space-around; pointer-events: none; }
.lanterns span { width: 26px; height: 34px; margin-top: 10px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #fca5a5, #dc2626 60%, #7f1d1d); box-shadow: 0 0 24px 6px rgba(245, 158, 11, 0.45); animation: sway 4s ease-in-out infinite alternate; }
.lanterns span:nth-child(2n) { animation-delay: -2s; margin-top: 22px; }
@keyframes sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .lanterns span { animation: none; } }
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }
.demo-note { background: #fef3c7; border: 1px solid #fcd34d; border-radius: 10px; padding: 8px 12px; font-size: 0.9rem; }
h2 small { font-size: 0.55em; color: var(--muted); font-weight: 400; margin-left: 8px; }
.market-map { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 16px; background: #292524; border-radius: 16px; }
.map-stall { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 10px; background: #44403c; color: #d6d3d1; text-decoration: none; font-size: 0.8rem; text-align: center; }
.map-stall .num { font-size: 1.3rem; font-weight: 700; }
.map-stall.agentic { background: linear-gradient(#dc2626, #7f1d1d); color: #fff; box-shadow: 0 0 18px rgba(245, 158, 11, 0.5); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.stall-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.stall-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stall-card.agentic { border-top: 5px solid var(--red); }
.stall-card h3 { margin: 4px 0 0; }
.stall-card .zh { margin: 0; color: var(--red); }
.stall-num { margin: 0; font-size: 0.8rem; color: var(--muted); }
.hl { font-size: 0.92rem; }
.stall-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 8px; font-size: 0.85rem; }
.stall-card dt { color: var(--muted); }
.stall-card dd { margin: 0; }
.badge { position: absolute; top: 12px; right: 12px; font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; background: #e7e5e4; color: #44403c; }
.badge.on { background: #fee2e2; color: var(--red-dark); }
.card-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.card-actions button, .crawl button { font: inherit; font-size: 0.9rem; background: var(--red); color: #fff; border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.crawl { position: sticky; top: 12px; background: #fff; border: 2px dashed var(--gold); border-radius: 16px; padding: 4px 16px 12px; }
.crawl-stops { padding-left: 0; list-style: none; }
.crawl-stops li { border-bottom: 1px solid var(--line); padding: 8px 0; }
.stop-head { display: flex; justify-content: space-between; gap: 8px; }
.crawl .remove { background: transparent; color: var(--muted); padding: 0 6px; }
.note { margin: 2px 0; font-size: 0.9rem; }
.order-zh { margin: 4px 0 0; font-size: 1.15rem; font-weight: 700; color: var(--red-dark); }
.order-py { margin: 0; font-size: 0.85rem; color: var(--muted); }
.crawl-total { font-weight: 700; }
.how li { margin-bottom: 8px; }
footer { text-align: center; padding: 24px 16px; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } .crawl { position: static; } .market-map { grid-template-columns: repeat(3, 1fr); } }
/* Assistant layout. Append to the site's stylesheet and set the colors to the site's palette. */
.assistant { margin-top: 48px; }

/* The runtime reads these variables for its chat, settings and agent panels.
   The chat background below also uses --ns-bg. White text sits on --ns-primary (the
   visitor's messages, Send, and the chat form and settings buttons) and on --ns-accent
   (Send while a turn is steered), so give both at least 4.5:1 contrast with white.
   --ns-accent also underlines the chat header. */
#agent-app {
  --ns-font: system-ui, sans-serif;
  --ns-bg: #ffffff;
  --ns-fg: #1f2328;
  --ns-primary: #b91c1c;
  --ns-accent: #7f1d1d;
  --ns-border: #d0d7de;
  --ns-panelbg: #ffffff;
  --ns-msgbg: #f6f8fa;
  --ns-muted: #59636e;
}

.assistant-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px;
  margin-top: 16px;
}

/* Set the height once the runtime has mounted the chat, so a failed load leaves no
   empty box. */
#agent-app.ns-composed-app [data-ns-slot="chat"] { height: 720px; }
/* The runtime gives the chat no background of its own. Keep --ns-msgbg different from
   --ns-bg, or bot replies lose their bubble. */
#agent-app .ns-chat { background: var(--ns-bg); }

/* Site-wide form rules often stretch the runtime's own controls. Undo them here. */
#agent-app input[type="checkbox"],
#agent-app input[type="radio"] { width: auto; }
#agent-app .ns-header { flex-wrap: wrap; }
/* Site label rules add margins and bold text, and the inputs inside the labels inherit
   the weight. */
#agent-app .ns-settings-body label { margin: 4px 0; font-weight: 400; }
/* Chat forms label radio groups with a legend, so site legend fonts would reach them. */
#agent-app .ns-w-label { font-family: inherit; }
/* Site label rules add margins to chat form fields and make their options bold. */
#agent-app .ns-widget label { margin: 0; }
#agent-app .ns-w-radio label,
#agent-app .ns-w-multi label,
#agent-app .ns-w-toggle { font-weight: 400; }
/* The runtime sizes radio and multi-choice options but not the checkbox label. */
#agent-app .ns-w-toggle { font-size: 13px; }
/* The runtime spaces its buttons with gap. A site's button margin pushes Send below the input. */
#agent-app button { margin: 0; }
/* Chat choices are buttons with a light background. A site's button color can hide their
   titles. */
#agent-app .ns-w-choice { color: var(--ns-fg); }
/* A site's button:hover background also reaches the runtime's plain buttons, behind
   their dark text. Keep the runtime's own backgrounds. */
#agent-app .ns-devtoggle:not(.on):hover,
#agent-app .ns-modal-close:hover { background: transparent; }
#agent-app .ns-w-choice:disabled:hover { background: #fafbfc; }
/* The runtime's message rule hides the partner consent card's own background, and its
   Decline label then has too little contrast. */
#agent-app .ns-consent { background: #fffbeb; }
/* While a consent card waits, the status line above it already says "Contacting", though
   nothing has been sent. Hide it until the visitor answers. */
#agent-app .ns-msgs:has(.ns-consent-actions) > .ns-turn-status { display: none; }
/* Long links in a reply would run out of the bubble on a phone. "anywhere" would also
   let the consent card's buttons shrink and split their labels. */
#agent-app .ns-msg { overflow-wrap: break-word; }
/* On a phone the consent card is too narrow for its three buttons in one row, and
   "Always allow" breaks onto two lines. Keep each label whole and wrap the row. */
#agent-app .ns-consent-actions { flex-wrap: wrap; }
#agent-app .ns-consent-actions button { white-space: nowrap; }

/* site.js and the runtime add their confirmation dialogs to <body>, outside #agent-app.
   Site h2 rules reach the heading, and the two buttons touch. A right margin keeps
   wrapped buttons lined up on the left. */
body > dialog h2 { margin: 0 0 12px; font: 700 1.25em system-ui, sans-serif; }
body > dialog button { margin-right: 8px; }
/* site.js's dialog: the details in two columns, and a plain decline button, so the two
   choices do not look the same. */
.assistant-review { max-width: 640px; width: 85%; max-height: 85vh; overflow: auto; border: 1px solid #888; border-radius: 12px; padding: 24px; font: 16px system-ui, sans-serif; }
.assistant-review dl { display: grid; grid-template-columns: fit-content(40%) 1fr; gap: 4px 16px; margin: 12px 0; }
.assistant-review dt { font-weight: 600; }
.assistant-review dd { margin: 0; overflow-wrap: anywhere; }
.assistant-review details { margin: 12px 0; }
.assistant-review pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-review .assistant-decline { background: transparent; color: inherit; border: 1px solid currentColor; }

@media (max-width: 760px) {
  .assistant-panels { grid-template-columns: 1fr; }
  /* On a phone, each detail goes under its label, so an email is not split. */
  .assistant-review dl { grid-template-columns: 1fr; gap: 0; }
  .assistant-review dd { margin-bottom: 8px; }
}
