/* 清明上河图 3D —— 界面样式（绢墨风） */
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #171310;
  font-family: "Songti SC", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  color: #2b2418; -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

button {
  font-family: inherit; cursor: pointer; color: #f3ead2;
  background: linear-gradient(#4a4136, #332c23);
  border: 1px solid rgba(226,208,168,.34);
  border-radius: 3px; padding: 5px 10px; font-size: 13px; line-height: 1.2;
  box-shadow: 0 1px 0 rgba(255,246,224,.08) inset, 0 2px 6px rgba(0,0,0,.35);
  transition: background .18s, color .18s, transform .1s;
}
button:hover { background: linear-gradient(#5b5040, #3c342a); }
button:active { transform: translateY(1px); }
button.off { color: #9c917c; background: linear-gradient(#2e281f, #221d17); }
button.wide { min-width: 52px; }
button.tiny { padding: 3px 7px; font-size: 11px; }

/* ---------- 顶栏 ---------- */
#topbar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 12;
  display: flex; align-items: flex-start; gap: 14px;
  padding: 10px 14px 26px;
  background: linear-gradient(rgba(20,16,11,.72), rgba(20,16,11,0));
  pointer-events: none;
}
#title { display: flex; flex-direction: column; pointer-events: auto; }
#title .t {
  font-size: 21px; letter-spacing: .22em; color: #f6ecd2; font-weight: 700;
  text-shadow: 0 1px 0 rgba(0,0,0,.5), 0 0 18px rgba(0,0,0,.5);
}
#title .s { font-size: 11px; letter-spacing: .18em; color: #cdc0a2; opacity: .85; margin-top: 2px; }
#chapWrap { flex: 1; min-width: 0; padding-top: 3px; }
#chap {
  display: inline-block; font-size: 15px; letter-spacing: .16em; color: #ffe9b6;
  padding: 2px 9px; border: 1px solid rgba(226,208,168,.35); border-radius: 2px;
  background: rgba(96,44,30,.5); pointer-events: auto;
}
#note {
  display: block; margin: 6px 0 0 2px; font-size: 12.5px; line-height: 1.55;
  color: #e8dcbe; max-width: 62ch; text-shadow: 0 1px 3px rgba(0,0,0,.65); opacity: .95;
}
#note.fade { animation: noteIn .8s ease-out; }
@keyframes noteIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: .95; transform: none; } }
#topBtns { pointer-events: auto; }

/* ---------- 右上运镜 ---------- */
#rig {
  position: fixed; right: 12px; top: 62px; z-index: 13; width: 208px;
  padding: 9px 10px 8px; border-radius: 5px;
  background: linear-gradient(rgba(38,31,23,.88), rgba(26,21,16,.86));
  border: 1px solid rgba(226,208,168,.24);
  box-shadow: 0 6px 22px rgba(0,0,0,.45);
}
#rig .row { display: flex; gap: 6px; align-items: center; margin-bottom: 7px; }
#rig .row:last-child { margin-bottom: 0; }
#rig .lab { font-size: 12px; color: #d9cbaa; letter-spacing: .1em; }
#rig .val { font-size: 12px; color: #ffe9b6; min-width: 34px; text-align: right; }
#rig .sub { font-size: 11px; color: #b9ab8c; gap: 6px; }
#rig .sep { opacity: .5; }
#zoom { flex: 1; -webkit-appearance: none; appearance: none; height: 20px; background: transparent; }
#zoom::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg,#8a4a30,#b9a06a 55%,#6d6552);
}
#zoom::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; margin-top: -6px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff2d2,#c9a86a 60%,#7a5f31);
  border: 1px solid rgba(0,0,0,.5); box-shadow: 0 1px 4px rgba(0,0,0,.6);
}
#zoom::-moz-range-track { height: 4px; background: #8a7a5a; border-radius: 2px; }
#zoom::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #d8b878; border: 1px solid #0007; }

/* ---------- 底栏：缩略图卷 + 进度 ---------- */
#bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 14;
  padding: 8px 12px 9px;
  background: linear-gradient(rgba(20,16,11,0), rgba(18,14,10,.82) 34%, rgba(14,11,8,.95));
}
#stripWrap { max-width: 1560px; margin: 0 auto; }
#strip {
  position: relative; height: 92px; border-radius: 3px; overflow: hidden;
  border: 1px solid rgba(226,208,168,.3);
  box-shadow: 0 3px 16px rgba(0,0,0,.5), 0 0 0 5px rgba(28,22,16,.55);
  background: #e3d6b2; cursor: ew-resize; touch-action: none;
}
#strip canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#overlay { pointer-events: auto; }
#dragTip {
  position: absolute; right: 8px; top: 5px; font-size: 10.5px; letter-spacing: .1em;
  color: rgba(60,44,28,.62); background: rgba(246,238,214,.5); padding: 1px 6px; border-radius: 2px;
  pointer-events: none;
}
#chapters { display: flex; gap: 5px; margin: 7px 0 6px; flex-wrap: wrap; }
#chapters button {
  padding: 3px 9px; font-size: 11.5px; letter-spacing: .08em;
  background: linear-gradient(#39312600, #262019 60%); color: #cdbf9e;
}
#chapters button.on {
  color: #fff0c8; background: linear-gradient(#7a3d28, #59301f);
  border-color: rgba(255,226,168,.5);
}
#progRow { display: flex; align-items: center; gap: 9px; }
#track {
  flex: 1; height: 5px; border-radius: 3px; position: relative;
  background: rgba(226,208,168,.16); box-shadow: 0 1px 2px rgba(0,0,0,.5) inset;
}
#win { position: absolute; top: -2px; bottom: -2px; border-radius: 3px; background: linear-gradient(90deg,rgba(190,92,58,.9),rgba(226,196,126,.85)); box-shadow: 0 0 8px rgba(226,196,126,.5); }
#chip {
  font-size: 11.5px; color: #ffe9b6; min-width: 62px; text-align: center;
  background: rgba(56,44,30,.7); border: 1px solid rgba(226,208,168,.24); border-radius: 2px; padding: 2px 5px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 提示 / 题注 ---------- */
#hint {
  position: fixed; left: 50%; top: 12%; transform: translateX(-50%); z-index: 20;
  padding: 5px 14px; border-radius: 2px; font-size: 12.5px; letter-spacing: .2em;
  background: rgba(24,19,13,.76); color: #f4e8c8; border: 1px solid rgba(226,208,168,.28);
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
#hint.show { opacity: 1; }
#card {
  position: fixed; left: 50%; bottom: 200px; transform: translateX(-50%) translateY(8px); z-index: 21;
  padding: 7px 15px; border-radius: 3px; display: flex; flex-direction: column; gap: 2px; align-items: center;
  background: linear-gradient(rgba(246,238,214,.96), rgba(232,220,190,.94));
  color: #2a2216; border: 1px solid rgba(90,66,40,.5);
  box-shadow: 0 8px 26px rgba(0,0,0,.5);
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
}
#card.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#card b { font-size: 15px; letter-spacing: .14em; }
#card span { font-size: 10.5px; opacity: .62; letter-spacing: .08em; }

/* ---------- 遮罩层 ---------- */
.hide { display: none !important; }
#help {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(14,11,8,.7); backdrop-filter: blur(3px);
}
.panel {
  width: min(560px, 92vw); padding: 20px 24px 18px; border-radius: 6px;
  background: linear-gradient(#f3ead0,#e4d6b2); border: 1px solid #6b543a;
  box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 6px rgba(28,22,16,.5);
  color: #2a2216;
}
.panel h3 { margin: 0 0 10px; font-size: 17px; letter-spacing: .16em; }
.panel ul { margin: 0 0 10px; padding-left: 20px; font-size: 13.5px; line-height: 1.95; }
.panel .muted { font-size: 12.5px; line-height: 1.75; opacity: .8; margin: 0 0 14px; }
.panel button { color: #f6ecd2; background: linear-gradient(#5c4130,#3b2a1e); }

#intro, #boot {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #2a2118, #12100c 70%);
  transition: opacity .7s ease, visibility .7s;
}
#intro.gone, #boot.gone { opacity: 0; visibility: hidden; pointer-events: none; }
#intro .box, #boot .box { text-align: center; width: min(900px, 94vw); }
#intro .tt {
  font-size: clamp(30px, 6.4vw, 62px); letter-spacing: .34em; color: #f6e9c6; font-weight: 700;
  text-shadow: 0 2px 0 rgba(0,0,0,.45), 0 0 40px rgba(226,180,110,.25);
}
#intro .st { margin: 8px 0 18px; font-size: 13px; letter-spacing: .3em; color: #c9b892; }
#introThumb {
  width: 100%; height: auto; max-height: 30vh; border: 1px solid rgba(226,208,168,.28);
  box-shadow: 0 10px 40px rgba(0,0,0,.6); border-radius: 2px;
}
#intro .tip { margin: 14px 0 16px; font-size: 12px; letter-spacing: .16em; color: #a99a7c; }
#start {
  font-size: 17px; letter-spacing: .4em; padding: 10px 34px;
  background: linear-gradient(#8a4b2f,#5d3120); border-color: rgba(255,226,168,.45);
}
#bootMsg { margin: 12px 0 10px; font-size: 13px; letter-spacing: .2em; color: #cdbc96; }
#bootBar {
  width: min(420px, 70vw); height: 3px; margin: 0 auto; border-radius: 2px; overflow: hidden;
  background: rgba(226,208,168,.16);
}
#bootBar i { display: block; height: 100%; width: 4%; background: linear-gradient(90deg,#b4643c,#e8c882); transition: width .35s; }
#boot .tt { font-size: 20px; letter-spacing: .3em; color: #e6d8b4; }

@media (max-width: 760px) {
  #note { display: none; }
  #rig { top: auto; bottom: 208px; right: 8px; width: 172px; padding: 7px 8px 6px; }
  #strip { height: 72px; }
  #dragTip { display: none; }
  #card { bottom: 240px; }
}
