/* ===== Zan Foods 品牌变量（取自 zanfoods.com.au） ===== */
:root {
  --brand: #E0BB7F;          /* 金色主色 */
  --brand-deep: #cfa765;
  --ink: #121212;            /* 墨黑 */
  --paper: #fbf7f0;          /* 米白 */
  --on-dark: #fffaf1;
  --on-dark-muted: rgba(255,250,241,.68);
  --bg: #121212;
  --font-display: "Bricolage Grotesque", ui-sans-serif, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-zh: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  overflow: hidden;
  cursor: none;
  -webkit-user-select: none; user-select: none;
  font-family: var(--font-display);
  color: var(--on-dark);
}

#stage {
  position: absolute; left: 0; top: 0;
  width: 1920px; height: 1080px;
  transform-origin: 0 0;
  overflow: hidden;
  background: var(--bg);
}
#slides { position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 1; }
#keepalive { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: fill; z-index: 0; background: var(--bg); }
body.preview #keepalive { display: none; }

/* 运行计时（测试屏保用） */
#uptime {
  display: none; position: absolute; right: 40px; top: 32px; z-index: 20;
  padding: 10px 22px; border-radius: 999px; background: rgba(18,18,18,.78);
  color: var(--brand); font-family: var(--font-zh); font-size: 26px;
}
body.show-uptime #uptime { display: block; }
body.no-clock #clock { display: none; }

/* ---------- 幻灯片 ---------- */
.slide {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  opacity: 0;
  transition: opacity var(--fade, 1.2s) ease;
  will-change: opacity;
  overflow: hidden;
}
.slide.active { opacity: 1; }

.slide img.media, .slide video.media {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: var(--bg);
}
.slide.fit-contain .media { object-fit: contain; }

.slide.kenburns.active img.media { animation: kb var(--dur, 9s) linear forwards; }
@keyframes kb { from { transform: scale(1.0); } to { transform: scale(1.07); } }

/* 有文字时加底部渐变，保证照片上文字清晰 */
.scrim {
  position: absolute; left: 0; right: 0; bottom: 0; height: 62%;
  background: linear-gradient(to top, rgba(18,18,18,.92) 0%, rgba(18,18,18,.55) 45%, rgba(18,18,18,0) 100%);
}

.caption {
  position: absolute; left: 112px; bottom: 168px; max-width: 1240px;
  color: var(--on-dark);
}
.caption .tag {
  display: inline-block; margin-bottom: 28px; padding: 10px 26px;
  background: var(--brand); color: var(--ink);
  font-size: 28px; font-weight: 700; letter-spacing: 1px;
  border-radius: 999px;
}
.caption h2 {
  font-family: var(--font-display);
  font-size: 104px; font-weight: 700; line-height: 1.02; letter-spacing: -2px;
  text-wrap: balance;
}
.caption .zh {
  font-family: var(--font-zh);
  font-size: 48px; font-weight: 600; margin-top: 22px; letter-spacing: 4px;
  color: var(--brand);
}
.caption .text {
  font-size: 36px; margin-top: 18px; line-height: 1.4; color: var(--on-dark-muted);
}
/* 入场：文字从下方轻微上浮 */
.slide .caption > * { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.slide.active .caption > * { opacity: 1; transform: none; }
.slide.active .caption > *:nth-child(2) { transition-delay: .15s; }
.slide.active .caption > *:nth-child(3) { transition-delay: .3s; }
.slide.active .caption > *:nth-child(4) { transition-delay: .45s; }

/* ---------- 纯文字公告页（type: "text"） ---------- */
.slide.text-slide { background: var(--ink); }
.slide.text-slide.light { background: var(--paper); color: var(--ink); }
.text-slide .glow {
  position: absolute; right: -320px; top: -260px; width: 1100px; height: 1100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(224,187,127,.22) 0%, rgba(224,187,127,0) 65%);
}
.text-slide .caption { bottom: auto; top: 50%; transform: translateY(-58%); max-width: 1500px; }
.text-slide .caption h2 { font-size: 128px; }
.text-slide .brandlogo ~ .caption { max-width: 1240px; }
.text-slide.light .caption h2 { color: var(--ink); }
.text-slide.light .caption .zh { color: #8a6a35; }
.text-slide.light .caption .text { color: rgba(18,18,18,.62); }

/* 文字页背景照片 + 遮罩 */
.text-slide .bg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.text-slide.active .bg { animation: kb var(--dur, 9s) linear forwards; }
.text-slide .shade { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: rgba(18,18,18,.74); }
.text-slide.light .shade { background: rgba(251,247,240,.86); }

/* 官方 Logo（替代原来的「赞」印章） */
.brandlogo {
  position: absolute; right: 150px; top: 50%; margin-top: -140px;
  width: 340px; height: 280px;
  display: flex; align-items: center; justify-content: center;
}
.brandlogo img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 12px 40px rgba(0,0,0,.35)); }
.text-slide.light .brandlogo img { filter: drop-shadow(0 8px 24px rgba(18,18,18,.18)); }

/* ---------- 底部品牌条 ---------- */
#brandbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 104px;
  display: flex; align-items: center; padding: 0 72px;
  background: rgba(18,18,18,.94);
  border-top: 1px solid rgba(224,187,127,.35);
  z-index: 10;
}
#logo { height: 60px; width: auto; }
#logo[src=""] { display: none; }
#tagline { flex: 1; margin-left: 44px; padding-left: 44px; border-left: 1px solid rgba(255,250,241,.18); white-space: nowrap; overflow: hidden; }
#tagline-en { font-size: 30px; font-weight: 500; color: var(--on-dark); }
#tagline-zh { font-family: var(--font-zh); font-size: 28px; color: var(--brand); margin-left: 24px; letter-spacing: 2px; }
#clock { font-size: 34px; font-weight: 600; color: var(--on-dark); font-variant-numeric: tabular-nums; letter-spacing: .5px; }
#clock b { color: var(--brand); font-weight: 700; margin-left: 18px; }
body.no-bar #brandbar { display: none; }
body.no-bar .scrim { height: 55%; }

/* 进度条：很细、半透明，不抢画面 */
#progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 11; background: transparent; }
#progress-fill { height: 100%; width: 0; background: var(--brand); opacity: .35; }
body.no-progress #progress { display: none; }

#boot {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,250,241,.4); font-size: 28px; background: var(--bg); z-index: 99;
}
#boot.hidden { display: none; }

/* ================= 文字位置轮换（防烧屏） =================
 * 图片页：左下 / 右下 / 左上 / 右上 四个位置
 * 文字页：靠左 / 靠右，并上下错开；印章和光晕跟着换到另一侧
 */
.slide.pos-bl .caption, .slide.pos-br .caption { top: auto; bottom: 110px; }
.slide.pos-tl .caption, .slide.pos-tr .caption { top: 100px; bottom: auto; }
body:not(.no-bar) .slide.pos-bl .caption, body:not(.no-bar) .slide.pos-br .caption { bottom: 168px; }
.slide.pos-bl .caption, .slide.pos-tl .caption { left: 112px; right: auto; text-align: left; }
.slide.pos-br .caption, .slide.pos-tr .caption { left: auto; right: 112px; text-align: right; }

.slide.pos-tl .scrim, .slide.pos-tr .scrim {
  top: 0; bottom: auto;
  background: linear-gradient(to bottom, rgba(18,18,18,.9) 0%, rgba(18,18,18,.5) 45%, rgba(18,18,18,0) 100%);
}
.slide.pos-tl .caption > *, .slide.pos-tr .caption > * { transform: translateY(-24px); }
.slide.pos-tl.active .caption > *, .slide.pos-tr.active .caption > * { transform: none; }

/* 文字页 */
.text-slide .caption { top: 50%; bottom: auto; }
.text-slide.pos-l-up .caption, .text-slide.pos-l-down .caption { left: 112px; right: auto; text-align: left; }
.text-slide.pos-r-up .caption, .text-slide.pos-r-down .caption { left: auto; right: 112px; text-align: right; }
.text-slide.pos-l-up .caption, .text-slide.pos-r-up .caption { transform: translateY(-68%); }
.text-slide.pos-l-down .caption, .text-slide.pos-r-down .caption { transform: translateY(-44%); }
.text-slide.pos-r-up .brandlogo, .text-slide.pos-r-down .brandlogo { right: auto; left: 150px; }
.text-slide.pos-l-up .brandlogo, .text-slide.pos-r-up .brandlogo { margin-top: -60px; }
.text-slide.pos-l-down .brandlogo, .text-slide.pos-r-down .brandlogo { margin-top: -220px; }
.text-slide.pos-r-up .glow, .text-slide.pos-r-down .glow { right: auto; left: -320px; }
.text-slide.pos-l-down .glow, .text-slide.pos-r-down .glow { top: auto; bottom: -260px; }

/* 修复：电视缩放时渐变边缘会留下约 1 像素的缝。
 * 让渐变层向屏幕外多伸出 8px（超出部分会被裁掉，看不到），彻底盖住缝隙。 */
.slide .scrim { left: -8px; right: -8px; bottom: -8px; height: calc(62% + 8px); }
body.no-bar .slide .scrim { height: calc(55% + 8px); }
.slide.pos-tl .scrim, .slide.pos-tr .scrim { top: -8px; bottom: auto; }
.text-slide .shade { left: -8px; top: -8px; right: -8px; bottom: -8px; }
