@font-face {
  font-family: "HarmonyOS Sans SC";
  src: url("/assets/fonts/HarmonyOS-Sans-SC-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "HarmonyOS Sans SC";
  src: url("/assets/fonts/HarmonyOS-Sans-SC-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --rn-brand: #214d9f;
  --rn-brand-strong: #153b76;
  --rn-accent: #20a5da;
  --rn-accent-soft: #eaf7fc;
  --rn-ink: #17324d;
  --rn-muted: #64788c;
  --rn-line: #dce7ef;
  --rn-surface: #ffffff;
  --rn-surface-soft: #f7fafc;
  --rn-page: #eff5f9;
  --rn-success: #0b7f72;
  --rn-warning: #a96500;
  --rn-danger: #b42318;
  --rn-radius-sm: 4px;
  --rn-radius-md: 6px;
  --rn-radius-lg: 8px;
  --rn-shadow-sm: 0 6px 20px rgba(21, 59, 118, 0.07);
  --rn-shadow-md: 0 16px 42px rgba(21, 59, 118, 0.12);
  --rn-motion-fast: 140ms;
  --rn-motion-base: 220ms;
  --rn-motion-slow: 360ms;
  --rn-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --rn-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --rn-font: "HarmonyOS Sans SC", "PingFang SC", "Source Han Sans CN", "Microsoft YaHei", Arial, sans-serif;
  --rn-content-max: 1240px;
  --rn-touch-target: 44px;
}

body.customer-demo,
body.widget-demo,
body.ops-admin {
  font-family: var(--rn-font);
  letter-spacing: 0;
}

body.customer-demo :is(button, textarea, input, select),
body.widget-demo :is(button, textarea, input, select),
body.ops-admin :is(button, textarea, input, select) {
  font-family: inherit;
}

body.customer-demo :is(button, textarea, a):focus-visible,
body.widget-demo :is(button, textarea, a):focus-visible,
body.ops-admin :is(button, textarea, input, select, a):focus-visible {
  outline: 3px solid rgba(31, 164, 217, 0.3);
  outline-offset: 2px;
}

body.customer-demo :is(button, a),
body.widget-demo :is(button, a),
body.ops-admin :is(button, a) {
  touch-action: manipulation;
}

/* Customer-facing full-page demo */
body.customer-demo {
  --bg: var(--rn-page);
  --surface: var(--rn-surface);
  --surface-soft: var(--rn-surface-soft);
  --ink: var(--rn-ink);
  --muted: var(--rn-muted);
  --line: var(--rn-line);
  --teal: var(--rn-success);
  --cyan: var(--rn-accent);
  --blue: var(--rn-brand);
  --navy: var(--rn-brand-strong);
  --shadow: var(--rn-shadow-md);
  --soft-shadow: var(--rn-shadow-sm);
  background: var(--rn-page);
  font-size: 15px;
}

body.customer-demo .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: #e1e9ef;
  box-shadow: 0 2px 12px rgba(21, 59, 118, 0.05);
}

body.customer-demo .topbar-inner {
  width: min(1240px, calc(100vw - 40px));
  min-height: 76px;
}

body.customer-demo .brand-logo {
  display: block;
  width: 150px;
  height: auto;
}

body.customer-demo .brand-text {
  padding-left: 12px;
  border-left: 1px solid var(--rn-line);
}

body.customer-demo .brand-text strong {
  color: var(--rn-brand);
}

body.customer-demo .nav {
  gap: 28px;
  color: var(--rn-brand);
  font-weight: 650;
}

body.customer-demo .nav a {
  position: relative;
  color: var(--rn-brand);
  text-decoration: none;
  transition: color var(--rn-motion-fast) ease;
}

body.customer-demo .nav a:first-child::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -13px;
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: var(--rn-accent);
  transform: translateX(-50%);
}

body.customer-demo .topbar-actions a {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-color: #dce7ef;
  border-style: solid;
  border-width: 1px;
  border-radius: var(--rn-radius-md);
  background: #fff;
  color: var(--rn-brand);
  text-decoration: none;
  transition:
    transform var(--rn-motion-fast) var(--rn-ease-out),
    border-color var(--rn-motion-fast) ease,
    background var(--rn-motion-fast) ease;
}

body.customer-demo .layout {
  width: min(1240px, calc(100vw - 40px));
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 28px;
  padding-top: 28px;
}

body.customer-demo .main-copy,
body.customer-demo .chat-panel {
  min-height: calc(100vh - 132px);
}

body.customer-demo .intro {
  padding-top: 6px;
}

body.customer-demo .eyebrow {
  color: var(--rn-accent);
  font-weight: 700;
}

body.customer-demo h1 {
  max-width: 720px;
  color: var(--rn-brand-strong);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 720;
  line-height: 1.25;
}

body.customer-demo .lead {
  max-width: 720px;
  line-height: 1.8;
}

body.customer-demo .service,
body.customer-demo .signal-band,
body.customer-demo .signal-card,
body.customer-demo .chat-panel {
  border-radius: var(--rn-radius-lg);
}

body.customer-demo .service {
  border-color: #dce7ef;
  box-shadow: none;
  transition:
    transform var(--rn-motion-base) var(--rn-ease-out),
    border-color var(--rn-motion-base) ease,
    box-shadow var(--rn-motion-base) ease;
}

body.customer-demo .service::before {
  background: var(--rn-accent);
}

body.customer-demo .signal-band {
  border-color: #dce7ef;
  box-shadow: none;
}

body.customer-demo .signal-visual {
  background:
    linear-gradient(90deg, rgba(32, 77, 158, 0.1), rgba(31, 164, 217, 0.08)),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(32, 77, 158, 0.07) 22px 23px);
}

body.customer-demo .gene-line,
body.customer-demo .gene-line.short {
  background: linear-gradient(90deg, var(--rn-brand), var(--rn-accent));
}

body.customer-demo .chat-panel {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  border-color: #cfdde8;
  box-shadow: var(--rn-shadow-md);
  top: 96px;
}

body.customer-demo .chat-header {
  min-height: 72px;
  background: linear-gradient(100deg, var(--rn-brand-strong), var(--rn-brand) 68%, var(--rn-accent));
}

body.customer-demo .messages {
  min-height: 0;
  background: #f7fafc;
  position: relative;
}

body.customer-demo .welcome-mascot {
  position: absolute;
  z-index: 1;
  left: 26px;
  top: 24px;
  width: 38px;
  height: 38px;
  padding: 3px;
  border: 1px solid #c9e8f4;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

body.customer-demo .messages > .welcome-mascot + .message.bot {
  padding-left: 58px;
  min-height: 64px;
}

body.customer-demo .message.bot {
  border-left-color: var(--rn-accent);
}

body.customer-demo .message.bot::before {
  color: var(--rn-brand);
}

body.customer-demo .message.user {
  border-color: var(--rn-brand);
  background: var(--rn-brand);
  box-shadow: 0 5px 16px rgba(32, 77, 158, 0.18);
}

body.customer-demo .next-action {
  border-color: #c9e8f4;
  background: var(--rn-accent-soft);
  color: var(--rn-brand-strong);
  transition:
    transform var(--rn-motion-fast) var(--rn-ease-out),
    border-color var(--rn-motion-fast) ease,
    background var(--rn-motion-fast) ease;
}

body.customer-demo .send-row textarea:focus {
  border-color: var(--rn-accent);
  outline: 3px solid rgba(31, 164, 217, 0.18);
}

body.customer-demo .send-row {
  border-top: 6px solid var(--rn-page);
}

body.customer-demo .send-row button {
  border-color: var(--rn-brand);
  background: var(--rn-brand);
  transition:
    transform var(--rn-motion-fast) var(--rn-ease-out),
    background var(--rn-motion-fast) ease,
    box-shadow var(--rn-motion-fast) ease,
    opacity var(--rn-motion-fast) ease;
}

body.customer-demo .cookie-consent {
  position: static;
  left: auto;
  bottom: auto;
  z-index: auto;
  width: auto;
  transform: none;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--rn-line);
  border-radius: 0;
  background: #f4f9fc;
  box-shadow: none;
  padding: 12px 14px;
  grid-template-columns: 1fr;
  gap: 10px;
}

body.customer-demo .cookie-consent.visible {
  display: grid;
  animation: rnCookieEnter var(--rn-motion-base) var(--rn-ease-out) both;
}

body.customer-demo .cookie-consent.leaving {
  animation: rnCookieLeave 180ms var(--rn-ease-standard) both;
  pointer-events: none;
}

body.customer-demo .cookie-copy strong {
  color: var(--rn-brand-strong);
}

body.customer-demo .cookie-actions .primary {
  border-color: var(--rn-brand);
  background: var(--rn-brand);
}

body.customer-demo .cookie-actions {
  justify-content: flex-end;
}

/* Public floating-widget host page */
body.widget-demo {
  --bg: var(--rn-page);
  --surface: var(--rn-surface);
  --ink: var(--rn-ink);
  --muted: var(--rn-muted);
  --line: var(--rn-line);
  --blue: var(--rn-brand);
  --cyan: var(--rn-accent);
  --navy: var(--rn-brand-strong);
  --teal: var(--rn-success);
  min-height: 100vh;
  background: var(--rn-page);
  font-size: 15px;
}

body.widget-demo .topbar {
  min-height: 76px;
  border-bottom-color: #e1e9ef;
  box-shadow: 0 2px 12px rgba(21, 59, 118, 0.05);
}

body.widget-demo .brand-logo {
  display: block;
  width: 150px;
  height: auto;
}

body.widget-demo .nav {
  color: var(--rn-brand);
  font-weight: 650;
}

body.widget-demo .nav a {
  color: var(--rn-brand);
  text-decoration: none;
  transition: color var(--rn-motion-fast) ease;
}

body.widget-demo main {
  width: min(1180px, calc(100vw - 40px));
  padding-top: 44px;
}

body.widget-demo .hero {
  grid-template-columns: minmax(0, 1fr) 380px;
  min-height: 330px;
}

body.widget-demo h1 {
  color: var(--rn-brand-strong);
  font-size: clamp(32px, 4vw, 48px);
}

body.widget-demo .hero-panel,
body.widget-demo .service,
body.widget-demo .notice {
  border-radius: var(--rn-radius-lg);
  box-shadow: none;
  transition:
    transform var(--rn-motion-base) var(--rn-ease-out),
    border-color var(--rn-motion-base) ease,
    box-shadow var(--rn-motion-base) ease;
}

body.widget-demo .hero-panel {
  border-top: 3px solid var(--rn-accent);
}

body.widget-demo .metric b {
  color: var(--rn-brand);
  font-size: 15px;
}

body.widget-demo .service {
  border-top-color: var(--rn-accent);
}

body.widget-demo .notice {
  border-color: #c9e8f4;
  border-left-color: var(--rn-accent);
  background: #f3fafd;
}

/* Internal operations UI */
body.ops-admin {
  --ink: var(--rn-ink);
  --muted: var(--rn-muted);
  --line: var(--rn-line);
  --line-strong: #bacbd8;
  --surface: var(--rn-surface);
  --soft: var(--rn-page);
  --soft-2: #eaf2f7;
  --brand: var(--rn-brand);
  --brand-strong: var(--rn-brand-strong);
  --blue: var(--rn-accent);
  --success: var(--rn-success);
  --success-bg: #edf8f6;
  --amber: var(--rn-warning);
  --danger: var(--rn-danger);
  --shadow: var(--rn-shadow-sm);
  background: var(--rn-page);
  font-size: 15px;
}

body.ops-admin header {
  background: rgba(255, 255, 255, 0.98);
  border-bottom-color: #e1e9ef;
  box-shadow: 0 2px 12px rgba(21, 59, 118, 0.05);
}

body.ops-admin .header-inner {
  max-width: 1400px;
  min-height: 76px;
  padding-block: 10px;
}

body.ops-admin .ops-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

body.ops-admin .ops-brand-logo {
  display: block;
  width: 136px;
  height: auto;
  flex: 0 0 auto;
}

body.ops-admin .ops-brand-copy {
  padding-left: 16px;
  border-left: 1px solid var(--rn-line);
}

body.ops-admin h1,
body.ops-admin h2,
body.ops-admin h3 {
  color: var(--rn-brand-strong);
}

body.ops-admin .shell {
  max-width: 1400px;
  gap: 18px;
}

body.ops-admin .tabs {
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 5px;
  scrollbar-width: thin;
}

body.ops-admin .tab {
  flex: 0 0 auto;
  border-color: #d5e1ea;
  color: var(--rn-brand-strong);
  transition:
    transform var(--rn-motion-fast) var(--rn-ease-out),
    border-color var(--rn-motion-fast) ease,
    background var(--rn-motion-fast) ease,
    color var(--rn-motion-fast) ease;
}

body.ops-admin .tab.active {
  border-color: var(--rn-brand);
  background: var(--rn-brand);
}

body.ops-admin section,
body.ops-admin .panel,
body.ops-admin .flow-step,
body.ops-admin .form-card,
body.ops-admin .upload-card,
body.ops-admin .status-card,
body.ops-admin .version-card,
body.ops-admin .store-card,
body.ops-admin .review-card,
body.ops-admin .question-card,
body.ops-admin .list-item {
  border-radius: var(--rn-radius-lg);
}

body.ops-admin section,
body.ops-admin .panel {
  border-color: #d7e3eb;
  box-shadow: none;
}

body.ops-admin .status-banner {
  border-radius: var(--rn-radius-md);
}

body.ops-admin .status-banner.motion-refresh {
  animation: rnStatusRefresh var(--rn-motion-slow) var(--rn-ease-out) both;
}

body.ops-admin .view.active {
  animation: rnViewEnter var(--rn-motion-base) var(--rn-ease-out) both;
}

body.ops-admin .status-card {
  border-top: 3px solid var(--rn-brand);
  min-height: 150px;
  transition:
    transform var(--rn-motion-base) var(--rn-ease-out),
    border-color var(--rn-motion-base) ease,
    box-shadow var(--rn-motion-base) ease;
}

body.ops-admin .status-card.ok {
  border-top-color: var(--rn-success);
}

body.ops-admin .status-card.warn {
  border-top-color: var(--rn-warning);
}

body.ops-admin button.primary,
body.ops-admin .action-row button.selected {
  border-color: var(--rn-brand);
  background: var(--rn-brand);
}

body.ops-admin button {
  transition:
    transform var(--rn-motion-fast) var(--rn-ease-out),
    border-color var(--rn-motion-fast) ease,
    background var(--rn-motion-fast) ease,
    color var(--rn-motion-fast) ease,
    opacity var(--rn-motion-fast) ease;
}

.motion-message-enter {
  --rn-message-x: -6px;
  animation: rnMessageEnter var(--rn-motion-base) var(--rn-ease-out) both;
}

.motion-message-enter.user {
  --rn-message-x: 6px;
}

@media (hover: hover) and (pointer: fine) {
  body.customer-demo .nav a:hover,
  body.widget-demo .nav a:hover {
    color: var(--rn-accent);
  }

  body.customer-demo .topbar-actions a:hover,
  body.customer-demo .service:hover,
  body.widget-demo :is(.hero-panel, .service, .notice):hover,
  body.ops-admin .status-card:hover {
    transform: translateY(-2px);
    border-color: #bfd7e7;
    box-shadow: var(--rn-shadow-sm);
  }

  body.customer-demo .next-action:hover,
  body.ops-admin .tab:hover:not(.active) {
    transform: translateY(-1px);
    border-color: var(--rn-accent);
    background: #f3fafd;
  }

  body.customer-demo .send-row button:hover:not(:disabled),
  body.ops-admin button.primary:hover:not(:disabled) {
    background: var(--rn-brand-strong);
    box-shadow: 0 7px 18px rgba(32, 77, 158, 0.18);
  }
}

body.customer-demo :is(.next-action, .send-row button, .topbar-actions a):active,
body.ops-admin :is(button, .tab):active {
  transform: scale(0.97);
}

@keyframes rnMessageEnter {
  from { opacity: 0; transform: translate(var(--rn-message-x), 7px); }
  to { opacity: 1; transform: translate(0, 0); }
}

@keyframes rnCookieEnter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rnCookieLeave {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(4px); }
}

@keyframes rnViewEnter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rnStatusRefresh {
  0% { opacity: 0.72; transform: translateY(-3px); }
  100% { opacity: 1; transform: translateY(0); }
}

body.ops-admin .drop-zone.active {
  border-color: var(--rn-accent);
  background: var(--rn-accent-soft);
}

body.ops-admin .pill.blue {
  color: var(--rn-brand);
  border-color: #bfdaec;
  background: var(--rn-accent-soft);
}

@media (max-width: 980px) {
  body.customer-demo .layout {
    grid-template-columns: 1fr;
  }

  body.widget-demo .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body.customer-demo .topbar-inner,
  body.customer-demo .layout {
    width: calc(100vw - 20px);
  }

  body.customer-demo .topbar-inner {
    min-height: 66px;
  }

  body.customer-demo .brand-logo {
    width: 132px;
  }

  body.customer-demo .brand-text {
    display: none;
  }

  body.customer-demo .chat-panel {
    min-height: calc(100dvh - 86px);
    max-height: calc(100dvh - 86px);
  }

  body.customer-demo .messages {
    min-height: 0;
  }

  body.customer-demo .cookie-consent {
    grid-template-columns: 1fr;
    padding: 11px;
  }

  body.customer-demo .cookie-copy {
    font-size: 11px;
  }

  body.customer-demo .cookie-actions button {
    min-height: 44px;
  }

  body.customer-demo .next-action,
  body.customer-demo .send-row button,
  body.ops-admin button {
    min-height: 44px;
  }

  body.widget-demo .topbar {
    padding-inline: 16px;
  }

  body.widget-demo .brand-logo {
    width: 132px;
  }

  body.widget-demo main {
    width: calc(100vw - 28px);
    padding-top: 30px;
  }

  body.widget-demo .hero {
    min-height: auto;
  }

  body.widget-demo h1 {
    font-size: 32px;
  }

  body.ops-admin .header-inner {
    align-items: center;
    flex-direction: row;
    min-height: 70px;
    padding-inline: 12px;
  }

  body.ops-admin .ops-brand-logo {
    width: 112px;
  }

  body.ops-admin .ops-brand-copy {
    padding-left: 10px;
  }

  body.ops-admin .ops-brand-copy .sub {
    display: none;
  }

  body.ops-admin #refreshBtn {
    min-width: 44px;
    padding-inline: 10px;
  }

  body.ops-admin .shell {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
