:root {
  --bg: #fffbea;
  --fg: #4a3200;
  --muted: #9b7f36;
  --ink: #ffc61a;
  --track: rgba(255, 198, 26, .26);
  --card: #ffffff;
  --size: min(64vw, 44vh, 340px);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ===== 整屏滑动：两屏切换 ===== */
.stage { position: fixed; inset: 0; }
.slide { position: absolute; inset: 0; height: 100svh; height: 100vh; overflow: hidden; }
.slide1 {
  display: grid;
  place-items: center;
  padding: 24px 16px 56px;
  user-select: none;
}
.slide2 {
  transform: translateY(100%);
  transition: transform .62s cubic-bezier(.6, .05, .28, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
}
.stage.at2 .slide2 { transform: translateY(0); }

/* ===== 护送页 ===== */
main { display: flex; flex-direction: column; align-items: center; gap: 32px; text-align: center; }

/* 校徽：白底圆盘 + 旋转文字环 + 不转的奶龙，外面一圈进度条 */
.wrap { transition: transform .45s cubic-bezier(.5, 0, .75, 0), opacity .45s ease-in; }
.badge { position: relative; width: var(--size); aspect-ratio: 1; }
.badge::before { content: ""; position: absolute; inset: 1.4%; border-radius: 50%; background: #fff; }
.badge svg.emblem { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-text { transform-box: view-box; transform-origin: 50% 50%; }
.progress { position: absolute; inset: -5.5%; width: 111%; height: 111%; transform: rotate(-90deg); overflow: visible; }
.progress circle { fill: none; stroke-width: 1.1; stroke-linecap: round; }
.progress .track { stroke: var(--track); }
.progress .bar {
  stroke: var(--ink); stroke-dasharray: 100; stroke-dashoffset: 100;
}
body.run .progress .bar {
  animation: fill var(--delay, 2600ms) linear forwards;
}
body.paused .progress .bar { animation-play-state: paused; }

.core {
  position: absolute; left: 50%; top: 50%;
  width: 60%; height: auto;
  transform: translate(-50%, -50%);
  animation: breathe 2.6s ease-in-out infinite;
  pointer-events: none;
}

.copy { display: flex; flex-direction: column; align-items: center; gap: 10px; transition: opacity .3s, transform .3s; }
h1 { font-size: clamp(26px, 7vw, 40px); font-weight: 800; letter-spacing: .12em; padding-left: .12em; }
.status { font-size: clamp(14px, 4vw, 17px); }
.dots i {
  display: inline-block; width: .3em; height: .3em; margin-left: .18em;
  border-radius: 50%; background: currentColor; vertical-align: middle;
  animation: dot 1s ease-in-out infinite;
}
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
.hint { font-size: 13px; color: var(--muted); }
.hint a { color: inherit; }

/* 跳转倒计时 */
.countdown {
  margin-top: 0;
  font-size: 14px; font-weight: 600; color: var(--fg);
}
.countdown b { font-size: 17px; }

/* 离场：校徽放大淡出 */
body.leaving .wrap { transform: scale(1.35); opacity: 0; }
body.leaving .copy { opacity: 0; transform: translateY(12px); }

@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -50%) scale(1.03); }
}
@keyframes fill { to { stroke-dashoffset: 0; } }
@keyframes dot { 0%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-.25em); } }

/* 打断按钮：停住自动跳转 */
.stop-btn {
  margin-top: 2px; padding: 8px 18px; border-radius: 999px;
  border: 1.5px solid var(--muted); background: none; color: var(--fg);
  font: inherit; font-size: 13px; cursor: pointer;
  transition: border-color .2s, color .2s, opacity .3s;
}
.stop-btn:hover, .stop-btn:focus-visible { border-color: var(--fg); }

/* 「认识扬州大学」入口：扬大红大按钮（真校徽图标） */
.yzu-entry {
  display: flex; align-items: center; gap: 13px;
  margin-top: 10px; padding: 12px 20px 12px 13px; border-radius: 18px;
  background: linear-gradient(135deg, #9c2323 0%, #8a1c1c 55%, #741515 100%);
  color: #fff; text-decoration: none;
  box-shadow: 0 10px 24px rgba(138, 28, 28, .32), inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: transform .18s ease, box-shadow .18s ease;
}
.yzu-entry:hover, .yzu-entry:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(138, 28, 28, .4), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.ye-icon {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  background: #fff;
  display: grid; place-items: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .16);
}
.ye-icon img { width: 33px; height: 33px; display: block; }
.ye-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.35; }
.ye-text b { font-size: 16px; letter-spacing: .06em; }
.ye-text i { font-style: normal; font-size: 11.5px; opacity: .82; letter-spacing: .05em; }
.ye-arrow {
  margin-left: 10px; font-size: 19px; opacity: .92;
  animation: nudge 1.6s ease-in-out infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

/* 下滑引导 */
.scroll-hint {
  position: absolute; left: 0; right: 0; bottom: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  color: var(--muted); font-size: 12px; letter-spacing: .14em;
  pointer-events: none;
}
.sh-arrow { animation: bob 1.5s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: .5; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* 右下角「关于」：打开时暂停倒计时 */
.about-btn {
  position: fixed; right: max(8px, env(safe-area-inset-right)); bottom: max(8px, env(safe-area-inset-bottom));
  padding: 8px 10px; border: 0; background: none; color: var(--muted);
  font: inherit; font-size: 13px; cursor: pointer; z-index: 30;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
  transition: color .2s, text-decoration-color .2s, opacity .3s;
}
.about-btn:hover, .about-btn:focus-visible { color: var(--fg); text-decoration-color: currentColor; }
.about {
  width: min(380px, calc(100vw - 32px)); margin: auto; padding: 0; border: 0; border-radius: 16px;
  background: var(--card); color: var(--fg); box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
  cursor: auto; user-select: text;
}
.about[open] { animation: rise .25s ease-out; }
.about::backdrop { background: rgba(20, 16, 5, .45); backdrop-filter: blur(3px); }
.about-body { padding: 24px 22px 18px; }
.about h2 { font-size: 18px; margin-bottom: 12px; }
.about p { font-size: 14px; line-height: 1.7; }
.about p + p { margin-top: 8px; }
.about del { color: var(--muted); text-decoration-thickness: 4px; }
.about code {
  padding: 1px 6px; border-radius: 6px; background: var(--track);
  font: inherit; font-weight: 700; white-space: nowrap;
}
.about form { margin-top: 18px; text-align: right; }
.about form button {
  padding: 8px 18px; border: 0; border-radius: 999px; background: var(--ink); color: #4a3200;
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  .core, .dots i, .about[open], .progress .bar, .ye-arrow, .sh-arrow { animation: none !important; }
  .progress .bar { stroke-dashoffset: 0; }
  .wrap, .copy { transition: none; }
  .slide2 { transition: none; }
}
