/* —— 主站：AI 工具紧凑下拉（非 mega） —— */
.nav-ai { position: relative; }
.nav-ai > summary {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 8px 10px; border-radius: 10px;
  color: var(--muted); font-size: 14px; line-height: 1.3; font-weight: 600; cursor: pointer; list-style: none;
}
.nav-ai > summary::-webkit-details-marker, .nav-ai > summary::marker { display: none; content: none; }
.nav-ai[open] > summary, .nav-ai > summary:hover { color: var(--text); }
.nav-ai[open] > summary { color: var(--accent-ink); background: var(--accent-soft); }
.nav-ai > summary .chev { width: 16px; height: 16px; }
.nav-ai[open] > summary .chev { transform: rotate(180deg); }
.ai-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40;
  width: 248px; padding: 8px;
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow);
}
.ai-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px; border-radius: 12px;
  color: var(--text); text-decoration: none; font-weight: 650;
}
.ai-menu a:hover { background: var(--soft); }
.ai-menu .ai-mini {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.ai-menu .ai-mini svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ai-menu small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; font-weight: 500; }

/* 手机抽屉里的 AI 分组（对齐 .drawer-tools） */
.drawer-ai > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 48px; padding: 12px 14px; border: 0; border-radius: 12px;
  background: transparent; color: var(--text);
  font-size: 16px; font-weight: 650; cursor: pointer; list-style: none;
}
.drawer-ai > summary::-webkit-details-marker, .drawer-ai > summary::marker { display: none; content: none; }
.drawer-ai > summary .chev {
  width: 14px; height: 14px; flex: 0 0 14px;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .16s ease;
}
.drawer-ai[open] > summary { color: var(--accent-ink); }
.drawer-ai[open] > summary .chev { transform: rotate(180deg); }
.drawer-ai-body { display: flex; flex-direction: column; gap: 4px; padding: 4px 6px 12px 10px; }
.drawer-ai-body a {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 8px 12px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: 15px; font-weight: 650;
}
.drawer-ai-body a:hover { background: var(--soft); }

/* —— 主站首页收紧，保证 1280×800 / 390×844 首屏见到三卡 —— */
.portal.compact-home > section { margin-top: 48px; }
.portal.compact-home > .hero { margin-top: 0; padding: 16px 0 0; gap: 28px; }
.portal.compact-home > .ai-entry { margin-top: 20px; }
.portal.compact-home .hero h1 { font-size: clamp(28px, 6vw, 44px); }
.portal.compact-home .hero .intro { margin-top: 10px; }
.portal.compact-home .hero-cta { margin-top: 16px; }
.portal.compact-home .hero-cta .primary-button,
.portal.compact-home .hero-cta .secondary-button { min-height: 44px; padding-inline: 18px; font-size: 15px; }
.portal.compact-home .hero-demo { min-height: 0; }

.ai-entry h2 { margin: 0 0 12px; font-size: 1.15rem; }
.ai-cards {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin: 0; padding: 0; list-style: none;
}
.ai-card a {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto;
  column-gap: 12px; align-items: center;
  min-height: 0; padding: 14px 16px;
  border: 1px solid var(--pill-border); border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface) 40%, var(--accent-soft));
  box-shadow: var(--shadow); color: inherit; text-decoration: none;
}
.ai-card .ai-icon {
  grid-row: 1 / span 2;
  width: 40px; height: 40px; padding: 8px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.ai-card .ai-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ai-card h3 { margin: 0; font-size: 15px; font-weight: 800; }
.ai-card p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }


.ai-menu .ai-mini { flex: 0 0 32px; }
.ai-menu a { padding: 10px; color: var(--text); }
.nav-ai > summary .chev { fill: none; stroke: currentColor; stroke-width: 1.8; }
.ai-card a:hover, .ai-card a:focus-visible { border-color: var(--accent); }
@media (max-width: 700px) {
 .portal.compact-home > .hero { padding-top: 12px; gap: 16px; }
 .portal.compact-home .demo-grid { min-height: 96px; }
 .ai-cards { gap: 8px; }
 .ai-card a { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 10px 4px; gap: 4px; text-align: center; height: 100%; }
 .ai-card .ai-icon { grid-row: auto; width: 30px; height: 30px; padding: 5px; }
 .ai-card h3 { font-size: 12px; overflow-wrap: anywhere; }
 .ai-card p { display: none; }
}
@media (min-width: 640px) and (max-width: 959px) {
 .portal-header .top-nav > a, .portal-header .nav-tools > summary, .portal-header .nav-ai > summary { padding-inline: 6px; font-size: 13px; }
 .portal-header .lang-current { display: none; }
}

.nav-ai > summary[aria-current="page"], .drawer-ai > summary[aria-current="page"],
.ai-menu a[aria-current="page"], .drawer-ai-body a[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); }
