/* ============================================================
   SeekYard 设计系统 · 极简学术与现代交互风
   tokens → 排版 → 品牌 Hero → 专栏卡片 → listing 微调 → 响应式
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800&family=Noto+Sans+SC:wght@400;500;600;700&family=Noto+Serif+SC:wght@600;700;900&display=swap');

/* ---------- 设计 token ---------- */
:root {
  --sy-ink: #0f172a;
  --sy-ink-secondary: #334155;
  --sy-muted: #64748b;
  --sy-line: #e2e8f0;
  --sy-line-soft: #edf2f7;
  --sy-bg-soft: #f8fafc;
  --sy-bg-card: #ffffff;
  --sy-bg-hero: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  --sy-accent: #2563eb;
  --sy-accent-light: #eff6ff;

  /* 专栏色锚点 */
  --sy-navy: #1e3a8a;   /* micro */
  --sy-navy-soft: #eff6ff;
  --sy-ochre: #c2410c;  /* policy */
  --sy-ochre-soft: #fff7ed;
  --sy-violet: #7c3aed; /* ai-workflows */
  --sy-violet-soft: #f5f3ff;
  --sy-amber: #b45309;  /* invest */
  --sy-amber-soft: #fffbeb;

  /* 字体栈 */
  --sy-brand-font: "Cinzel", "Noto Serif SC", Georgia, serif;
  --sy-serif: "Noto Serif SC", Georgia, "Songti SC", "STSong", serif;
  --sy-sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --sy-mono: "Cascadia Mono", Consolas, "JetBrains Mono", "Courier New", monospace;

  --sy-radius-sm: 8px;
  --sy-radius: 14px;
  --sy-radius-lg: 20px;
  --sy-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --sy-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --sy-shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.1), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
}

[data-bs-theme="dark"],
body.quarto-dark {
  --sy-ink: #f1f5f9;
  --sy-ink-secondary: #cbd5e1;
  --sy-muted: #94a3b8;
  --sy-line: #1e293b;
  --sy-line-soft: #162032;
  --sy-bg-soft: #0f172a;
  --sy-bg-card: #131d31;
  --sy-bg-hero: linear-gradient(135deg, #0b1120 0%, #0f172a 60%, #172554 100%);
  --sy-accent: #38bdf8;
  --sy-accent-light: #0c2d48;

  --sy-navy-soft: #172554;
  --sy-ochre-soft: #431407;
  --sy-violet-soft: #2e1065;
  --sy-amber-soft: #451a03;

  --sy-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --sy-shadow: 0 6px 20px -2px rgba(0, 0, 0, 0.45);
  --sy-shadow-lg: 0 16px 36px -4px rgba(0, 0, 0, 0.6);
}

/* ---------- 基础排版 ---------- */
body {
  font-family: var(--sy-sans);
  line-height: 1.8;
  color: var(--sy-ink);
  background-color: var(--sy-bg-soft);
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, h6,
.quarto-title-banner h1,
.quarto-title-banner .title,
.title.h1 {
  font-family: var(--sy-serif);
  letter-spacing: -0.015em;
  color: var(--sy-ink);
}

code, pre, kbd {
  font-family: var(--sy-mono);
}

/* ============================================================
   置顶公告条 · 极简测试提示 (Announcement Bar)
   ============================================================ */
#quarto-announcement {
  margin: 0;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(217, 119, 6, 0.22);
  background: linear-gradient(90deg, #fffdf5 0%, #fef9e7 50%, #fffdf5 100%);
  color: #92400e;
  padding: 7px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  z-index: 1060;
  position: relative;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

[data-bs-theme="dark"] #quarto-announcement,
body.quarto-dark #quarto-announcement {
  background: linear-gradient(90deg, #14120e 0%, #201a11 50%, #14120e 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  color: #fef08a;
}

#quarto-announcement.hidden {
  display: none !important;
}

.quarto-announcement-icon {
  color: #d97706;
  margin-right: 8px;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  animation: sy-pulse-icon 2.5s ease-in-out infinite;
}

[data-bs-theme="dark"] .quarto-announcement-icon,
body.quarto-dark .quarto-announcement-icon {
  color: #fbbf24;
}

@keyframes sy-pulse-icon {
  0%, 100% {
    opacity: 0.75;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.45));
  }
}

.quarto-announcement-content {
  display: inline-block;
}

.quarto-announcement-content p {
  margin: 0;
  display: inline;
}

.quarto-announcement-content strong {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.quarto-announcement-action {
  margin-left: 14px;
  cursor: pointer;
  opacity: 0.5;
  font-size: 0.75rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.quarto-announcement-action:hover {
  opacity: 1;
  transform: scale(1.15);
  background-color: rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .quarto-announcement-action:hover,
body.quarto-dark .quarto-announcement-action:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  #quarto-announcement {
    justify-content: flex-start;
    text-align: left;
    padding: 6px 36px 6px 14px;
    font-size: 0.75rem;
  }
  .quarto-announcement-action {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
  }
  .quarto-announcement-action:hover {
    transform: translateY(-50%) scale(1.15);
  }
}

/* ---------- 导航栏优化 ---------- */
.navbar-brand {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-family: var(--sy-serif) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
}

.navbar-brand img {
  height: 28px !important;
  width: 28px !important;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.navbar-brand:hover img {
  transform: rotate(6deg) scale(1.08);
}

/* ---------- 首页容器（page-layout: full） ---------- */
.home-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

/* ============================================================
   全新的视觉品牌 Hero 区域
   ============================================================ */
.hero-section {
  position: relative;
  border-radius: var(--sy-radius-lg);
  border: 1px solid var(--sy-line);
  background: var(--sy-bg-card);
  padding: 56px 48px 48px;
  margin-bottom: 38px;
  overflow: hidden;
  box-shadow: var(--sy-shadow);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.hero-content {
  flex: 1 1 60%;
  max-width: 620px;
}

/* 求索徽标 Pill */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  background: var(--sy-bg-soft);
  border: 1px solid var(--sy-line);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sy-muted);
  letter-spacing: 0.05em;
  margin-bottom: 20px;
  box-shadow: var(--sy-shadow-sm);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
  animation: sy-pulse 2s infinite ease-in-out;
}

@keyframes sy-pulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* 品牌大标题 */
.hero-brand-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 0 0 16px;
  line-height: 1.15;
}

.hero-brand-title .title-en {
  font-family: var(--sy-brand-font);
  font-size: clamp(2.5rem, 5.5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--sy-ink) 0%, var(--sy-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-brand-title .title-divider {
  font-family: var(--sy-sans);
  font-size: 2rem;
  color: var(--sy-muted);
  opacity: 0.35;
  font-weight: 300;
}

.hero-brand-title .title-cn {
  font-family: var(--sy-serif);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--sy-ink);
}

/* 极简学术方向标签流（替代大段介绍文字） */
.hero-tagline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 1.05rem;
  color: var(--sy-ink-secondary);
  margin-bottom: 28px;
  font-weight: 500;
}

.hero-tagline .tag-item {
  color: var(--sy-muted);
  transition: color 0.15s ease;
}

.hero-tagline .tag-item:hover {
  color: var(--sy-accent);
}

.hero-tagline .tag-sep {
  color: var(--sy-line);
  font-weight: 700;
}

[data-bs-theme="dark"] .hero-tagline .tag-sep {
  color: #334155;
}

/* 按钮组 */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-hero-primary {
  background: var(--sy-ink);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

[data-bs-theme="dark"] .btn-hero-primary,
body.quarto-dark .btn-hero-primary {
  background: #38bdf8;
  color: #0b1120 !important;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
}

.btn-hero-primary:hover {
  background: var(--sy-accent);
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

[data-bs-theme="dark"] .btn-hero-primary:hover,
body.quarto-dark .btn-hero-primary:hover {
  background: #7dd3fc;
  color: #0b1120 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.4);
}

.btn-hero-ghost {
  background: var(--sy-bg-card);
  color: var(--sy-ink) !important;
  border: 1px solid var(--sy-line);
}

.btn-hero-ghost:hover {
  background: var(--sy-bg-soft);
  color: var(--sy-accent) !important;
  border-color: var(--sy-accent);
  transform: translateY(-2px);
}

.btn-hero .btn-icon {
  transition: transform 0.2s ease;
}

.btn-hero:hover .btn-icon {
  transform: translateY(2px);
}

.btn-hero-ghost:hover .btn-icon {
  transform: translateX(3px);
}

/* Hero 右侧 Logo 徽章展示 */
.hero-emblem-container {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.hero-emblem-glow {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.2) 0%, rgba(245, 158, 11, 0.08) 50%, transparent 70%);
  filter: blur(28px);
  pointer-events: none;
  z-index: 1;
}

.hero-emblem-img {
  position: relative;
  z-index: 2;
  width: 200px;
  height: 200px;
  filter: drop-shadow(0 12px 28px rgba(15, 23, 42, 0.18));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
}

.hero-emblem-container:hover .hero-emblem-img {
  transform: scale(1.05) rotate(-1.5deg);
  filter: drop-shadow(0 18px 36px rgba(37, 99, 235, 0.25));
}

/* ---------- 首页小节标题 ---------- */
h2.home-h2 {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 40px 0 22px;
  color: var(--sy-ink);
}

h2.home-h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--sy-line) 0%, transparent 100%);
}

/* ============================================================
   四大专栏卡片 (Portal Grid)
   ============================================================ */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 6px 0 44px;
}

.portal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--sy-line);
  border-radius: var(--sy-radius);
  background: var(--sy-bg-card);
  padding: 24px 22px 20px;
  overflow: hidden;
  box-shadow: var(--sy-shadow-sm);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease;
}

/* 全卡片整块可点击热区 */
.card-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.portal-card h3,
.portal-card .card-top-row,
.portal-card .card-footer-row,
.portal-card p {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.portal-card h3 a,
.portal-card .card-footer-row a {
  pointer-events: auto;
}

.portal-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--card-accent, var(--sy-accent));
  transition: width 0.2s ease;
}

.portal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sy-shadow-lg);
  border-color: var(--card-accent, var(--sy-accent));
}

.portal-card:hover::before {
  width: 6px;
}

/* 卡片顶部 Row */
.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.portal-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--sy-radius-sm);
  background: var(--card-soft-bg, var(--sy-accent-light));
  color: var(--card-accent, var(--sy-accent));
  transition: transform 0.2s ease;
}

.portal-card:hover .portal-icon-box {
  transform: scale(1.08);
}

.card-tag {
  font-family: var(--sy-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--card-accent, var(--sy-muted));
  background: var(--card-soft-bg, var(--sy-bg-soft));
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--sy-line);
}

.portal-card h3 {
  font-family: var(--sy-sans);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.35;
}

.portal-card h3 a {
  text-decoration: none;
  color: var(--sy-ink);
  transition: color 0.15s ease;
}

.portal-card:hover h3 a {
  color: var(--card-accent, var(--sy-accent));
}

.portal-card p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--sy-muted);
  margin: 0 0 20px;
  flex: 1 1 auto;
}

/* 卡片底部 Row */
.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px dashed var(--sy-line);
  font-size: 0.82rem;
}

.card-meta {
  color: var(--sy-muted);
  font-weight: 500;
}

.card-arrow {
  color: var(--card-accent, var(--sy-accent));
  font-weight: 600;
  transition: transform 0.2s ease;
}

.portal-card:hover .card-arrow {
  transform: translateX(4px);
}

/* 四大专栏主题色 */
.card-micro {
  --card-accent: var(--sy-navy);
  --card-soft-bg: var(--sy-navy-soft);
}
.card-policy {
  --card-accent: var(--sy-ochre);
  --card-soft-bg: var(--sy-ochre-soft);
}
.card-ai {
  --card-accent: var(--sy-violet);
  --card-soft-bg: var(--sy-violet-soft);
}
.card-invest {
  --card-accent: var(--sy-amber);
  --card-soft-bg: var(--sy-amber-soft);
}

/* ============================================================
   Listing 文章列表微调
   ============================================================ */
.quarto-listing-container.quarto-listing-container-default {
  margin-top: 12px;
}

.quarto-listing-container-default .quarto-post .thumbnail {
  display: none;
}

.quarto-listing-container-default .quarto-post {
  border: 1px solid var(--sy-line);
  border-left: 3.5px solid var(--sy-navy);
  border-radius: var(--sy-radius-sm);
  background: var(--sy-bg-card);
  padding: 10px 16px;
  margin-bottom: 8px;
  box-shadow: var(--sy-shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.quarto-listing-container-default .quarto-post:hover {
  transform: translateX(3px);
  border-color: var(--sy-navy);
  box-shadow: var(--sy-shadow);
}

.quarto-listing-container-default .quarto-post .listing-title {
  font-family: var(--sy-sans);
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 2px;
  line-height: 1.35;
}

.quarto-listing-container-default .quarto-post .listing-subtitle {
  font-size: 0.85rem;
  color: var(--sy-ink-secondary);
  margin-bottom: 3px;
  line-height: 1.4;
}

.quarto-listing-container-default .quarto-post .listing-description {
  font-size: 0.84rem;
  color: var(--sy-muted);
  line-height: 1.5;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quarto-listing-container-default .quarto-post .listing-categories {
  margin-top: 3px;
  margin-bottom: 2px;
}

.quarto-listing-container-default .quarto-post .listing-category {
  font-size: 0.72rem;
  padding: 1px 6px;
  margin-right: 4px;
  margin-bottom: 2px;
}

.listing-date,
.listing-author {
  font-variant-numeric: tabular-nums;
  font-family: var(--sy-mono);
  font-size: 0.78rem;
  color: var(--sy-muted);
}

/* ---------- 文章页细节 ---------- */
.quarto-title-banner {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--sy-line);
  margin-bottom: 24px;
}

.quarto-title-subtitle {
  color: var(--sy-muted);
}

/* ---------- 数学公式移动端防溢出 ---------- */
mjx-container[jax="CHTML"][display="true"] {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding-bottom: 2px;
}

/* ---------- 图片响应式兜底 ---------- */
main img {
  max-width: 100%;
  height: auto;
}

/* ---------- 响应式视频容器 ---------- */
.video-responsive {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 10px;
  margin: 1.5rem 0;
}

.video-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================================
   移动端响应式优化
   ============================================================ */
@media (max-width: 860px) {
  .hero-inner {
    flex-direction: column-reverse;
    text-align: center;
    gap: 24px;
  }
  .hero-content {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .hero-badge {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 16px;
  }
  .hero-brand-title {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
  }
  .hero-brand-title .title-divider {
    display: none;
  }
  .hero-brand-title .title-cn {
    font-size: 1.75rem;
  }
  .hero-tagline {
    justify-content: center;
    font-size: 0.95rem;
    gap: 6px 8px;
    margin-bottom: 22px;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-emblem-img {
    width: 150px;
    height: 150px;
  }
  .hero-emblem-glow {
    width: 180px;
    height: 180px;
  }
}

@media (max-width: 767.98px) {
  .home-container {
    padding: 12px 14px 60px;
  }
  .hero-section {
    padding: 30px 18px 28px;
    margin-bottom: 24px;
  }
  h2.home-h2 {
    font-size: 1.25rem;
    margin: 28px 0 16px;
  }
}

/* ---------- AI 助教组件（升级版：卡片化、流式展开、宽屏/全屏模式、快捷提问与浮动唤醒） ---------- */
.ai-tutor-container {
  background: var(--sy-bg-card);
  border: 1px solid var(--sy-line);
  border-radius: var(--sy-radius);
  box-shadow: var(--sy-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 1.25rem 0 2rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-tutor-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.ai-tutor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--sy-bg-soft);
  border-bottom: 1px solid var(--sy-line);
  gap: 0.75rem;
}

.ai-tutor-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ai-avatar-group {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.ai-header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  border: 2px solid rgba(30, 58, 138, 0.4);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
  display: block;
}

.ai-avatar-badge-robot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  font-size: 13px;
  line-height: 1;
  background: var(--sy-bg-card);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.ai-tutor-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--sy-sans);
  color: var(--sy-ink);
}

.ai-tutor-status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}

.ai-tutor-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-tutor-tool-btn {
  font-family: var(--sy-sans);
  font-size: 0.82rem;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--sy-line);
  background: var(--sy-bg-card);
  color: var(--sy-ink-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.ai-tutor-tool-btn:hover {
  border-color: var(--sy-navy);
  color: var(--sy-navy);
  background: var(--sy-navy-soft);
}

.ai-tutor-tool-btn.active {
  background: var(--sy-navy);
  color: #ffffff;
  border-color: var(--sy-navy);
}

.ai-tutor-log {
  min-height: 200px;
  max-height: 540px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.2rem;
  background: var(--sy-bg-card);
}

.ai-tutor-intro {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1rem 1.25rem;
  background: var(--sy-navy-soft);
  border: 1px solid rgba(30, 58, 138, 0.15);
  border-radius: var(--sy-radius-sm);
  color: var(--sy-ink-secondary);
  font-size: 0.92rem;
}

.ai-intro-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--sy-navy);
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.2);
  flex-shrink: 0;
}

.ai-intro-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.ai-intro-text strong {
  color: var(--sy-navy);
  display: block;
  margin-bottom: 0.25rem;
}

.ai-intro-text p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

/* 问答独立卡片（对比与步骤分离） */
.ai-qa-card {
  border: 1px solid var(--sy-line);
  border-radius: var(--sy-radius-sm);
  background: var(--sy-bg-card);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: border-color 0.2s ease;
}

.ai-qa-card:hover {
  border-color: rgba(30, 58, 138, 0.3);
}

.ai-qa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.95rem;
  background: var(--sy-bg-soft);
  border-bottom: 1px solid var(--sy-line-soft);
  gap: 0.5rem;
}

.ai-qa-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
}

.ai-qa-badge {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--sy-mono);
  background: var(--sy-navy);
  color: #f0f6fc;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.ai-qa-question {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sy-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-qa-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.ai-qa-tool-btn {
  font-size: 0.76rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--sy-line);
  border-radius: 4px;
  background: var(--sy-bg-card);
  color: var(--sy-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-qa-tool-btn:hover {
  color: var(--sy-navy);
  border-color: var(--sy-navy);
}

.ai-qa-body {
  padding: 1rem 1.15rem;
}

.ai-answer-author-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed var(--sy-line);
}

.ai-msg-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--sy-navy);
  display: block;
}

.ai-msg-author-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sy-navy);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ai-intro-avatar-wrap {
  position: relative;
  width: 66px;
  height: 66px;
  flex-shrink: 0;
}

.ai-intro-avatar {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  border: 2.5px solid var(--sy-navy);
  box-shadow: 0 3px 10px rgba(30, 58, 138, 0.22);
  display: block;
}

.ai-intro-robot-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  font-size: 16px;
  line-height: 1;
  background: var(--sy-bg-card);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.ai-dock-avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.ai-dock-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  display: block;
}

.ai-dock-robot-badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  font-size: 11px;
  line-height: 1;
  background: var(--sy-bg-card);
  border-radius: 50%;
}

.ai-msg {
  font-size: 0.95rem;
  line-height: 1.8;
  overflow-wrap: break-word;
}

.ai-msg p { margin-bottom: 0.6rem; }
.ai-msg p:last-child { margin-bottom: 0; }
.ai-msg h2, .ai-msg h3, .ai-msg h4 {
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  font-family: var(--sy-sans);
  font-weight: 700;
  color: var(--sy-ink);
}
.ai-msg pre {
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #1e293b;
  color: #f8fafc;
  overflow-x: auto;
  margin: 0.6rem 0;
}
.ai-msg pre code {
  color: inherit;
  background: transparent;
}

.ai-msg-assistant {
  color: var(--sy-ink);
}

.ai-cite {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--sy-line);
  font-size: 0.8rem;
  color: var(--sy-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.ai-cite-title {
  font-weight: 600;
  color: var(--sy-ink-secondary);
}

.ai-cite-chip {
  border: 1px solid rgba(30, 58, 138, 0.2);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  background: rgba(30, 58, 138, 0.06);
  color: var(--sy-navy);
  font-size: 0.76rem;
}

.ai-tutor-bottom {
  padding: 0.9rem 1.2rem;
  background: var(--sy-bg-soft);
  border-top: 1px solid var(--sy-line);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-tutor-hint {
  font-size: 0.78rem;
  color: var(--sy-muted);
}

.ai-tutor-row {
  display: flex;
  gap: 0.6rem;
}

.ai-tutor-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--sy-line);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.94rem;
  font-family: var(--sy-sans);
  color: var(--sy-ink);
  background: var(--sy-bg-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ai-tutor-input:focus {
  outline: none;
  border-color: var(--sy-navy);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}

.ai-tutor-btn {
  flex: 0 0 auto;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.25rem;
  font-size: 0.94rem;
  font-weight: 600;
  font-family: var(--sy-sans);
  background: var(--sy-navy);
  color: #f0f6fc;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-tutor-btn:disabled { opacity: 0.55; cursor: default; }
.ai-tutor-btn:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-1px); }

.ai-tutor-codewrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.65rem 0.85rem;
  background: var(--sy-bg-card);
  border: 1px dashed var(--sy-navy);
  border-radius: var(--sy-radius-sm);
}

.ai-thinking {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  color: var(--sy-navy);
  font-size: 0.9rem;
  padding: 0.4rem 0;
}

.ai-thinking-dots {
  font-weight: 500;
  animation: ai-pulse 1.2s ease-in-out infinite;
}

.ai-thinking-sec {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--sy-muted);
}

.ai-msg .ai-table {
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 0.6rem 0;
  width: 100%;
  overflow-x: auto;
  display: block;
}

.ai-msg .ai-table th,
.ai-msg .ai-table td {
  border: 1px solid var(--sy-line);
  padding: 0.4rem 0.75rem;
  text-align: left;
}

.ai-msg .ai-table th {
  background: rgba(30, 58, 138, 0.08);
  font-weight: 600;
}

/* ---------- 宽屏/全屏沉浸模式（Fullscreen/Modal Reader） ---------- */
body.ai-modal-open {
  overflow: hidden !important;
}

.ai-tutor-container.ai-fullscreen-active {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  z-index: 99999 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background: rgba(15, 23, 42, 0.82) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 2vh 2vw !important;
  box-sizing: border-box !important;
}

.ai-tutor-container.ai-fullscreen-active .ai-tutor-inner {
  width: min(1200px, 95vw) !important;
  height: 92vh !important;
  max-height: 92vh !important;
  background: var(--sy-bg-card) !important;
  border: 1px solid var(--sy-line) !important;
  border-radius: var(--sy-radius) !important;
  box-shadow: var(--sy-shadow-lg) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.ai-tutor-container.ai-fullscreen-active .ai-tutor-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--sy-line);
}

.ai-tutor-container.ai-fullscreen-active .ai-tutor-log {
  flex: 1 1 auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding: 1.5rem 2rem !important;
  gap: 1.5rem !important;
}

.ai-tutor-container.ai-fullscreen-active .ai-qa-card {
  border-width: 1.5px;
}

.ai-tutor-container.ai-fullscreen-active .ai-msg {
  font-size: 1.02rem;
  line-height: 1.85;
}

.ai-tutor-container.ai-fullscreen-active .ai-tutor-bottom {
  padding: 1.1rem 1.5rem;
}

/* ---------- 首屏 AI 伴学指引卡片与预设提问 Chips ---------- */
.ai-quick-guide {
  background: var(--sy-bg-card);
  border: 1px solid var(--sy-line);
  border-left: 4px solid var(--sy-navy);
  border-radius: var(--sy-radius-sm);
  padding: 0.9rem 1.15rem;
  margin: 1.25rem 0 1.75rem;
  box-shadow: var(--sy-shadow-sm);
}

.ai-quick-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.ai-quick-guide-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--sy-navy);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ai-quick-guide-subtitle {
  font-size: 0.8rem;
  color: var(--sy-muted);
}

/* 快速提问 Chips 栏通用样式 */
.ai-quick-chip-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed var(--sy-line);
}

.ai-chip-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sy-muted);
  margin-right: 0.2rem;
}

.ai-quick-chip {
  font-family: var(--sy-sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  background: var(--sy-bg-soft);
  border: 1px solid var(--sy-line);
  border-radius: 999px;
  color: var(--sy-ink-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none !important;
  line-height: 1.4;
  outline: none;
}

.ai-quick-chip:hover {
  background: var(--sy-navy-soft);
  border-color: var(--sy-navy);
  color: var(--sy-navy);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.1);
}

/* ============================================================
   PDF 在线浏览（报告附件页 · 无下载入口）
   ============================================================ */
#pdf-viewer-wrap {
  margin: 1.5rem 0 2rem;
}
#pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--sy-bg-card);
  border: 1px solid var(--sy-line);
  border-radius: var(--sy-radius-sm);
  position: sticky;
  top: 3.5rem;
  z-index: 100;
}
.pdf-btn {
  font-family: var(--sy-sans);
  font-size: 0.9rem;
  padding: 0.35rem 0.9rem;
  color: var(--sy-ink);
  background: var(--sy-bg-soft);
  border: 1px solid var(--sy-line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.pdf-btn:hover:not(:disabled) {
  border-color: var(--sy-amber);
  color: var(--sy-amber);
}
.pdf-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pdf-page-ind {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  color: var(--sy-muted);
  min-width: 4.5rem;
  text-align: center;
}
#pdf-canvas-container {
  display: flex;
  justify-content: center;
  background: var(--sy-bg-soft);
  border: 1px solid var(--sy-line);
  border-radius: var(--sy-radius);
  padding: 0.75rem;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
#pdf-canvas {
  max-width: 100%;
  box-shadow: var(--sy-shadow);
  border-radius: 4px;
}
.pdf-fallback {
  text-align: center;
  color: var(--sy-muted);
  padding: 1.5rem 0;
}
@media (max-width: 575.98px) {
  #pdf-toolbar {
    top: 3rem;
    gap: 0.5rem;
  }
  .pdf-btn {
    font-size: 0.85rem;
    padding: 0.3rem 0.7rem;
  }
}
