/* Agent 入口只占首页导航；浮层不移动或遮罩上传主操作。 */
.agent-entry { position: relative; z-index: 5; }
.agent-trigger, .agent-copy {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; border-radius: 999px;
  padding: 0 15px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.agent-trigger {
  border: 1px solid #d7fff452;
  background: linear-gradient(140deg, #1b5257b8, #093b46cf);
  color: #effff9;
  box-shadow: 0 6px 18px #00283324, inset 0 1px 0 #ffffff24;
  transition: background-color .18s, border-color .18s, box-shadow .18s, transform .18s;
}
.agent-trigger svg { color: #9ef0d6; }
.agent-trigger:hover,
.figma-entry[open] > .agent-trigger,
.agent-trigger[aria-expanded="true"] {
  border-color: #c8f3e099;
  background: linear-gradient(140deg, #226368d4, #0d4854eb);
  box-shadow: 0 8px 22px #00283333, inset 0 1px 0 #ffffff33;
}
.agent-copy {
  min-height: 40px; gap: 8px; padding: 0 16px;
  border: 1px solid #dcfff080; background: #c8f3e0; color: #10453e;
}
.agent-copy:hover { background: #e4ffef; }
.agent-trigger svg, .agent-copy svg { width: 16px; height: 16px; flex: none; }
.agent-popover {
  position: absolute; top: calc(100% + 12px); right: 0;
  width: min(340px, calc(100vw - 40px)); padding: 20px; box-sizing: border-box;
  border: 1px solid #d7fff45c; border-radius: 16px;
  background: #104852; color: #effff9; text-align: left;
  box-shadow: 0 12px 32px #00263030;
}
.agent-popover[hidden], .agent-entry [hidden] { display: none; }
.agent-popover h2 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.45; }
.agent-popover p { margin: 8px 0 16px; color: #c6e7de; font-size: 13px; line-height: 1.65; }
.agent-copy { width: 100%; border-radius: 9px; }
.agent-client { white-space: nowrap; }
.agent-copy:disabled { opacity: .65; cursor: wait; }
.agent-popover .agent-status { margin: 10px 0 0; font-size: 12px; }
.agent-status:empty { display: none; }
.agent-manual { display: block; margin-top: 12px; font-size: 12px; color: #c6e7de; }
.agent-manual textarea {
  display: block; width: 100%; box-sizing: border-box; min-height: 115px; margin-top: 6px;
  border: 1px solid #d7fff470; border-radius: 6px; padding: 8px;
  color: #effff9; background: #073b46; font: inherit; resize: vertical;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .agent-trigger { backdrop-filter: blur(14px) saturate(120%); -webkit-backdrop-filter: blur(14px) saturate(120%); }
  .agent-popover { background: #104852ed; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
}
@media (prefers-reduced-transparency: reduce) {
  .agent-trigger { background: #104852; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .agent-popover { background: #104852; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (max-width: 720px) { .agent-trigger { padding-inline: 13px; } }

.agent-popover,
.agent-manual textarea,
.intro-video-dialog {
  color-scheme: dark;
  overscroll-behavior: contain;
}
:is(.agent-popover, .agent-manual textarea, .intro-video-dialog)::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
:is(.agent-popover, .agent-manual textarea, .intro-video-dialog)::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
:is(.agent-popover, .agent-manual textarea, .intro-video-dialog)::-webkit-scrollbar-track {
  background: transparent;
  margin-block: 12px;
}
:is(.agent-popover, .agent-manual textarea, .intro-video-dialog)::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #9ef0d647;
}
:is(.agent-popover, .agent-manual textarea, .intro-video-dialog)::-webkit-scrollbar-thumb:hover {
  background: #9ef0d67a;
}
@supports not selector(::-webkit-scrollbar) {
  .agent-popover,
  .agent-manual textarea,
  .intro-video-dialog {
    scrollbar-width: thin;
    scrollbar-color: #9ef0d659 transparent;
  }
}

/* Figma 下载与 Agent 接入共用首页浮层样式。 */
.figma-entry > summary { list-style: none; white-space: nowrap; }
.figma-entry > summary::-webkit-details-marker { display: none; }
.figma-entry .agent-popover {
  width: min(641px, calc(100vw - 40px), max(380px, calc((100dvh - 315px) * 1.27 + 40px)));
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
}
.figma-download { box-sizing: border-box; margin-top: 14px; text-decoration: none; }
.figma-entry .figma-install-note { margin-bottom: 0; font-size: 16px; line-height: 1.7; color: #effff9; }
.figma-install-guide { margin: 16px 0 0; border-radius: 10px; overflow: hidden; }
.figma-install-guide img { display: block; width: 100%; height: auto; }
@media (max-height: 780px) {
  .figma-entry .agent-popover {
    width: min(641px, calc(100vw - 40px), max(360px, calc((100dvh - 285px) * 1.27 + 32px)));
    padding: 16px;
  }
  .figma-download { margin-top: 10px; min-height: 38px; }
  .figma-install-guide { margin-top: 12px; }
  .figma-entry .figma-install-note { margin-top: 12px; font-size: 14px; line-height: 1.55; }
}
@media (max-width: 720px) {
  .ocean-header-actions { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .intro .site-header { position: relative; flex-wrap: wrap; padding-block: 12px; gap: 12px; }
  .ocean-header-actions .agent-entry { position: static; }
  .ocean-header-actions .agent-popover { top: calc(100% - 2px); right: 0; z-index: 6; max-height: calc(100dvh - 150px); overflow-y: auto; }
}

/* 首页顶部「30 秒了解易图」入口与 5:4 视频播放弹窗。 */
.intro-video-trigger {
  white-space: nowrap;
}
.intro-video-trigger:active { transform: translateY(1px); }

.intro-video-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 20px;
  border: 0;
  background: transparent;
  color: #103f40;
  box-sizing: border-box;
  overflow: auto;
}
.intro-video-dialog[open] {
  display: grid;
  place-items: center;
}
.intro-video-dialog::backdrop {
  background: #06283085;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.intro-video-panel {
  width: min(940px, calc(100vw - 48px), calc((100dvh - 96px) * 1.25));
  min-width: min(280px, calc(100vw - 32px));
  padding: 12px 14px 14px;
  border: 1px solid #ffffffcc;
  border-radius: 22px;
  background: #f5fbfaf7;
  box-shadow: 0 28px 72px #021c2459, inset 0 1px 0 #fff;
  box-sizing: border-box;
}
.intro-video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 10px;
}
.intro-video-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: #103f40;
  letter-spacing: -.2px;
}
.intro-video-close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #103f4024;
  border-radius: 50%;
  background: #ffffffbf;
  color: #103f40;
  cursor: pointer;
}
.intro-video-close:hover {
  border-color: #0d4b5259;
  background: #fff;
}
.intro-video-close:focus-visible,
.intro-video-retry:focus-visible {
  outline: 2px solid #087f8c;
  outline-offset: 2px;
}
.intro-video-close svg { width: 16px; height: 16px; }
.intro-video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 4;
  border-radius: 14px;
  overflow: hidden;
  background: #f9fbfb;
  border: 1px solid #103f4017;
}
.intro-video-player {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f9fbfb;
}
.intro-video-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  background: #f5fbfad9;
  color: #103f40;
  text-align: center;
  pointer-events: none;
}
.intro-video-status[hidden],
.intro-video-retry[hidden] { display: none; }
.intro-video-dialog[data-state="error"] .intro-video-status {
  pointer-events: auto;
  background: #f5fbfaf2;
}
.intro-video-status p {
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: #ffffffeb;
  border: 1px solid #103f401f;
  font-size: 13px;
  font-weight: 550;
  box-shadow: 0 4px 14px #063d4614;
}
.intro-video-retry {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid #087f8c;
  border-radius: 999px;
  background: #087f8c;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.intro-video-retry:hover { background: #066a75; }
@media (prefers-reduced-transparency: reduce) {
  .intro-video-dialog::backdrop {
    background: #062830bf;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .intro-video-panel { background: #f5fbfa; }
}
@media (max-width: 720px) {
  .intro-video-dialog { padding: 12px; }
  .intro-video-panel {
    width: min(100%, calc(100vw - 24px), calc((100dvh - 108px) * 1.25));
    padding: 10px 10px 12px;
    border-radius: 18px;
  }
  .intro-video-header h2 { font-size: 15px; }
}

/* Figma 安装入口只保留系统、复制命令和对应图解。 */
.intro .site-header { position: relative; }
.ocean-header-actions .figma-entry { position: static; }
.figma-entry .agent-popover { top: calc(100% - 2px); width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 110px); padding: 0 20px 20px; color: #164650; color-scheme: light; background: #f7fffc; border-color: #ffffffb3; box-shadow: 0 18px 56px #00353e30; }
.figma-install-controls { position: sticky; top: 0; z-index: 1; padding: 20px 0 16px; background: #f7fffc; }
.figma-entry .figma-install-controls h2 { font-size: 17px; }
.figma-install-actions { display: flex; gap: 12px; margin-top: 14px; }
.figma-system-choice { flex: none; }
.figma-system-choice .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.figma-system-choice select {
  appearance: none; -webkit-appearance: none;
  box-sizing: border-box; width: 148px; height: 44px; padding: 0 38px 0 15px;
  border: 1px solid #c2dcd3; border-radius: 10px; background-color: #edf7f2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='m3 4.5 3 3 3-3' stroke='%234e786c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  color: #24584b; font: inherit; font-size: 13px; font-weight: 600; line-height: 1.4;
  color-scheme: light; cursor: pointer;
}
.figma-system-choice select:hover { border-color: #8ebfac; background-color: #e3f2eb; }
.figma-system-choice select:focus-visible { outline: 3px solid #00877826; outline-offset: 2px; border-color: #008778; }
.figma-system-choice select:disabled { opacity: .55; cursor: wait; }
.figma-entry #figma-shell-copy { flex: 1; min-width: 0; min-height: 44px; color: #fff; background: #008778; }
.figma-entry #figma-shell-copy:hover { background: #006f64; }
.figma-entry .agent-status { color: #28675f; }
.figma-entry .agent-manual { color: #47636c; }
.figma-entry .agent-manual textarea { color: #164650; background: #fff; border-color: #b9d8ce; }
.figma-entry .figma-install-guide { display: block; margin: 0; border-radius: 12px; }
.figma-install-guide:focus-visible { outline: 2px solid #008778; outline-offset: 3px; }
.figma-entry .agent-popover::-webkit-scrollbar-thumb { background: #8daea3; }
@media (max-width: 720px) { .figma-entry .agent-popover { right: 0; max-height: calc(100dvh - 190px); padding: 0 12px 12px; } .figma-install-controls { padding-top: 14px; } .figma-install-actions { gap: 8px; } }
