/* 齐白石课 · 网页公共样式：和课件同一套宣纸底、印章红、圆角卡片 + 柔和投影（不用色条装饰）。
   按 1920×1080 设计，1rem = 10 设计像素，随窗口等比缩放。 */
:root {
  --ink: #26221f; --ink2: #544c44; --grey: #8c8276; --line: #e4dccd;
  --red: #b03428; --red2: #96281e; --blush: #f6e4df; --cream: #fbf5e8; --card: #fffdf8;
  --shadow: 0 1.2rem 3.2rem rgba(70, 48, 24, .13), 0 .2rem .6rem rgba(70, 48, 24, .08);
  --head: "QB Head", "Source Han Serif SC", "Noto Serif SC", "SimSun", serif;
  --kai: "QB Kai", "KaiTi", "STKaiti", "楷体", serif;
  --sans: "Microsoft YaHei", "PingFang SC", sans-serif;
}
* { box-sizing: border-box; }
html { font-size: calc(min(100vw / 1920, 100vh / 1080) * 10); }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: #f3ede1 url(../img/paper.jpg) center / cover no-repeat;
  color: var(--ink); font: 2.4rem/1.6 var(--sans);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:disabled { cursor: default; }
img { -webkit-user-drag: none; }
[hidden] { display: none !important; }

/* 页面骨架：左上角印章标题（同课件），右上角工具 */
.stage { position: absolute; left: 50%; top: 50%; width: 192rem; height: 108rem; transform: translate(-50%, -50%); }
.top { position: absolute; left: 7rem; right: 7rem; top: 4.2rem; height: 7rem; display: flex; align-items: center; gap: 1.8rem; }
.mark {
  width: 6.4rem; height: 6.4rem; border-radius: .9rem; background: var(--red); color: #fff; flex: none;
  display: grid; place-items: center; font: 4.2rem/1 var(--head); box-shadow: 0 .4rem 1rem rgba(150, 40, 30, .25);
}
.top h1 { margin: 0; font: 4.4rem/1 var(--head); letter-spacing: .1rem; white-space: nowrap; }
.top .sub { color: var(--grey); font-size: 2.4rem; white-space: nowrap; margin-left: .6rem; }
.tools { margin-left: auto; display: flex; gap: 1.2rem; align-items: center; }
.tool {
  height: 5.6rem; min-width: 5.6rem; padding: 0 1.8rem; border-radius: 2.8rem; background: rgba(255, 253, 248, .82);
  box-shadow: 0 .3rem 1rem rgba(70, 48, 24, .1); color: var(--ink2); font-size: 2.2rem; display: flex; align-items: center; gap: .8rem;
}
.tool svg { width: 2.8rem; height: 2.8rem; }
.tool.off { color: #b9afa2; }
.tool.close { background: var(--ink); color: #fff; }
.status { font-size: 2rem; color: var(--grey); display: flex; align-items: center; gap: .8rem; white-space: nowrap; }
.status b { width: 1.2rem; height: 1.2rem; border-radius: 50%; background: #c9bfb2; display: inline-block; }
.status.on b { background: #4d8a4a; box-shadow: 0 0 0 .4rem rgba(77, 138, 74, .15); }

.card { background: var(--card); border-radius: 2.4rem; box-shadow: var(--shadow); }
.btn {
  height: 7.2rem; padding: 0 3.6rem; border-radius: 3.6rem; background: var(--red); color: #fff; font-size: 2.8rem; font-weight: 700;
  box-shadow: 0 .8rem 2rem rgba(150, 40, 30, .28); display: inline-flex; align-items: center; justify-content: center; gap: 1.2rem; letter-spacing: .1rem;
  transition: transform .15s, box-shadow .15s;
}
.btn:active { transform: translateY(.2rem) scale(.98); box-shadow: 0 .4rem 1rem rgba(150, 40, 30, .25); }
.btn.ghost { background: var(--card); color: var(--red); box-shadow: var(--shadow); }
.btn svg { width: 3rem; height: 3rem; }

/* 画作装裱：白边 + 投影，下方小字图注 */
.work { position: relative; background: #fff; padding: 1.2rem; border-radius: 1rem; box-shadow: var(--shadow); }
.work img, .work canvas { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: .3rem; }
.cap { color: var(--grey); font-size: 1.8rem; text-align: center; margin-top: 1.2rem; white-space: nowrap; }
.cap b { color: var(--ink2); font-weight: 400; margin-right: 1.2rem; }

/* 白石爷爷头像：圆形，说话时外面一圈圈墨晕 */
.avatar { position: relative; border-radius: 50%; }
.avatar img { position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 30%; border: .7rem solid #fff; box-shadow: var(--shadow); }
.avatar i { position: absolute; inset: 0; border-radius: 50%; border: .3rem solid rgba(176, 52, 40, .35); opacity: 0; }
.speaking .avatar i { animation: ripple 2.4s ease-out infinite; }
.speaking .avatar i:nth-child(2) { animation-delay: .8s; }
.speaking .avatar i:nth-child(3) { animation-delay: 1.6s; }
@keyframes ripple { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.32); opacity: 0; } }

/* 逐字出现的字幕 */
.say span { opacity: .14; transition: opacity .25s; }
.say span.on, .say.all span { opacity: 1; }

/* 提示条 */
#toast {
  position: fixed; left: 50%; bottom: 6%; transform: translate(-50%, 2rem); opacity: 0; pointer-events: none; z-index: 50;
  background: rgba(38, 34, 31, .92); color: #fff; font-size: 2.6rem; padding: 1.6rem 3.6rem; border-radius: 4rem; transition: all .3s; white-space: nowrap;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 打开页面先点一下（浏览器不让网页自己出声） */
.tap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(243, 237, 225, .72); backdrop-filter: blur(.4rem); }
.tap button { display: flex; flex-direction: column; align-items: center; gap: 2.4rem; font: 3.6rem/1.3 var(--head); color: var(--ink); }
.tap button i { width: 18rem; height: 18rem; border-radius: 50%; background: var(--red); display: grid; place-items: center; box-shadow: 0 1.6rem 4rem rgba(150, 40, 30, .35); animation: breathe 2.2s ease-in-out infinite; }
.tap button i svg { width: 7rem; height: 7rem; fill: #fff; margin-left: 1rem; }
.tap button small { font: 2.4rem/1.4 var(--sans); color: var(--grey); }
@keyframes breathe { 50% { transform: scale(1.06); } }

/* 盖章动画 */
.stamp { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; pointer-events: none; }
.stamp img { width: 16rem; animation: stamp .7s cubic-bezier(.2, 1.6, .4, 1) both; filter: drop-shadow(0 1rem 2rem rgba(150, 40, 30, .3)); }
@keyframes stamp { 0% { transform: scale(2.6) rotate(-8deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(-4deg); opacity: 1; } }
