/* ============================================================
   西电联通校园网智能助手 —— 视觉体系 v2（大师级打磨）
   主色 联通红 #B71C1C / 亮红 #E53935 / 暖橙 #FF8A65
   设计要点：分层环境光 · 多层柔和阴影 · 内高光按钮 ·
             扫入式悬停 · 精致排印 · 全链路焦点可达
   ============================================================ */
:root {
  --red: #B71C1C;
  --red-2: #D32F2F;
  --red-bright: #E53935;
  --red-deep: #8E1414;
  --red-light: #FFEBEE;
  --orange: #FF8A65;
  --peach: #FFCDD2;
  --cream: #FFFAF7;
  --ink: #2E2121;
  --ink-2: #7A6565;
  --ink-3: #B9A3A3;
  --card: rgba(255, 255, 255, 0.88);
  --card-border: rgba(183, 28, 28, 0.09);
  --shadow-sm: 0 1px 2px rgba(58, 32, 32, 0.05);
  --shadow: 0 1px 2px rgba(58, 32, 32, 0.04), 0 12px 32px rgba(183, 28, 28, 0.09);
  --shadow-lg: 0 2px 4px rgba(58, 32, 32, 0.05), 0 24px 60px rgba(183, 28, 28, 0.16);
  --radius: 20px;
  --topbar-h: 68px;
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* hidden 属性兜底：防止 display 覆盖导致元素隐藏失效（如弹窗关不掉） */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--ink);
  background: linear-gradient(165deg, var(--cream) 0%, #FFF2EB 48%, #FFE3DC 100%);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- 背景层次：环境光晕 + 漂浮光斑 ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(640px 440px at 10% -8%, rgba(211, 47, 47, 0.10), transparent 70%),
    radial-gradient(760px 540px at 108% 10%, rgba(255, 138, 101, 0.13), transparent 70%),
    radial-gradient(600px 480px at 50% 118%, rgba(183, 28, 28, 0.08), transparent 70%);
}
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  width: 440px;
  height: 440px;
  right: -130px;
  top: -130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 101, 0.17), transparent 65%);
  filter: blur(42px);
  animation: orbDrift 16s ease-in-out infinite;
}

::selection { background: rgba(183, 28, 28, 0.18); }

:focus-visible {
  outline: 2px solid rgba(183, 28, 28, 0.55);
  outline-offset: 2px;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.campus-silhouette {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 150px;
  color: var(--red);
  opacity: 0.07;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000 55%, transparent);
  mask-image: linear-gradient(to top, #000 55%, transparent);
}

/* ---------- 顶部栏 ---------- */
.topbar {
  position: relative;
  z-index: 5;
  height: var(--topbar-h);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 1px 0 rgba(183, 28, 28, 0.08), 0 10px 32px rgba(183, 28, 28, 0.05);
  animation: fadeDown 0.6s var(--ease-out) both;
}

.topbar-inner {
  max-width: 860px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(183, 28, 28, 0.16), 0 8px 20px rgba(183, 28, 28, 0.28);
  animation: logoFloat 4s ease-in-out infinite;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }

.brand-text { min-width: 0; }
.brand-line1 { display: flex; align-items: center; gap: 8px; }
.online-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #2E7D32;
  background: rgba(232, 245, 233, 0.92);
  border: 1px solid rgba(67, 160, 71, 0.18);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.online-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #43A047;
  animation: pulseDot 1.8s ease-out infinite;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-text h1 {
  font-size: 17.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(100deg, var(--red) 15%, var(--red-2) 55%, var(--orange) 115%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-text p {
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 10px 18px;
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease, color 0.22s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--red-bright) 0%, var(--red) 58%, var(--red-deep) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 20px rgba(183, 28, 28, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 12px 28px rgba(183, 28, 28, 0.44);
}
.btn-primary:active { transform: translateY(0) scale(0.97); }

/* 主按钮流光扫过 */
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; left: -80%;
  width: 45%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  animation: shine 3.8s ease-in-out infinite;
}

.btn-outline {
  color: var(--red);
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(183, 28, 28, 0.26);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover {
  transform: translateY(-2px);
  border-color: rgba(183, 28, 28, 0.65);
  box-shadow: 0 10px 22px rgba(183, 28, 28, 0.16);
  background: #fff;
}
.btn-outline:active { transform: scale(0.97); }

.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- 聊天区 ---------- */
.chat-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(183, 28, 28, 0.28) transparent;
}
.chat-scroll::-webkit-scrollbar { width: 8px; }
.chat-scroll::-webkit-scrollbar-track { background: transparent; }
.chat-scroll::-webkit-scrollbar-thumb {
  background: rgba(183, 28, 28, 0.20);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.chat-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(183, 28, 28, 0.36);
  border: 2px solid transparent;
  background-clip: content-box;
}

.chat-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- 消息气泡 ---------- */
/* #msg-area 是所有动态消息的容器：轮内（用户→机器人）留 14px，
   新一轮提问前额外多留 10px，保证呼吸感 */
#msg-area { display: flex; flex-direction: column; gap: 14px; }
#msg-area .msg-bot + .msg-user { margin-top: 10px; }

.msg { display: flex; gap: 10px; max-width: 86%; animation: bubbleIn 0.5s var(--ease-spring) both; }
.msg-bot { align-self: flex-start; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }

.avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(183, 28, 28, 0.25);
}
.avatar svg { width: 20px; height: 20px; }
.avatar-bot { background: linear-gradient(135deg, var(--red-bright), var(--red) 70%); box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 4px 12px rgba(183, 28, 28, 0.28); }
.avatar-user { background: linear-gradient(135deg, #FF9E7A, #FF7043); box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 4px 12px rgba(255, 112, 67, 0.30); }
.avatar-mascot {
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(183, 28, 28, 0.14), 0 6px 16px rgba(183, 28, 28, 0.20);
  overflow: hidden;
}
.avatar-mascot img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 信任滚动条 ---------- */
.marquee {
  position: relative;
  z-index: 4;
  flex-shrink: 0;
  max-height: 36px;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(255, 235, 238, 0.82), rgba(255, 243, 235, 0.82));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(183, 28, 28, 0.06);
  transition: max-height 0.35s ease, opacity 0.3s ease;
}
/* 内容超过一页或向上滑时收起（JS 控制），向下滑时恢复 */
.marquee.hide { max-height: 0; opacity: 0; }
.marquee::before, .marquee::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 56px;
  z-index: 1;
  pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, var(--cream), transparent); }
.marquee::after { right: 0; background: linear-gradient(270deg, var(--cream), transparent); }
.marquee-track {
  display: inline-flex;
  align-items: center;
  height: 36px;
  white-space: nowrap;
  animation: marqueeScroll 28s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { font-size: 12.5px; letter-spacing: 0.01em; color: var(--ink-2); padding: 0 6px; }
.marquee-item b { color: var(--red); font-weight: 700; font-feature-settings: "tnum"; }
.marquee-dot { color: var(--red); opacity: 0.45; padding: 0 10px; font-weight: 700; font-size: 10px; }

/* ---------- 套餐速览卡 ---------- */
.plan-card {
  margin-left: 46px;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fadeUp 0.6s var(--ease-out) 0.5s both;
}
.plan-card-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease;
}
.plan-card-toggle:hover { background: rgba(183, 28, 28, 0.045); }
.plan-card-title { font-size: 14px; font-weight: 700; letter-spacing: 0.02em; color: var(--red); }
.plan-card-arrow { font-size: 11.5px; color: var(--ink-2); transition: transform 0.25s ease; }
.plan-card.collapsed .plan-card-body { display: none; }
.plan-card-body {
  padding: 0 16px 16px;
  border-top: 1px dashed rgba(183, 28, 28, 0.15);
  animation: fadeUp 0.3s ease both;
}
.plan-note { font-size: 12.5px; color: var(--ink-2); padding: 10px 0 9px; line-height: 1.65; }
.plan-note b { color: var(--red); font-feature-settings: "tnum"; }
.plan-table {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(183, 28, 28, 0.11);
  box-shadow: var(--shadow-sm);
}
.plan-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  padding: 9px 12px;
  font-size: 13px;
  align-items: center;
  background: #fff;
  transition: background 0.18s ease;
}
.plan-row + .plan-row { border-top: 1px solid rgba(183, 28, 28, 0.07); }
.plan-row:not(.plan-head):hover { background: #FFF6F3; }
.plan-row.plan-head {
  background: linear-gradient(90deg, var(--red-light), #FFF3EC);
  font-weight: 700;
  color: var(--red);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}
.plan-row.plan-hot { background: #FFFAF7; }
.plan-row.plan-hot:hover { background: #FFF3EE; }
.plan-price { font-weight: 800; color: var(--red); font-size: 14.5px; font-feature-settings: "tnum"; letter-spacing: 0.01em; }
.chip {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2.5px 11px;
  letter-spacing: 0.02em;
}
.chip-100 { background: var(--red-light); color: var(--red); border: 1px solid rgba(183, 28, 28, 0.12); }
.chip-200 {
  background: linear-gradient(135deg, var(--red-bright), var(--red));
  color: #fff;
  box-shadow: 0 3px 10px rgba(183, 28, 28, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.plan-tip {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 10px;
  padding: 8px 12px;
  line-height: 1.65;
  background: linear-gradient(90deg, rgba(255, 235, 238, 0.75), rgba(255, 249, 247, 0.35));
  border-left: 3px solid var(--red-2);
  border-radius: 0 10px 10px 0;
}
.plan-tip b { color: var(--red); font-feature-settings: "tnum"; }

/* ---------- 气泡与 Markdown ---------- */
.bubble {
  padding: 13px 17px;
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.75;
  word-break: break-word;
}

.msg-bot .bubble {
  background: var(--card);
  backdrop-filter: blur(12px) saturate(1.25);
  -webkit-backdrop-filter: blur(12px) saturate(1.25);
  border: 1px solid var(--card-border);
  border-top-left-radius: 8px;
  box-shadow: var(--shadow);
}

.msg-user .bubble {
  color: #fff;
  background: linear-gradient(135deg, var(--red-bright) 0%, var(--red) 60%, var(--red-deep) 100%);
  border-top-right-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 22px rgba(183, 28, 28, 0.32);
}

.bubble p + p { margin-top: 6px; }
.bubble a {
  color: var(--red);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed rgba(183, 28, 28, 0.4);
  transition: opacity 0.18s ease;
}
.msg-user .bubble a { color: #fff; border-bottom-color: rgba(255, 255, 255, 0.5); }
.bubble a:hover { opacity: 0.75; }
.bubble ul, .bubble ol { padding-left: 20px; margin: 6px 0; }
.bubble li { margin: 3px 0; }
.bubble li::marker { color: var(--red); }
.msg-user .bubble li::marker { color: rgba(255, 255, 255, 0.8); }
.bubble strong { color: var(--red); font-weight: 700; }
.msg-user .bubble strong { color: #fff; }
.bubble code {
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  background: var(--red-light);
  color: var(--red);
  border: 1px solid rgba(183, 28, 28, 0.10);
  padding: 1px 6px;
  border-radius: 6px;
}

/* 欢迎语打字光标 */
.type-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--red);
  animation: blink 0.8s step-end infinite;
}

/* ---------- 快捷问题（横向滚动） ---------- */
.quick-area { animation: fadeUp 0.6s var(--ease-out) 0.3s both; }
.quick-title { font-size: 13px; color: var(--ink-2); margin: 4px 0 2px 46px; letter-spacing: 0.01em; }
.quick-scroll {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  /* 顶部 10px 给悬停上跃 (-3px) + 阴影留位，底部 12px 给悬停阴影留位，防止被裁剪 */
  padding: 10px 46px 12px 46px;
  margin-top: -2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  cursor: grab;
}
.quick-scroll::-webkit-scrollbar { display: none; }
.quick-scroll.dragging { cursor: grabbing; scroll-snap-type: none; }
.quick-list {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 10px;
  padding-right: 46px;
}

.quick-btn {
  font-family: inherit;
  font-size: 13.5px;
  letter-spacing: 0.01em;
  color: var(--red);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(183, 28, 28, 0.20);
  border-radius: 999px;
  padding: 8px 17px;
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease, color 0.22s ease, border-color 0.22s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  flex-shrink: 0;
  scroll-snap-align: start;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
/* 悬停时品牌红自左扫入填充 */
.quick-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--red-bright), var(--red));
  opacity: 0;
  transform: scaleX(0.55);
  transform-origin: left center;
  transition: opacity 0.24s ease, transform 0.32s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.quick-btn:hover {
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(183, 28, 28, 0.30);
}
.quick-btn:hover::before { opacity: 1; transform: scaleX(1); }
.quick-btn:active { transform: scale(0.97); }

/* ---------- 打字指示器 ---------- */
.typing-msg .bubble { display: flex; gap: 5px; align-items: center; padding: 15px 18px; }
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-2), var(--red));
  opacity: 0.5;
  animation: dotBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

/* ---------- 办理卡片 ---------- */
.apply-card {
  align-self: flex-start;
  margin-left: 46px;
  margin-top: 2px;
  max-width: 420px;
  width: calc(100% - 46px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-radius: 22px;
  padding: 18px 20px;
  position: relative;
  box-shadow: 0 20px 50px rgba(183, 28, 28, 0.14);
  animation: cardIn 0.55s var(--ease-spring) both;
}

/* 脉冲发光边框 */
.apply-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 24px;
  background: linear-gradient(120deg, var(--red), var(--orange), var(--red));
  background-size: 200% 200%;
  z-index: -1;
  animation: borderFlow 3s linear infinite, glowPulse 2.2s ease-in-out infinite;
}

.apply-card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 6px;
}
.apply-card-title .spark { animation: sparkle 1.6s ease-in-out infinite; }
.apply-card-desc { font-size: 13px; color: var(--ink-2); margin: 6px 0 12px; line-height: 1.65; }
.apply-card-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.apply-card-actions .btn { padding: 9px 20px; font-size: 14px; }

/* ---------- 常驻办理入口 ---------- */
.apply-dock {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: 6px 16px 0;
}
.btn-apply-dock {
  font-size: 13.5px;
  padding: 8px 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 16px rgba(183, 28, 28, 0.32);
  animation: dockIn 0.5s var(--ease-out) both;
}

/* ---------- 输入区 ---------- */
.inputbar {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(255, 250, 247, 0.98) 30%, rgba(255, 250, 247, 0.55) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.inputbar-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(183, 28, 28, 0.14);
  border-radius: 26px;
  padding: 8px 8px 8px 20px;
  box-shadow: 0 2px 6px rgba(58, 32, 32, 0.04), 0 12px 32px rgba(183, 28, 28, 0.10);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.inputbar-inner:focus-within {
  border-color: rgba(183, 28, 28, 0.50);
  box-shadow: 0 0 0 4px rgba(183, 28, 28, 0.10), 0 14px 36px rgba(183, 28, 28, 0.18);
}

#input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  caret-color: var(--red);
  background: transparent;
  max-height: 120px;
  padding: 8px 0;
}
#input::placeholder { color: var(--ink-3); }

.btn-send {
  padding: 10px 18px;
  flex-shrink: 0;
}

.inputbar-hint {
  max-width: 860px;
  margin: 7px auto 0;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  color: var(--ink-3);
}
.inputbar-hint a { color: var(--red); text-decoration: none; font-weight: 600; font-feature-settings: "tnum"; }

/* ---------- 微信弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(46, 24, 24, 0.48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: maskIn 0.25s ease both;
}

.modal {
  position: relative;
  background: #fff;
  border: 1px solid rgba(183, 28, 28, 0.08);
  border-radius: 26px;
  padding: 34px 38px 30px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.38s var(--ease-spring) both;
}
/* 顶部品牌渐变饰条 */
.modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  right: 26px;
  height: 4px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, var(--red), var(--orange));
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--red-light);
  color: var(--red);
  font-size: 17px;
  cursor: pointer;
  transition: all 0.22s ease;
}
.modal-close:hover { background: var(--red); color: #fff; transform: rotate(90deg); }

.modal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: linear-gradient(100deg, var(--red), var(--red-2) 70%, var(--orange) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.modal-desc { font-size: 13px; color: var(--ink-2); margin-top: 6px; letter-spacing: 0.01em; }

.qr-box {
  position: relative;
  width: 210px;
  height: 210px;
  margin: 20px auto 12px;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(183, 28, 28, 0.10);
  box-shadow: 0 10px 30px rgba(183, 28, 28, 0.13);
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.qr-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid var(--red);
}
.qr-corner.tl { top: -3px; left: -3px; border-right: none; border-bottom: none; border-radius: 10px 0 0 0; }
.qr-corner.tr { top: -3px; right: -3px; border-left: none; border-bottom: none; border-radius: 0 10px 0 0; }
.qr-corner.bl { bottom: -3px; left: -3px; border-right: none; border-top: none; border-radius: 0 0 0 10px; }
.qr-corner.br { bottom: -3px; right: -3px; border-left: none; border-top: none; border-radius: 0 0 10px 0; }

.modal-tip { font-size: 12.5px; color: var(--ink-2); letter-spacing: 0.01em; }
.modal-phone { font-size: 14px; color: var(--ink); margin-top: 8px; }
.modal-phone a {
  color: var(--red);
  font-weight: 700;
  text-decoration: none;
  font-feature-settings: "tnum";
  background: var(--red-light);
  border: 1px solid rgba(183, 28, 28, 0.10);
  padding: 3px 12px;
  border-radius: 999px;
}

/* ---------- 管理后台（admin.html 复用部分变量） ---------- */
.admin-body { display: block; overflow: auto; height: auto; min-height: 100dvh; }

/* ---------- 动画定义 ---------- */
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  60%  { opacity: 1; transform: translateY(-3px) scale(1.01); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes dockIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes shine {
  0% { left: -80%; }
  45%, 100% { left: 130%; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 138, 101, 0.35); }
  50% { box-shadow: 0 0 26px rgba(211, 47, 47, 0.55); }
}
@keyframes borderFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.25) rotate(12deg); }
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.88) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(67, 160, 71, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(67, 160, 71, 0); }
}
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes orbDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-46px, 34px) scale(1.08); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .brand-text p { display: none; }
  .brand-text h1 { font-size: 15.5px; }
  .brand-logo { width: 38px; height: 38px; }
  .topbar-inner { padding: 0 14px; }
  .btn-wechat span, .btn-new-chat span { display: none; }
  .btn-wechat, .btn-new-chat { padding: 10px 12px; }
  .chat-inner { padding: 16px 12px 8px; gap: 12px; }
  .msg { max-width: 92%; }
  .bubble { font-size: 14.5px; padding: 12px 15px; }
  .marquee { max-height: 32px; }
  .marquee-track { height: 32px; }
  .marquee-item { font-size: 11.5px; }
  .quick-title { margin-left: 0; }
  .quick-scroll { padding-left: 0; padding-right: 0; }
  .quick-list { padding-right: 0; }
  .plan-card { margin-left: 0; max-width: none; }
  .apply-card { width: 100%; max-width: none; margin-left: 0; }
  .inputbar { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .btn-send span { display: none; }
  .btn-send { padding: 10px 13px; }
  .campus-silhouette { height: 90px; }
  .modal { padding: 28px 22px 24px; }
  .modal::before { left: 20px; right: 20px; }
  body::after { width: 300px; height: 300px; right: -110px; top: -110px; }
}

/* ---------- 减弱动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .chat-scroll { scroll-behavior: auto; }
}
