/* SeMo3D 项目页 · 组件样式（品牌色、按钮、轮播、对比视频、3D 查看器）
   品牌色：Se=#D9864A、Mo3D=#355E8B；蓝橙衍生色由主色统一生成。 */
:root {
  --navy: #355E8B;
  --orange: #D9864A;
  --navy-soft: color-mix(in srgb, var(--navy) 55%, white);
  --navy-tint: color-mix(in srgb, var(--navy) 10%, white);
  --navy-highlight: color-mix(in srgb, var(--navy) 16%, white);
  --orange-ink: color-mix(in srgb, var(--orange) 50%, #512C15);
  --orange-on: #3D2B1F;
  --orange-soft: color-mix(in srgb, var(--orange) 55%, white);
  --orange-tint: color-mix(in srgb, var(--orange) 10%, white);
  --orange-highlight: color-mix(in srgb, var(--orange) 20%, white);
  --ink: #27384A;
  --text: #33414f;
  --muted: #5b6672;
  --faint: #8a939d;
  --line: #e2e6ea;
  --soft: #f5f6f8;
  --bg: #ffffff;
  --radius-card: 18px;
  --radius-panel: 16px;
  --radius-board: 14px;
  --radius-stage: 12px;
  --radius-control: 8px;
  --viewer-toolbar-height: 48px;
  --viewer-toolbar-bottom: 10px;
  --viewer-toolbar-gap: 6px;
  --viewer-control-size: 12px;

  --gen: color-mix(in srgb, var(--navy) 78%, white); --gen-soft: var(--navy-soft); --gen-tint: var(--navy-tint);
  --edit: #629E84;  --edit-soft: #89B6A3;  --edit-tint: #E6EFEB;
  --comp: var(--orange); --comp-soft: var(--orange-soft); --comp-tint: var(--orange-tint);
  --multi: #9383BE; --multi-soft: #AEA2CE; --multi-tint: #EEEBF5;
  --point: #d9483b;
  --keep: var(--navy);

  --serif: "Times New Roman", Tinos, "Liberation Serif", Times, "Songti SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

[data-task="gen"]   { --task: var(--gen);   --task-soft: var(--gen-soft);   --task-tint: var(--gen-tint); }
[data-task="edit"]  { --task: var(--edit);  --task-soft: var(--edit-soft);  --task-tint: var(--edit-tint); }
[data-task="comp"]  { --task: var(--comp);  --task-soft: var(--comp-soft);  --task-tint: var(--comp-tint); }
[data-task="multi"] { --task: var(--multi); --task-soft: var(--multi-soft); --task-tint: var(--multi-tint); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ---------- 品牌字标 ---------- */
.se { color: var(--orange); }
.mo { color: var(--navy); }
.wordmark { font-family: var(--serif); font-weight: 700; letter-spacing: .005em; white-space: nowrap; }

/* ---------- 链接按钮 ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 999px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn .ico-stroke { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn .ico-fill { fill: currentColor; }
.btn .emoji { font-size: 1.1em; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.btn[data-soon]::after {
  content: "Coming soon"; position: absolute; left: 50%; top: calc(100% + 8px); transform: translate(-50%, -4px);
  padding: 4px 9px; border-radius: 6px; background: var(--ink); color: #fff; font: 12px/1.4 var(--sans);
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; white-space: nowrap;
}
.btn[data-soon]:hover::after, .btn[data-soon]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Teaser ---------- */
.teaser { position: relative; }
.teaser video { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: #c9c6c2; }
.teaser-replay {
  position: absolute; right: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 10px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(39, 56, 74, .72); color: #fff; font: 13px/1 var(--sans); backdrop-filter: blur(6px);
}
.teaser-replay svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.teaser-replay:hover { background: var(--navy); }

/* ---------- 插图 ---------- */
.figure img { width: 100%; height: auto; }
.figure figcaption { margin-top: 12px; font-size: .9em; line-height: 1.55; color: var(--muted); }

/* ---------- 轮播 ---------- */
.cr { position: relative; outline: none; }
.cr-stage { position: relative; }
.cr-viewport { overflow: hidden; touch-action: pan-y; }
.cr-track { display: flex; transition: transform .55s var(--ease); will-change: transform; }
.cr-slide { flex: 0 0 100%; min-width: 0; }
.cr-arrow {
  position: absolute; top: 50%; z-index: 4; width: 44px; height: 44px; margin-top: -22px;
  display: grid; place-items: center; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .94); color: var(--ink);
  box-shadow: 0 2px 10px rgba(30, 45, 60, .1); transition: background-color .15s, color .15s, border-color .15s, transform .15s;
}
.cr-arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cr-arrow:hover { background: var(--task, var(--navy)); border-color: transparent; color: #fff; }
.cr-arrow:active { transform: scale(.94); }
.cr-prev { left: -64px; }
.cr-next { right: -64px; }
.cr-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; }
.cr-dots { display: flex; gap: 8px; }
.cr-dot { width: 28px; height: 4px; padding: 0; border: 0; border-radius: 2px; background: var(--line); cursor: pointer; transition: background-color .2s, width .2s; }
.cr-dot:hover { background: var(--task-soft, var(--faint)); }
.cr-dot.is-active { width: 44px; background: var(--task, var(--navy)); }
.cr-count { min-width: 3.4em; color: var(--faint); font: 13px/1 var(--sans); font-variant-numeric: tabular-nums; }
.cr-nav--thumbs { justify-content: center; }
.cr-thumbs { position: relative; display: flex; gap: 8px; max-width: 100%; overflow-x: auto; padding: 4px; scrollbar-width: none; }
.cr-thumbs::-webkit-scrollbar { display: none; }
.cr-thumb {
  flex: none; width: 64px; height: 64px; padding: 5px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; opacity: .6; transition: opacity .15s, border-color .15s, box-shadow .15s;
}
.cr-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cr-thumb:hover { opacity: .9; }
.cr-thumb.is-active { opacity: 1; border-color: var(--task, var(--navy)); box-shadow: 0 0 0 3px var(--task-tint, var(--soft)); }

/* ---------- 条件（Image / Text） ---------- */
.cond-label { margin-bottom: 6px; color: var(--ink); font-weight: 700; }
.cond-sub { color: var(--faint); font-weight: 400; font-size: .9em; }
.cond-img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.cond-text { margin: 0; color: var(--muted); font-style: italic; line-height: 1.45; }

/* ---------- 对比视频 case ---------- */
.vcase { display: grid; grid-template-columns: minmax(170px, 21%) minmax(0, 1fr); align-items: center; }
.vcase-cond {
  display: flex; flex-direction: column; gap: 22px; align-self: stretch; justify-content: center;
  padding-right: 22px; margin-right: 22px; border-right: 1.5px solid var(--task-soft, var(--line)); text-align: center;
}
.vcase-cond .cond-img { max-width: 220px; margin: 0 auto; }
.vcase-grid { position: relative; container-type: inline-size; background: #fff; }
.vcase-grid video { width: 100%; height: 100%; object-fit: contain; }
.vcase-labels { position: absolute; inset: 0; pointer-events: none; }
/* 对比视频缓冲时的提示 */
.vcase-grid::after {
  content: "Loading Video…"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 8px 14px; border-radius: 10px;
  background: rgba(255, 255, 255, .92); box-shadow: 0 4px 18px rgba(39, 56, 74, .12); color: var(--muted); font: 500 13px/1.3 var(--sans);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.vcase-grid.is-loading::after { opacity: 1; transition-delay: .25s; }
.vlabel {
  position: absolute; display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--ink); font-size: clamp(9px, 1.7cqw, 18px); line-height: 1.15; white-space: nowrap;
}
.vlabel.is-ours { color: var(--task); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .28em; }
.vlabel.is-prompt { padding: 0 4%; white-space: normal; color: var(--muted); font-style: italic; font-size: clamp(10px, 1.75cqw, 17px); }

/* ---------- 交互式 3D case ---------- */
.gcase { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.gcase-info { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 26px; align-items: center; }
.gcase-info .cond--image .cond-label { display: none; }
.gcase-info .cond-img { width: 176px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.gcase-meta { display: grid; gap: 10px; }
.gcase-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; color: var(--faint); font-size: .86em; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.lg + .lg, .gcase-legend .lg:not(:first-child) { margin-left: 10px; }
.lg-point { background: var(--point); }
.lg-cloud { background: radial-gradient(circle, #8d97a2 30%, transparent 32%) 0 0 / 4px 4px; border: 1px solid #b8c0c8; }
.lg-mask { border-radius: 2px; background: rgba(143, 155, 170, .35); border: 1px solid #56626f; }
.gcase-prompts { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.gcase-prompts li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: baseline; color: var(--muted); font-style: italic; line-height: 1.4; }
.gcase-num {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--task, var(--navy)); color: #fff; font: 600 11px/1 var(--sans); font-style: normal;
}
.gcase--multi { grid-template-columns: minmax(240px, 32%) minmax(0, 1fr); gap: 28px; align-items: center; }
.gcase--multi .gcase-info { grid-template-columns: minmax(0, 1fr); align-items: start; }
.gcase--multi .gcase-info .cond--image .cond-label { display: block; }
.gcase--multi .gcase-info .cond-img { width: 100%; max-width: 280px; }

.gcase-stage { position: relative; overflow: hidden; border: 0; border-radius: var(--radius-stage); background: var(--stage-bg, #f6f7f9); aspect-ratio: var(--ar, 2 / 1); }
.gcase-posters { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); transition: opacity .35s; }
.gcase-posters img { width: 100%; height: 100%; object-fit: contain; }
.gcase-posters img:not(.is-last-col) { border-right: 1px solid var(--pane-sep, rgba(39, 56, 74, .08)); }
.gcase-posters img:not(.is-last-row) { border-bottom: 1px solid var(--pane-sep, rgba(39, 56, 74, .08)); }
.gcase-stage.is-live .gcase-posters { opacity: 0; }

/* 3D 查看器（viewer3d.js 生成的 DOM） */
.v3d { position: absolute; inset: 0; }
.v3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; outline: none; }
.v3d-canvas:active { cursor: grabbing; }
.v3d-panes { position: absolute; inset: 0; display: grid; pointer-events: none; }
.v3d-pane { position: relative; min-width: 0; }
.v3d-pane:not(.is-last-col) { border-right: 1px solid var(--pane-sep, rgba(39, 56, 74, .08)); }
.v3d-pane:not(.is-last-row) { border-bottom: 1px solid var(--pane-sep, rgba(39, 56, 74, .08)); }
.v3d-label {
  position: absolute; left: 12px; top: 10px; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 3px 9px; border-radius: 7px; background: rgba(255, 255, 255, .82); color: var(--ink); font: 600 13px/1.3 var(--sans);
}
.v3d-label.is-ours { color: var(--task, var(--navy)); }
.v3d-pane:has(.v3d-downloads) .v3d-label { max-width: calc(100% - 136px); }
.v3d-downloads { position: absolute; right: 10px; top: 8px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.gcase--multi .v3d-label { min-width: 24px; text-align: center; background: var(--task, var(--navy)); color: #fff; border-radius: 999px; padding: 3px 8px; }
.v3d-download {
  display: inline-flex; align-items: center; gap: 5px; pointer-events: auto; white-space: nowrap;
  padding: 5px 10px; border-radius: var(--radius-control); text-decoration: none; background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line); color: var(--ink); font: 600 12px/1 var(--sans); transition: background-color .15s, color .15s, border-color .15s;
}
.v3d-download svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.v3d-download:hover { background: var(--task, var(--navy)); border-color: transparent; color: #fff; }
/* 加载提示：舞台中央一个提示框（文字 + 百分比 + 进度条），模型就绪后淡出 */
.v3d-loading { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; transition: opacity .35s; }
.v3d.is-ready .v3d-loading { opacity: 0; }
.v3d-loading-box {
  display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 8px 10px; padding: 12px 16px 13px; border-radius: 12px;
  background: rgba(255, 255, 255, .94); box-shadow: 0 4px 18px rgba(39, 56, 74, .12); color: var(--ink); font: 500 13px/1.3 var(--sans);
}
.v3d-loading .v3d-pct { color: var(--faint); font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.v3d-bar { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.v3d-bar i { display: block; height: 100%; background: var(--task, var(--navy)); transform-origin: left; transform: scaleX(0); transition: transform .2s; }
/* 3D 查看器还没挂载（脚本 / 首个模型尚未开始加载）时，静态预览图上也给出提示 */
.gcase-stage:not(.is-live)::before {
  content: "Loading 3D Viewer, Please Wait…"; position: absolute; left: 50%; top: 50%; z-index: 1; transform: translate(-50%, -50%);
  padding: 9px 14px; border-radius: 10px; background: rgba(255, 255, 255, .9); color: var(--muted); font: 500 13px/1.3 var(--sans);
  white-space: nowrap; pointer-events: none;
}
.gcase-stage:has(.v3d)::before, .no-3d .gcase-stage::before { display: none; }
.v3d-spinner { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--task, var(--navy)); animation: v3d-spin .8s linear infinite; }
@keyframes v3d-spin { to { transform: rotate(360deg); } }
.v3d-toolbar { position: absolute; left: 50%; bottom: var(--viewer-toolbar-bottom); transform: translateX(-50%); display: flex; gap: var(--viewer-toolbar-gap); width: max-content; max-width: calc(100% - 20px); overflow-x: auto; scrollbar-width: none; }
.v3d-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 10px; border-radius: var(--radius-control); cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .9); color: var(--muted); font: 500 var(--viewer-control-size)/1.3 var(--sans);
  transition: background-color .15s, color .15s, border-color .15s;
}
.v3d-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.v3d-btn:hover { color: var(--ink); border-color: #c9d0d7; }
.v3d-btn[aria-pressed="true"] { color: var(--ink); }
.v3d-switch { position: relative; width: 22px; height: 12px; border-radius: 6px; background: #cfd5db; transition: background-color .15s; }
.v3d-switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 8px; height: 8px; border-radius: 50%; background: #fff; transition: transform .15s; }
.v3d-btn[aria-pressed="true"] .v3d-switch { background: var(--task, var(--navy)); }
.v3d-btn[aria-pressed="true"] .v3d-switch::after { transform: translateX(10px); }
.v3d-btn[data-action="rotate"][aria-pressed="true"] svg { color: var(--task, var(--navy)); }
.v3d-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 7px 13px; border-radius: 8px;
  background: rgba(39, 56, 74, .82); color: #fff; font: 13px/1.3 var(--sans); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.v3d.show-hint .v3d-hint { opacity: 1; }
.no-3d .gcase-stage::after {
  content: "Open This Page over HTTP(S) to Enable the Interactive 3D Viewer"; position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  padding: 5px 10px; border-radius: 6px; background: rgba(255, 255, 255, .9); color: var(--muted); font: 12px/1.3 var(--sans); white-space: nowrap;
}

/* ---------- BibTeX ---------- */
.bibtex { position: relative; }
.bibtex pre { margin: 0; overflow-x: auto; font: 13.5px/1.6 var(--mono); }
.copy-btn {
  position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px;
  cursor: pointer; font: 500 12px/1 var(--sans); transition: background-color .15s, color .15s, border-color .15s;
}
.copy-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 响应式 ---------- */
@media (max-width: 1240px) {
  .cr-prev { left: 8px; }
  .cr-next { right: 8px; }
  .cr-arrow { width: 38px; height: 38px; margin-top: -19px; }
}
@media (max-width: 760px) {
  .vcase { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .vcase-cond { flex-direction: row; align-items: center; gap: 16px; padding: 0 0 12px; margin: 0; border-right: 0; border-bottom: 1.5px solid var(--task-soft, var(--line)); text-align: left; }
  .vcase-cond .cond { flex: 1; }
  .vcase-cond .cond:first-child { flex: 0 0 120px; }
  .vcase-cond .cond-img { max-width: 120px; margin: 0; }
  .gcase-info { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; }
  .gcase-info .cond-img { width: 112px; padding: 5px; }
  .gcase--multi { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .gcase--multi .gcase-info { grid-template-columns: 120px minmax(0, 1fr); }
  .gcase--multi .gcase-info .cond-img { max-width: 120px; }
  .cr-arrow { top: auto; bottom: -50px; margin-top: 0; }
  .cr-prev { left: 0; }
  .cr-next { right: 0; }
  .cr-nav { padding: 0 52px; }
  .v3d-btn span:not(.v3d-switch) { display: none; }
  .v3d-toolbar { gap: 4px; max-width: calc(100% - 12px); }
  .v3d-btn { padding: 6px 8px; gap: 5px; }
  .gcase-stage--row2 { aspect-ratio: 1 / 1.6; }
  .gcase-stage--row2 .gcase-posters { grid-template-columns: 1fr; }
  .gcase-stage--row2 .gcase-posters img { border-right: 0 !important; }
  .gcase-stage--row2 .gcase-posters img:first-child { border-bottom: 1px solid var(--pane-sep, rgba(39, 56, 74, .08)); }
  .v3d-btn[data-toggle] span:not(.v3d-switch) { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cr-track { transition: none; }
}
