:root {
  --bg: #f3f7ff;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.68);
  --border: rgba(55, 83, 138, 0.14);
  --primary: #2368e8;
  --primary-deep: #153b92;
  --text: #1d2d4f;
  --muted: #697895;
  --cyan: #3fb7f2;
  --green: #25a57a;
  --gold: #d79b2b;
  --coral: #e56f64;
  --violet: #7367d8;
  --ink: #33486f;
  --shadow: 0 18px 44px rgba(36, 76, 145, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(35, 104, 232, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(35, 104, 232, 0.06) 1px, transparent 1px),
    radial-gradient(circle at 18% 10%, rgba(87, 178, 255, 0.22), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(85, 178, 155, 0.15), transparent 26%),
    linear-gradient(180deg, #edf4ff 0%, #f8fbff 58%, #eef5ff 100%);
  background-size: 44px 44px, 44px 44px, auto, auto, auto;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
}

@media (min-width: 981px) {
  body {
    overflow: hidden;
  }

  .shell {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .main {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

.shell {
  display: grid;
  grid-template-columns: clamp(248px, 22vw, 312px) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  padding: 24px 20px 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.76);
  border-right: 1px solid rgba(74, 107, 171, 0.14);
  box-shadow: 10px 0 36px rgba(41, 78, 139, 0.06);
  backdrop-filter: blur(24px);
}

.sidebar::before {
  position: absolute;
  inset: auto -70px 12% auto;
  width: 180px;
  height: 260px;
  content: "";
  background:
    linear-gradient(90deg, transparent 34%, rgba(37, 104, 232, 0.08) 34% 39%, transparent 39%),
    linear-gradient(180deg, transparent 18%, rgba(37, 104, 232, 0.08) 18% 22%, transparent 22% 42%, rgba(37, 104, 232, 0.07) 42% 46%, transparent 46%),
    rgba(255, 255, 255, 0.36);
  clip-path: polygon(50% 0, 83% 12%, 83% 100%, 17% 100%, 17% 12%);
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  padding: 14px 14px 14px 12px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(236, 244, 255, 0.88));
  border: 1px solid rgba(74, 107, 171, 0.14);
  box-shadow:
    0 14px 30px rgba(41, 78, 139, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.brand__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  text-decoration: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(48, 92, 178, 0.42), transparent 58%),
    linear-gradient(160deg, #0f1f45 0%, #17356f 52%, #0d2147 100%);
  box-shadow:
    0 12px 24px rgba(15, 31, 69, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand__mark:hover {
  transform: translateY(-1px);
  box-shadow:
    0 16px 28px rgba(15, 31, 69, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.brand__logo-img {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand__text {
  min-width: 0;
}

.brand__college {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #6d7f9f;
}

.brand__title {
  margin: 4px 0 0;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #17356f;
}

.brand__badge {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #1f5fd0;
  background: linear-gradient(135deg, rgba(35, 104, 232, 0.12), rgba(37, 165, 122, 0.1));
  border: 1px solid rgba(35, 104, 232, 0.14);
}

.brand h1,
.brand h2,
.brand p,
.topbar h2,
.topbar p,
.welcome__header h3,
.welcome__header p,
.section-kicker {
  margin: 0;
}

.new-chat-btn,
.ghost-btn,
.primary-outline-btn,
.send-btn,
.quick-chip,
.prompt-chip,
.feedback-btn,
.danger-text-btn {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.new-chat-btn,
.ghost-btn,
.primary-outline-btn {
  height: 50px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
}

.new-chat-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  background: var(--panel-strong);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(68, 112, 191, 0.2);
}

.new-chat-btn span {
  font-size: 24px;
  line-height: 0;
}

.new-chat-btn:hover,
.ghost-btn:hover,
.primary-outline-btn:hover,
.send-btn:hover,
.quick-chip:hover,
.prompt-chip:hover {
  transform: translateY(-1px);
}

.sidebar__service {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  padding: 16px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(35, 104, 232, 0.1), rgba(37, 165, 122, 0.08));
  border: 1px solid rgba(74, 107, 171, 0.13);
}

.sidebar__service span,
.section-kicker,
.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6f80a5;
}

.sidebar__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  padding: 0 2px;
}

.sidebar__title {
  flex-shrink: 0;
  margin-bottom: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6f80a5;
}

.sidebar__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #2f67d8;
  background: rgba(35, 104, 232, 0.1);
  border: 1px solid rgba(35, 104, 232, 0.12);
}

.sidebar__count[hidden] {
  display: none;
}

.sidebar__service strong {
  font-size: 14px;
  line-height: 1.6;
}

.sidebar__section {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  margin-top: 2px;
  padding-top: 4px;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 12px;
  padding: 4px 4px 12px 2px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(74, 107, 171, 0.28) transparent;
}

.session-list::-webkit-scrollbar {
  width: 6px;
}

.session-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(74, 107, 171, 0.28);
}

.session-list::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 107, 171, 0.42);
}

.session-item {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 0 0 auto;
  min-height: 58px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(91, 124, 181, 0.12);
  box-shadow: 0 4px 14px rgba(41, 78, 139, 0.05);
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.session-item:hover {
  border-color: rgba(35, 104, 232, 0.2);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(41, 78, 139, 0.08);
}

.session-item.active {
  border-color: rgba(35, 104, 232, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
  box-shadow: 0 12px 26px rgba(73, 114, 199, 0.12);
}

.session-item__indicator {
  flex: none;
  width: 3px;
  background: transparent;
  transition: background 0.2s ease;
}

.session-item:hover .session-item__indicator {
  background: rgba(35, 104, 232, 0.22);
}

.session-item.active .session-item__indicator {
  background: linear-gradient(180deg, #4eb8f2 0%, #2368e8 100%);
}

.session-item__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 10px 32px 10px 12px;
  border: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.session-item__title {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: #243a63;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.session-item.active .session-item__title {
  color: #17356f;
}

.session-item__time {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
  color: #a4b2cc;
  white-space: nowrap;
}

.session-item.active .session-item__time {
  color: #6f87b8;
}

.session-item__delete {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 1px solid rgba(209, 95, 95, 0.16);
  border-radius: 8px;
  color: #d15f5f;
  font-size: 16px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%) scale(0.92);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.session-item:hover .session-item__delete,
.session-item:focus-within .session-item__delete,
.session-item.active .session-item__delete {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.session-item__delete:hover {
  color: #ffffff;
  background: #d15f5f;
  box-shadow: 0 10px 18px rgba(209, 95, 95, 0.2);
}

.session-empty {
  display: grid;
  place-items: center;
  min-height: 140px;
  padding: 28px 20px;
  text-align: center;
  font-size: 13px;
  line-height: 1.75;
  color: #8a9ab9;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px dashed rgba(91, 124, 181, 0.2);
}

.portal-link {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  margin-top: auto;
  min-height: 48px;
  padding: 0 18px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  color: #17356f;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
  border: 1px solid rgba(74, 107, 171, 0.18);
  box-shadow: 0 8px 20px rgba(41, 78, 139, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.portal-link:hover {
  transform: translateY(-1px);
  border-color: rgba(35, 104, 232, 0.28);
  box-shadow: 0 12px 24px rgba(41, 78, 139, 0.12);
}

.portal-link svg {
  width: 16px;
  height: 16px;
  color: #2f67d8;
}

.main {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 30px 16px;
}

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

.main::before {
  right: 42px;
  top: 68px;
  width: 150px;
  height: 300px;
  opacity: 0.24;
  background:
    linear-gradient(90deg, transparent 40%, #ffffff 40% 45%, transparent 45%),
    linear-gradient(180deg, transparent 15%, #ffffff 15% 18%, transparent 18% 34%, #ffffff 34% 37%, transparent 37% 53%, #ffffff 53% 56%, transparent 56%),
    rgba(255, 255, 255, 0.28);
  clip-path: polygon(50% 0, 92% 14%, 78% 14%, 78% 100%, 22% 100%, 22% 14%, 8% 14%);
}

.main::after {
  display: none;
}

.hero-bg {
  display: none;
}

.topbar,
.welcome,
.chat-panel,
.composer {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-shrink: 0;
  grid-row: 1;
}

.topbar h2 {
  font-size: clamp(25px, 2.6vw, 40px);
  font-weight: 800;
  line-height: 1.18;
}

.is-chatting .topbar {
  align-items: center;
}

.is-chatting .topbar h2 {
  font-size: 30px;
}

.is-chatting .topbar p {
  margin-top: 4px;
}

.topbar p {
  margin-top: 7px;
  color: var(--muted);
}

.topbar__actions {
  display: flex;
  gap: 12px;
}

.ghost-btn,
.primary-outline-btn {
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(77, 108, 170, 0.15);
}

.primary-outline-btn {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.9);
}

.welcome,
.chat-panel {
  grid-row: 2;
  grid-column: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(74, 107, 171, 0.28) transparent;
}

.welcome::-webkit-scrollbar,
.chat-panel::-webkit-scrollbar {
  width: 6px;
}

.welcome::-webkit-scrollbar-thumb,
.chat-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(74, 107, 171, 0.28);
}

.welcome {
  padding: 16px 0 20px;
}

.welcome__masthead {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
}

.welcome__header {
  text-align: center;
}

.section-kicker {
  color: var(--green);
}

.welcome__header h3 {
  margin-top: 0;
  font-size: clamp(22px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.3;
}

.campus-emblem {
  width: 140px;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(77, 108, 170, 0.12);
  box-shadow: var(--shadow);
}

.campus-emblem img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 1040px;
  margin: 20px auto 0;
}

.trust-strip {
  gap: 12px 14px;
  max-width: 980px;
  perspective: 900px;
}

.trust-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 999px;
  color: #314569;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(77, 108, 170, 0.14);
}

.trust-strip span {
  position: relative;
  flex: 0 0 auto;
  padding: 8px 15px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 24px rgba(36, 76, 145, 0.1);
  animation: floatingTag 4.8s ease-in-out infinite;
  will-change: transform;
}

.trust-strip span::before {
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  content: "";
  background: var(--green);
}

.trust-strip span:nth-child(2n) {
  transform: translateY(5px);
  animation-delay: -1.2s;
}

.trust-strip span:nth-child(3n) {
  transform: translateY(-4px);
  animation-delay: -2.1s;
}

.trust-strip span:nth-child(4n)::before {
  background: var(--primary);
}

.trust-strip span:nth-child(5n)::before {
  background: var(--gold);
}

@keyframes floatingTag {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -5px;
  }
}

.service-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  max-width: 1040px;
  margin: 24px auto 0;
}

.service-flow article,
.composer__box {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.service-flow article {
  position: relative;
  min-height: 132px;
  padding: 18px 18px 16px;
  border-radius: 12px;
  overflow: hidden;
}

.service-flow article::after {
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  content: "";
  background: rgba(35, 104, 232, 0.08);
}

.service-flow span {
  display: block;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.service-flow strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.service-flow p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.quick-services-block h4 {
  margin: 0;
}

.quick-services-block {
  max-width: 1040px;
  margin: 22px auto 0;
}

.quick-services-block h4 {
  font-size: 18px;
}

.quick-services {
  --quick-cols: 5;
  display: grid;
  grid-template-columns: repeat(var(--quick-cols), minmax(0, 1fr));
  gap: clamp(8px, 1vw, 12px);
  margin-top: 12px;
}

.prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.quick-chip,
.prompt-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(77, 108, 170, 0.15);
}

.quick-chip {
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
}

.quick-chip__label {
  flex: 1;
  min-width: 0;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.quick-chip:hover,
.prompt-chip:hover {
  box-shadow: 0 12px 22px rgba(36, 76, 145, 0.1);
}

.quick-chip__icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: var(--primary);
}

.status-banner {
  max-width: 1040px;
  margin: 18px auto 0;
  padding: 14px 16px;
  border-radius: 12px;
  color: #34528f;
  background: linear-gradient(135deg, rgba(63, 183, 242, 0.15), rgba(255, 255, 255, 0.82));
  border: 1px solid rgba(77, 108, 170, 0.14);
}

.chat-panel {
  display: none;
  padding: 16px 0 8px;
  scroll-behavior: auto;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 0 8px 16px;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(100%, 900px);
  max-width: 900px;
}

.message.assistant {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.message__avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 13px;
  flex: none;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #35b8e9, #2368e8);
}

.message.user .message__avatar {
  background: linear-gradient(145deg, #25a57a, #153b92);
}

.message__bubble {
  min-width: 220px;
  max-width: calc(100% - 56px);
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(77, 108, 170, 0.13);
  box-shadow: 0 16px 34px rgba(66, 97, 171, 0.1);
}

.message.user .message__bubble {
  color: #fff;
  background: linear-gradient(135deg, #2368e8, #25a57a);
}

.message__content {
  white-space: normal;
  line-height: 1.8;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.message__content h3,
.message__content h4,
.message__content h5 {
  margin: 14px 0 8px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--primary-deep);
}

.message__content h3:first-child,
.message__content h4:first-child,
.message__content h5:first-child {
  margin-top: 0;
}

.message__content h3 {
  font-size: 17px;
}

.message__content h5 {
  font-size: 15px;
}

.message__content p {
  margin: 0 0 10px;
}

.message__content ol,
.message__content ul {
  margin: 6px 0 12px;
  padding-left: 1.35em;
}

.message__content li {
  margin: 5px 0;
  padding-left: 2px;
}

.message__content strong {
  font-weight: 800;
}

.message__content em {
  font-style: normal;
  color: #466082;
}

.message__content code {
  padding: 2px 6px;
  border-radius: 6px;
  color: #20436f;
  background: rgba(35, 104, 232, 0.08);
  border: 1px solid rgba(35, 104, 232, 0.12);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.message__content pre {
  max-width: 100%;
  margin: 10px 0 12px;
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: 10px;
  background: #f5f8ff;
  border: 1px solid rgba(77, 108, 170, 0.14);
}

.message__content pre code {
  display: block;
  padding: 0;
  border: 0;
  color: #253b5c;
  background: transparent;
  white-space: pre;
}

.message__content blockquote {
  margin: 10px 0 12px;
  padding: 9px 12px;
  border-left: 4px solid rgba(35, 104, 232, 0.36);
  border-radius: 8px;
  color: #405a80;
  background: rgba(35, 104, 232, 0.06);
}

.message__content blockquote p:last-child {
  margin-bottom: 0;
}

.message__content hr {
  height: 1px;
  margin: 14px 0;
  border: 0;
  background: rgba(77, 108, 170, 0.16);
}

.message-table-wrap {
  max-width: 100%;
  margin: 10px 0 12px;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(77, 108, 170, 0.14);
}

.message__content table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.72);
}

.message__content th,
.message__content td {
  padding: 9px 11px;
  border-bottom: 1px solid rgba(77, 108, 170, 0.12);
  text-align: left;
  vertical-align: top;
}

.message__content th {
  color: #234677;
  font-weight: 800;
  background: rgba(35, 104, 232, 0.07);
}

.message__content tr:last-child td {
  border-bottom: 0;
}

.message-suggestions {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(246, 249, 255, 0.86);
  border: 1px solid rgba(77, 108, 170, 0.14);
}

.message-suggestions__title {
  margin-bottom: 9px;
  color: #4f6388;
  font-size: 13px;
  font-weight: 800;
}

.message-suggestions__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-suggestion {
  max-width: 100%;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #1f3b68;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  background: #fff;
  border: 1px solid rgba(35, 104, 232, 0.18);
  box-shadow: 0 8px 16px rgba(36, 76, 145, 0.08);
}

.message-suggestion:hover {
  color: #fff;
  background: linear-gradient(135deg, #2368e8, #25a57a);
  border-color: transparent;
}

.message-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0 3px;
  padding: 3px 11px;
  border-radius: 999px;
  color: #1d5fd0;
  font-weight: 800;
  text-decoration: none;
  background: rgba(35, 104, 232, 0.08);
  border: 1px solid rgba(35, 104, 232, 0.2);
}

.message-link:hover {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 10px 20px rgba(35, 104, 232, 0.18);
}

.thinking .message__bubble {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(35, 104, 232, 0.08);
}

.thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  color: #4f6388;
  font-size: 14px;
}

.thinking-indicator__dots {
  display: inline-flex;
  align-items: flex-end;
  gap: 5px;
  height: 18px;
}

.thinking-indicator__dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25a57a, #2368e8);
  animation: thinkingBounce 1.1s ease-in-out infinite;
}

.thinking-indicator__dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking-indicator__dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.thinking-indicator__text {
  letter-spacing: 0.02em;
}

@keyframes thinkingBounce {
  0%,
  70%,
  100% {
    opacity: 0.35;
    transform: translateY(0) scale(0.92);
  }

  35% {
    opacity: 1;
    transform: translateY(-5px) scale(1);
  }
}

.message__source {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

.message__source--kb {
  color: #1d6b4d;
  background: rgba(37, 165, 122, 0.1);
  border: 1px solid rgba(37, 165, 122, 0.18);
}

.message__source--site {
  color: #1f4f8f;
  background: rgba(63, 183, 242, 0.12);
  border: 1px solid rgba(63, 183, 242, 0.22);
}

.message__source--llm {
  color: #35508a;
  background: rgba(35, 104, 232, 0.08);
  border: 1px solid rgba(35, 104, 232, 0.16);
}

.message__source--system {
  color: #7a5c18;
  background: rgba(215, 155, 43, 0.12);
  border: 1px solid rgba(215, 155, 43, 0.2);
}

.message__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.message-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.message-action-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(77, 108, 170, 0.14);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  color: #5d7096;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.message-action-btn__icon {
  width: 16px;
  height: 16px;
}

.message-action-btn:hover {
  border-color: rgba(35, 104, 232, 0.28);
  color: var(--primary);
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px);
}

.message-action-btn.is-done {
  color: #1f765d;
  border-color: rgba(37, 165, 122, 0.24);
  background: rgba(37, 165, 122, 0.08);
}

.message.user .message__meta {
  color: rgba(255, 255, 255, 0.82);
}

.feedback-actions {
  display: inline-flex;
  gap: 8px;
}

.feedback-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(77, 108, 170, 0.16);
  background: rgba(255, 255, 255, 0.72);
}

.feedback-btn.active {
  color: var(--primary);
  border-color: rgba(35, 104, 232, 0.32);
  background: rgba(35, 104, 232, 0.08);
}

.feedback-notice {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #1f765d;
  font-weight: 800;
  background: rgba(37, 165, 122, 0.1);
  border: 1px solid rgba(37, 165, 122, 0.18);
  animation: feedbackNoticeIn 0.18s ease-out;
}

@keyframes feedbackNoticeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.composer {
  position: relative;
  grid-row: 3;
  grid-column: 1;
  z-index: 2;
  flex-shrink: 0;
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid rgba(77, 108, 170, 0.1);
  background: rgba(243, 247, 255, 0.72);
}

.prompt-row {
  max-width: 1080px;
  margin-right: auto;
  margin-left: auto;
  margin-bottom: 12px;
  justify-content: center;
}

.composer__box {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px;
  border-radius: 16px;
}

.composer__box textarea {
  flex: 1;
  resize: none;
  min-height: 62px;
  max-height: 180px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  line-height: 1.8;
}

.send-btn {
  min-width: 96px;
  height: 50px;
  padding: 0 20px;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #25a57a, #2368e8);
  box-shadow: 0 16px 26px rgba(35, 104, 232, 0.24);
}

.send-btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.composer__tips {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.composer__tips span::before {
  content: "•";
  margin-right: 7px;
  color: var(--green);
}

.danger-text-btn {
  padding: 0;
  background: transparent;
  color: #d15f5f;
  font-weight: 800;
}

.floating-helper {
  display: none;
  position: fixed;
  right: 22px;
  bottom: 112px;
  z-index: 6;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 62px;
  height: 86px;
  padding: 10px 8px;
  border-radius: 18px;
  color: #24416f;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(77, 108, 170, 0.15);
  box-shadow: var(--shadow);
}

.floating-helper__logo {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
  padding: 4px;
  border-radius: 10px;
  background: linear-gradient(160deg, #0f1f45 0%, #17356f 100%);
}

.floating-helper strong {
  writing-mode: vertical-rl;
  font-size: 12px;
  letter-spacing: 0.12em;
}

@media (max-width: 1280px) {
  .welcome__masthead {
    grid-template-columns: 1fr;
  }

  .campus-emblem {
    display: none;
  }
}

@media (max-width: 980px) {
  body {
    overflow: hidden;
  }

  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .sidebar {
    max-height: 46vh;
    gap: 16px;
    padding: 18px 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(77, 108, 170, 0.14);
    overflow-y: auto;
  }

  .main {
    min-height: 0;
    overflow: hidden;
  }

  .topbar__actions {
    flex-wrap: wrap;
  }

  .session-list {
    flex: 1;
    min-height: 0;
    max-height: none;
    gap: 6px;
  }

  .session-item__title {
    font-size: 12.5px;
  }

  .floating-helper {
    display: none;
  }
}

@media (max-width: 900px) {
  .quick-chip {
    padding: 8px 8px;
    font-size: 13px;
    gap: 6px;
  }

  .quick-chip__icon {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 16px 14px 12px;
  }

  .sidebar {
    padding: 20px 14px;
  }

  .service-flow {
    grid-template-columns: 1fr;
  }

  .welcome__header {
    text-align: left;
  }

  .trust-strip {
    justify-content: flex-start;
  }

  .composer__box {
    flex-direction: column;
    align-items: stretch;
  }

  .messages {
    gap: 14px;
    padding-right: 0;
    padding-left: 0;
  }

  .message {
    width: 100%;
    max-width: 100%;
    gap: 10px;
  }

  .message__avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 11px;
    font-size: 12px;
  }

  .message__bubble {
    min-width: 0;
    padding: 14px 15px;
  }

  .prompt-row {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .prompt-chip {
    flex: 0 1 auto;
    max-width: 100%;
    white-space: normal;
  }

  .quick-chip {
    flex-direction: column;
    gap: 4px;
    min-height: 54px;
    padding: 8px 6px;
    justify-content: center;
    text-align: center;
  }

  .quick-chip__label {
    font-size: 12px;
    line-height: 1.35;
  }

  .quick-chip__icon {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }

  .send-btn {
    width: 100%;
  }

  .composer__tips {
    gap: 8px 12px;
    font-size: 12px;
  }

  .ghost-btn,
  .primary-outline-btn,
  .new-chat-btn {
    height: 44px;
    font-size: 15px;
  }
}

.handoff-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.handoff-modal[hidden] {
  display: none;
}

.handoff-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 36, 72, 0.42);
  backdrop-filter: blur(4px);
}

.handoff-modal__panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  width: min(720px, 100%);
  max-height: min(86vh, 860px);
  padding: 22px;
  border-radius: 18px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.handoff-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.handoff-modal__header h3 {
  margin: 6px 0 0;
  font-size: 22px;
  color: var(--primary-deep);
}

.handoff-modal__kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.handoff-modal__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(35, 104, 232, 0.08);
  color: var(--primary-deep);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.handoff-modal__textarea {
  width: 100%;
  min-height: 320px;
  max-height: 52vh;
  padding: 16px;
  border: 1px solid rgba(74, 107, 171, 0.18);
  border-radius: 14px;
  resize: vertical;
  font: inherit;
  line-height: 1.7;
  color: var(--text);
  background: rgba(243, 247, 255, 0.72);
}

.handoff-modal__textarea:focus {
  outline: 2px solid rgba(35, 104, 232, 0.22);
  border-color: rgba(35, 104, 232, 0.42);
}

.handoff-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.handoff-modal__footer .ghost-btn,
.handoff-modal__footer .send-btn {
  min-width: 108px;
  height: 46px;
}

body.is-modal-open {
  overflow: hidden;
}
