/* ═══ mb90s：《叁镜选校设计规范》设计令牌（取自附件 3mir-abroad-chatbot-fe）═══ */
:root {
  --brand-color-10: #fff2f1; --brand-color-20: #fceaeb; --brand-color-30: #e08d8d;
  --brand-color-40: #d46467; --brand-color-50: #c63e46; --brand-color-60: #a12a37;
  --brand-color-70: #7a1b28; --brand-color-80: #540d19;
  --primary-color: var(--brand-color-50);
  --text-gray-00: #ffffff; --text-gray-10: #f7f7f7; --text-gray-20: #f2f3f5;
  --text-gray-40: #e5e5e5; --text-gray-60: #bfbfbf; --text-gray-70: #8c8c8c;
  --text-gray-80: #595959; --text-gray-90: #222222;
  --border-color: #efefef; --link-text-color: #233d6b;
  --color-green-50: #00ab6b; --color-red-50: #fe2842; --color-orange-50: #fa8c15;
}

    /* ===== 全局重置与基础样式 ===== */
    *, *::before, *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    :root {
      /* mb62: 蓝灰系主题（默认·方案三 雾蓝清晨）——切换见顶栏🎨；--sj-blue 为关键操作主题蓝 */
      --sj-red: #C63E46; --sj-red-rgb: 198,62,70;
      --sj-red-h: #D46467; --sj-red-d: #A12A37; --sj-red-wash: #FFF2F1;
      --sj-blue: #C63E46; --sj-blue-d: #A12A37; --sj-blue-rgb: 198,62,70;
      --sj-bg: #F7F7F7; --sj-side: #F7F7F7; --sj-side2: #FCEAEB;
      --sj-ink1: #222222; --sj-ink2: #595959; --sj-ink3: #8C8C8C; --sj-ink-rgb: 34,34,34;
      --sj-gold: #8C8C8C; --sj-gold-rgb: 140,140,140;
      --sj-line: #EFEFEF; --sj-line-rgb: 239,239,239;
      --sj-error: #FE2842; --sj-error-rgb: 254,40,66; --sj-error-light: #FFF2F1;
      --pink: var(--sj-red);
      --purple: var(--sj-red-h);
      --grad: linear-gradient(135deg,var(--sj-red),var(--sj-red-h));
      --primary: var(--sj-red);
      --primary-light: var(--sj-red-wash);
      --primary-dark: var(--sj-red-d);
      --bg: var(--sj-bg);
      --surface: #ffffff;
      --border: var(--sj-line);
      --text-main: var(--sj-ink1);
      --text-sub: var(--sj-ink2);
      --text-muted: var(--sj-ink3);
      --error: var(--sj-error);
      --error-light: var(--sj-error-light);
      --success: #00AB6B;
      --shadow-sm: 0 1px 3px rgba(31,42,48,0.06), 0 1px 2px rgba(31,42,48,0.04);
      --shadow-md: 0 3px 10px rgba(31,42,48,0.08), 0 1px 3px rgba(31,42,48,0.05);
      --shadow-glass: 0 2px 8px rgba(31,42,48,0.06), 0 1px 3px rgba(31,42,48,0.04);
      --radius-sm: 8px;
      --radius-md: 12px;
      --radius-lg: 20px;
      --radius-xl: 28px;
      --glass-bg: rgba(255,255,255,0.72);
      --glass-border: rgba(255,255,255,0.55);
      --aurora1: rgba(var(--sj-red-rgb),0.05);
      --aurora2: rgba(var(--sj-gold-rgb),0.06);
      --aurora3: rgba(var(--sj-gold-rgb),0.05);
    }


    /* ===== Aurora 流光背景 ===== */
    body::before {
      display: none;
      content: '';
      position: fixed;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      background:
        radial-gradient(ellipse 72% 55% at 18% 28%, var(--aurora1) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 82% 68%, var(--aurora2) 0%, transparent 65%),
        radial-gradient(ellipse 50% 45% at 55% 15%, var(--aurora3) 0%, transparent 60%);
      animation: aurora-drift 28s ease-in-out infinite alternate;
    }
    body::after {
      display: none;
      content: '';
      position: fixed;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      background-image:
        radial-gradient(circle 1.5px at 12% 18%, rgba(255,255,255,0.90) 0%, transparent 100%),
        radial-gradient(circle 1px at 35% 72%, rgba(255,255,255,0.85) 0%, transparent 100%),
        radial-gradient(circle 2px at 58% 34%, rgba(255,255,255,0.80) 0%, transparent 100%),
        radial-gradient(circle 1px at 78% 55%, rgba(255,255,255,0.88) 0%, transparent 100%),
        radial-gradient(circle 1.5px at 90% 20%, rgba(255,255,255,0.75) 0%, transparent 100%),
        radial-gradient(circle 1px at 22% 88%, rgba(255,255,255,0.82) 0%, transparent 100%),
        radial-gradient(circle 2px at 68% 82%, rgba(255,255,255,0.78) 0%, transparent 100%),
        radial-gradient(circle 1px at 47% 10%, rgba(255,255,255,0.85) 0%, transparent 100%);
      animation: twinkle 3s ease-in-out infinite alternate;
    }
    @keyframes aurora-drift {
      0%   { transform: translate(0,0) scale(1); }
      33%  { transform: translate(3%,2%) scale(1.04); }
      66%  { transform: translate(-2%,3%) scale(0.97); }
      100% { transform: translate(1%,-2%) scale(1.03); }
    }
    @keyframes twinkle {
      0%   { opacity: 0.35; }
      100% { opacity: 0.90; }
    }
    @media (prefers-reduced-motion: reduce) {
      body::before { animation: none; }
      body::after  { animation: none; }
    }

    /* ===== 全局滚动条美化 ===== */
    * {
      scrollbar-width: thin;
      scrollbar-color: rgba(var(--sj-ink-rgb),0.35) transparent;
    }
    *::-webkit-scrollbar { width: 4px; height: 4px; }
    *::-webkit-scrollbar-track { background: transparent; }
    *::-webkit-scrollbar-thumb {
      background: rgba(var(--sj-ink-rgb),0.35);
      border-radius: 6px;
      transition: background 0.2s;
    }
    *::-webkit-scrollbar-thumb:hover { background: var(--purple); }

    html, body {
      height: 100%;
    }

    body {
      font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei",
        -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans GB", sans-serif;
      background: var(--sj-side);
      color: var(--text-main);
      display: flex;
      flex-direction: column;
      align-items: center;
      min-height: 100vh;
      position: relative;
    }

    /* ===== 整体布局容器 ===== */
    #app {
      width: 100%;
      max-width: none;
      min-height: 100vh;
      display: flex;
      flex-direction: row;
      align-items: stretch;
      background: transparent;
      position: relative;
      z-index: 1;
    }
    #main-area {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      height: calc(100dvh - 8px);
      overflow: hidden;
      margin: 8px 0 0 0;
      border-radius: 14px 0 0 0;
      background: var(--sj-bg);
    }
    #reco-sidebar { display: none !important; }
    @media (min-width: 900px) {
      body:not(.side-collapsed) #conv-handle { display: none; }
      #conv-drawer, #conv-drawer-mask { display: none; }
    }
    @media (min-width: 900px) {
      body.side-collapsed #side-nav { display: none; }
    }

    /* ===== 顶部标题栏 ===== */
    header {
      position: sticky;
      top: 0;
      z-index: 100;
      background: transparent;
      border-bottom: none;
      padding: 14px 20px 10px;
      box-shadow: none;
    }

    .header-inner {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    /* A2: logo → 渐变orb */
    .header-logo {
      width: 40px;
      height: 40px;
      background: var(--grad);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      color: #fff;
      flex-shrink: 0;
      box-shadow: 0 0 0 3px rgba(var(--sj-ink-rgb),0.18), 0 0 16px rgba(var(--sj-ink-rgb),0.28);
      animation: orb-breathe 4s ease-in-out infinite;
    }
    .header-logo::after {
      content: '✦';
      font-size: 16px;
      color: #fff;
      pointer-events: none;
    }


    /* mb48: 展开区卡内滚动 */
    .match-schools-hidden { scrollbar-width: thin; }
    .match-schools-hidden::-webkit-scrollbar { width: 5px; }
    .match-schools-hidden::-webkit-scrollbar-thumb { background: rgba(var(--sj-ink-rgb),0.18); border-radius: 3px; }


    /* mb47: 当前问题浮条（可折叠） */
    .ctx-floating-bar {
      display: none; /* 有内容才显示 */
      margin: 8px auto 0;
      max-width: 640px; width: calc(100% - 32px);
      align-items: center; gap: 10px;
      padding: 8px 14px;
      background: #FFFFFF;
      border: 1px solid var(--sj-line);
      border-radius: 999px;
      cursor: pointer;
      transition: padding 0.18s, background 0.15s, border-color 0.15s;
      animation: ctxBarIn 0.28s ease both;
      box-shadow: 0 1px 3px rgba(31,42,48,0.05);
    }
    .ctx-floating-bar.show { display: flex; }
    .ctx-floating-bar:hover { border-color: #C6D8DC; }
    .ctx-float-label {
      flex: none;
      font-size: 11px; font-weight: 700; color: var(--sj-red);
      border: 1px solid rgba(var(--sj-red-rgb),0.35);
      border-radius: 5px; padding: 1.5px 7px;
      letter-spacing: 0.04em;
    }
    .ctx-float-text {
      flex: 1; min-width: 0;
      font-size: 13px; color: var(--sj-ink1); font-weight: 500;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .ctx-floating-bar.collapsed .ctx-float-text { display: none; }
    .ctx-float-toggle {
      flex: none; font-size: 11px; color: var(--sj-ink3);
      display: flex; align-items: center; gap: 3px; user-select: none;
      white-space: nowrap;
    }
    .ctx-float-toggle .ctx-toggle-ico {
      display: inline-block; transition: transform 0.2s; font-size: 10px;
    }
    .ctx-floating-bar.collapsed .ctx-toggle-ico { transform: rotate(-90deg); }
    .ctx-floating-bar.collapsed { padding: 5px 12px; }
    @keyframes ctxBarIn {
      from { opacity: 0; transform: translateY(-5px); }
      to { opacity: 1; transform: translateY(0); }
    }
    @media (max-width: 899px) {
      .ctx-floating-bar { width: calc(100% - 20px); margin: 6px auto 0; }
    }

    /* 简报按钮样式（mb70 已移除主题换肤，本样式由 #sj-brief-btn 使用） */
    .sj-theme-btn {
      width: 34px; height: 34px; border-radius: 50%;
      border: 1px solid var(--sj-line); background: var(--sj-bg);
      cursor: pointer; font-size: 15px; line-height: 1;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 1px 3px rgba(var(--sj-ink-rgb),0.08);
      transition: transform 0.18s, box-shadow 0.18s;
    }
    .sj-theme-btn:hover { transform: scale(1.08); box-shadow: 0 2px 8px rgba(var(--sj-ink-rgb),0.14); }

    @keyframes orb-breathe {
      0%,100% { box-shadow: 0 0 0 3px rgba(var(--sj-ink-rgb),0.18), 0 0 16px rgba(var(--sj-ink-rgb),0.28); }
      50%      { box-shadow: 0 0 0 5px rgba(var(--sj-red-rgb),0.22), 0 0 28px rgba(var(--sj-ink-rgb),0.38); }
    }
    @media (prefers-reduced-motion: reduce) {
      .header-logo { animation: none; }
    }

    .header-text h1 {
      font-size: 15px;
      font-weight: 400;
      color: var(--sj-ink1);
      line-height: 1.3;
    }

    .header-text p {
      font-size: 12px;
      color: var(--text-sub);
      margin-top: 2px;
      line-height: 1.4;
    }

    /* ===== 消息滚动区 ===== */
    #messages {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 20px 16px;
      display: flex;
      flex-direction: column;
      gap: 20px;
      padding-bottom: 24px;
    }
    #messages > * {
      width: 100%;
      max-width: 860px;
      margin-left: auto;
      margin-right: auto;
    }
    /* mb68: 快捷提问条与AI气泡左缘对齐（头像36+间距10=46px），恢复被上方居中规则覆盖的左缩进 */
    #messages > .suggest-bar {
      padding-left: 46px;
      box-sizing: border-box;
      margin-top: -4px;
    }

    #messages::-webkit-scrollbar {
      width: 4px;
    }
    #messages::-webkit-scrollbar-track {
      background: transparent;
    }
    #messages::-webkit-scrollbar-thumb {
      background: var(--border);
      border-radius: 4px;
    }

    /* ===== 消息行 ===== */
    .msg-row {
      display: flex;
      gap: 10px;
      align-items: flex-start;
    }

    .msg-row.ai {
      flex-direction: row;
    }

    .msg-row.user {
      justify-content: flex-end;
    }
    .msg-row.user .msg-content {
      align-items: flex-end;
    }

    /* ===== 头像 ===== */
    .avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      flex-shrink: 0;
      margin-top: 0;
    }

    .avatar.ai-avatar {
      background: transparent;
      overflow: hidden;
    }
    @keyframes avatar-orb-breathe {
      0%,100% { box-shadow: 0 0 0 2px rgba(var(--sj-red-rgb),0.18), 0 0 14px rgba(var(--sj-ink-rgb),0.45); filter: brightness(1); }
      50%      { box-shadow: 0 0 0 4px rgba(var(--sj-ink-rgb),0.22), 0 0 24px rgba(var(--sj-ink-rgb),0.55); filter: brightness(1.08); }
    }
    @media (prefers-reduced-motion: reduce) {
      .avatar.ai-avatar { animation: none; }
    }

    .avatar.user-avatar {
      background: transparent;
    }

    /* ===== 消息内容区 ===== */
    .msg-content {
      max-width: calc(100% - 56px);
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    /* 数据类气泡（匹配/案例/专业列表/详情）撑满内容区，提升空间利用率 */
    .msg-row:has(.bubble-match) .msg-content,
    .msg-row:has(.bubble-case-table) .msg-content,
    .msg-row:has(.bubble-detail) .msg-content,
    .msg-row:has(.bubble-university) .msg-content,
    .msg-row:has(.case-table-block) .msg-content {
      width: 100%;
      max-width: 100%;
    }

    /* mb71: 专业/匹配入口卡 PC 端与摘要气泡同宽（msg-content 同 calc 锚点，chat-bubble 走全局 85% 上限） */
    .msg-row:has(.bubble-major-entry) .msg-content,
    .msg-row:has(.bubble-match-entry) .msg-content {
      width: calc(100% - 56px);
    }
    .msg-row:has(.bubble-major-entry) .chat-bubble,
    .msg-row:has(.bubble-match-entry) .chat-bubble {
      width: 100%;
    }
    .msg-row:has(.bubble-match) .chat-bubble,
    .msg-row:has(.bubble-case-table) .chat-bubble,
    .msg-row:has(.bubble-detail) .chat-bubble,
    .msg-row:has(.bubble-university) .chat-bubble,
    .msg-row:has(.case-table-block) .chat-bubble {
      max-width: 100%;
      width: 100%;
      box-sizing: border-box;
    }

    .bubble-user {
      position: relative;
      background: #D9EBF1;
      color: var(--sj-ink1);
      padding: 10px 14px;
      border-radius: 18px;
      font-size: 14px;
      line-height: 1.6;
      word-break: break-word;
      box-shadow: 0 1px 3px rgba(31,42,48,0.06);
    }

    .bubble-ai {
      background: #FFFFFF;
      color: var(--text-main);
      padding: 10px 14px;
      border-radius: 18px;
      font-size: 14px;
      line-height: 1.6;
      word-break: break-word;
      box-shadow: 0 1px 3px rgba(31,42,48,0.07);
    }

    .bubble-error {
      background: var(--error-light);
      color: var(--error);
      padding: 10px 14px;
      border-radius: 18px;
      font-size: 14px;
      line-height: 1.6;
      border: 1px solid #fca5a5;
      box-shadow: var(--shadow-sm);
    }

    /* ===== 解析条件标签组 ===== */
    .parsed-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .tag {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 10px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 500;
      background: #FFFFFF;
      color: #71898F;
      border: 1px solid #C9D9DD;
      white-space: nowrap;
    }
    /* mb69: 核心筛选条件标签（如"不需要雅思"）视觉权重略高 */
    .tag.tag-core {
      background: #E7F1F6;
      color: #C63E46;
      border: 1px solid #B7D5DE;
      font-weight: 600;
    }

    /* mb69: 表格容器防横向溢出 */
    .case-table-block { max-width: 100%; overflow-x: auto; }

    /* ===== 结果摘要 ===== */
    .summary-text {
      font-size: 13px;
      color: var(--text-sub);
      padding: 6px 12px;
      background: #f0f9ff;
      border-radius: var(--radius-sm);
      border-left: 3px solid var(--primary);
    }

    /* ===== 学校分组列表 ===== */
    .school-group-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
      width: 100%;
    }
    .match-group-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 4px;
    }
    .match-section {
      border: 1px solid rgba(var(--sj-ink-rgb),0.15);
      border-radius: 20px;
      overflow: hidden;
      background: #fff;
      box-shadow: 0 2px 12px rgba(var(--sj-ink-rgb),0.08);
    }
    .match-section-header {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 14px;
      font-weight: 600;
      font-size: 14px;
    }
    .match-status-available .match-section-header {
      background: #f0fdf4;
      color: #15803d;
    }
    .match-status-gpa_insufficient .match-section-header {
      background: #fffbeb;
      color: #b45309;
    }
    .match-status-unavailable .match-section-header {
      background: #f9fafb;
      color: var(--sj-ink2);
    }
    .match-status-count {
      font-weight: 400;
      font-size: 12px;
      color: inherit;
      opacity: 0.7;
    }
    .match-uni-list {
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .match-uni.match-uni-collapsed {
      display: none;
    }
    .match-more-row {
      display: flex;
      justify-content: center;
      padding: 4px 12px 10px;
    }
    .match-more-btn {
      background: #ffffff;
      border: 1px solid var(--sj-line);
      border-radius: 18px;
      font-size: 13px;
      color: #374151;
      padding: 6px 16px;
      cursor: pointer;
    }
    .match-more-btn:hover {
      border-color: var(--sj-ink3);
    }
    .match-uni.loading {
      opacity: 0.6;
    }
    .match-uni-loading {
      padding: 12px;
      text-align: center;
      color: var(--sj-ink2);
      font-size: 13px;
    }
    .match-empty {
      padding: 12px;
      text-align: center;
      color: var(--sj-ink3);
      font-size: 13px;
    }
    .match-card-sub {
      font-size: 12px;
      color: var(--sj-ink2);
      font-style: italic;
    }
    .match-card-meta {
      margin-top: 6px;
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .match-point {
      font-size: 12px;
      color: #C63E46;
      background: #eff6ff;
      border-radius: 6px;
      padding: 2px 8px;
    }
    .match-state-badge {
      font-size: 12px;
      color: #b45309;
      background: #fffbeb;
      border-radius: 6px;
      padding: 2px 8px;
    }

    /* ===== 学校分组卡片 ===== */
    .school-group {
      background: rgba(255,255,255,0.82);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: 1.5px solid rgba(var(--sj-ink-rgb),0.15);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-glass);
      overflow: hidden;
      transition: box-shadow 0.18s ease, transform 0.18s ease;
    }

    .school-group:hover {
      box-shadow: 0 8px 32px rgba(var(--sj-ink-rgb),0.15), 0 2px 8px rgba(var(--sj-red-rgb),0.08);
      transform: translateY(-1px);
    }

    /* 学校分组头部（可点击） */
    .school-group-header {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 14px 16px;
      cursor: pointer;
      user-select: none;
      transition: background 0.15s;
      position: relative;
    }

    .school-group-header:hover {
      background: var(--sj-bg);
    }

    .school-group-header:focus {
      outline: 2px solid var(--primary);
      outline-offset: -2px;
    }

    .school-group-header-left {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 5px;
    }

    .school-group-title-row {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
    }

    .school-group-name {
      font-size: 15px;
      font-weight: 700;
      color: var(--text-main);
      line-height: 1.4;
    }

    .school-qs-badge {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 2px 8px;
      background: linear-gradient(135deg, var(--primary-light), #c7d9fb);
      color: var(--primary-dark);
      border-radius: 20px;
      font-size: 11px;
      font-weight: 600;
      border: 1px solid #FCEAEB;
      white-space: nowrap;
      flex-shrink: 0;
    }

    .school-major-count {
      font-size: 12px;
      font-weight: 600;
      color: var(--primary);
      background: var(--primary-light);
      padding: 2px 8px;
      border-radius: 20px;
      border: 1px solid #FCEAEB;
      white-space: nowrap;
      flex-shrink: 0;
    }

    /* 专业预览文字 */
    .school-group-preview {
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.5;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    /* 右侧箭头 */
    .school-group-arrow {
      width: 28px;
      height: 28px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      background: var(--bg);
      border: 1px solid var(--border);
      color: var(--text-sub);
      font-size: 13px;
      flex-shrink: 0;
      transition: transform 0.25s ease, background 0.15s, color 0.15s;
    }

    .school-group.expanded .school-group-arrow {
      transform: rotate(180deg);
      background: var(--primary-light);
      color: var(--primary);
      border-color: #FCEAEB;
    }

    /* 展开后专业卡片区 */
    .school-group-body {
      display: none;
      padding: 0 12px 12px;
      animation: fadeInDown 0.2s ease;
    }

    .school-group.expanded .school-group-body {
      display: block;
    }

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

    .school-group-body .card-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    /* ===== 专业卡片列表 ===== */
    .card-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      width: 100%;
    }

    /* 单个专业卡片 */
    .major-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      box-shadow: var(--shadow-sm);
      transition: box-shadow 0.15s ease, transform 0.15s ease;
      overflow: hidden;
      cursor: pointer;
    }

    /* 分组内部的专业卡片：去掉外阴影，用细边框代替 */
    .school-group-body .major-card {
      box-shadow: none;
      border-color: #e8edf4;
    }

    .major-card:hover {
      box-shadow: var(--shadow-md);
      transform: translateY(-1px);
    }

    .school-group-body .major-card:hover {
      box-shadow: var(--shadow-sm);
    }

    .major-card:focus {
      outline: 2px solid var(--primary);
      outline-offset: 2px;
    }

    /* 卡片主体区（可点击区域） */
    .card-body {
      padding: 14px;
    }

    /* 卡片顶部：学校名 + QS徽章 */
    .card-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
    }

    .school-name {
      font-size: 13px;
      color: var(--text-sub);
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .qs-badge {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 2px 8px;
      background: linear-gradient(135deg, #fef3c7, #fde68a);
      color: #92400e;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 600;
      border: 1px solid #fcd34d;
      white-space: nowrap;
      flex-shrink: 0;
    }

    /* 专业名称 */
    .major-name {
      font-size: 15px;
      font-weight: 700;
      color: var(--text-main);
      line-height: 1.4;
      margin-bottom: 10px;
    }

    /* 信息网格 */
    .card-info {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 5px 12px;
    }

    .info-item {
      display: flex;
      align-items: flex-start;
      gap: 5px;
      font-size: 12px;
      color: var(--text-sub);
      line-height: 1.5;
    }

    .info-item .info-emoji {
      flex-shrink: 0;
      margin-top: 0px;
    }

    .info-item .info-label {
      color: var(--text-muted);
      margin-right: 2px;
    }

    .info-item.full-row {
      grid-column: 1 / -1;
    }

    /* ===== 展开提示条 ===== */
    .card-toggle {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      padding: 8px 14px;
      font-size: 12px;
      font-weight: 500;
      color: var(--primary);
      background: var(--primary-light);
      border-top: 1px solid #FCEAEB;
      user-select: none;
      transition: background 0.15s;
    }

    .major-card:hover .card-toggle {
      background: #c7d9fb;
    }

    .card-toggle-arrow {
      font-style: normal;
      transition: transform 0.2s ease;
      display: inline-block;
    }

    .major-card.expanded .card-toggle-arrow {
      transform: rotate(180deg);
    }

    /* ===== 详情区 ===== */
    .detail-limit-note {
      font-size: 12px;
      color: var(--sj-ink3);
      text-align: center;
      padding: 6px 4px;
      pointer-events: none;
      user-select: none;
    }

    .card-detail {
      display: none;
      padding: 14px;
      background: var(--sj-bg);
      border-top: 1px solid var(--border);
      animation: fadeIn 0.2s ease;
    }

    .major-card.expanded .card-detail {
      display: block;
    }

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

    /* ===== 快捷提问chips ===== */
    .suggest-bar {
      display: flex; flex-wrap: wrap; gap: 12px;
      margin: 0 0 18px 52px;
      animation: fadeIn .25s ease;
    }
    .suggest-chip {
      background: #fff;
      border: none;
      border-radius: 999px;
      padding: 7px 14px;
      font-size: 13px;
      color: #C63E46;
      cursor: pointer;
      transition: all .2s;
      font-family: inherit;
      line-height: 1.4;
      box-shadow: 0 1px 2px rgba(31,42,48,0.06);
    }
    .suggest-chip:hover {
      background: #FFF2F1;
      color: #D46467;
      box-shadow: 0 1px 3px rgba(31,42,48,0.08);
    }
    .suggest-chip:active {
      transform: translateY(0);
    }

    /* mb35d: 领域勾选标签条（clarify fields） */
    .field-picker {
      gap: 8px;
    }
    .field-chip {
      background: #fff;
      border: none;
      border-radius: 999px;
      padding: 7px 14px;
      font-size: 13px;
      color: #C63E46;
      cursor: pointer;
      transition: all .2s;
      font-family: inherit;
      line-height: 1.4;
      box-shadow: 0 1px 2px rgba(31,42,48,0.06);
    }
    .field-chip .fc-count {
      color: var(--text-sub);
      font-size: 12px;
      margin-left: 3px;
    }
    .field-chip.selected {
      background: #EFEFEF;
      color: #D46467;
      font-weight: 500;
    }
    .field-chip.selected .fc-count { color: rgba(31,42,48,0.6); }
    .field-submit-btn {
      border: none; border-radius: 999px;
      background: var(--sj-blue); color: #fff;
      padding: 7px 18px; font-size: 13px; cursor: pointer;
      font-family: inherit; transition: all .2s;
      box-shadow: 0 1px 3px rgba(36,36,208,0.28);
    }
    .field-submit-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
    .field-hint {
      width: 100%; font-size: 12px; color: var(--text-sub);
      padding-left: 2px;
    }
    .field-picker.shake { animation: fpShake .35s ease; }
    @keyframes fpShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 50%{transform:translateX(4px)} 75%{transform:translateX(-3px)} }

    /* 详情内部行 */
    .detail-row {
      display: flex;
      align-items: flex-start;
      gap: 6px;
      font-size: 13px;
      color: var(--text-sub);
      line-height: 1.7;
      padding: 4px 0;
      border-bottom: 1px solid #eef1f5;
    }

    .detail-row:last-child {
      border-bottom: none;
    }

    .detail-emoji {
      flex-shrink: 0;
      margin-top: 1px;
    }

    .detail-content {
      flex: 1;
      word-break: break-word;
    }

    .detail-label {
      color: var(--text-muted);
      margin-right: 3px;
      font-weight: 500;
    }

    /* 申请轮次每行 */
    .apply-date-item {
      display: block;
      line-height: 1.7;
    }

    /* 课程列表 */
    .courses-list {
      display: flex;
      flex-wrap: wrap;
      gap: 4px 8px;
      margin-top: 2px;
    }

    .course-chip {
      display: inline-block;
      padding: 1px 8px;
      background: #e0e7ff;
      color: #3730a3;
      border-radius: 10px;
      font-size: 12px;
      line-height: 1.6;
    }

    .courses-more {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 4px;
      display: block;
    }

    /* 官网链接 */
    .detail-link {
      color: var(--primary);
      text-decoration: none;
      word-break: break-all;
    }

    .detail-link:hover {
      text-decoration: underline;
    }

    /* 详情加载/错误状态 */
    .detail-loading,
    .detail-error {
      font-size: 13px;
      text-align: center;
      padding: 12px 0;
    }

    .detail-loading {
      color: var(--text-muted);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    .detail-loading .dots {
      display: inline-flex;
      gap: 4px;
    }

    .detail-loading .dots span {
      width: 5px;
      height: 5px;
      background: var(--primary);
      border-radius: 50%;
      animation: dot-bounce 1.2s ease-in-out infinite;
    }

    .detail-loading .dots span:nth-child(2) { animation-delay: 0.2s; }
    .detail-loading .dots span:nth-child(3) { animation-delay: 0.4s; }

    .detail-error {
      color: var(--error);
    }

    .retry-btn {
      display: inline-block;
      margin-top: 6px;
      padding: 3px 12px;
      border: 1px solid var(--error);
      border-radius: 20px;
      color: var(--error);
      font-size: 12px;
      cursor: pointer;
      background: none;
      font-family: inherit;
      transition: background 0.15s;
    }

    .retry-btn:hover {
      background: var(--error-light);
    }

    /* ===== loading 动画气泡 ===== */
    .bubble-loading {
      background: var(--surface);
      border: none;
      padding: 12px 16px;
      border-radius: 18px;
      box-shadow: 0 1px 3px rgba(31,42,48,0.07);
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      color: var(--text-sub);
    }

    .dots {
      display: inline-flex;
      gap: 4px;
    }

    .dots span {
      width: 6px;
      height: 6px;
      background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
      border-radius: 50%;
      animation: dot-bounce 1.2s ease-in-out infinite;
    }

    .dots span:nth-child(2) { animation-delay: 0.2s; }
    .dots span:nth-child(3) { animation-delay: 0.4s; }

    @keyframes dot-bounce {
      0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
      40% { transform: scale(1); opacity: 1; }
    }

    /* ===== 底部输入区 ===== */
    footer {
      position: sticky;
      bottom: 0;
      background: var(--sj-bg);
      border-top: none;
      padding: 8px 16px;
      box-shadow: none;
    }
    /* mb64: 输入区与对话区同宽对齐 */
    footer > .input-wrap,
    footer > .input-tools,
    footer > .poster-bar {
      max-width: 896px;
      margin-left: auto;
      margin-right: auto;
    }

    .input-wrap {
      display: flex;
      gap: 10px;
      align-items: flex-end;
      background: #FFFFFF;
      border-radius: 18px;
      padding: 6px 6px 6px 14px;
      border: 1px solid #EFEFEF;
      box-shadow: 0 1px 3px rgba(31,42,48,0.05);
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    .input-wrap:focus-within {
      border-color: rgba(47,102,117,0.45);
      box-shadow: 0 0 0 3px rgba(47,102,117,0.07), 0 1px 4px rgba(31,42,48,0.06);
    }

    #user-input {
      flex: 1;
      resize: none;
      border: none;
      border-radius: 18px;
      padding: 8px 4px;
      font-size: 14px;
      font-family: inherit;
      color: var(--text-main);
      background: transparent;
      outline: none;
      transition: none;
      line-height: 1.5;
      max-height: 160px;
      min-height: 60px;
      overflow-y: auto;
    }

    #user-input::placeholder {
      color: var(--text-muted);
    }

    #user-input:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    #send-btn {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      border: none;
      background: var(--sj-blue);
      color: white;
      font-size: 17px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      transition: box-shadow 0.18s, transform 0.12s, filter 0.18s;
      outline: none;
      box-shadow: 0 1px 3px rgba(36,36,208,0.28);
    }

    #send-btn:hover:not(:disabled) {
      filter: brightness(1.06);
      box-shadow: 0 2px 8px rgba(36,36,208,0.35);
      transform: translateY(-1px);
    }
    /* ===== mb56: 语音输入按钮 ===== */
    #sj-mic-btn {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      border: 1px solid var(--sj-line);
      background: #fff;
      color: #8C8C8C;
      font-size: 19px;
      cursor: pointer;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: box-shadow .18s, transform .12s, background .18s, border-color .18s;
      box-shadow: 0 1px 2px rgba(31,42,48,0.05);
      line-height: 1;
      user-select: none;
      -webkit-user-select: none;
      touch-action: manipulation;
    }
    #sj-mic-btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 2px 6px rgba(47,102,117,0.16);
      border-color: #C6D8DC;
    }
    #sj-mic-btn.listening {
      background: var(--sj-blue);
      color: #fff;
      border-color: transparent;
      animation: sjMicPulse 1.1s ease-in-out infinite;
    }
    #sj-mic-btn.unsupported { opacity: .45; }
    #sj-mic-btn.listening svg * { stroke: #fff; }
    @keyframes sjMicPulse {
      0%, 100% { box-shadow: 0 0 0 0 rgba(var(--sj-blue-rgb),0.45); }
      50% { box-shadow: 0 0 0 9px rgba(var(--sj-blue-rgb),0); }
    }
    .sj-mic-hint {
      position: fixed;
      left: 50%;
      bottom: 138px;
      transform: translateX(-50%) translateY(6px);
      background: rgba(var(--sj-ink-rgb),0.92);
      color: #fff;
      font-size: 13px;
      padding: 7px 16px;
      border-radius: 999px;
      z-index: 900;
      opacity: 0;
      pointer-events: none;
      transition: opacity .2s, transform .2s;
      max-width: 86vw;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .sj-mic-hint.show { opacity: 1; transform: translateX(-50%) translateY(0); }
    /* ===== mb56: 回答朗读按钮 ===== */
    .sj-tts-btn {
      display: inline-flex;
      align-items: center;
      align-self: flex-start;
      gap: 3px;
      margin-top: 2px;
      padding: 2px 10px;
      border: 1px solid #DCE5E8;
      border-radius: 999px;
      background: #fff;
      color: var(--text-muted);
      font-size: 12px;
      cursor: pointer;
      line-height: 1.5;
      transition: all .18s;
      user-select: none;
      -webkit-user-select: none;
    }
    .sj-tts-btn:hover {
      border-color: rgba(var(--sj-blue-rgb),0.5);
      color: var(--sj-blue-d);
    }
    .sj-tts-btn.speaking {
      border-color: rgba(var(--sj-blue-rgb),0.6);
      color: var(--sj-blue-d);
      background: rgba(var(--sj-blue-rgb),0.06);
    }
    @media (max-width: 640px) {
      #sj-mic-btn { width: 40px; height: 40px; font-size: 17px; }
      .sj-mic-hint { bottom: 122px; }
    }

    #send-btn:active:not(:disabled) {
      transform: scale(0.93);
      box-shadow: 0 1px 6px rgba(var(--sj-ink-rgb),0.20);
    }

    #send-btn:disabled {
      opacity: 0.60;
      cursor: not-allowed;
    }

    #send-btn .btn-spinner {
      width: 18px;
      height: 18px;
      border: 2px solid rgba(255,255,255,0.4);
      border-top-color: white;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    .footer-note {
      margin: 0 0 0 auto;
      text-align: right;
      font-size: 12px;
      color: #8FA5AD;
      line-height: 1.4;
    }
    .poster-bar {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 10px;
      padding: 8px 14px;
      border-radius: 14px;
      background: #FFFFFF;
      border: 1px solid var(--sj-line);
      flex-wrap: wrap;
    }
    .poster-bar-count {
      font-size: 13px;
      color: var(--text-main);
    }
    .poster-bar-count b {
      color: var(--sj-red-d);
      font-weight: 700;
    }
    .poster-bar-btn {
      background: var(--sj-blue);
      color: #fff;
      border: none;
      border-radius: 20px;
      padding: 6px 18px;
      font-size: 13px;
      cursor: pointer;
      transition: opacity 0.2s;
    }
    .poster-bar-btn:hover:not(:disabled) {
      opacity: 0.85;
    }
    .poster-bar-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
    .poster-bar-clear {
      background: #fff;
      color: var(--sj-ink3);
      border: 1px solid var(--sj-line);
      border-radius: 20px;
      padding: 6px 14px;
      font-size: 12px;
      cursor: pointer;
      transition: background 0.2s;
    }
    .poster-bar-clear:hover {
      background: #f5f5f5;
    }

    /* mb22: 海报版式选择网格与按钮样式 */
    .poster-style-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
      margin-top: 8px;
    }

    .poster-style-btn {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      background: #ffffff;
      border: 1.5px solid var(--sj-line);
      border-radius: 12px;
      cursor: pointer;
      text-align: left;
      transition: border-color 0.18s, box-shadow 0.18s;
    }

    .poster-style-btn:hover {
      border-color: var(--sj-red);
      box-shadow: 0 0 0 3px rgba(var(--sj-red-rgb), 0.1);
    }

    .poster-style-swatch {
      width: 38px;
      height: 38px;
      border-radius: 10px;
      flex-shrink: 0;
      border: 1px solid rgba(0, 0, 0, 0.06);
    }

    .poster-style-name {
      font-size: 13px;
      font-weight: 700;
      color: var(--text-main);
      display: block;
    }

    .poster-style-desc {
      font-size: 11.5px;
      color: var(--sj-ink3);
      margin-top: 2px;
      display: block;
    }
    .poster-result img {
      width: 100%;
      border-radius: 12px;
      display: block;
    }
    .poster-dl {
      display: inline-block;
      margin-top: 10px;
      padding: 7px 20px;
      border-radius: 20px;
      font-size: 13px;
      color: #fff;
      text-decoration: none;
      background: linear-gradient(90deg, var(--sj-red), var(--sj-red-h));
    }
    .poster-status {
      text-align: center;
      color: var(--text-muted);
      padding: 8px 0;
      font-size: 13px;
    }

    /* ===== 响应式 ===== */
    @media (max-width: 480px) {
      header {
        padding: 10px 14px 8px;
        margin: 8px 8px 0;
        border-radius: var(--radius-xl);
        border: 1px solid rgba(var(--sj-ink-rgb),0.14);
        top: 8px;
      }

      .header-text h1 {
        font-size: 15px;
      }

      .header-text p {
        font-size: 11px;
      }

      #messages {
        padding: 14px 12px 20px;
        gap: 16px;
      }

      .card-info {
        grid-template-columns: 1fr;
      }

      .info-item.full-row {
        grid-column: 1;
      }

      footer {
        padding: 10px 12px;
      }

      /* mb69: 移动端防横向溢出与逐字竖排 */
      #messages, .msg-content, .chat-bubble, .msg-row {
        min-width: 0;
        max-width: 100%;
      }
      /* mb70: 移动端结果卡使用全部可用宽度（PC端已回归普通内容列宽度）；mb71: 匹配入口卡一并全宽 */
      .msg-row:has(.bubble-major-entry) .msg-content,
      .msg-row:has(.bubble-match-entry) .msg-content,
      .msg-row:has(.bubble-major-entry) .chat-bubble,
      .msg-row:has(.bubble-match-entry) .chat-bubble {
        width: 100%;
        max-width: 100%;
      }
      .bubble-ai, .bubble-user, .summary-text {
        overflow-wrap: anywhere;
        word-break: break-word;
      }

      .school-group-title-row {
        gap: 6px;
      }

      .school-group-name {
        font-size: 14px;
      }

      .school-qs-badge {
        font-size: 10px;
        padding: 2px 6px;
      }

      .school-major-count {
        font-size: 11px;
        padding: 2px 6px;
      }
    }

    /* ===== mb39: 手机端 header 紧凑化 + 案例表格卡片化 ===== */
    /* mb40b: 案例详情ⓘ按钮仅手机端显示（默认隐藏，下方640px块内覆盖为flex） */
    .case-detail-btn { display: none; }
    @media (max-width: 640px) {
      header {
        padding: 6px 10px;
        margin: 0;
        border-radius: 0;
        border: none;
        top: 0;
      }
      .header-inner { gap: 8px; }
      .header-text { min-width: 0; }
      .header-text h1 {
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
      }
      #section-switch-btn {
        min-width: 0;
        flex: 1;
        padding: 6px 10px;
      }
      #section-switch-btn #section-switch-name {
        display: inline-block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .header-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
        box-shadow: 0 0 0 2px rgba(var(--sj-ink-rgb),0.18), 0 1px 6px rgba(var(--sj-ink-rgb),0.22);
      }

      /* 案例表格 → 卡片式，解决手机上5列表格截断问题 */
      .case-table-wrap { overflow-x: visible; }
      .case-table {
        min-width: 0;
        width: 100%;
        font-size: 0.95em;
      }
      .case-table thead { display: none; }
      .case-table tbody, .case-table tr, .case-table td {
        display: block;
        width: 100%;
      }
      .case-table tr {
        border: 1px solid rgba(var(--sj-ink-rgb),0.16);
        border-radius: 12px;
        margin-bottom: 10px;
        padding: 10px 12px 8px;
        background: #fff;
        box-shadow: 0 1px 4px rgba(var(--sj-ink-rgb),0.06);
      }
      .case-table tr:last-child { margin-bottom: 0; }
      .case-table td {
        border-bottom: none;
        padding: 2px 0;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
      }
      .case-table .td-school {
        font-size: 1.05em;
        font-weight: 700;
        padding-bottom: 6px;
      }
      .case-table .td-major { max-width: none; }
      .case-table .td-major::before,
      .case-table .td-result::before,
      .case-table .td-year::before,
      .case-table .td-info::before {
        color: var(--text-muted);
        font-size: 0.85em;
        margin-right: 2px;
      }
      .case-table .td-major::before { content: '专业：'; }
      .case-table .td-result::before { content: '结果：'; }
      .case-table .td-year::before { content: '入学：'; }
      .case-table .td-info::before { content: '背景：'; }
      .case-row-similar td { background: transparent; }
      .case-row-similar { background: var(--sj-bg); }
      .case-table .case-toggle { display: none; }

      /* mb39: 大页面浏览弹窗手机全屏化 */
      #result-modal-overlay { padding: 0; align-items: stretch; }
      #result-modal-box {
        max-width: none;
        width: 100%;
        height: 100dvh;
        border-radius: 0;
      }
      #result-modal-header { padding: 10px 14px 8px; }

      #brief-modal-header { padding: 10px 14px 8px; }

      /* mb55: 简报弹窗手机全屏化 */
      #brief-modal-overlay { padding: 0; align-items: stretch; }
      #brief-modal-box { max-width: none; width: 100%; height: 100dvh; border-radius: 0; }


      /* mb39: 专业列表行紧凑化，提升一屏容量 */
      .major-row { padding: 6px 8px; }
      .major-line2 { font-size: 11px; gap: 4px; }
      .uni-bubble-header { padding: 8px 10px; }
      .expand-btn { padding: 5px 10px; font-size: 11px; }
      .tag-filter-chip { font-size: 10px; padding: 2px 7px; }

      /* mb50: 手机端行内专业展开紧凑化 */
      .match-major-inline { margin-left: 12px; padding: 7px 8px; }

      /* mb40: 手机端勾选圈扩大+热区外扩，案例卡片一点别处就弹详情弹窗，勾选圈太小难点中 */
      .news-check, .case-check, .match-check {
        width: 22px;
        height: 22px;
        min-width: 22px;
        position: relative;
      }
      .news-check::before, .case-check::before, .match-check::before {
        content: '';
        position: absolute;
        inset: -9px; /* 点击热区外扩9px，约40px总热区 */
      }
      .case-check, .match-check { margin-right: 8px; }
      .td-school { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }

      /* mb40b: 手机端案例卡片详情入口按钮 */
      .case-detail-btn {
        margin-left: auto;
        width: 26px;
        height: 26px;
        border-radius: 50%;
        background: var(--sj-red-wash);
        color: var(--sj-red);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        flex-shrink: 0;
        border: 1px solid rgba(var(--sj-red-rgb), 0.25);
      }
      .case-similar-tag-inline { margin-right: 4px; }
    }
  /* ─────────────────────────────────────────────
   淡入动画
───────────────────────────────────────────── */
.fade-in-row {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.38s cubic-bezier(0.22,1,0.36,1), transform 0.38s cubic-bezier(0.22,1,0.36,1);
}
.fade-in-row.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─────────────────────────────────────────────
   通用聊天气泡覆盖
───────────────────────────────────────────── */
.chat-bubble {
  max-width: 85%;
  word-break: break-word;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: 18px;
  margin-bottom: 0;
}

.msg-row.ai + .msg-row.ai .chat-bubble {
  margin-top: 0;
}

/* ─────────────────────────────────────────────
   B1: 思考指示器气泡
───────────────────────────────────────────── */
    .thinking-bubble {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 16px;
      font-size: 13px;
      color: var(--text-sub);
      background: #FFFFFF;
      border: none;
      border-radius: 18px;
      box-shadow: 0 1px 3px rgba(31,42,48,0.07);
    }
.thinking-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
    .thinking-dots span {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
      animation: thinking-bounce 1.3s ease-in-out infinite;
      display: inline-block;
    }
.thinking-dots span:nth-child(2) { animation-delay: 0.18s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes thinking-bounce {
  0%,80%,100% { transform: scale(0.65) translateY(0); opacity: 0.5; }
  40%          { transform: scale(1) translateY(-5px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .thinking-dots span { animation: none; opacity: 0.7; }
}
/* mb42: 生成过程百分比进度 */
.thinking-progress-wrap {
  display: flex; flex-direction: column; gap: 5px; min-width: 148px;
}
.thinking-progress-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  line-height: 1;
}
.thinking-stage { font-size: 12.5px; }
.thinking-pct {
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.thinking-bar {
  width: 100%; height: 4px; border-radius: 999px;
  background: rgba(var(--sj-ink-rgb),0.15); overflow: hidden;
}
.thinking-bar-fill {
  width: 0%; height: 100%; border-radius: 999px;
  background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
  transition: width 0.32s ease-out;
}
.thinking-bar-fill.done { transition: width 0.18s ease; }

/* ─────────────────────────────────────────────
   B2: 打字机
───────────────────────────────────────────── */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  background: linear-gradient(180deg, var(--sj-red), var(--sj-red-h));
  margin-left: 1px;
  animation: blink-cursor 0.65s step-end infinite;
  vertical-align: text-bottom;
  height: 1em;
  border-radius: 1px;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ─────────────────────────────────────────────
   标签 chips 淡入
───────────────────────────────────────────── */
.bubble-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.bubble-tags.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─────────────────────────────────────────────
   inline loading 气泡
───────────────────────────────────────────── */
.bubble-loading-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88em;
  color: #888;
  padding: 8px 14px;
}
.loading-label {
  color: #666;
}
.bubble-loading-inline .dots span {
  display: inline-block;
  animation: dots-bounce 1.2s infinite;
  font-weight: bold;
  color: #aaa;
}
.bubble-loading-inline .dots span:nth-child(2) { animation-delay: 0.2s; }
.bubble-loading-inline .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dots-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* ─────────────────────────────────────────────
   学校气泡
───────────────────────────────────────────── */
.bubble-university {
  padding: 10px 14px 8px;
  min-width: 260px;
}

.uni-bubble-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.uni-bubble-icon {
  font-size: 1.1em;
}
.uni-bubble-name {
  font-weight: 600;
  font-size: 0.97em;
  color: #1a1a2e;
}
.uni-bubble-qs {
  font-size: 0.78em;
  background: #e8f4fd;
  color: #2980b9;
  border-radius: 10px;
  padding: 1px 7px;
  font-weight: 500;
}
.uni-bubble-count {
  font-size: 0.78em;
  color: #888;
  margin-left: auto;
}

/* ─────────────────────────────────────────────
   专业行
───────────────────────────────────────────── */
.major-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.major-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  height: auto;
  min-height: 44px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 0.875em;
  transition: background 0.15s;
}

.major-line1 {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
}

.major-line2 {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding-left: 27px;
}

.major-row-clickable {
  cursor: pointer;
}
.major-row-clickable:hover {
  background: rgba(41, 128, 185, 0.07);
}

.major-row-disabled {
  cursor: default;
  opacity: 0.7;
}

/* 超出详情名额：跳转叁镜专业页 */
.major-row-sanjing {
  cursor: pointer;
  opacity: 0.75;
  transition: background 0.15s, opacity 0.15s;
}
.major-row-sanjing:hover {
  opacity: 1;
  background: rgba(var(--sj-red-rgb), 0.06);
}
.major-row-sanjing .major-ielts-hint {
  color: var(--sj-red);
}

/* 序号徽章 */
.major-idx-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  background: #f0f0f5;
  color: #666;
  border-radius: 4px;
  font-size: 0.78em;
  font-weight: 600;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.major-row-clickable .major-idx-badge {
  background: #e3effe;
  color: #3478d4;
}

.major-name {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  line-height: 1.4;
}
.major-name-link {
  color: #C63E46;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(37,99,235,0.4);
}
.major-row-clickable:hover .major-name-link {
  color: #C63E46;
  text-decoration-color: #C63E46;
}
.major-name-grey {
  color: #aaa;
}

.major-ielts {
  font-size: 0.78em;
  color: #888;
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: auto;
}
.major-line2 .major-ielts {
  margin-left: auto;
}
.major-ielts-hint {
  color: #bbb;
  font-size: 0.75em;
}
.major-intake {
  font-size: 11px;
  color: #be185d;
  background: #fff;
  border: 1px solid #f43f5e;
  border-radius: 999px;
  padding: 1px 7px;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.6;
}

/* 专业标签 chips */
.major-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  flex-shrink: 0;
}
.major-tag-chip {
  font-size: 10px;
  color: var(--sj-red);
  background: rgba(var(--sj-ink-rgb), 0.10);
  border: 1px solid rgba(var(--sj-ink-rgb), 0.35);
  border-radius: 999px;
  padding: 0 6px;
  line-height: 1.6;
  white-space: nowrap;
  cursor: default;
}
.cet6-chip {
  background: rgba(34, 197, 94, 0.12) !important;
  color: #16a34a !important;
  border: 1px solid rgba(34, 197, 94, 0.35) !important;
  font-weight: 600;
}

/* 标签筛选条（搜索模式摘要后） */
.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.tag-filter-label {
  font-size: 12px;
  color: var(--sj-ink2);
  flex-shrink: 0;
}
.tag-filter-chip {
  font-size: 11px;
  color: var(--sj-red-d);
  background: #fff;
  border: 1px solid rgba(var(--sj-ink-rgb), 0.45);
  border-radius: 999px;
  padding: 1px 8px;
  cursor: pointer;
  line-height: 1.7;
  transition: all .15s ease;
}
.tag-filter-chip:hover { background: rgba(var(--sj-ink-rgb), 0.12); }
.tag-filter-chip.active {
  color: #fff;
  background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
  border-color: transparent;
}
.tag-filter-count {
  font-size: 10px;
  opacity: .75;
  margin-left: 1px;
}
.tag-filter-result {
  font-size: 11px;
  color: var(--sj-ink3);
  margin-left: auto;
  flex-shrink: 0;
}

/* hidden wrapper */
.major-row-hidden > .major-row {
  display: flex;
}

/* ─────────────────────────────────────────────
   展开按钮
───────────────────────────────────────────── */
.expand-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  background: none;
  border: none;
  color: #C63E46;
  font-size: 0.82em;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.expand-btn:hover {
  background: rgba(37,99,235,0.08);
  color: #C63E46;
}

/* ─────────────────────────────────────────────
   详情气泡
───────────────────────────────────────────── */
.bubble-detail {
  padding: 12px 16px;
}
.detail-bubble-title {
  font-weight: 700;
  font-size: 0.97em;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  color: #1a1a2e;
}
.detail-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.875em;
  line-height: 1.5;
}
.detail-icon {
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.detail-label {
  flex-shrink: 0;
  color: #888;
  font-size: 0.92em;
}
.detail-value {
  color: #333;
  flex: 1;
}
.detail-link {
  color: #C63E46;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.detail-link:hover {
  color: #C63E46;
}
.detail-empty {
  color: #aaa;
  font-size: 0.875em;
}

/* ─────────────────────────────────────────────
   匹配模式 - 分档气泡
───────────────────────────────────────────── */
.bubble-match {
  padding: 10px 14px 8px;
  min-width: 240px;
}

.match-group-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.match-group-icon {
  font-size: 1.1em;
}
.match-group-label {
  font-weight: 600;
  font-size: 0.95em;
  color: #1a1a2e;
}
.match-group-count {
  font-size: 0.8em;
  color: #888;
  margin-left: auto;
  background: #f5f5f5;
  padding: 1px 7px;
  border-radius: 10px;
}

/* 档色调 */
.bubble-match-available .match-group-label { color: #16a34a; }
.bubble-match-available .match-group-icon  { filter: none; }
.bubble-match-gpa_short .match-group-label { color: #d97706; }
.bubble-match-unavailable .match-group-label { color: #dc2626; }
.match-unavailable-tip { font-size: 11px; color: var(--sj-ink3); padding: 4px 2px 2px; line-height: 1.5; }

.match-school-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.match-school-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.88em;
}
.match-school-row:hover {
  background: rgba(37,99,235,0.07);
}
.match-school-name {
  font-weight: 500;
  color: #C63E46;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(37,99,235,0.35);
}
.match-school-qs {
  font-size: 0.78em;
  background: #e8f4fd;
  color: #2980b9;
  border-radius: 10px;
  padding: 1px 7px;
  flex-shrink: 0;
}
.match-school-count {
  font-size: 0.78em;
  color: #aaa;
  flex-shrink: 0;
}
.match-school-row[data-loading="true"] {
  opacity: 0.5;
  pointer-events: none;
}

/* mb50: 点学校原地展开专业（行内块），不再追加独立卡片 */
.match-school-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}
.match-school-row.expanded {
  background: rgba(37,99,235,0.07);
}
.match-school-row.expanded .match-school-arrow {
  transform: rotate(-90deg);
}
.match-major-inline {
  margin: 1px 0 6px 26px;
  padding: 8px 10px;
  background: rgba(var(--sj-red-rgb),0.045);
  border-left: 3px solid rgba(var(--sj-red-rgb),0.5);
  border-radius: 10px;
  animation: fadeIn 0.25s ease;
}
.match-major-inline .match-majors-header {
  margin-bottom: 6px;
  font-size: 0.82em;
}

.match-schools-hidden .match-school-row {
  display: flex;
}

/* ─────────────────────────────────────────────
   匹配模式 - 专业列表气泡
───────────────────────────────────────────── */
.bubble-match-majors {
  padding: 10px 14px 8px;
}
.match-majors-header {
  font-weight: 600;
  font-size: 0.95em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.match-fold-btn {
  flex-shrink: 0;
  border: 1px solid rgba(var(--sj-ink-rgb),0.22);
  background: rgba(255,255,255,0.9);
  color: var(--text-sub);
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
}
.match-fold-btn:hover {
  border-color: rgba(var(--sj-red-rgb),0.5);
  color: var(--sj-red);
  background: #fff;
}
.match-major-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.match-major-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 2px;
  font-size: 0.875em;
  border-radius: 6px;
  cursor: pointer;
}
.match-major-row[data-sjurl]:hover {
  background: rgba(var(--sj-red-rgb), 0.08);
}
.match-major-name {
  font-weight: 500;
  color: #222;
}
.match-major-en {
  color: #999;
  font-size: 0.85em;
}
.match-major-point {
  font-size: 0.8em;
  background: #fef3c7;
  color: #d97706;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: auto;
}
.match-major-state {
  font-size: 0.78em;
  color: #aaa;
}

/* ─────────────────────────────────────────────
   空结果气泡
───────────────────────────────────────────── */
.bubble-empty {
  color: #888;
  font-size: 0.92em;
}
/* 代码块2: CSS */



#app > footer,
#app > .chat-footer,
#app > form,
#app > #input-area {
  grid-column: 1 / -1;
}


/* 侧栏占第二列 */
#reco-sidebar { display: none; }
@media (min-width: 1100px) {
  #reco-sidebar { display: flex; flex-direction: column; position: sticky; top: 16px; max-height: calc(100vh - 32px); }
}

#reco-sidebar-inner {
  background: var(--surface, #fff);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-md, 0 4px 16px rgba(0,0,0,0.1));
  border: 1px solid var(--border, #eee);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}

#reco-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border, #eee);
  flex-shrink: 0;
  background: var(--surface, #fff);
}

.reco-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main, #1a1a1a);
  line-height: 1.4;
}

.reco-subtitle {
  display: block;
  font-size: 12px;
  color: var(--text-muted, #999);
  margin-top: 2px;
}

#reco-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px;
  scroll-behavior: smooth;
}

#reco-list::-webkit-scrollbar {
  width: 4px;
}
#reco-list::-webkit-scrollbar-track {
  background: transparent;
}
#reco-list::-webkit-scrollbar-thumb {
  background: var(--border, #ddd);
  border-radius: 2px;
}

/* 空态 */
#reco-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: var(--text-muted, #bbb);
  gap: 8px;
}

.reco-empty-icon {
  font-size: 28px;
  opacity: 0.5;
}

#reco-empty p {
  margin: 0;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}

/* 学校条目 */
.reco-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-md, 10px);
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
  border: 1.5px solid transparent;
}

.reco-item:hover {
  background: var(--primary-light, var(--sj-error-light));
}

.reco-item.reco-active {
  background: var(--primary-light, var(--sj-error-light));
  border-color: var(--primary, var(--sj-error));
}

.reco-item-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main, #1a1a1a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.reco-qs-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
  border-radius: 6px;
  padding: 1px 6px;
  line-height: 1.6;
  white-space: nowrap;
}

.reco-qs-badge.reco-qs-na {
  background: var(--text-muted, #bbb);
  font-weight: 400;
}

.reco-count {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-sub, #666);
  white-space: nowrap;
}

/* 高亮描边动画 */
@keyframes reco-flash-anim {
  0%   { box-shadow: 0 0 0 2px var(--primary, var(--sj-error)), 0 0 12px 3px rgba(var(--sj-error-rgb),0.35); outline-color: var(--primary, var(--sj-error)); }
  60%  { box-shadow: 0 0 0 3px var(--primary, var(--sj-error)), 0 0 20px 6px rgba(var(--sj-error-rgb),0.2); }
  100% { box-shadow: 0 0 0 2px transparent, 0 0 0 0 transparent; outline-color: transparent; }
}

.reco-flash {
  outline: 2px solid var(--primary, var(--sj-error));
  outline-offset: 2px;
  border-radius: var(--radius-md, 10px);
  animation: reco-flash-anim 2s ease-out forwards;
}

/* 响应式：<1100px 隐藏侧栏，恢复单栏 */
@media (max-width: 1099px) {
  #app {
    grid-template-columns: 1fr;
    gap: 0;
  }

  #messages {
    grid-column: 1 / -1;
  }

  #reco-sidebar {
    display: none;
  }
}

/* ═══ Detail Drawer — 右侧滑出抽屉 ═══ */
.detail-drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.detail-drawer-mask.open {
  opacity: 1;
  pointer-events: auto;
}
.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100vh;
  height: 100dvh;
  background: #fff;
  border-left: 1px solid var(--sj-line);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.10);
  z-index: 1101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.detail-drawer.open {
  transform: translateX(0);
}
    .detail-drawer-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 0 16px;
      height: 52px;
      min-height: 52px;
      background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
      color: #fff;
      flex-shrink: 0;
    }
.detail-drawer-title-text {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.detail-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
  padding: 0;
}
.detail-drawer-close:hover {
  background: rgba(255, 255, 255, 0.20);
}
.detail-drawer-close:active {
  background: rgba(255, 255, 255, 0.35);
}
.detail-drawer-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px 32px;
}
.detail-drawer-body .detail-bubble-title {
  display: none;
}
.major-row-clickable.expanded {
  background: #fecdd3 !important;
  box-shadow: inset 4px 0 0 var(--primary, var(--sj-red));
}
.major-row-clickable.expanded .major-name-link {
  font-weight: 700;
}
/* ── clarify 引导气泡 ─────────────────────────────────── */
.bubble-clarify {
  background: #FFFFFF;
  color: var(--text-main);
  line-height: 1.65;
  font-size: 0.9em;
}

/* ── chat 常识回答气泡 ────────────────────────────────── */
.bubble-chat-answer {
  background: var(--surface);
  color: var(--text-main);
  line-height: 1.7;
  font-size: 0.9em;
}

.bubble-chat-answer strong {
  color: var(--primary);
  font-weight: 600;
}

/* ── 深度思考分析气泡 ── */
.bubble-analysis {
  background: #FFFFFF;
  line-height: 1.75;
  font-size: 0.9em;
}
.bubble-analysis strong {
  color: var(--sj-red);
  font-weight: 600;
}
.analyze-badge {
  display: inline-flex;
  background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
  color: #fff;
  font-size: 0.72em;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

/* ── 深度思考 Tab 面板 ────────────────────────────────── */
.analysis-tabs {
  display: flex;
  gap: 6px;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}
.analysis-tab-btn {
  padding: 4px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--sj-red);
  background: transparent;
  color: var(--sj-red);
  font-size: 0.78em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  line-height: 1.6;
}
.analysis-tab-btn.active {
  background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
  color: #fff;
  border-color: transparent;
}
.analysis-tab-panel {
  display: none;
}
.analysis-tab-panel.active {
  display: block;
}

/* ── case 列表气泡容器 ────────────────────────────────── */
.bubble-case-list {
  background: var(--bg);
  padding: 4px 2px;
  font-size: 0.9em;
}

.case-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-tr { cursor: pointer; transition: background .15s; }
.case-tr:hover { background: rgba(var(--sj-red-rgb), 0.04); }
.case-toggle { display: inline-block; width: 14px; color: var(--sj-red); font-size: 11px; transition: transform .2s; }
.case-tr.case-open .case-toggle { transform: rotate(90deg); }
.case-detail-tr td { padding: 4px 16px 14px !important; }
.case-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 18px; background: linear-gradient(135deg, rgba(var(--sj-red-rgb),0.03), rgba(var(--sj-red-rgb),0.03)); border: 1px solid rgba(var(--sj-red-rgb),0.12); border-radius: 10px; padding: 12px 14px; margin: 4px 0 8px; }
.case-detail-item { display: flex; flex-direction: column; gap: 2px; }
.case-detail-label { font-size: 11px; color: var(--sj-ink3); }
.case-detail-value { font-size: 13px; color: var(--sj-ink1); font-weight: 500; }

.case-empty {
  color: var(--text-muted);
  font-size: 0.88em;
  text-align: center;
  padding: 12px 0;
  margin: 0;
}

/* ── 案例卡片 ─────────────────────────────────────────── */
.case-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.case-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* 同级别卡片：细虚线边框区分 */
.case-card-similar {
  border-style: dashed;
  border-color: #cbd5e1;
}

/* 同级别左上角小标签 */
.case-similar-tag {
  display: inline-block;
  background: var(--sj-side2);
  color: var(--text-sub);
  font-size: 0.75em;
  padding: 1px 6px;
  border-radius: 4px;
  margin-bottom: 5px;
  line-height: 1.6;
}

/* 卡片头部：院校名 + 右侧徽章+年份 */
.case-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.case-university {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.92em;
  flex: 1;
  white-space: normal;
  word-break: break-word;
}

.case-header-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

/* result 徽章通用 */
.case-badge {
  display: inline-block;
  font-size: 0.75em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.5;
  white-space: nowrap;
}

.case-badge-offer {
  background: #ecfdf5;
  color: #059669;
}

.case-badge-reject {
  background: var(--sj-error-light);
  color: var(--primary);
}

/* 年份小字 */
.case-year {
  font-size: 0.78em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 专业名：主色，单行截断 */
.case-major {
  color: var(--primary);
  font-size: 0.88em;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 信息行：本科、GPA、本科专业 */
.case-info {
  font-size: 0.8em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

/* ── case 表格模式（卡片列表替代方案） ─────────────────── */
.bubble-case-table {
  background: var(--surface);
  padding: 6px 7px;
  font-size: 0.9em;
  max-width: min(760px, 92%);
}

/* ===== 院校资讯（news）卡片 ===== */
.bubble-news-list {
  background: var(--surface);
  padding: 8px 10px;
  font-size: 0.9em;
  max-width: min(760px, 92%);
}

/* ── 勾选圈通用样式 ── */
.news-check, .case-check, .match-check {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 50%;
  border: 1.5px solid #d1d5db;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.news-check::after, .case-check::after, .match-check::after {
  content: '✓';
  font-size: 12px;
  color: transparent;
  line-height: 1;
  transition: color 0.18s;
}
.news-item.checked .news-check,
tr.case-tr.checked .case-check,
.match-school-row.checked .match-check {
  background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
  border-color: transparent;
  box-shadow: 0 1px 6px rgba(var(--sj-red-rgb), 0.35);
}
.news-item.checked .news-check::after,
tr.case-tr.checked .case-check::after,
.match-school-row.checked .match-check::after {
  color: #fff;
}
.news-item.checked {
  border-color: rgba(var(--sj-red-rgb), 0.55);
  background: linear-gradient(135deg, rgba(var(--sj-red-rgb), 0.06), rgba(var(--sj-ink-rgb), 0.08));
}
tr.case-tr.checked > td {
  background: rgba(var(--sj-red-rgb), 0.08);
}
.match-school-row.checked {
  background: linear-gradient(135deg, rgba(var(--sj-red-rgb), 0.10), rgba(var(--sj-ink-rgb), 0.12));
}
.case-check, .match-check {
  margin-right: 6px;
}

.news-chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.news-chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.news-chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-sub);
  font-size: 0.78em;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  line-height: 1.5;
}

.news-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(var(--sj-red-rgb),0.12);
}

.news-chip.active {
  background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px rgba(var(--sj-ink-rgb),0.30);
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.news-item:hover {
  border-color: rgba(var(--sj-red-rgb),0.45);
  box-shadow: var(--shadow-md);
}

.news-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.news-date-badge {
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 6px;
  padding: 2px 7px;
  font-weight: 600;
  white-space: nowrap;
}

.news-subtag {
  font-size: 11px;
  color: var(--sj-red);
  background: var(--sj-red-wash);
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
}

.news-uni {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-main);
}

.news-country {
  font-size: 11px;
  color: var(--text-muted);
}

/* mb49: 资讯标题行（生产 announcement API 提供 title） */
.news-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 7px;
  line-height: 1.5;
}

.news-content {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-top: 6px;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item.open .news-content {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.news-expand-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

.news-expand-hint::after {
  content: '展开全文 ▾';
}

.news-item.open .news-expand-hint::after {
  content: '收起 ▴';
}

.case-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.case-filter-chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-sub);
  font-size: 0.78em;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  line-height: 1.5;
}

.case-filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.case-filter-chip {
  transition: all 0.18s ease;
}
.case-filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(var(--sj-red-rgb),0.12);
}
    .case-filter-chip.active {
      background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
      border-color: transparent;
      color: #fff;
      box-shadow: 0 2px 10px rgba(var(--sj-ink-rgb),0.30);
    }

.case-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.case-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.84em;
}

    .case-table thead tr {
      background: linear-gradient(135deg, var(--sj-red) 0%, var(--sj-red-h) 100%);
    }
    .case-table th {
      text-align: left;
      font-weight: 700;
      color: #fff;
      font-size: 0.88em;
      padding: 6px 8px;
      border-bottom: none;
      white-space: nowrap;
      position: relative;
    }

.case-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.case-table tbody tr:last-child td {
  border-bottom: none;
}

    .case-table tbody tr:hover td {
      background: rgba(var(--sj-ink-rgb),0.05);
    }

.case-row-similar td {
  background: var(--sj-bg);
}

.case-table .td-school {
  font-weight: 600;
  color: var(--text-main);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

.case-table .td-major {
  max-width: 175px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

.case-table .td-info {
  color: var(--text-muted);
  font-size: 0.92em;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

.case-table .td-year {
  color: var(--text-muted);
}

.case-similar-tag-inline {
  display: inline-block;
  background: var(--sj-side2);
  color: var(--text-sub);
  font-size: 0.72em;
  padding: 0 5px;
  border-radius: 4px;
  margin-right: 4px;
  line-height: 1.7;
  vertical-align: middle;
}

.case-major-link {
  color: var(--primary);
  cursor: pointer;
  border-bottom: 1px dashed rgba(var(--sj-red-rgb), 0.45);
}

.case-major-link:hover {
  border-bottom-style: solid;
}

/* ── 会话管理：header按钮 + 左侧抽屉 ──────────────────── */
.header-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.header-btn {
    border: none;
    background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
    color: #fff;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.18s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(var(--sj-ink-rgb),0.25);
  }
  .header-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--sj-ink-rgb),0.35);
  }
  /* ===== 顶栏导航 ===== */
  .header-nav {
    margin-left: auto;
    order: 9;
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
  }
  .nav-tab {
    background: #fff;
    border: 1px solid var(--sj-line);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 400;
    color: var(--sj-ink1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-family: inherit;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    white-space: nowrap;
  }
  .nav-tab-ico {
    font-size: 15px;
    color: var(--sj-red);
    filter: grayscale(0.3);
  }
  .nav-tab:hover {
    background: #F7F7F7;
    color: var(--sj-ink1);
  }

  /* ===== mb24: 手机端板块切换按钮与底部面板 ===== */
  #section-switch-btn {
    display: none;
    align-items: center;
    gap: 5px;
    background: #fff;
    border: 1px solid var(--sj-line);
    color: var(--sj-ink1);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(31,42,48,0.06);
    transition: all 0.18s ease;
  }
  #section-switch-btn:active { transform: scale(0.96); }
  #section-switch-ico { font-size: 15px; }
  .section-switch-arrow { font-size: 11px; opacity: 0.7; }

  .section-sheet-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1180;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .section-sheet-mask.open { opacity: 1; pointer-events: auto; }

  .section-sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 105%);
    width: min(520px, 100vw);
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.18);
    z-index: 1190;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 78vh;
  }
  .section-sheet.open { transform: translate(-50%, 0); }
  .section-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .section-sheet-title { font-size: 15px; font-weight: 700; color: var(--sj-ink1); }
  .section-sheet-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--sj-side2);
    color: var(--sj-ink2);
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
  }
  .section-sheet-close:hover { background: var(--sj-line); }
  .section-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1.5px solid var(--sj-line);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.16s ease;
    text-align: left;
    font-family: inherit;
    width: 100%;
  }
  .section-card:hover { border-color: rgba(var(--sj-red-rgb),0.45); background: #faf8ff; }
  .section-card.active { border-color: var(--sj-red); background: rgba(var(--sj-red-rgb),0.06); }
  .section-card-ico {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(var(--sj-red-rgb),0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
  }
  .section-card.active .section-card-ico { background: rgba(var(--sj-red-rgb),0.18); }
  .section-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .section-card-name { font-size: 14.5px; font-weight: 700; color: var(--sj-ink1); display: flex; align-items: center; gap: 6px; }
  .section-card-check { color: var(--sj-red); font-size: 12px; font-weight: 700; }
  .section-card-desc { font-size: 12px; color: var(--sj-ink2); line-height: 1.45; }
  .section-card-last {
    font-size: 11px;
    color: var(--sj-ink3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 当前选中的导航tab高亮样式 */
  .nav-tab.active {
    background: var(--sj-blue);
    color: #fff;
    font-weight: 500;
    border-color: transparent;
  }

  /* markdown标题行（### 等）渲染样式 */
  .bubble-ai .md-h {
    display: block;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--sj-ink1);
    margin: 10px 0 4px;
  }
  /* 标题作为气泡首个元素时去掉上边距 */
  .bubble-ai .md-h:first-child {
    margin-top: 0;
  }

  /* markdown列表行（- 或 * 开头）渲染样式 */
  .bubble-ai .md-li {
    display: block;
    margin: 2px 0 2px 4px;
    padding-left: 12px;
    position: relative;
  }
  /* 列表项前的紫色圆点符号 */
  .bubble-ai .md-li::before {
    content: '•';
    position: absolute;
    left: 2px;
    color: var(--sj-red);
  }

  /* 板块切换提示气泡：浅色小字风格 */
  .bubble-ai.bubble-section-hint {
    font-size: 13px;
    color: var(--sj-ink2);
    background: #FFFFFF;
  }
  .header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sj-blue);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 6px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(31,42,48,0.18);
  }
  /* ===== 输入区工具 ===== */
  .input-star {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--sj-red-wash);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--sj-red);
    flex-shrink: 0;
    align-self: center;
    margin-right: 2px;
  }
  .input-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 14px;
    padding-left: 4px;
    flex-wrap: wrap;
  }
  .input-tool {
    background: #fff;
    border: 1px solid var(--sj-line);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    color: var(--sj-ink2);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    white-space: nowrap;
  }
  .input-tool:hover {
    background: rgba(var(--sj-red-rgb),0.06);
    border-color: rgba(var(--sj-red-rgb),0.35);
  }
  .input-tool.active {
    background: rgba(var(--sj-red-rgb),0.10);
    border-color: rgba(var(--sj-red-rgb),0.45);
    color: var(--sj-red-d);
    font-weight: 500;
  }
  /* mb41: 深度思考模型选择器（🧠开启时显示） */
  .model-picker { position: relative; display: none; }
  .model-picker.visible { display: block; }
  .model-picker-btn {
    background: #fff;
    border: 1px solid var(--sj-line);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    color: var(--sj-red-d);
    cursor: pointer;
    display: flex; align-items: center; gap: 4px;
    font-family: inherit;
    font-weight: 600;
    transition: background 0.18s, border-color 0.18s;
    white-space: nowrap;
  }
  .model-picker-btn:hover { background: rgba(var(--sj-red-rgb),0.06); border-color: rgba(var(--sj-red-rgb),0.45); }
  .model-caret { font-size: 10px; opacity: 0.7; }
  .model-menu {
    position: absolute; bottom: calc(100% + 6px); left: 0;
    background: #fff;
    border: 1px solid rgba(var(--sj-red-rgb),0.18);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(var(--sj-red-rgb),0.16);
    padding: 6px; min-width: 150px; z-index: 60;
    display: none; flex-direction: column; gap: 2px;
  }
  .model-menu.open { display: flex; }
  .model-opt {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: transparent; border: none; border-radius: 8px;
    padding: 8px 10px; font-size: 12.5px; color: var(--sj-ink2);
    cursor: pointer; font-family: inherit; text-align: left; width: 100%;
  }
  .model-opt:hover { background: rgba(var(--sj-red-rgb),0.06); }
  .model-opt.active { color: var(--sj-red-d); font-weight: 600; background: rgba(var(--sj-red-rgb),0.08); }
  .model-opt.active::before { content: '✓ '; font-size: 11px; }
  .model-tag { font-size: 10.5px; color: var(--sj-ink3); font-weight: 400; }

/* D1: 左侧把手 */
#conv-handle {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 120px;
  z-index: 1205;
  background: linear-gradient(180deg, rgba(var(--sj-red-rgb),0.18) 0%, rgba(var(--sj-ink-rgb),0.15) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.50);
  border-left: none;
  border-radius: 0 14px 14px 0;
  box-shadow: 2px 0 18px rgba(var(--sj-ink-rgb),0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s, width 0.2s;
  user-select: none;
}
#conv-handle:hover {
  background: linear-gradient(180deg, rgba(var(--sj-red-rgb),0.28) 0%, rgba(var(--sj-ink-rgb),0.24) 100%);
  box-shadow: 3px 0 24px rgba(var(--sj-ink-rgb),0.28);
  width: 34px;
}
.conv-handle-text {
  writing-mode: vertical-rl;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 2px;
  line-height: 1;
}
.conv-handle-badge {
  background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 1px 4px rgba(var(--sj-ink-rgb),0.35);
}

/* D4: mask不再需要遮挡视线，改为透明不可点击 */
.conv-drawer-mask {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.conv-drawer-mask.open {
  opacity: 1;
  pointer-events: auto;
}

/* D2+D5: 会话抽屉玻璃拟态升级 */
.conv-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(300px, 85vw);
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(var(--sj-ink-rgb),0.14);
  z-index: 1201;
  box-shadow: 4px 0 32px rgba(var(--sj-ink-rgb),0.12), 2px 0 8px rgba(var(--sj-red-rgb),0.06);
  transform: translateX(-100%);
  transition: transform 0.26s cubic-bezier(0.22,1,0.36,1);
  display: flex;
  flex-direction: column;
}
.conv-drawer.open {
  transform: translateX(0);
}

.conv-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
}

.conv-drawer-close {
  border: none;
  background: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
}

.conv-drawer-close:hover {
  color: var(--primary);
}

.conv-new-btn {
  margin: 10px 12px;
  padding: 8px;
  border-radius: 8px;
  border: 1px dashed var(--primary);
    background: linear-gradient(135deg, var(--sj-red), var(--sj-red-h));
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    border: none;
    border-radius: 20px;
  }

  .conv-new-btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 2px 10px rgba(var(--sj-ink-rgb),0.30);
  }

.conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 12px;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.18s ease, box-shadow 0.18s;
  position: relative;
}
.conv-item:hover {
  background: #F7F7F7;
}
.conv-item.active {
  background: #EFEFEF;
}

.conv-item-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-item.active .conv-item-title {
  color: var(--sj-ink1);
  font-weight: 400;
}

.conv-item-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.conv-item:hover .conv-item-time {
  opacity: 0;
}

.conv-item-del {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.conv-item-rename {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  position: absolute;
  right: 34px;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.conv-item:hover .conv-item-del,
.conv-item:hover .conv-item-rename {
  opacity: 1;
}
.conv-item-del:hover {
  color: var(--sj-error);
  background: var(--sj-error-light);
}
.conv-item-rename:hover {
  color: var(--sj-red-d);
  background: var(--sj-red-wash);
}
/* C2: 改名input */
.conv-rename-input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-main);
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 2px 6px;
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(var(--sj-red-rgb),0.12);
}
/* D3: 抽屉收起按钮 */
.conv-drawer-collapse {
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 48px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(var(--sj-red-rgb),0.15);
  border-left: none;
  border-radius: 0 10px 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--primary);
  box-shadow: 3px 0 10px rgba(var(--sj-red-rgb),0.08);
  transition: background 0.15s;
  z-index: 1;
}
.conv-drawer-collapse:hover {
  background: var(--sj-red-wash);
}
/* ===== 新PC侧边栏 ===== */
    #side-nav {
      width: 256px;
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      background: var(--sj-side);
      border-right: none;
      position: relative;
      z-index: 100;
    }
    @media (max-width: 899px) {
      #side-nav { display: none !important; }
      /* 移动端隐藏顶栏导航标签，头像通过 margin-left:auto 保持贴右 */
      .header-nav { display: none !important; }
      /* mb24: 手机端显示板块切换按钮，隐藏副标题省出空间 */
      #section-switch-btn { display: inline-flex; }
      .header-text p { display: none; }
      .header-avatar { margin-left: auto; }
    }
    .side-brand {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 18px 16px 14px;
    }
    .side-brand-logo {
      width: 36px;
      height: 36px;
      background: var(--sj-blue);
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      line-height: 1;
      color: #fff;
      flex-shrink: 0;
      box-shadow: 0 1px 3px rgba(31,42,48,0.20);
    }
    .side-brand-text {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .side-brand-text strong {
      font-size: 15px;
      font-weight: 600;
      color: var(--sj-ink1);
      display: flex;
      align-items: center;
      gap: 4px;
      line-height: 1.3;
    }
    .side-brand-text strong em {
      font-style: normal;
      font-size: 11px;
      font-weight: 600;
      color: var(--sj-red-d);
      background: var(--sj-red-wash);
      border-radius: 4px;
      padding: 1px 5px;
      line-height: 1.4;
    }
    .side-brand-text span {
      font-size: 12px;
      color: var(--sj-ink3);
      line-height: 1.4;
    }
    
    .side-new-btn {
      margin: 8px 12px 10px;
      padding: 9px;
      border-radius: 999px;
      background: #fff;
      border: 1px solid var(--sj-line);
      color: var(--sj-ink1);
      font-size: 13px;
      font-weight: 400;
      cursor: pointer;
      text-align: center;
      transition: background 0.18s, box-shadow 0.18s;
      font-family: inherit;
      box-shadow: 0 1px 2px rgba(31,42,48,0.04);
    }
    .side-new-btn:hover {
      background: #F7F7F7;
      box-shadow: 0 1px 2px rgba(31,42,48,0.06);
    }
    .side-new-btn .sn-plus { transition: color 0.15s; }
    .side-new-btn:hover .sn-plus { color: #386875; }
    .side-new-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(47,102,117,0.22); }
    .side-conv-list {
      flex: 1;
      overflow-y: auto;
      padding: 2px 8px 10px;
    }
    .side-conv-list::-webkit-scrollbar { width: 4px; }
    .side-conv-list::-webkit-scrollbar-thumb { background: rgba(var(--sj-ink-rgb),0.18); border-radius: 4px; }
    .conv-group-label {
      font-size: 11px;
      font-weight: 600;
      color: var(--sj-ink3);
      padding: 10px 8px 4px;
      letter-spacing: 1px;
      text-transform: uppercase;
    }
    .conv-item-ico {
      font-size: 14px;
      color: #8C8C8C;
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      line-height: 1;
    }
    .side-foot {
      padding: 10px 12px;
    }
    .side-foot-item {
      width: 100%;
      background: transparent;
      border: none;
      padding: 7px 8px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--sj-ink2);
      cursor: pointer;
      text-align: left;
      font-family: inherit;
      transition: background 0.18s;
    }
    .side-foot-item:hover {
      background: #EFEFEF;
      color: var(--sj-ink1);
    }
    /* ===== Toast提示 ===== */
    .app-toast {
      position: fixed;
      top: 24px;
      left: 50%;
      transform: translateX(-50%) translateY(-8px);
      z-index: 3000;
      background: #fff;
      border: 1px solid rgba(var(--sj-red-rgb),0.30);
      border-radius: 999px;
      padding: 8px 20px;
      font-size: 13px;
      font-weight: 500;
      color: var(--sj-red);
      box-shadow: 0 4px 24px rgba(var(--sj-ink-rgb),0.18);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.22s ease, transform 0.22s ease;
      white-space: nowrap;
    }
    .app-toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
.conv-item {
  position: relative;
}

.conv-empty-tip {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 20px 0;
  margin: 0;
}

/* ===== mb24g 案例详情 Modal ===== */
#case-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  align-items: flex-end;
  justify-content: center;
}
#case-modal-overlay.open {
  display: flex;
}
#case-modal-box {
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#case-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
#case-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: #111;
}
#case-modal-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: #f2f2f2;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #555;
}
#case-modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 12px 16px 24px;
}
.case-modal-row {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
}
.case-modal-row:last-child { border-bottom: none; }
.case-modal-label {
  font-size: 11px;
  color: #999;
  margin-bottom: 3px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.case-modal-value {
  font-size: 14px;
  color: #222;
  line-height: 1.5;
  word-break: break-word;
}

/* ===== mb29 结果大页面浏览 Modal ===== */
/* ===== mb55: 今日更新简报弹窗 ===== */
#brief-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 950;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
#brief-modal-overlay.open { display: flex; }
#brief-modal-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 860px;
  height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
#brief-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
#brief-modal-title { font-size: 15px; font-weight: 600; color: #111; }
#brief-modal-close {
  width: 30px; height: 30px; border-radius: 50%; border: none; background: #f2f2f2;
  font-size: 16px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; color: #555; flex-shrink: 0; margin-left: 12px;
}
#brief-modal-body { overflow-y: auto; flex: 1; padding: 16px 18px 28px; }
.brief-loading { text-align: center; color: #8C8C8C; padding: 40px 0; font-size: 14px; }
.brief-cards { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.brief-card { flex: 1; min-width: 96px; background: #fafafa; border: 1px solid #f0f0f0; border-radius: 12px; padding: 12px 8px; text-align: center; }
.brief-num { font-size: 20px; font-weight: 700; color: #111; }
.brief-num span { font-size: 13px; font-weight: 600; }
.brief-up { color: #16a34a; }
.brief-down { color: #dc2626; }
.brief-chg { color: #c2410c; }
.brief-flat { color: #8C8C8C; }
.brief-lab { font-size: 11px; color: #8C8C8C; margin-top: 2px; }
.brief-sec { background: #fafafa; border: 1px solid #f0f0f0; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.brief-sec-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: #111; }
.brief-badge { font-size: 11px; font-weight: 400; background: rgba(var(--sj-red-rgb),0.08); color: var(--sj-red); border-radius: 10px; padding: 2px 10px; margin-left: 6px; }
.brief-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.brief-table th { background: #fff; text-align: left; padding: 6px 10px; color: #8C8C8C; font-weight: 500; white-space: nowrap; border-bottom: 1px solid #f0f0f0; }
.brief-table td { padding: 7px 10px; border-bottom: 1px solid #f5f5f5; vertical-align: top; }
.brief-mname { font-weight: 600; color: #1f2937; }
.brief-uni { color: #6b7280; }
.brief-qs { color: var(--sj-red); font-weight: 600; white-space: nowrap; }
.brief-chgtag { display: inline-block; background: #fff7ed; color: #c2410c; border-radius: 6px; padding: 1px 8px; font-size: 11.5px; margin: 1px 3px 1px 0; }
.brief-arrow { color: #8C8C8C; margin: 0 2px; }
.brief-empty { color: #8C8C8C; text-align: center; padding: 14px 0; font-size: 12.5px; }
.brief-foot { color: #8C8C8C; font-size: 11.5px; text-align: center; padding: 4px 0 8px; }
.brief-range { font-size: 12px; color: #8C8C8C; margin-bottom: 12px; }
.brief-base-card { text-align: center; padding: 22px 12px 18px; background: rgba(var(--sj-red-rgb),0.05); border-radius: 12px; margin-bottom: 14px; }
.brief-base-ico { font-size: 30px; }
.brief-base-title { font-size: 15px; font-weight: 700; margin-top: 6px; color: #111; }
.brief-base-sub { font-size: 12px; color: #6b7280; margin-top: 6px; line-height: 1.7; }
#result-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 900;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
#result-modal-overlay.open {
  display: flex;
}
#result-modal-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
#result-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
#result-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#result-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #f2f2f2;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  flex-shrink: 0;
  margin-left: 12px;
}
#result-modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 14px 18px 28px;
}
.result-modal-uni {
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
/* mb43: 案例列表入口卡片（点击在大页面弹窗展开） */
/* mb73: 筛选结果纯文字清单 */
.text-list-block {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
  max-height: 360px;
  overflow-y: auto;
  color: #384f58;
  background: #ffffff;
  border: 1px solid rgba(92, 120, 131, 0.16);
  border-radius: 10px;
  padding: 12px 13px;
  box-sizing: border-box;
  word-break: break-word;
}
.text-list-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 9px;
  padding: 6px 11px;
  border: 1px solid rgba(92, 120, 131, 0.34);
  border-radius: 8px;
  background: #ffffff;
  color: #8C8C8C;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.text-list-copy-btn:hover {
  background: #F7F7F7;
  border-color: rgba(92, 120, 131, 0.58);
}
.text-list-copy-btn:active {
  background: #e9f1f3;
}

/* mb73b: 清单入口按钮 */
.text-list-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid rgba(92, 120, 131, 0.22);
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.text-list-entry:hover { background: #F7F7F7; border-color: rgba(92, 120, 131, 0.45); }
.text-list-entry-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #F7F7F7;
  font-size: 15px;
  flex-shrink: 0;
}
.text-list-entry-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.text-list-entry-main strong { font-size: 13px; color: #384f58; font-weight: 600; }
.text-list-entry-main em { font-size: 11px; color: #8aa3ad; font-style: normal; }
.text-list-entry-arrow { margin-left: auto; color: #8aa3ad; font-size: 16px; }

/* mb73b: 清单模态弹窗 */
#text-list-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(24, 38, 45, 0.45);
  z-index: 1300;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#text-list-modal-overlay.open { display: flex; }
#text-list-modal-box {
  background: #ffffff;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 50px rgba(24, 38, 45, 0.22);
  overflow: hidden;
}
#text-list-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(92, 120, 131, 0.14);
}
#text-list-modal-header .tlm-title { font-size: 14px; font-weight: 600; color: #384f58; }
#text-list-modal-close {
  border: none;
  background: none;
  font-size: 16px;
  color: #8aa3ad;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
#text-list-modal-close:hover { background: #F7F7F7; }
#text-list-modal-body { padding: 13px 16px; overflow-y: auto; }
#text-list-modal-foot {
  display: flex;
  justify-content: center;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(92, 120, 131, 0.14);
}

.case-modal-entry {
  display: flex; align-items: flex-start; gap: 10px;
  background: #F7F7F7;
  border: 1px solid #F7F7F7;
  border-radius: 12px; padding: 11px 14px;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  width: 100%;
  box-sizing: border-box;
}
.case-modal-entry:hover {
  border-color: #E1EAEC;
  box-shadow: 0 2px 8px rgba(31,42,48,0.05);
}
.case-modal-ico { font-size: 20px; line-height: 1; flex: none; margin-top: 4px; }
.case-modal-main { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.case-modal-main strong { font-size: 16px; font-weight: 600; color: #121318; line-height: 1.35; }
.case-modal-main em { font-size: 12.5px; color: #91A3AC; font-style: normal; line-height: 1.5; }
.case-modal-arrow { font-size: 13px; color: #91A3AC; flex: none; margin-top: 5px; }
/* mb69: 入口卡辅助信息分段样式 */
.case-entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.case-entry-meta .meta-sep { color: #C3CFD4; font-size: 11px; }
.case-entry-meta .meta-filter { color: #4E8DB4; background: rgba(78,141,180,0.09); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.case-entry-meta .meta-poster { color: #A8B7BF; }
.case-entry-meta .meta-link { color: #4A6572; font-weight: 600; margin-left: auto; font-size: 12.5px; white-space: nowrap; }
.result-modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid #e8e0e8;
  border-radius: 999px;
  background: #fff;
  color: var(--sj-red);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.result-modal-btn:hover {
  background: #fff0f6;
  border-color: var(--sj-red);
}
.case-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 13px;
  color: #aaa;
  line-height: 1;
  vertical-align: middle;
  transition: color 0.15s;
}
.case-expand-btn:hover { color: #333; }

/* ═══ mb92：折叠块对齐附件（reply-result-actions / fold-toggle）═══ */
.fold-hidden { display: none !important; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; min-height: 36px; padding: 0 16px;
  border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-default {
  border: 1px solid var(--border-color, #efefef);
  background: var(--bg-color, #fff);
  color: var(--text-gray-90, #222);
}
.btn-default:hover {
  border-color: var(--brand-color-50, #c63e46);
  color: var(--brand-color-50, #c63e46);
  background: var(--brand-color-10, #fff2f1);
}
.reply-result-actions {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px; margin-top: 4px;
  background: transparent; box-shadow: none; border: none; padding: 0;
}
.reply-result-actions > :only-child { grid-column: 1 / -1; }
.reply-result-actions .reply-fold-toggle,
.reply-result-actions .reply-full-toggle {
  position: relative; min-width: 0; min-height: 36px;
  padding-inline: 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
}
.reply-result-actions .reply-fold-toggle svg,
.reply-result-actions .reply-full-toggle svg {
  width: 16px; height: 16px; flex: none;
  transition: transform .15s ease;
}
.reply-result-actions .reply-fold-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
