.competition-flight-target {
  position: absolute; z-index: 2; top: 0; left: 0; margin: 0; padding: 0;
  border: 0; border-radius: 6px; appearance: none; background: transparent;
  cursor: pointer; touch-action: manipulation;
}
.competition-flight-target:focus-visible, .saig-fallback-trigger:focus-visible { outline: 3px solid #805633; outline-offset: 3px; }
.competition-flight-caption {
  position: absolute; display: grid; place-items: center; width: 60px; height: 18px;
  border: 1px solid #9e6750; border-radius: 3px; background: #fff4dd; color: #793724;
  font: 700 11px/1 "Microsoft YaHei","PingFang SC",sans-serif; pointer-events: none;
}
.competition-flight-caption::after { content: ""; position: absolute; top: 100%; left: 50%; height: 4px; border-left: 1px solid #9e6750; }
.saig-fallback-trigger {
  position: absolute; top: 15%; left: 50%; transform: translateX(-50%); z-index: 2;
  width: max-content; max-width: 95%; padding: 11px 18px; background: #954b36;
  border: 2px solid #f1d8ae; border-radius: 4px; color: #fff7de; font-family: inherit; font-size: 15px; font-weight: 650; cursor: pointer;
}
#competition-demo {
  --saig-ink: #213e35; --saig-rust: #914a33; --saig-rule: #cdc4ae;
  --saig-serif: "Noto Serif SC","Songti SC",SimSun,serif;
  width: min(1220px, calc(100% - 48px)); max-width: none;
  height: min(768px, calc(100dvh - 56px)); max-height: none;
  margin: auto; padding: 0; overflow: hidden;
  border: 1px solid #a9a68c; border-radius: 11px; background: #f8f2e3; color: var(--saig-ink);
  box-shadow: 0 24px 96px #19352d50;
}
#competition-demo[open] { display: flex; flex-direction: column; }
#competition-demo [hidden] { display: none !important; }
#competition-demo::backdrop { background: #193c365c; backdrop-filter: blur(3px); }
#competition-demo button { cursor: pointer; font-family: inherit; touch-action: manipulation; }
#competition-demo :is(button, a, summary, [tabindex]):focus-visible { outline: 3px solid #ad7840; outline-offset: -3px; }
.saig-header {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 17px clamp(16px, 3vw, 34px) 18px; border-bottom: 3px solid #ba985c; background: #25483e; color: #f7efdc;
}
.saig-edition, .saig-overline { margin: 0 0 4px; font: 650 12px/1.5 var(--saig-serif); letter-spacing: .09em; }
.saig-edition { color: #ddc79b; }
.saig-header h1 { margin: 0; font: 680 clamp(22px, 2.4vw, 34px)/1.24 var(--saig-serif); }
.saig-intro { margin: 6px 0 0; color: #e1e8d9; font-size: 13px; line-height: 1.5; }
.saig-close {
  flex: none; padding: 8px 12px; color: #fbf4df; font-size: 13px;
  border: 1px solid #96a396; border-radius: 5px; background: transparent;
}
.saig-close:hover { background: #38594e; }
.saig-tabs { display: flex; flex: none; background: #f5eedc; border-bottom: 1px solid var(--saig-rule); }
.saig-tabs button {
  position: relative; flex: 1; padding: 12px 5px; min-height: 46px; color: #546052;
  font-size: clamp(13px, 1.3vw, 16px); border: 0; border-inline-end: 1px solid #cfc8b54f; background: transparent;
}
.saig-tabs button[aria-selected="true"] { background: #e7eadb; color: #284b3c; font-weight: 700; }
.saig-tabs button[aria-selected="true"]::after { content: ""; position: absolute; inset: auto 0 -1px; height: 3px; background: #58785d; }
.saig-layout { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(340px, 1fr); flex: 1; min-height: 0; }
.saig-visual {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background-color: #dce9dd;
  background-image: linear-gradient(#5c7f6810 1px,transparent 1px),linear-gradient(90deg,#5c7f6810 1px,transparent 1px),
    radial-gradient(ellipse at center, #f2f2e4, #cde2d6);
  background-size: 44px 44px, 44px 44px, cover;
}
.saig-visual-head { flex: none; display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: clamp(17px, 2.5vw, 32px) clamp(16px, 2.5vw, 31px) 0; }
.saig-overline { color: var(--saig-rust); }
.saig-visual-head h2 { margin: 0; font: 700 clamp(20px, 2.3vw, 31px)/1.3 var(--saig-serif); }
.saig-source-view { flex: none; border: 1px solid #a1af9b; background: #f9f5e9da; color: #355245; padding: 7px 10px; border-radius: 4px; font-size: 12px; }
.saig-frame { position: relative; flex: 1; min-height: 0; }
#saig-model, .saig-avatar { position: absolute; inset: 0; margin: 0; }
#saig-model { touch-action: none; }
#saig-model canvas { display: block; width: 100%; height: 100%; cursor: grab; }
#saig-model canvas:active { cursor: grabbing; }
.saig-avatar { display: grid; place-items: center; padding: 14px 7%; }
.saig-avatar img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.saig-visual-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 18px;
  border-top: 1px solid #9bb6a3; background: #e7eedf; font-size: 12px; color: #496252;
}
#saig-visual-caption { display: inline-flex; align-items: center; gap: 9px; font-weight: 620; }
#saig-visual-caption::before { content: ""; width: 7px; height: 7px; transform: rotate(45deg); background: #98643b; }
.saig-flat { height: 100%; margin: 0; padding: 10px; display: flex; align-items: center; justify-content: center; list-style: none; }
.saig-flat li { position: relative; padding: 9px; font-size: 14px; background: #f8f2e1; border: 1px solid #a3af98; }
.saig-flat li+li { margin-left: 20px; }
.saig-flat li+li::before { content: "→"; position: absolute; left: -19px; color: #804931; }
#saig-panel {
  min-width: 0; overflow-y: auto; padding: clamp(20px, 2.8vw, 35px) clamp(18px, 2.7vw, 34px);
  border-left: 1px solid #aeb7a1; background: linear-gradient(#faf4e5ec,#f8f0dfe8),url("decor/scroll-paper.webp") center/430px;
  scrollbar-width: thin; overscroll-behavior: contain;
}
#saig-stage-copy h2 { margin: 0 0 10px; font: 700 clamp(23px, 2.2vw, 31px)/1.35 var(--saig-serif); text-wrap: balance; }
#saig-stage-copy p, .saig-about p { color: #465748; font-size: 14px; line-height: 1.8; margin: 0; }
#saig-stage-copy h3 { margin: 19px 0 7px; font: 700 16px/1.4 var(--saig-serif); }
.saig-tasks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 16px; margin: 0; padding: 0; list-style: none; }
.saig-tasks li { padding-left: 10px; border-left: 2px solid #aa774d; font-size: 14px; line-height: 1.5; }
.saig-schedule-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.saig-schedule-heading span { color: #736b58; font-size: 11px; }
.saig-schedule { margin: 0; font-size: 13px; }
.saig-schedule div { display: grid; grid-template-columns: minmax(90px,.93fr) minmax(0,1.3fr); gap: 12px; padding: 8px 0; border-top: 1px solid #cfc5ae; line-height: 1.5; }
.saig-schedule dt { font-variant-numeric: tabular-nums; font-weight: 600; }
.saig-schedule dd { margin: 0; color: #455548; }
.saig-about { margin: 15px 0 8px; padding-block: 9px; border-block: 1px solid var(--saig-rule); }
.saig-about summary { width: fit-content; color: #44614a; font-size: 14px; font-weight: 650; cursor: pointer; }
.saig-about p { margin: 9px 0; }
.saig-about a { color: #3e634d; font-size: 13px; text-underline-offset: 3px; }
.saig-source { margin: 10px 0 0; color: #696b5b; font-size: 11px; }
@media (max-width: 740px) {
  #competition-demo { width: 100%; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .saig-header { padding: max(10px,env(safe-area-inset-top)) 13px 11px; gap: 6px; }
  .saig-header h1 { font-size: clamp(17px, 4.4vw, 24px); }
  .saig-edition { font-size: 10px; }
  .saig-intro { font-size: 11px; line-height: 1.4; }
  .saig-close { padding: 6px 8px; font-size: 12px; }
  .saig-tabs button { min-height: 44px; padding-block: 9px; }
  .saig-layout { display: flex; flex-direction: column; overflow-y: auto; }
  .saig-visual { flex: none; height: clamp(226px, 35dvh, 354px); }
  #saig-model { touch-action: pan-y; }
  .saig-visual-head { padding: 10px 14px 0; }
  .saig-visual-head h2 { font-size: 20px; }
  .saig-overline { font-size: 10px; margin-bottom: 1px; }
  .saig-visual-foot { padding: 5px 14px; font-size: 11px; }
  #saig-panel { flex: 1 0 auto; border-left: 0; overflow: visible; padding: 17px 17px max(24px,env(safe-area-inset-bottom)); }
}
@media (pointer: coarse) {
  .saig-close, .saig-source-view { min-height: 44px; }
}
