:root {
  color-scheme: light;

  --wanli-blue: #0a3287;
  --wanli-deep: #06265f;
  --wanli-bright: #1b5eb9;
  --wanli-pale: #eef4fd;
  --wanli-line: #cbdaf0;
  /* Legacy token names retained for compatibility; values now follow Wanli blue. */
  --product-teal: #1b5eb9;
  --product-teal-deep: #0a3287;
  --ai-gold: #f3c956;

  --ink: #102e55;
  --muted: #66778b;
  --line: #d6e1f0;
  --blue-soft: #eaf2fc;
  --surface: #ffffff;
  --surface-subtle: #f7f9fc;
  --composer-bg: #f5f8fc;
  --user-bg: #eef3fb;
  --user-border: #d3deed;
  --warning-bg: #fff3cb;
  --warning-border: #eed27c;
  --warning-ink: #72510d;

  --radius-shell: 20px;
  --radius-card: 12px;
  --radius-control: 10px;
  --radius-input: 14px;
  --radius-mark: 12px;
  --radius-status: 999px;

  --shadow-panel: 0 11px 30px rgba(6, 38, 95, 0.15);
  --shadow-card: 0 5px 14px rgba(6, 38, 95, 0.09);
  --shadow-control: 0 4px 9px rgba(6, 38, 95, 0.13);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  font-family:
    "Noto Sans SC",
    "PingFang SC",
    "Microsoft YaHei UI",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: #eef4fa;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  z-index: -2;
  background:
    url("./assets/wanli-stadium-desktop.webp")
    center center / cover no-repeat;
  filter: saturate(0.9) brightness(1.01);
  transform: scale(1.01);
}

body::after {
  z-index: -1;
  background:
    linear-gradient(
      180deg,
      rgba(234, 244, 255, 0.67) 0%,
      rgba(242, 247, 253, 0.82) 48%,
      rgba(238, 244, 250, 0.94) 100%
    );
}

body.arriving-from-home .site-header {
  animation: ai-header-arrive .46s cubic-bezier(.2, .78, .2, 1) both;
}

body.arriving-from-home .page-shell {
  animation: ai-workspace-arrive .58s .06s cubic-bezier(.2, .78, .2, 1) both;
}

body.is-returning-home .site-header,
body.is-returning-home .page-shell {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .26s ease, transform .32s ease;
}

button,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--ai-gold);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--wanli-deep);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.product-mark {
  display: block;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  min-height: 84px;
  padding: 5px clamp(24px, 3.125vw, 48px) 0;
  border-bottom: 1px solid rgba(207, 219, 233, 0.95);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 2px 16px rgba(6, 38, 95, 0.045);
  backdrop-filter: blur(18px);
}

.site-header::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--wanli-blue);
  content: "";
}

.site-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.header-seal {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 36px;
  margin: 0 16px 0 13px;
  background: rgba(10, 50, 135, 0.18);
}

.product-mark-header {
  width: 29px;
  height: 29px;
}

.brand-copy {
  display: grid;
  min-width: 0;
  margin-left: 10px;
}

.brand-copy strong {
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.25;
  white-space: nowrap;
}

.brand-copy small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: clamp(26px, 3.2vw, 52px);
  margin-left: auto;
}

.desktop-nav a {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 90px;
  padding: 6px 4px 0;
  color: #526b83;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition:
    color 160ms ease,
    transform 160ms ease;
}

.desktop-nav a:hover {
  color: var(--wanli-blue);
  transform: translateY(-1px);
}

.desktop-nav a.active {
  color: var(--ink);
  font-weight: 700;
}

.desktop-nav a.active::before {
  position: absolute;
  top: 17px;
  right: 13px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ai-gold);
  content: "";
}

.desktop-nav a.active::after {
  position: absolute;
  right: 22px;
  bottom: 14px;
  left: 22px;
  height: 3px;
  border-radius: 999px;
  background: var(--wanli-blue);
  content: "";
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 125px;
  height: 40px;
  margin-left: clamp(24px, 3vw, 60px);
  border: 1px solid rgba(10, 50, 135, 0.42);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.home-link:hover {
  border-color: var(--product-teal);
  background: #fff;
  transform: translateY(-1px);
}

.home-link svg {
  width: 18px;
  height: 18px;
  color: var(--product-teal);
}

/* Workspace */
.page-shell {
  width: min(1440px, calc(100% - 96px));
  margin: 20px auto 56px;
}

.workspace-shell {
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr);
  gap: 15px;
  height: min(864px, calc(100dvh - 124px));
  min-height: 720px;
}

.question-sidebar,
.chat-workspace {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-shell);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-panel);
}

/* Sidebar */
.question-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.campus-identity {
  position: relative;
  min-height: 163px;
  overflow: hidden;
  padding: 18px 26px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--wanli-blue), #174d9c);
}

.campus-identity::before {
  position: absolute;
  top: 22px;
  right: 28px;
  width: 76px;
  height: 76px;
  border-top: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  content: "";
  transform: rotate(47deg);
}

.campus-identity::after {
  position: absolute;
  top: 90px;
  right: 31px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  content: "";
}

.campus-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.seal-wrap {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #fff;
}

.seal-wrap img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.campus-heading h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.campus-heading p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.campus-summary {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
}

.non-official {
  position: relative;
  z-index: 1;
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.sidebar-scroll {
  display: flex;
  min-height: 0;
  overflow-y: auto;
  flex-direction: column;
  padding: 10px 31px 32px;
  scrollbar-color: rgba(10, 50, 135, 0.22) transparent;
  scrollbar-width: thin;
}

.sidebar-section {
  flex: 0 0 auto;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.section-title span {
  color: var(--muted);
  font-size: 10px;
}

.section-title button {
  padding: 2px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
}

.section-title button:hover {
  color: var(--wanli-blue);
}

.quick-list {
  display: grid;
  gap: 10px;
}

.quick-list > button {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid #dde6f2;
  border-radius: 11px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.88);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.quick-list > button::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: transparent;
  content: "";
}

.quick-list > button:hover {
  border-color: #98b9df;
  background: #f8fbff;
  box-shadow: 0 4px 12px rgba(10, 50, 135, 0.07);
  transform: translateY(-1px);
}

.quick-list > button.selected {
  border: 2px solid #6ea5e3;
  background: #e9f2ff;
}

.quick-list > button.selected::before {
  background: var(--wanli-blue);
}

.question-number {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--wanli-blue);
  background: #eef4fb;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.quick-list > button.selected .question-number {
  color: #fff;
  background: var(--wanli-blue);
}

.quick-list strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-list svg,
.recent-questions button svg {
  width: 16px;
  height: 16px;
  color: var(--wanli-blue);
}

.recent-section {
  margin-top: 32px;
}

.recent-questions {
  display: grid;
  gap: 8px;
}

.recent-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 81px;
  border: 1px solid #dfe7f2;
  border-radius: 13px;
  color: #78889c;
  background: #f7fafe;
  font-size: 12px;
}

.recent-empty svg {
  width: 24px;
  height: 24px;
  margin-bottom: 6px;
  color: #8a9aaf;
}

.recent-questions button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #dfe7f2;
  border-radius: 10px;
  color: var(--ink);
  text-align: left;
  background: #f9fbfd;
}

.recent-questions button:hover {
  border-color: #98b9df;
  background: #f2f7fd;
}

.recent-questions button span {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.privacy-reminder {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  margin-top: auto;
  padding: 16px 14px;
  border: 1px solid var(--warning-border);
  border-radius: 14px;
  color: var(--warning-ink);
  background: #fff8e3;
}

.privacy-reminder svg {
  width: 26px;
  height: 26px;
}

.privacy-reminder strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.privacy-reminder p {
  margin: 0;
  font-size: 11px;
  line-height: 1.65;
}

/* Promoter attribution stays available inside the redesigned sidebar. */
.promoter-notice {
  display: grid;
  grid-template-areas:
    "badge copy"
    "badge action";
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  row-gap: 8px;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid var(--wanli-line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(241,246,253,.96));
  box-shadow: 0 9px 24px rgba(6, 38, 95, .08);
}

.promoter-badge {
  grid-area: badge;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: var(--wanli-blue);
  box-shadow: 0 8px 18px rgba(10, 50, 135, .18);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.promoter-notice > div {
  grid-area: copy;
  display: grid;
  min-width: 0;
  gap: 2px;
}

.promoter-notice strong {
  color: var(--wanli-deep);
  font-size: 13px;
  line-height: 1.4;
}

.promoter-notice span:not(.promoter-badge) {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

.promoter-notice button {
  grid-area: action;
  justify-self: start;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #b7cae7;
  border-radius: 11px;
  color: var(--wanli-blue);
  background: #fff;
  box-shadow: 0 4px 12px rgba(6, 38, 95, .06);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.promoter-notice button:hover {
  border-color: #7fa3d6;
  background: var(--wanli-pale);
  transform: translateY(-1px);
}

/* Chat workspace */
.chat-workspace {
  display: grid;
  grid-template-rows: 91px minmax(0, 1fr) auto;
}

.chat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
}

.assistant-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.assistant-identity strong,
.assistant-identity small {
  display: block;
}

.assistant-identity strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.assistant-identity small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.chat-tools {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
}

.quiet-button,
.support-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 700;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.quiet-button {
  min-width: 85px;
  padding: 0 14px;
  border: 1px solid #c7d5e8;
  color: var(--muted);
  background: #fff;
}

.support-button {
  gap: 7px;
  min-width: 100px;
  padding: 0 12px;
  border: 1px solid #d8e2ee;
  color: var(--wanli-blue);
  background: #f5f8fc;
}

.support-button svg {
  width: 19px;
  height: 19px;
}

.quiet-button:hover,
.support-button:hover {
  border-color: #9db7da;
  color: var(--wanli-blue);
  background: #f1f5fc;
  transform: translateY(-1px);
}

.messages {
  min-height: 0;
  overflow-y: auto;
  padding: 30px 32px 26px;
  scroll-behavior: smooth;
  scrollbar-color: rgba(10, 50, 135, 0.22) transparent;
  scrollbar-width: thin;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
  animation: message-in 240ms ease both;
}

.message.user {
  justify-content: flex-end;
}

.message-mark {
  width: 32px;
  height: 32px;
  margin-top: 14px;
}

.bubble {
  max-width: min(906px, calc(100% - 42px));
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.65;
  white-space: normal;
}

.assistant-bubble {
  padding: 22px 24px;
  border: 1px solid #d8e2ee;
  border-radius: var(--radius-card);
  background: var(--surface-subtle);
}

.assistant-bubble:has(.answer-source) {
  border-color: #d8e2ea;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.user-message {
  display: grid;
  justify-items: end;
  gap: 5px;
  max-width: 58%;
}

.user-label {
  color: #7a899a;
  font-size: 11px;
  font-weight: 600;
}

.user .bubble {
  width: fit-content;
  max-width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--user-border);
  border-radius: 16px 6px 16px 16px;
  background: var(--user-bg);
  box-shadow: 0 3px 12px rgba(14, 47, 82, 0.05);
  white-space: pre-wrap;
}

.answer-source {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  border: 1px solid #a9c0e5;
  border-radius: var(--radius-status);
  color: var(--wanli-blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.source-badge.temporary {
  border-color: var(--warning-border);
  color: var(--warning-ink);
  background: var(--warning-bg);
}

.source-detail {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-text {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.answer-model {
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid #d9e3f1;
  border-radius: 6px;
  background: #f5f8fc;
  color: #60708a;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.conversion-prompt {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--product-teal);
  border-radius: 0 8px 8px 0;
  background: var(--wanli-pale);
  color: #294b78;
  font-size: 14px;
  line-height: 1.7;
}

.follow-up-block {
  margin-top: 18px;
}

.follow-up-title {
  margin: 0 0 9px;
  color: #6a7890;
  font-size: 13px;
  font-weight: 600;
}

.follow-up-options {
  display: grid;
  gap: 8px;
}

.follow-up-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #d6e0ed;
  border-radius: 10px;
  background: #f8faff;
  color: #23446b;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.follow-up-options button:hover {
  border-color: #9eb6d5;
  background: #f0f5fc;
  transform: translateY(-1px);
}

.follow-up-options button:focus-visible {
  outline: 3px solid rgba(29, 78, 145, 0.2);
  outline-offset: 2px;
}

.follow-up-options svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--wanli-blue);
}

.answer-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #dce5f0;
}

.answer-notice {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.65;
}

.answer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.answer-actions > span {
  margin-right: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.answer-actions button,
.message-action {
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid #c7d5e8;
  border-radius: 9px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.answer-actions button:hover,
.answer-actions button.selected {
  border-color: #7eade2;
  color: var(--wanli-blue);
  background: var(--blue-soft);
}

.message-action {
  color: var(--wanli-blue) !important;
  border-color: rgba(10, 50, 135, 0.24) !important;
}

.message-action:hover {
  background: var(--wanli-pale) !important;
}

.message-action.standalone {
  margin-top: 14px;
}

.message.is-loading .message-mark {
  animation: assistant-breathe 1.4s ease-in-out infinite;
}

.message.is-loading .assistant-bubble {
  color: var(--muted);
}

/* Composer */
.composer {
  margin: 0 30px 36px;
  padding: 18px 22px 20px;
  border: 1px solid rgba(190, 207, 232, .88);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(250,252,255,.98), rgba(243,247,252,.98));
  box-shadow: 0 12px 30px rgba(6, 38, 95, .07);
}

.composer > label {
  display: block;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.composer-field {
  position: relative;
  padding: 4px;
  border: 1px solid #bed0e8;
  border-radius: 17px;
  background: #fff;
  box-shadow:
    0 8px 24px rgba(6, 38, 95, .08),
    inset 0 1px 0 rgba(255,255,255,.92);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.composer-field:focus-within {
  border-color: #739bd0;
  box-shadow:
    0 10px 28px rgba(6, 38, 95, .11),
    0 0 0 4px rgba(10, 50, 135, .08);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 65px;
  max-height: 120px;
  resize: none;
  padding: 17px 72px 16px 18px;
  border: 0;
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  line-height: 1.7;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.composer textarea::placeholder {
  color: #8a98a9;
}

.composer textarea:focus {
  box-shadow: none;
}

.send-button {
  position: absolute;
  top: 50%;
  right: 9px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  color: #fff;
  background: var(--wanli-blue);
  box-shadow: 0 9px 20px rgba(10, 50, 135, .24);
  transform: translateY(-50%);
  transition:
    background 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.send-button:hover {
  background: var(--wanli-bright);
  box-shadow: 0 11px 24px rgba(10, 50, 135, .28);
  transform: translateY(calc(-50% - 1px));
}

.send-button:disabled {
  background: #bdc9da;
  box-shadow: none;
}

.send-button svg {
  width: 24px;
  height: 24px;
}

.composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
}

.disclaimer {
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0;
  color: #718096;
  font-size: 12px;
}

.pulse-line {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 12px;
  margin-right: 10px;
}

.pulse-line::before {
  position: absolute;
  top: 6px;
  right: 0;
  left: 0;
  height: 2px;
  background:
    linear-gradient(
      90deg,
      transparent 0 10%,
      #718096 10% 30%,
      transparent 30% 36%,
      #718096 36% 50%,
      transparent 50% 56%,
      #718096 56% 88%,
      transparent 88%
    );
  content: "";
}

.keyboard-hint {
  flex: 0 0 auto;
  color: #8996a7;
  font-size: 11px;
}

.composer.is-answering .pulse-line {
  animation: pulse-travel 1.1s ease-in-out infinite;
}

/* Below-workspace legal notice, commercial service card and footer are retained. */
.identity-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 15px;
  border: 1px solid rgba(238, 210, 124, 0.78);
  border-radius: 12px;
  color: #6f5a2f;
  background: rgba(255, 248, 227, 0.92);
  font-size: 11px;
  line-height: 1.65;
}

.identity-notice strong {
  flex: 0 0 auto;
  color: var(--warning-ink);
}

.service-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--wanli-line);
  border-radius: 18px;
  background: rgba(249, 252, 255, 0.96);
  box-shadow: 0 10px 28px rgba(6, 38, 95, 0.07);
}

.service-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--wanli-line);
  border-radius: 14px;
  color: var(--wanli-blue);
  background: #fff;
  font-size: 15px;
  font-weight: 800;
}

.service-kicker,
.dialog-kicker {
  margin: 0 0 5px;
  color: var(--wanli-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.service-card h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 18px;
}

.service-copy > p:not(.service-kicker) {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.service-points {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.service-points span {
  padding: 5px 9px;
  border: 1px solid #d1deef;
  border-radius: 8px;
  color: var(--wanli-blue);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.primary-button {
  min-height: 42px;
  padding: 9px 15px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--wanli-blue);
  box-shadow: 0 8px 18px rgba(10, 50, 135, .18);
  font-weight: 800;
  transition:
    background 150ms ease,
    transform 150ms ease;
}

.primary-button:hover {
  background: var(--wanli-bright);
  transform: translateY(-1px);
}

.primary-button.wide {
  width: 100%;
  margin-top: 13px;
}

.site-footer {
  margin-top: 20px;
  padding: 18px 4px 0;
  border-top: 1px solid rgba(214, 225, 240, 0.92);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.site-footer strong {
  color: var(--ink);
}

.site-footer p {
  max-width: 880px;
  margin: 6px 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 8px 0;
}

.site-footer button {
  padding: 0;
  border: 0;
  color: var(--wanli-blue);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.site-footer small {
  color: #8996a7;
}

.site-footer a {
  color: var(--wanli-blue);
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Dialogs are intentionally kept functional and visually compatible. */
dialog {
  width: min(500px, calc(100% - 24px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 80px rgba(6, 25, 55, 0.28);
}

dialog::backdrop {
  background: rgba(6, 28, 61, 0.52);
  backdrop-filter: blur(5px);
}

.dialog-shell {
  position: relative;
  padding: 26px;
}

.dialog-shell h2 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 21px;
}

.dialog-shell > p:not(.dialog-kicker) {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #d8e2ee;
  border-radius: 9px;
  color: var(--muted);
  background: #f3f6fa;
  font-size: 20px;
}

.dialog-shell label {
  display: grid;
  gap: 7px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px;
  border: 1px solid #d8e2ee;
  border-radius: 11px;
  color: var(--ink);
  background: #f3f7fb;
}

.copy-row strong,
.copy-row a {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
}

.copy-row button {
  border: 0;
  color: var(--wanli-blue);
  background: transparent;
  font-weight: 800;
}

.contact-guide {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--wanli-line);
  border-radius: 14px;
  background: linear-gradient(135deg, #f7faff, #edf4fd);
}

.contact-guide-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.contact-guide-heading strong {
  color: var(--wanli-deep);
  font-size: 13px;
}

.contact-guide-heading span {
  color: var(--muted);
  font-size: 10px;
}

.contact-guide ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-guide li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid rgba(203, 218, 240, .78);
  border-radius: 10px;
  background: rgba(255,255,255,.82);
}

.contact-guide li > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--wanli-blue);
  font-size: 9px;
  font-weight: 800;
}

.contact-guide li strong,
.contact-guide li small {
  display: block;
}

.contact-guide li strong {
  color: var(--ink);
  font-size: 11px;
  line-height: 1.35;
}

.contact-guide li small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.need-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 18px;
}

.need-grid button {
  min-height: 62px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  text-align: left;
  background: var(--surface-subtle);
}

.need-grid button:hover {
  border-color: #98b9df;
  background: var(--blue-soft);
}

.soft-note {
  padding: 11px;
  border-radius: 10px;
  background: var(--surface-subtle);
  font-size: 11px;
}

.commercial-note {
  color: #7c6757 !important;
  font-size: 11px !important;
}

.legal-shell {
  position: relative;
  max-height: min(76vh, 680px);
  overflow-y: auto;
  padding: 28px;
}

.legal-shell h2 {
  margin: 0 0 14px;
}

.legal-shell h3 {
  margin: 18px 0 4px;
  color: var(--ink);
  font-size: 14px;
}

.legal-shell p {
  margin: 7px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.consent-shell {
  padding: 28px;
  text-align: center;
}

.consent-shell .product-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
}

.consent-shell h2 {
  margin: 0 0 14px;
}

.consent-shell ul {
  margin: 0;
  padding: 15px 15px 15px 34px;
  border: 1px solid #dfe7f2;
  border-radius: 12px;
  color: var(--muted);
  text-align: left;
  background: #f5f8fc;
  font-size: 12px;
  line-height: 1.8;
}

.text-button {
  margin-top: 12px;
  border: 0;
  color: var(--wanli-blue);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

/* Motion */
@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes assistant-breathe {
  0%,
  100% {
    opacity: 0.76;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

@keyframes pulse-travel {
  0%,
  100% {
    opacity: 0.45;
    transform: translateX(0);
  }
  50% {
    opacity: 1;
    transform: translateX(3px);
  }
}

@keyframes ai-header-arrive {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
}

@keyframes ai-workspace-arrive {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.992);
  }
}

/* Compact desktop/tablet */
@media (max-width: 1240px) {
  .site-header {
    padding-right: 24px;
    padding-left: 24px;
  }

  .desktop-nav {
    gap: 18px;
  }

  .desktop-nav a {
    min-width: 76px;
  }

  .home-link {
    min-width: 106px;
    margin-left: 18px;
  }

  .page-shell {
    width: min(1160px, calc(100% - 40px));
  }

  .workspace-shell {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 14px;
  }

  .campus-identity {
    padding-right: 20px;
    padding-left: 20px;
  }

  .sidebar-scroll {
    padding-right: 24px;
    padding-left: 24px;
  }

  .chat-heading,
  .messages {
    padding-right: 24px;
    padding-left: 24px;
  }

  .composer {
    margin-right: 24px;
    margin-left: 24px;
    padding-right: 24px;
    padding-left: 24px;
  }
}

/* Tablet: sidebar becomes a compact question rail above the chat. */
@media (max-width: 1000px) {
  .site-header {
    min-height: 68px;
  }

  .header-seal {
    width: 40px;
    height: 40px;
  }

  .brand-divider {
    height: 28px;
    margin-right: 12px;
    margin-left: 10px;
  }

  .product-mark-header {
    width: 28px;
    height: 28px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .brand-copy small {
    display: none;
  }

  .desktop-nav {
    gap: 8px;
  }

  .desktop-nav a {
    min-width: 68px;
    font-size: 13px;
  }

  .desktop-nav a.active::before {
    top: 12px;
    right: 7px;
  }

  .desktop-nav a.active::after {
    right: 14px;
    bottom: 8px;
    left: 14px;
  }

  .home-link {
    width: 42px;
    min-width: 42px;
    height: 42px;
    margin-left: 10px;
    padding: 0;
  }

  .home-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .page-shell {
    width: min(940px, calc(100% - 28px));
    margin-top: 14px;
  }

  .workspace-shell {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .question-sidebar {
    display: block;
    border-radius: 16px;
  }

  .campus-identity,
  .recent-section,
  .privacy-reminder {
    display: none;
  }

  .sidebar-scroll {
    display: block;
    overflow: visible;
    padding: 14px 16px 16px;
  }

  .section-title {
    margin-bottom: 9px;
  }

  .quick-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 1px 1px 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .quick-list::-webkit-scrollbar {
    display: none;
  }

  .quick-list > button {
    flex: 0 0 210px;
    scroll-snap-align: start;
  }

  .chat-workspace {
    height: min(790px, calc(100dvh - 104px));
    min-height: 680px;
  }
}

/* Phone */
@media (max-width: 760px) {
  body::before {
    background-image: url("./assets/wanli-stadium-mobile.webp");
    background-position: 54% top;
  }

  body::after {
    background: rgba(238, 244, 250, 0.96);
  }

  .site-header {
    min-height: 60px;
    padding: 5px 12px 0;
  }

  .header-seal {
    width: 32px;
    height: 32px;
  }

  .brand-divider {
    height: 24px;
    margin-right: 8px;
    margin-left: 8px;
  }

  .product-mark-header {
    width: 28px;
    height: 28px;
  }

  .brand-copy {
    margin-left: 7px;
  }

  .brand-copy strong {
    font-size: 17px;
    letter-spacing: 0.04em;
  }

  .desktop-nav {
    display: none;
  }

  .home-link {
    width: 44px;
    min-width: 44px;
    height: 44px;
    margin-left: auto;
  }

  .page-shell {
    width: 100%;
    margin: 0;
  }

  .workspace-shell {
    gap: 0;
  }

  .question-sidebar {
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: none;
  }

  .sidebar-scroll {
    padding: 10px 12px 9px;
  }

  .sidebar-section .section-title {
    margin-bottom: 7px;
  }

  .section-title h2 {
    font-size: 13px;
  }

  .section-title span {
    display: none;
  }

  .quick-list {
    padding-bottom: 3px;
  }

  .quick-list > button {
    flex-basis: 184px;
    min-height: 38px;
  }

  .promoter-notice {
    grid-template-columns: 36px minmax(0, 1fr);
    margin-bottom: 10px;
    padding: 8px;
  }

  .promoter-badge {
    width: 36px;
    height: 36px;
  }

  .chat-workspace {
    height: calc(100dvh - 164px);
    min-height: 560px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .chat-heading {
    min-height: 64px;
    padding: 0 12px;
  }

  .assistant-identity {
    gap: 9px;
  }

  .assistant-identity .product-mark {
    width: 32px;
    height: 32px;
  }

  .assistant-identity strong {
    font-size: 17px;
  }

  .assistant-identity small {
    display: none;
  }

  .chat-tools {
    gap: 6px;
  }

  .quiet-button {
    min-width: 48px;
    height: 44px;
    padding: 0 7px;
    font-size: 11px;
  }

  .support-button {
    position: relative;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
  }

  .support-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .messages {
    padding: 16px 12px 14px;
  }

  .message {
    gap: 7px;
    margin-bottom: 16px;
  }

  .message-mark {
    width: 28px;
    height: 28px;
    margin-top: 10px;
  }

  .bubble {
    max-width: calc(100% - 35px);
    font-size: 16px;
  }

  .assistant-bubble {
    padding: 15px 16px;
  }

  .user-message {
    max-width: 84%;
  }

  .user .bubble {
    padding: 10px 13px;
  }

  .source-detail {
    display: none;
  }

  .answer-source {
    flex-wrap: wrap;
    margin-bottom: 12px;
  }

  .answer-model {
    margin-left: 0;
  }

  .follow-up-options button {
    min-height: 46px;
    font-size: 13px;
  }

  .answer-footer {
    margin-top: 15px;
  }

  .answer-actions {
    align-items: stretch;
  }

  .answer-actions > span {
    flex: 0 0 100%;
  }

  .composer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 0;
    background: rgba(245, 248, 252, 0.97);
    backdrop-filter: blur(14px);
  }

  .composer > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .composer textarea {
    min-height: 66px;
    max-height: 120px;
    padding: 10px 64px 10px 14px;
    font-size: 16px;
    line-height: 1.4;
  }

  .composer-meta {
    margin-top: 8px;
  }

  .disclaimer {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pulse-line {
    display: none;
  }

  .keyboard-hint {
    display: none;
  }

  .identity-notice {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    margin: 12px 10px 0;
  }

  .service-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    margin: 12px 10px 0;
    padding: 16px;
    border-radius: 16px;
  }

  .service-card h2 {
    font-size: 16px;
  }

  .service-copy > p:not(.service-kicker) {
    font-size: 12px;
  }

  .service-points {
    display: none;
  }

  .service-card .primary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .site-footer {
    margin: 16px 10px 0;
    padding-bottom: 24px;
  }

  dialog {
    border-radius: 16px;
  }

  .dialog-shell {
    padding: 24px 18px 18px;
  }

  .contact-guide-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .contact-guide ul {
    grid-template-columns: 1fr;
  }

  .need-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header-seal {
    width: 30px;
    height: 30px;
  }

  .brand-copy strong {
    font-size: 16px;
  }

  .question-number {
    display: none;
  }

  .quick-list > button {
    grid-template-columns: minmax(0, 1fr) 16px;
    flex-basis: 166px;
  }

  .quick-list strong {
    font-size: 13px;
  }

  .user-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .answer-actions button {
    flex: 1 1 calc(50% - 4px);
  }

  .message-action {
    flex-basis: 100% !important;
  }

  .identity-notice span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .send-button:hover,
  .quick-list > button:hover,
  .home-link:hover,
  .support-button:hover,
  .quiet-button:hover,
  .primary-button:hover {
    transform: none;
  }
}
