/* ================================================================
   阳光视翰科技 · 产品文档中心  style.css
================================================================ */

/*  Variables & Reset  */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent: #f97316;
  --accent-dark: #ea580c;
  --accent-glow: rgba(249, 115, 22, .25);
  --accent-light: #fff7ed;
  --nav-h: 62px;
  --content-max: 900px;
  --toc-w: 220px;
  --ai-w: 400px;
  --radius: 12px;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, .06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .1);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .14);
}

html {
  scroll-behavior: smooth;
}


body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.7;
  padding-top: var(--nav-h);
}

/* ================================================================
   TOP NAV
================================================================ */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, .8);
  z-index: 500;
  box-shadow: var(--shadow-sm);
}

.topnav-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 8px;
}

/* Brand */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  margin-right: 12px;
  flex-shrink: 0;
}

.brand-logo {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Nav menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dd-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: none;
  background: none;
  font-size: 16.5px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.nav-dd-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.nav-dd-btn.active {
  color: var(--accent);
  background: var(--accent-light);
}

.dd-arrow {
  font-size: 15px;
  transition: transform .2s;
  opacity: .6;
}

.nav-dropdown.open .dd-arrow {
  transform: rotate(180deg);
}

.nav-dd-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  min-width: 210px;
  padding: 6px;
  z-index: 600;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s, transform .18s, visibility .18s;
  pointer-events: none;
}

.nav-dropdown.open .nav-dd-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.nav-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  text-decoration: none;
  color: #334155;
  font-size: 16px;
  border-radius: 9px;
  transition: background .12s, color .12s;
  cursor: pointer;
}

.nav-dd-item:hover {
  background: #f8fafc;
  color: var(--accent);
}

.nav-dd-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.dd-item-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.nav-dd-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 8px;
}

.coming-tag {
  margin-left: auto;
  font-size: 10px;
  color: #94a3b8;
  background: #f1f5f9;
  border-radius: 99px;
  padding: 2px 8px;
}

/* Nav actions (right side) */
.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(249, 115, 22, .3);
  transition: transform .15s, box-shadow .15s;
}

.ai-nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(249, 115, 22, .42);
}

.ai-nav-btn:active {
  transform: none;
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  color: #475569;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background .15s;
}

.hamburger-btn:hover {
  background: #f1f5f9;
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all .25s;
}

.hamburger-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav drawer */
.mobile-nav {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, .96);
  backdrop-filter: blur(10px);
  z-index: 490;
  padding: 20px 16px;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

.mobile-nav.open {
  transform: none;
}

.mn-group {
  margin-bottom: 28px;
}

.mn-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #475569;
  padding: 0 6px;
  margin-bottom: 8px;
}

.mn-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 15px;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.mn-item:hover,
.mn-item.active {
  background: rgba(249, 115, 22, .15);
  color: var(--accent);
}

.mn-coming {
  color: #475569 !important;
  cursor: default;
}

.mn-coming-tag {
  margin-left: auto;
  font-size: 11px;
  background: #1e293b;
  color: #475569;
  border-radius: 99px;
  padding: 2px 10px;
}

/* ================================================================
   MAIN / LAYOUT
================================================================ */
#main-view {
  min-height: calc(100vh - var(--nav-h));
}

.content-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 28px;
  display: flex;
  gap: 36px;
  align-items: flex-start;
}

/* ================================================================
   HOME PAGE
================================================================ */
.home-wrap {
  width: 100%;
}

/* Hero */
.hero {
  border-radius: 20px;
  /* 底层：与下方产品介绍卡片相同的深色渐变 */
  /* 图片层：右对齐，使左侧空白由底层颜色填充 */
  background:
    /* ① 图片文字压暗蒙版（最顶层）：右侧深色覆盖图片文字，左侧渐透保护网站文字 */
    linear-gradient(to left,
      rgba(0, 0, 0, .60) 0%,
      rgba(0, 0, 0, .55) 48%,
      rgba(0, 0, 0, .20) 64%,
      transparent 74%),
    /* ② KTV 氛围渐变（叠在图片上方，现在实际可见） */
    radial-gradient(ellipse 40% 55% at 88% 10%, rgba(139, 92, 246, .22) 0%, transparent 70%),
    radial-gradient(ellipse 30% 45% at 78% 95%, rgba(236, 72, 153, .16) 0%, transparent 68%),
    /* ③ 图片层 */
    url('../img/1.jpg') right center / 88% auto no-repeat,
    /* ④ 底层深色背景（左侧空白填色） */
    linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #1e1b4b 100%);
  padding: 46px 56px 54px;
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
  /* 卡片外阴影 + 内阴影四边压暗，增加图片纵深感 */
  box-shadow:
    0 8px 40px rgba(0, 0, 0, .45),
    inset 0 0 60px rgba(0, 0, 0, .50),
    inset 0 -30px 50px rgba(0, 0, 0, .40),
    inset 0 20px 40px rgba(0, 0, 0, .30);
}

/* 图片左侧边缘与底层背景的过渡融合 */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(to right,
      #0f172a 0%,
      #0f172a 10%,
      rgba(15, 23, 42, .85) 22%,
      rgba(15, 23, 42, .30) 32%,
      transparent 42%);
  pointer-events: none;
}

/* 右下角青蓝色 KTV 氛围光 */
.hero::after {
  content: '';
  position: absolute;
  bottom: -50px;
  right: -30px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 210, 240, .18) 0%, transparent 65%);
  animation: float 9s ease-in-out infinite reverse;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-top: 46px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--accent);
  background: rgba(249, 115, 22, .12);
  border: 1px solid rgba(249, 115, 22, .28);
  padding: 4px 13px;
  border-radius: 99px;
  margin-bottom: 14px;
}

.hero-badge::before {
  content: '✦';
  font-size: 8px;
}

.hero h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.2;

  margin-bottom: 12px;
  letter-spacing: -.5px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero p {
  font-size: 1rem;
  color: #94a3b8;
  max-width: 480px;
  margin-bottom: 24px;
  margin-top: 30px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}

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

.hero-btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(249, 115, 22, .35);
}

.hero-btn-primary:hover {
  box-shadow: 0 6px 24px rgba(249, 115, 22, .5);
}

.hero-btn-ghost {
  background: rgba(255, 255, 255, .08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, .12);
}

.hero-btn-ghost:hover {
  background: rgba(255, 255, 255, .14);
}

.hero-stats {
  position: absolute;
  bottom: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, .05);
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-left: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px 0 20px 0;
  overflow: hidden;
}

.hero-stat {
  padding: 14px 24px;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.hero-stat:last-child {
  border-right: none;
}

.hero-stat-num {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.hero-stat-label {
  font-size: 11px;
  color: #64748b;
  letter-spacing: .3px;
}

/* Section title */
.section-heading {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 首页底部客服热线 */
.home-hotline {
  text-align: center;
  color: var(--accent);
  font-size: clamp(14px, 4vw, 28px);
  font-weight: 600;
  padding: 0 0 8px;
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* Doc cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
  margin-bottom: 48px;
}

/* 首页卡片保持较大宽度 */
.home-wrap .cards-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.doc-card {
  background: #fff;
  border: 1px solid #e8eef4;
  border-radius: var(--radius);
  padding: 24px 22px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  position: relative;
  overflow: hidden;
}

.doc-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(249, 115, 22, .04), transparent);
  opacity: 0;
  transition: opacity .2s;
}

.doc-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(249, 115, 22, .14), 0 0 0 3px rgba(249, 115, 22, .06);
  transform: translateY(-4px);
}

.doc-card:hover::before {
  opacity: 1;
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  background: linear-gradient(135deg, #fff7ed, #fed7aa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
  transition: transform .2s;
}

.doc-card:hover .card-icon {
  transform: scale(1.08) rotate(-3deg);
}

.card-title {
  font-size: 17px;
  font-weight: 400;
  margin-bottom: 7px;
  color: #0f172a;
}

.card-desc {
  display: none;
}

.card-cta {
  margin-top: 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s, transform .2s;
}

.doc-card:hover .card-cta {
  opacity: 1;
  transform: none;
}

/* Coming soon cards */
.coming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.coming-card {
  background: #fafafa;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: center;
  transition: border-color .2s;
}

.coming-card:hover {
  border-color: #94a3b8;
}

.coming-card .card-icon {
  margin: 0 auto 14px;
  background: #f1f5f9;
  filter: grayscale(.4);
}

.coming-card .card-title {
  color: #94a3b8;
}

.coming-badge {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  color: #94a3b8;
  background: #e8eef4;
  border-radius: 99px;
  padding: 3px 12px;
}

/* ================================================================
   ARTICLE PAGE
================================================================ */
.article-wrap {
  flex: 1;
  min-width: 0;
}

.breadcrumb {
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}

.breadcrumb a {
  color: #64748b;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .sep {
  color: #cbd5e1;
}

.article-header {
  padding-bottom: 22px;
  border-bottom: 2px solid #f1f5f9;
  margin-bottom: 32px;
}

.article-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 10px;
}

.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: #94a3b8;
}

/*  Markdown Body  */
.markdown-body {
  font-size: 15px;
  color: #334155;
  line-height: 1.85;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: #0f172a;
  font-weight: 700;
  line-height: 1.4;
  scroll-margin-top: 90px;
}

.markdown-body h1 {
  font-size: 1.55rem;
  margin: 2.2rem 0 1rem;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: .5rem;
}

.markdown-body h2 {
  font-size: 1.25rem;
  margin: 1.9rem 0 .8rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: .4rem;
}

.markdown-body h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 .6rem;
}

.markdown-body h4 {
  font-size: .95rem;
  margin: 1.2rem 0 .5rem;
  color: #475569;
}

.markdown-body p {
  margin-bottom: .9rem;
}

.markdown-body a {
  color: var(--accent);
  text-decoration: none;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.6em;
  margin-bottom: .9rem;
}

.markdown-body li {
  margin-bottom: .35rem;
}

.markdown-body strong {
  font-weight: 700;
  color: #0f172a;
}

.markdown-body code {
  font-family: "Fira Code", Consolas, "Cascadia Code", monospace;
  font-size: .875em;
  background: #f1f5f9;
  color: #e11d48;
  padding: .15em .45em;
  border-radius: 5px;
}

.markdown-body pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.2em 1.5em;
  border-radius: 11px;
  overflow-x: auto;
  margin-bottom: 1.2rem;
}

.markdown-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: .9em;
}

.markdown-body blockquote {
  border-left: 4px solid var(--accent);
  background: var(--accent-light);
  padding: .9em 1.2em;
  margin-bottom: 1rem;
  border-radius: 0 10px 10px 0;
  color: #92400e;
}

.markdown-body img {
  max-width: 100%;
  border-radius: 9px;
  margin: .9rem 0;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
  display: block;
}

.markdown-body img.broken {
  display: none !important;
}

/* ── 内嵌视频播放器 ── */
.md-video {
  width: 100%;
  max-width: 720px;
  border-radius: 10px;
  background: #0f172a;
  display: block;
  margin: 1rem 0;
}
/* 隐藏投屏 / 画中画 / 下载按钮 */
.md-video::-internal-media-controls-overlay-cast-button,
.md-video::-webkit-media-controls-overlay-cast-button,
.md-video::-webkit-media-controls-cast-button,
.md-video::-webkit-media-controls-picture-in-picture-button,
.md-video::-webkit-media-controls-remote-playback-button {
  display: none !important;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.2rem;
  font-size: 14px;
  overflow-x: auto;
  display: block;
}

.markdown-body th {
  background: #f8fafc;
  font-weight: 700;
  color: #0f172a;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
}

.markdown-body td {
  padding: 9px 14px;
  border: 1px solid #e2e8f0;
  vertical-align: top;
}

.markdown-body tr:nth-child(even) td {
  background: #fafafa;
}

.markdown-body tr:hover td {
  background: var(--accent-light);
}

/* 语雀 font tag - warning style */
.yuque-warn {
  display: inline;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: .9em;
  font-weight: 600;
}

/* Back to top */
.back-top {
  position: fixed;
  bottom: 230px;
  right: max(24px, calc(50vw - 640px));
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  color: #64748b;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s, background .15s;
  z-index: 400;
}

.back-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-top:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ================================================================
   TOC
================================================================ */
.toc-wrap {
  width: var(--toc-w);
  flex-shrink: 0;
}

.toc-inner {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  max-height: calc(100vh - var(--nav-h) - 48px);
  overflow-y: auto;
}

.toc-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.toc-list {
  list-style: none;
}

.toc-list li+li {
  margin-top: 2px;
}

.toc-link {
  display: block;
  font-size: 12.5px;
  color: #64748b;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  border-left: 2px solid transparent;
  line-height: 1.5;
  transition: color .12s, background .12s, border-color .12s;
}

.toc-link:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.toc-link.active {
  color: var(--accent);
  background: var(--accent-light);
  border-left-color: var(--accent);
  font-weight: 600;
}

.toc-link.h2 {
  padding-left: 16px;
}

.toc-link.h3 {
  padding-left: 28px;
  font-size: 12px;
}

.toc-link.h4 {
  padding-left: 40px;
  font-size: 11px;
  color: #94a3b8;
}

/* ================================================================
   AI PANEL
================================================================ */
/* Floating button */
.ai-fab {
  position: fixed;
  bottom: 50px;
  /* right 跟随内容区域右边缘（content-wrap max-width:1280px 居中） */
  right: max(20px, calc(50vw - 640px));
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 450;
  padding: 0;
  transition: transform .2s;
  width: auto;
  height: auto;
  border-radius: 0;
  box-shadow: none;
  font-size: inherit;
  animation: none;
}

.ai-fab-img {
  width: clamp(48px, 7vw, 98px);
  height: auto;
  object-fit: contain;
  transition: transform .3s;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .15));
  animation: aiFabFloat 3s ease-in-out infinite;
}

/* 轻微上下浮动 + 微旋转，让人物看起来有生气 */
@keyframes aiFabFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%      { transform: translateY(-5px) rotate(.8deg); }
  75%      { transform: translateY(3px) rotate(-.5deg); }
}

.ai-fab:hover .ai-fab-img {
  animation: none;
  transform: scale(1.1);
}

.ai-fab-close {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(71, 85, 105, .85);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

.ai-fab.open .ai-fab-close {
  display: flex;
}

.ai-fab-label {
  font-size: 12px;
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
}

.ai-fab.open {
  background: none;
}

@keyframes fabPulse {

  0%,
  100% {
    box-shadow: 0 4px 20px rgba(249, 115, 22, .4);
  }

  50% {
    box-shadow: 0 4px 28px rgba(249, 115, 22, .65), 0 0 0 6px rgba(249, 115, 22, .12);
  }
}

/* Panel */
.ai-panel {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  bottom: 0;
  width: var(--ai-w);
  background: #fff;
  border-left: 1px solid #e2e8f0;
  box-shadow: -8px 0 32px rgba(0, 0, 0, .1);
  z-index: 460;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

.ai-panel.open {
  transform: none;
}

.ai-panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ai-panel-icon {
  height: 36px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.ai-panel-title {
  font-weight: 700;
  font-size: 14.5px;
  color: #0f172a;
}

.ai-panel-sub {
  font-size: 11.5px;
  color: #94a3b8;
}

.ai-panel-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.ai-panel-close:hover {
  background: #f1f5f9;
  color: #475569;
}

/* Messages */
.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.ai-msg {
  display: flex;
  gap: 10px;
  animation: fadeInUp .25s ease;
}

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

.ai-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.ai-msg-user .ai-msg-avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
}

.ai-msg-bot .ai-msg-avatar {
  background: none;
  border-radius: 0;
  width: auto;
  height: 30px;
}

.ai-msg-bot .ai-msg-avatar img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

.ai-msg-body {
  max-width: 88%;
}

.ai-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.65;
  word-break: break-word;
  overflow-wrap: break-word;
}

.ai-msg-user .ai-msg-bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border-radius: 14px 4px 14px 14px;
}

.ai-msg-bot .ai-msg-bubble {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e8eef4;
  border-radius: 4px 14px 14px 14px;
}

/* Thinking bubble */
.ai-thinking .ai-msg-bubble {
  padding: 12px 18px;
}

.ai-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.ai-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  display: block;
  animation: dotBounce .9s ease-in-out infinite;
}

.ai-dots span:nth-child(2) {
  animation-delay: .15s;
}

.ai-dots span:nth-child(3) {
  animation-delay: .30s;
}

@keyframes dotBounce {

  0%,
  100% {
    transform: translateY(0);
    opacity: .4;
  }

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

/* Cursor blink */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink .7s step-end infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* Result cards */
.ai-results {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-result-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  animation: fadeInUp .3s ease both;
}

.ai-result-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(249, 115, 22, .1);
}

.result-path {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.result-path .doc-name {
  color: var(--accent);
  font-weight: 600;
}

.result-excerpt {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-excerpt mark {
  background: rgba(249, 115, 22, .18);
  color: #c2410c;
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 600;
}

.result-go {
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* No results */
.ai-no-result {
  text-align: center;
  padding: 20px;
  color: #94a3b8;
  font-size: 13px;
}

.ai-no-result .emoji {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

/* Quick questions */
.ai-quick {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-quick-label {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.ai-quick-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #475569;
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s, border-color .12s;
}

.ai-quick-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* Input area */
.ai-input-area {
  padding: 14px 16px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.ai-input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  color: #334155;
  transition: border-color .15s, box-shadow .15s;
  resize: none;
}

.ai-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .1);
}

.ai-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
  align-self: flex-end;
}

.ai-send-btn:hover {
  background: var(--accent-dark);
}

.ai-send-btn:active {
  transform: scale(.95);
}

.ai-send-btn:disabled {
  background: #e2e8f0;
  cursor: default;
}

/* ================================================================
   LOADING / ERROR
================================================================ */
.loading-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 12px;
  color: #94a3b8;
  font-size: 14px;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid #e2e8f0;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 24px;
  color: #dc2626;
  font-size: 14px;
  line-height: 1.7;
}

/* Coming soon page */
.coming-page {
  text-align: center;
  padding: 80px 20px;
  animation: fadeIn .4s ease;
}

.coming-page .big-emoji {
  font-size: 64px;
  margin-bottom: 16px;
  display: block;
}

.coming-page h2 {
  font-size: 1.4rem;
  color: #0f172a;
  margin-bottom: 8px;
}

.coming-page p {
  font-size: 14px;
  color: #94a3b8;
}

/* ================================================================
   ANIMATIONS
================================================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slideInR {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-18px) scale(1.04);
  }
}

/* Page transition classes */
.page-leave {
  animation: pageOut .18s ease forwards;
}

.page-enter {
  animation: pageIn .28s ease forwards;
}

@keyframes pageOut {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Staggered entrance for home cards */
.card-animate {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .45s ease, transform .45s ease;
}

.card-animate.in {
  opacity: 1;
  transform: none;
}

/* Hero text stagger */
.hero-badge {
  animation: fadeInUp .5s .1s both;
}

.hero h1 {
  animation: fadeInUp .5s .2s both;
}

.hero p {
  animation: fadeInUp .5s .3s both;
}

.hero-actions {
  animation: fadeInUp .5s .4s both;
}

.hero-stats {
  animation: fadeIn .6s .5s both;
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 1200px) {
  .toc-wrap {
    display: none;
  }
}

@media (max-width: 900px) {
  .hero {
    padding: 36px 32px 46px;
  }

  .hero-stats {
    display: none;
  }

  .content-wrap {
    padding: 28px 20px;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }

  .hero {
    padding: 40px 24px 56px;
    border-radius: 14px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .content-wrap {
    padding: 20px 16px;
  }

  .ai-panel {
    width: 100%;
  }
}

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

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

  .hero-actions {
    flex-direction: row;
  }

  .hero-btn {
    width: auto;
  }

  .ai-fab {
    bottom: 40px;
    right: 16px;
  }
}

/* ================================================================
   NEW: 功能介绍 Featured Card
================================================================ */
.featured-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #1e1b4b 100%);
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 32px;
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(249, 115, 22, .2);
  transition: border-color .2s, box-shadow .2s, transform .15s;
  position: relative;
  overflow: hidden;
}

.featured-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 115, 22, .2) 0%, transparent 70%);
}

.featured-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 28px rgba(249, 115, 22, .2);
  transform: translateY(-2px);
}

.featured-card-icon {
  font-size: 40px;
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  border-radius: 16px;
  background: rgba(249, 115, 22, .15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-card-body {
  flex: 1;
  position: relative;
}

.featured-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.featured-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.featured-card-desc {
  font-size: 13.5px;
  color: #94a3b8;
}

.featured-card-arrow {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
}

@media (max-width: 600px) {
  .featured-card {
    flex-direction: row;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
    margin-bottom: 16px;
  }

  .featured-card-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
    border-radius: 10px;
  }

  .featured-card-title {
    font-size: .95rem;
  }

  .featured-card-desc {
    font-size: 12px;
  }

  .featured-card-arrow {
    margin-top: 0;
    font-size: 12px;
  }
}

/* ================================================================
   NEW: Group Summary Cards（首页分组卡片）
================================================================ */
.group-card {
  background: #fff;
  border: 1px solid #e8eef4;
  border-radius: var(--radius);
  padding: 22px 20px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  position: relative;
  overflow: hidden;
}

.group-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(249, 115, 22, .04), transparent);
  opacity: 0;
  transition: opacity .2s;
}

.group-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(249, 115, 22, .14), 0 0 0 3px rgba(249, 115, 22, .06);
  transform: translateY(-4px);
}

.group-card:hover::before {
  opacity: 1;
}

.group-card:hover .card-icon {
  transform: scale(1.08) rotate(-3deg);
}

.group-card:hover .card-cta {
  opacity: 1;
  transform: none;
}

.group-card-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 99px;
  padding: 2px 10px;
  margin-bottom: 10px;
  align-self: flex-start;
}

.group-card-sub {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 8px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ================================================================
   顶部导航：首页按钮 & 直连按钮（single:true 分组）
================================================================ */
.nav-home-btn,
.nav-direct-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: none;
  background: none;
  font-size: 16.5px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.nav-home-btn:hover,
.nav-direct-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.nav-home-btn.active,
.nav-direct-btn.active {
  color: var(--accent);
  background: var(--accent-light);
}

/* ================================================================
   NEW: 下拉菜单子分组标题
================================================================ */
.nav-dd-subheader {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 10px 12px 4px;
}

/* ================================================================
   NEW: 分组索引页 - 子分组区块
================================================================ */
.subgroup-section {
  margin-bottom: 36px;
}

.subgroup-heading {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e293b;
  padding: 10px 0 14px;
  border-bottom: 2px solid var(--accent-light);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subgroup-heading::before {
  content: '';
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

/* AI 搜索结果命中类型标签 */
.result-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  flex-shrink: 0;
}

.badge-title {
  background: rgba(249, 115, 22, .15);
  color: var(--accent-dark);
}

.badge-heading {
  background: rgba(99, 102, 241, .12);
  color: #6366f1;
}

/* 移动端子分组标题 */
.mn-subheader {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  color: #64748b;
  padding: 10px 14px 4px;
  text-transform: uppercase;
}

/* ================================================================
   图片文档页
================================================================ */
.image-doc-page {
  padding: 24px 0 48px;
  text-align: center;
}

.image-doc-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 28px;
  text-align: center;
  line-height: 1.4;
}

.image-doc-wrap {
  display: flex;
  justify-content: center;
}

.image-doc-img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: block;
}

/* ================================================================
   LIGHTBOX – 图片点击放大弹框
================================================================ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, .88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
  /* 关闭时淡出 */
  opacity: 0;
  transition: opacity .2s ease;
}

.lightbox.open {
  display: flex;
  opacity: 1;
  animation: lb-fade-in .22s ease forwards;
}

@keyframes lb-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* 图片容器（点击不关闭） */
.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 92vw;
  max-height: 82vh;
  cursor: default;
  overflow: auto;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 56px rgba(0, 0, 0, .7);
  background: #fff;
  animation: lb-img-in .24s cubic-bezier(.22, .68, 0, 1.2) forwards;
  display: block;
  cursor: default;
  user-select: none;
}

@keyframes lb-img-in {
  from {
    opacity: 0;
    transform: scale(.88);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .15s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, .28);
  transform: scale(1.1);
}

.lightbox-caption {
  margin-top: 14px;
  color: rgba(255, 255, 255, .6);
  font-size: 13px;
  max-width: 80vw;
  text-align: center;
  line-height: 1.5;
  min-height: 18px;
}

/* 可点击图片：显示放大光标 */
.markdown-body img:not(.broken),
.image-doc-img:not(.broken) {
  cursor: zoom-in;
}

/* --- 建议功能关闭时隐藏所有建议入口 --- */
body.feedback-disabled #feedback-nav-btn,
body.feedback-disabled #feedback-fab,
body.feedback-disabled .feedback-entry-btn {
  display: none !important;
}

/* --- feedback nav button (same style as .ai-nav-btn) --- */
.feedback-nav-btn {
  visibility: visible !important;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(249, 115, 22, .3);
  transition: transform .15s, box-shadow .15s;
}

.feedback-nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(249, 115, 22, .42);
}

.feedback-nav-btn:active {
  transform: none;
}

/* --- feedback FAB --- */
.feedback-fab {
  visibility: visible;
  position: fixed;
  bottom: 236px;
  right: max(28px, calc(50vw - 640px));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(249, 115, 22, .4);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 449;
  transition: transform .2s, box-shadow .2s;
}

.feedback-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(249, 115, 22, .55);
}

/* --- feedback panel --- */
.feedback-panel {
  display: none;
  position: fixed;
  top: var(--nav-h);
  right: 0;
  bottom: 0;
  width: var(--ai-w);
  background: #fff;
  border-left: 1px solid #e2e8f0;
  box-shadow: -8px 0 32px rgba(0, 0, 0, .1);
  z-index: 461;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
}

.feedback-panel.open {
  display: flex;
  transform: none;
}

.feedback-panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.feedback-panel-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.feedback-panel-title {
  font-weight: 700;
  font-size: 14.5px;
  color: #0f172a;
}

.feedback-panel-sub {
  font-size: 11.5px;
  color: #94a3b8;
}

.feedback-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.feedback-close:hover {
  background: #f1f5f9;
  color: #475569;
}

.feedback-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.feedback-field {
  margin-bottom: 16px;
}

.feedback-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.feedback-field .required {
  color: #ef4444;
}

.feedback-field .optional {
  font-weight: 400;
  color: #9ca3af;
  font-size: 12px;
}

.feedback-field select,
.feedback-field textarea,
.feedback-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  outline: none;
  transition: border-color .15s;
  background: #fff;
}

.feedback-field select:focus,
.feedback-field textarea:focus,
.feedback-field input:focus {
  border-color: var(--accent);
}

.feedback-field textarea {
  resize: vertical;
}

.feedback-status {
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 8px;
}

.feedback-status.error {
  color: #ef4444;
}

.feedback-status.success {
  color: #22c55e;
}

.feedback-submit {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}

.feedback-submit:hover {
  opacity: .88;
}

.feedback-submit:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/* --- auth modal --- */
.auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal.open {
  display: flex;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
  padding: 36px 32px;
  width: 400px;
  max-width: 100%;
  animation: auth-card-in .22s cubic-bezier(.22, .68, 0, 1.2) forwards;
}

@keyframes auth-card-in {
  from {
    opacity: 0;
    transform: scale(.94) translateY(10px);
  }

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

.auth-logo {
  display: block;
  height: 44px;
  margin: 0 auto 10px;
  object-fit: contain;
}

.auth-title {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 20px;
}

.auth-tabs {
  display: flex;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 9px 0;
  border: none;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.auth-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 700;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.auth-form input {
  padding: 11px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}

.auth-form input:focus {
  border-color: var(--accent);
}

.auth-error {
  font-size: 13px;
  color: #ef4444;
  min-height: 18px;
  margin: 0;
}

.auth-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
  margin-top: 4px;
}

.auth-btn:hover {
  opacity: .88;
}

.auth-btn:disabled {
  opacity: .7;
  cursor: not-allowed;
}

.auth-hint {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

.auth-forgot-link {
  display: block;
  text-align: right;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  margin-top: 2px;
}

.auth-forgot-link:hover {
  text-decoration: underline;
}

.auth-back-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
  margin-top: 4px;
}

.auth-back-link:hover {
  color: var(--accent);
}

@media (max-width: 600px) {
  .feedback-nav-btn {
    display: none;
  }

  .feedback-panel {
    width: 100%;
  }

  .auth-card {
    padding: 28px 20px;
    border-radius: 12px;
  }
}

/*  Nav user button / login button  */
#nav-user {
  display: flex;
  align-items: center;
}

.nav-login-btn {
  padding: 7px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
}

.nav-login-btn:hover {
  opacity: .85;
}

.nav-user-wrap {
  position: relative;
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 99px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  transition: border-color .15s, box-shadow .15s;
}

.nav-user-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(251, 146, 60, .13);
}

.nav-user-avatar {
  font-size: 16px;
  line-height: 1;
}

.nav-user-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user-caret {
  font-size: 10px;
  color: #9ca3af;
}

.nav-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
  min-width: 140px;
  padding: 8px 0;
  z-index: 3000;
}

.nav-user-dropdown.open {
  display: block;
}

.nav-user-info {
  padding: 8px 16px 6px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 4px;
}

.nav-user-dropdown button {
  display: block;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  color: #ef4444;
  cursor: pointer;
  transition: background .12s;
}

.nav-user-dropdown button:hover {
  background: #fef2f2;
}

@media (max-width: 600px) {
  .nav-user-name {
    display: none;
  }

  .nav-user-btn {
    padding: 6px 8px;
  }
}

/*  Nav user: hamburger stays last on mobile  */
@media (max-width: 820px) {
  #nav-user {
    order: -1;
  }
}

/*  My Feedback modal  */
.my-feedback-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.my-feedback-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: auth-card-in .22s cubic-bezier(.22, .68, 0, 1.2) forwards;
}

.my-feedback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 16px;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.my-feedback-close {
  width: 28px;
  height: 28px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.my-feedback-close:hover {
  background: #e2e8f0;
}

.my-feedback-body {
  overflow-y: auto;
  padding: 12px 24px 20px;
  flex: 1;
}

.my-feedback-loading,
.my-feedback-empty {
  text-align: center;
  padding: 48px 0;
  color: #94a3b8;
  font-size: 14px;
}

.my-feedback-item {
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: box-shadow .15s;
}

.my-feedback-item:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
}

.my-feedback-item:last-child {
  margin-bottom: 0;
}

.my-feedback-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.mf-type {
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 99px;
}

.mf-status {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}

.mf-status-pending {
  background: #fef9c3;
  color: #854d0e;
}

.mf-status-processing {
  background: #dbeafe;
  color: #1d4ed8;
}

.mf-status-done {
  background: #dcfce7;
  color: #166534;
}

.mf-time {
  font-size: 11px;
  color: #94a3b8;
  margin-left: auto;
}

.my-feedback-content {
  font-size: 14px;
  color: #374151;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

/*  Nav dropdown: logout button distinct style  */
.nav-user-dropdown .logout-btn {
  color: #ef4444;
}

.nav-user-dropdown .logout-btn:hover {
  background: #fef2f2;
}

/* my-feedback title sub */
.my-feedback-title-wrap {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.my-feedback-sub {
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
  line-height: 1;
  margin-bottom: 1px;
}

/* -- Feedback image upload ----------------------------------- */
.feedback-img-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.feedback-img-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  flex-shrink: 0;
  user-select: none;
}

.feedback-img-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.feedback-img-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-img-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.feedback-img-thumb img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  display: block;
}

.feedback-img-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  border: none;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* -- My feedback images (user modal) ------------------------ */
.mf-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.mf-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  cursor: zoom-in;
  transition: opacity .15s;
}

.mf-thumb:hover {
  opacity: .85;
}

.mf-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, .85);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.mf-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
}

/* -- Admin: image thumbnails --------------------------------- */
.detail-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  cursor: zoom-in;
  transition: opacity .15s;
}

.admin-thumb:hover {
  opacity: .85;
}

.img-count-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: #3b82f6;
  vertical-align: middle;
}

/* -- My feedback: content + images side by side ------------- */
.mf-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.mf-row .my-feedback-content {
  flex: 1;
  min-width: 0;
}

.mf-row .mf-images {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}


/* -- My feedback: single thumb + carousel ------------------- */
.mf-img-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  cursor: pointer;
}

.mf-img-wrap .mf-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  display: block;
  transition: opacity .15s;
}

.mf-img-wrap:hover .mf-thumb {
  opacity: .85;
}

.mf-img-more {
  position: absolute;
  bottom: 3px;
  right: 5px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7), 0 0 2px rgba(0, 0, 0, .5);
  pointer-events: none;
  line-height: 1;
}

.mf-carousel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, .92);
  align-items: center;
  justify-content: center;
}

.mf-car-img {
  max-width: 86vw;
  max-height: 86vh;
  border-radius: 8px;
  object-fit: contain;
  display: block;
}

.mf-car-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  z-index: 1;
}

.mf-car-btn:hover {
  background: rgba(255, 255, 255, .32);
}

.mf-car-prev {
  left: 20px;
}

.mf-car-next {
  right: 20px;
}

.mf-car-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.mf-car-close:hover {
  background: rgba(255, 255, 255, .32);
}

.mf-car-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .75);
  font-size: 13px;
  letter-spacing: .5px;
}

/* ================================================================
   MOBILE RESPONSIVE - v2.0
   Breakpoints: 900 / 768 / 600 / 480 / 390 / 360
   + Landscape + Safe-area (iPhone notch / Dynamic Island)
================================================================ */

/* -- Global touch optimization --------------------------------- */
button,
a,
[role="button"],
.doc-card,
.group-card,
.mn-item,
.ai-quick-btn,
.ai-result-card {
  -webkit-tap-highlight-color: transparent;
}

/* Prevent iOS auto-zoom on input focus */
input,
select,
textarea {
  font-size: 16px !important;
}

@media (max-width: 768px) {
  body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
}

/* ================================================================
   900px  Tablet landscape
================================================================ */
@media (max-width: 900px) {
  .topnav-inner {
    padding: 0 16px;
  }

  .content-wrap {
    padding: 24px 16px;
    gap: 0;
  }

  .article-header h1 {
    font-size: 1.5rem;
  }

  .back-top {
    bottom: 200px;
    right: 18px;
  }

  .doc-card:hover {
    transform: none;
  }

  .group-card:hover {
    transform: none;
  }

  .featured-card:hover {
    transform: none;
    box-shadow: none;
  }
}

/* ================================================================
   768px  Tablet portrait / large phone
================================================================ */
@media (max-width: 768px) {

  /* Topnav */
  .topnav-inner {
    padding: 0 14px;
    gap: 8px;
  }

  .brand-logo {
    height: 28px;
  }

  .nav-actions {
    gap: 8px;
  }

  /* Hero */
  .hero {
    margin-bottom: 24px;
  }

  .hero p {
    font-size: .95rem;
  }

  .hero-btn {
    padding: 10px 18px;
    font-size: 13.5px;
  }

  /* Content */
  .content-wrap {
    padding: 18px 14px;
  }

  .cards-grid {
    gap: 12px;
    margin-bottom: 28px;
  }

  /* Article */
  .article-header {
    padding-bottom: 16px;
    margin-bottom: 22px;
  }

  .article-header h1 {
    font-size: 1.42rem;
  }

  /* Markdown */
  .markdown-body {
    font-size: 14.5px;
  }

  .markdown-body h1 {
    font-size: 1.38rem;
  }

  .markdown-body h2 {
    font-size: 1.15rem;
  }

  .markdown-body h3 {
    font-size: 1rem;
  }

  .markdown-body pre {
    padding: .85em 1em;
    font-size: 13px;
    border-radius: 8px;
  }

  .markdown-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .markdown-body th,
  .markdown-body td {
    padding: 8px 12px;
    white-space: nowrap;
  }

  /* FABs */
  .ai-fab {
    bottom: 40px;
    right: 16px;
  }

  .feedback-fab {
    bottom: 155px;
    right: 18px;
    width: 48px;
    height: 48px;
    font-size: 19px;
  }

  .back-top {
    bottom: 210px;
    right: 18px;
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  /* Mobile nav: bigger touch targets */
  .mn-item {
    padding: 13px 14px;
    min-height: 48px;
  }
}

/* ================================================================
   600px  Medium phone
================================================================ */
@media (max-width: 600px) {

  /* Topnav */
  .topnav-inner {
    padding: 0 12px;
  }

  .brand-logo {
    height: 26px;
  }

  .nav-actions {
    gap: 6px;
  }

  .ai-nav-btn {
    padding: 7px 12px;
    font-size: 13px;
  }

  /* Hero: 手机端 — 背景图完整显示 */
  .hero {
    padding: 16px 14px 16px;
    border-radius: 12px;
    margin-bottom: 14px;
    background:
      /* ① 半透明遮罩保证文字可读 */
      linear-gradient(to right,
        rgba(15, 23, 42, .82) 0%,
        rgba(15, 23, 42, .55) 45%,
        rgba(0, 0, 0, .18) 70%,
        transparent 100%),
      /* ② KTV 氛围光 */
      radial-gradient(ellipse 40% 55% at 88% 10%, rgba(139, 92, 246, .22) 0%, transparent 70%),
      radial-gradient(ellipse 30% 45% at 78% 95%, rgba(236, 72, 153, .16) 0%, transparent 68%),
      /* ③ 图片：100% 宽度，完整显示，垂直居中 */
      url('../img/1.jpg') center center / 100% auto no-repeat,
      /* ④ 底层 */
      linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #1e1b4b 100%);
  }

  .hero::before {
    display: none;
  }

  .hero-content {
    padding-top: 16px;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 1.8vw, 2.3rem);
    margin-top: 8px;
    margin-bottom: 8px;
  }

  .hero p {
    font-size: .78rem;
    margin-bottom: 10px;
    max-width: 65%;
    line-height: 1.45;
  }

  .hero-badge {
    font-size: 10px;
    padding: 3px 10px;
    margin-bottom: 8px;
  }

  .hero-actions {
    gap: 6px;
  }

  .hero-btn {
    width: auto;
    padding: 7px 16px;
    font-size: 12px;
  }

  .hero-stats {
    display: none;
  }

  /* Section heading */
  .section-heading {
    font-size: .9rem;
    margin-bottom: 14px;
  }

  /* Cards: 2 columns */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }

  .coming-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .doc-card {
    padding: 16px 13px;
  }

  .card-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    margin-bottom: 10px;
    border-radius: 9px;
  }

  .card-title {
    font-size: 13px;
  }

  .card-desc {
    font-size: 12px;
  }

  .card-cta {
    display: none;
  }

  /* Featured card */
  .featured-card {
    padding: 16px 14px;
    gap: 12px;
    margin-bottom: 16px;
  }

  .featured-card-icon {
    width: 44px;
    height: 44px;
    font-size: 22px;
    border-radius: 10px;
  }

  .featured-card-title {
    font-size: 1.1rem;
  }

  .featured-card-desc {
    font-size: 12.5px;
  }

  /* Article page */
  .content-wrap {
    padding: 14px 12px;
  }

  .breadcrumb {
    font-size: 12px;
    gap: 4px;
    margin-bottom: 14px;
    flex-wrap: wrap;
  }

  .article-header h1 {
    font-size: 1.28rem;
    line-height: 1.35;
  }

  .article-meta {
    gap: 10px;
    font-size: 12px;
  }

  /* Markdown */
  .markdown-body {
    font-size: 14px;
    line-height: 1.82;
  }

  .markdown-body h1 {
    font-size: 1.28rem;
  }

  .markdown-body h2 {
    font-size: 1.1rem;
  }

  .markdown-body ul,
  .markdown-body ol {
    padding-left: 1.3em;
  }

  .markdown-body blockquote {
    padding: .7em 1em;
  }

  /* AI panel -> bottom sheet */
  .ai-panel {
    top: auto !important;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    border-left: none;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .13);
    transform: translateY(100%) !important;
  }

  .ai-panel.open {
    transform: none !important;
  }

  /* Feedback panel -> bottom sheet */
  .feedback-panel {
    top: auto !important;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    border-left: none;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .12);
    transform: translateY(100%) !important;
    transition: transform .32s cubic-bezier(.4, 0, .2, 1) !important;
  }

  .feedback-panel.open {
    transform: none !important;
  }

  /* Feedback form */
  .feedback-form {
    padding: 16px 16px 20px;
  }

  .feedback-field {
    margin-bottom: 13px;
  }

  .feedback-field label {
    font-size: 12.5px;
    margin-bottom: 5px;
  }

  .feedback-field select,
  .feedback-field textarea,
  .feedback-field input {
    padding: 9px 11px;
  }

  .feedback-field textarea {
    min-height: 90px;
  }

  .feedback-submit {
    padding: 11px;
    font-size: 14.5px;
  }

  /* Auth modal -> bottom sheet */
  .auth-modal {
    padding: 0;
    align-items: flex-end;
  }

  .auth-card {
    width: 100%;
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    padding: 24px 18px 28px;
  }

  .auth-logo {
    height: 36px;
  }

  .auth-title {
    font-size: 15px;
    margin-bottom: 16px;
  }

  .auth-form input {
    padding: 10px 12px;
  }

  .auth-btn {
    padding: 11px;
    font-size: 14.5px;
  }

  /* My feedback modal -> bottom sheet */
  .my-feedback-modal {
    padding: 0;
    align-items: flex-end;
  }

  .my-feedback-card {
    max-width: 100%;
    width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 88vh;
  }

  /* FABs */
  .ai-fab {
    bottom: 36px;
    right: 14px;
  }

  .feedback-fab {
    width: 46px;
    height: 46px;
    font-size: 18px;
    bottom: 140px;
    right: 16px;
  }

  .back-top {
    bottom: 195px;
    right: 16px;
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}

/* ================================================================
   480px  Small phone (enhance existing)
================================================================ */
@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .coming-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* Feedback image upload */
  .feedback-img-area {
    gap: 6px;
  }

  .feedback-img-thumb,
  .feedback-img-thumb img,
  .feedback-img-btn {
    width: 64px;
    height: 64px;
  }

  /* Markdown table */
  .markdown-body table {
    font-size: 12.5px;
  }

  .markdown-body th,
  .markdown-body td {
    padding: 6px 10px;
  }

  /* Coming page */
  .coming-page .big-emoji {
    font-size: 48px;
  }

  .coming-page h2 {
    font-size: 1.2rem;
  }

  /* FABs */
  .feedback-fab {
    width: 42px;
    height: 42px;
    font-size: 17px;
    bottom: 130px;
  }

  .back-top {
    bottom: 180px;
  }
}

/* ================================================================
   390px  iPhone standard (new breakpoint)
================================================================ */
@media (max-width: 390px) {

  /* Topnav */
  .topnav-inner {
    padding: 0 10px;
    gap: 6px;
  }

  .brand-logo {
    height: 24px;
  }

  .hamburger-btn {
    width: 32px;
    height: 32px;
  }

  .ai-nav-btn {
    padding: 6px 10px;
    font-size: 12.5px;
  }

  /* Hero */
  .hero {
    padding: 16px 12px 20px;
    border-radius: 10px;
  }

  .hero h1 {
    font-size: 1.35rem;
    letter-spacing: -.2px;
  }

  .hero p {
    font-size: .75rem;
    margin-bottom: 10px;
  }

  .hero-badge {
    font-size: 10px;
    padding: 3px 9px;
    margin-bottom: 8px;
  }

  .hero-btn {
    padding: 7px 14px;
    font-size: 12px;
  }

  /* Content */
  .content-wrap {
    padding: 12px 10px;
  }

  /* Cards */
  .doc-card {
    padding: 14px 11px;
  }

  .card-icon {
    width: 38px;
    height: 38px;
    font-size: 17px;
    margin-bottom: 8px;
  }

  .card-title {
    font-size: 12.5px;
    margin-bottom: 4px;
  }

  .card-desc {
    font-size: 11.5px;
  }

  /* Featured */
  .featured-card {
    padding: 14px 12px;
    gap: 10px;
    margin-bottom: 12px;
  }

  .featured-card-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
    border-radius: 10px;
  }

  .featured-card-title {
    font-size: 1rem;
  }

  .featured-card-desc {
    font-size: 12px;
  }

  /* Article */
  .article-header h1 {
    font-size: 1.2rem;
  }

  .breadcrumb {
    font-size: 11.5px;
  }

  /* Markdown */
  .markdown-body {
    font-size: 13.5px;
  }

  .markdown-body h1 {
    font-size: 1.2rem;
  }

  .markdown-body h2 {
    font-size: 1.05rem;
  }

  /* AI input */
  .ai-input {
    padding: 8px 12px;
  }

  .ai-send-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .ai-input-area {
    padding: 12px 13px;
  }

  /* FABs */
  .ai-fab {
    bottom: 32px;
    right: 12px;
  }

  .feedback-fab {
    bottom: 120px;
    right: 14px;
  }

  .back-top {
    bottom: 170px;
    right: 14px;
  }
}

/* ================================================================
   360px  Small Android (new breakpoint)
================================================================ */
@media (max-width: 360px) {
  .topnav-inner {
    padding: 0 8px;
  }

  .brand-logo {
    height: 22px;
  }

  .nav-login-btn {
    padding: 5px 11px;
    font-size: 12px;
  }

  .ai-nav-btn {
    padding: 5px 9px;
    font-size: 12px;
  }

  .hero {
    padding: 22px 12px 30px;
  }

  .hero h1 {
    font-size: 1.32rem;
  }

  /* Single column on very small screens */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .coming-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Markdown */
  .markdown-body {
    font-size: 13px;
  }

  .markdown-body h1 {
    font-size: 1.12rem;
  }

  .markdown-body h2 {
    font-size: .98rem;
  }

  /* FABs: minimal */
  .ai-fab {
    bottom: 28px;
    right: 10px;
  }

  .ai-fab-label {
    font-size: 11px;
  }

  .feedback-fab {
    width: 40px;
    height: 40px;
    font-size: 16px;
    bottom: 112px;
    right: 12px;
  }

  .back-top {
    bottom: 160px;
    right: 12px;
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
}

/* ================================================================
   Landscape phone (short + wide screen)
================================================================ */
@media (max-width: 900px) and (orientation: landscape) {

  /* Hero: compress vertically */
  .hero {
    padding: 22px 28px;
    margin-bottom: 14px;
  }

  .hero p {
    display: none;
  }

  /* Panels: restore slide-from-right in landscape */
  .ai-panel,
  .feedback-panel {
    top: var(--nav-h) !important;
    left: auto !important;
    right: 0;
    bottom: 0;
    width: min(360px, 90vw);
    max-height: 100dvh;
    border-radius: 0;
    border-left: 1px solid #e2e8f0;
    border-top: none;
    transform: translateX(100%) !important;
  }

  .ai-panel.open,
  .feedback-panel.open {
    transform: none !important;
  }

  /* Mobile nav: denser */
  .mn-item {
    padding: 8px 14px;
    min-height: 40px;
  }

  .mn-group {
    margin-bottom: 14px;
  }

  /* Auth modal: centered, scrollable */
  .auth-modal {
    align-items: flex-start;
    padding: 8px;
    overflow-y: auto;
  }

  .auth-card {
    width: 380px;
    max-width: 94vw;
    border-radius: 14px;
    padding: 20px;
    margin: auto;
  }

  /* My feedback: scrollable */
  .my-feedback-modal {
    align-items: flex-start;
    padding: 8px;
    overflow-y: auto;
  }

  .my-feedback-card {
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
    margin: auto;
  }

  /* FABs */
  .ai-fab {
    bottom: 28px;
    right: 14px;
  }

  .feedback-fab {
    width: 40px;
    height: 40px;
    font-size: 16px;
    bottom: 120px;
    right: 14px;
  }

  /* Performance: skip heavy animations */
  .hero::before,
  .hero::after {
    display: none;
  }
}

/* ================================================================
   Safe area  iPhone notch / Dynamic Island / Android cutout
================================================================ */
@supports (padding: max(0px)) {
  .topnav-inner {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  @media (max-width: 600px) {
    .topnav-inner {
      padding-left: max(12px, env(safe-area-inset-left));
      padding-right: max(12px, env(safe-area-inset-right));
    }
  }

  .mobile-nav {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .ai-fab {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(32px, calc(env(safe-area-inset-bottom) + 24px));
  }

  .feedback-fab {
    right: max(18px, env(safe-area-inset-right));
    bottom: max(120px, calc(env(safe-area-inset-bottom) + 110px));
  }

  .back-top {
    right: max(18px, env(safe-area-inset-right));
    bottom: max(170px, calc(env(safe-area-inset-bottom) + 160px));
  }

  .feedback-panel,
  .ai-panel {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .my-feedback-modal {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ================================================================
   MOBILE NAV FIX - v2.1
================================================================ */

/* Fix 1: restore nav-user to rightmost (cancel order:-1) */
@media (max-width: 820px) {
  #nav-user {
    order: 0;
  }
}

/* Fix 2: feedback button - icon-only on mobile */
@media (max-width: 768px) {
  .feedback-nav-btn {
    padding: 7px 10px;
    font-size: 15px;
  }

  .feedback-nav-btn .btn-text {
    display: none;
  }
}

/* Hide text inside feedback-nav-btn on narrow screens */
@media (max-width: 600px) {
  .feedback-nav-btn {
    display: inline-flex !important;
    padding: 7px 9px;
    font-size: 16px;
    box-shadow: none;
  }
}

/* Fix 3: AI panel - fixed height on mobile, no resize */
@media (max-width: 600px) {
  .ai-panel {
    max-height: none !important;
    height: 88vh;
    height: 88dvh;
  }

  .ai-panel.open {
    height: 88vh;
    height: 88dvh;
  }

  .feedback-panel {
    max-height: none !important;
    height: auto;
    max-height: 92vh !important;
    max-height: 92dvh !important;
  }
}

/* ================================================================
   MOBILE NAV FIX - v2.3  全元素 flex-shrink:0 + 紧凑布局
================================================================ */
@media (max-width: 768px) {

  /* topnav 内边距收紧 */
  .topnav-inner {
    padding: 0 10px;
    gap: 4px;
  }

  /* brand 允许轻微收缩，不占多余空间 */
  .nav-brand {
    flex-shrink: 1;
    margin-right: 2px;
  }

  /* 首页按钮：恢复显示，紧凑尺寸，禁止收缩 */
  .nav-home-btn {
    display: flex !important;
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 13px;
  }

  /* nav-actions 整体禁止收缩，gap 收紧 */
  .nav-actions {
    flex-shrink: 0;
    gap: 4px;
  }

  /* AI 和 建议：手机端顶栏隐藏，通过 FAB / 抽屉菜单访问 */
  .ai-nav-btn {
    display: none !important;
  }

  .feedback-nav-btn {
    display: none !important;
  }

  /* 汉堡和用户按钮禁止收缩 */
  .hamburger-btn {
    flex-shrink: 0;
  }

  #nav-user {
    flex-shrink: 0;
  }
}

/* 390px 以下进一步压缩 */
@media (max-width: 390px) {
  .nav-home-btn {
    padding: 5px 8px;
    font-size: 12.5px;
  }

  .nav-login-btn {
    padding: 5px 11px;
    font-size: 12px;
  }

  .nav-actions {
    gap: 3px;
  }
}

/* 360px 以下极限压缩 */
@media (max-width: 360px) {
  .topnav-inner {
    padding: 0 6px;
    gap: 3px;
  }

  .nav-home-btn {
    padding: 5px 6px;
    font-size: 12px;
  }

  .nav-actions {
    gap: 2px;
  }
}

/* ================================================================
   AI 答案区域（后端 RAG 模式）
================================================================ */

/* 答案容器 */
.ai-answer-wrap {
  font-size: 13.5px;
  line-height: 1.7;
}

/* markdown-body 在 AI 面板内的覆盖：去掉背景/内边距，继承颜色 */
.ai-answer-body.markdown-body {
  font-size: 13.5px !important;
  background: transparent !important;
  padding: 0 !important;
  color: inherit !important;
  border-radius: 0 !important;
}

.ai-answer-body.markdown-body p {
  margin: 0 0 6px;
}

.ai-answer-body.markdown-body p:last-child {
  margin-bottom: 0;
}

.ai-answer-body.markdown-body ul,
.ai-answer-body.markdown-body ol {
  padding-left: 18px;
  margin: 4px 0 6px;
}

.ai-answer-body.markdown-body li {
  margin: 2px 0;
}

.ai-answer-body.markdown-body code {
  font-size: 12px;
  background: rgba(99, 102, 241, .15);
  padding: 1px 5px;
  border-radius: 4px;
  color: #a5b4fc;
}

.ai-answer-body.markdown-body pre {
  background: rgba(0, 0, 0, .25);
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 6px 0;
}

.ai-answer-body.markdown-body pre code {
  background: none;
  padding: 0;
  color: #e2e8f0;
}

.ai-answer-body.markdown-body strong {
  color: #c7d2fe;
}

.ai-answer-body.markdown-body h1,
.ai-answer-body.markdown-body h2,
.ai-answer-body.markdown-body h3 {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 8px 0 4px;
  border-bottom: none;
  padding-bottom: 0;
}

.ai-answer-body.markdown-body hr {
  border: none;
  border-top: 1px solid rgba(99, 102, 241, .18);
  margin: 8px 0;
}

/* 参考文档区 */
.ai-sources {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(99, 102, 241, .20);
}

.ai-sources-label {
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 6px;
  letter-spacing: .3px;
}

.ai-sources-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ai-source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 12px;
  color: #a5b4fc;
  background: rgba(99, 102, 241, .10);
  border: 1px solid rgba(99, 102, 241, .22);
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.ai-source-link:hover {
  background: rgba(99, 102, 241, .22);
  color: #c7d2fe;
}