:root {
  --red: #b3222a;
  --gold: #d9a441;
  --ink: #2b2b2b;
  --bg: #f7f1e6;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 90px;
}

/* 顶部 */
.top {
  background: linear-gradient(135deg, #8e1a20, #b3222a);
  color: #fff;
  padding: 16px 16px 12px;
}
.top-inner { display: flex; align-items: center; gap: 12px; }
.logo-badge {
  width: 118px; height: auto; flex: 0 0 auto; display: block;
}
.badge {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--gold); color: #7a1014;
  font-size: 22px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.title h1 { font-size: 19px; font-weight: 800; }
.title p { font-size: 12px; opacity: .9; margin-top: 2px; }
.stats { font-size: 12px; opacity: .95; margin-top: 8px; }

/* 长卷 */
.scroll-section { background: #fff; padding: 10px 0; }
.scroll-hint {
  text-align: center; font-size: 12px; color: #888;
  padding: 4px 0 8px;
}
#scroll-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: #1a1a1a;
}
#scroll-box { position: relative; display: inline-block; }
#scroll-img { display: block; height: 46vh; width: auto; user-select: none; }
#markers { position: absolute; inset: 0; pointer-events: none; }
.marker {
  position: absolute;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  background: radial-gradient(circle, #ffd76e 0%, #f2a52b 60%, #e07b1a 100%);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255,160,40,.9);
  pointer-events: auto;
  animation: flame 1.6s ease-in-out infinite;
  cursor: pointer;
}
@keyframes flame {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}
.sign-mark {
  position: absolute;
  width: 46px; height: 46px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(217,164,65,.85);
  pointer-events: auto;
  cursor: pointer;
  background: rgba(255,255,255,.4);
}
#scroll-wrap.signing { outline: 3px dashed #d9a441; outline-offset: -3px; }

/* 留言墙 */
.wall { padding: 16px; }
.wall-title { font-size: 16px; margin-bottom: 12px; color: #7a1014; }
.card {
  background: #fff; border-radius: 12px;
  padding: 12px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.card-img { width: 100%; border-radius: 8px; margin-bottom: 8px; display: block; }
.card-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #555; }
.card-user b { color: #7a1014; }
.card-content { font-size: 15px; line-height: 1.5; margin: 8px 0; word-break: break-all; }
.card-actions { display: flex; gap: 16px; font-size: 13px; color: #888; border-top: 1px solid #f0f0f0; padding-top: 8px; }
.card-actions span { cursor: pointer; }
.card-actions span.active { color: #e07b1a; }
.card-comments { font-size: 12px; color: #999; margin-top: 6px; }
.card-comments div { padding: 2px 0; }
.feed-more { text-align: center; color: #b3222a; font-size: 14px; padding: 10px; cursor: pointer; }

/* 浮动按钮 */
.fab {
  position: fixed; right: 16px; bottom: 24px;
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, #d9a441, #b3222a);
  color: #fff; border: none; font-size: 13px; font-weight: 700; line-height: 1.2;
  box-shadow: 0 6px 18px rgba(179,34,42,.5);
  z-index: 20;
}

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px; padding: 20px;
  width: 100%; max-width: 380px; max-height: 86vh; overflow-y: auto;
}
.modal h3 { font-size: 17px; margin-bottom: 14px; color: #7a1014; }
.modal input, .modal textarea {
  width: 100%; border: 1px solid #e0d8c8; border-radius: 8px;
  padding: 11px 12px; font-size: 15px; margin-bottom: 10px;
  background: #fbf8f1; color: var(--ink);
}
.modal textarea { height: 110px; resize: none; }
.char-count { text-align: right; font-size: 11px; color: #aaa; margin: -6px 0 8px; }
.modal-btns { display: flex; gap: 10px; margin-top: 6px; }
.modal-btns button { flex: 1; padding: 11px; border-radius: 8px; font-size: 15px; border: none; }
.primary { background: linear-gradient(135deg, #b3222a, #8e1a20); color: #fff; font-weight: 700; }
.ghost { background: #eee; color: #555; }

.upload-box {
  border: 1px dashed #d9a441; border-radius: 8px; padding: 14px;
  text-align: center; color: #b3222a; font-size: 14px; margin-bottom: 10px; cursor: pointer;
}
.upload-box img { max-width: 100%; max-height: 180px; border-radius: 6px; margin: 0 auto; }

.detail-img { width: 100%; border-radius: 8px; margin-bottom: 10px; }
.detail-content { font-size: 15px; line-height: 1.5; margin-bottom: 10px; word-break: break-all; }
#detail-comments { max-height: 160px; overflow-y: auto; font-size: 13px; color: #555; margin-bottom: 10px; }
#detail-comments div { padding: 4px 0; border-bottom: 1px dashed #eee; }
.comment-input { display: flex; gap: 8px; margin-bottom: 10px; }
.comment-input input { flex: 1; margin-bottom: 0; }
.comment-input button { width: auto; padding: 0 16px; }

.foot { text-align: center; padding: 20px 16px; color: #999; font-size: 12px; }
.share-btn {
  margin-top: 10px; padding: 10px 24px; border-radius: 20px;
  background: #fff; color: #b3222a; border: 1px solid #b3222a; font-size: 14px;
}

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 10px 18px;
  border-radius: 20px; font-size: 14px; z-index: 100; max-width: 80%;
}

/* 留言弹幕（占屏幕 1/3） */
#danmaku {
  position: fixed; top: 64px; left: 0; right: 0; height: 33vh;
  pointer-events: none; z-index: 15; overflow: hidden;
}
.bullet {
  position: absolute; left: 100%; top: 0;
  white-space: nowrap; max-width: 74vw; overflow: hidden; text-overflow: ellipsis;
  background: rgba(255,255,255,.92); color: #b3222a;
  border: 1px solid #d9a441; border-radius: 16px;
  padding: 5px 12px; font-size: 13px; line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  pointer-events: auto; cursor: pointer;
  animation-name: dm-move; animation-timing-function: linear; animation-fill-mode: forwards;
}
@keyframes dm-move {
  to { transform: translateX(calc(-100vw - 100%)); }
}

/* 签名 */
.fab-sign { bottom: 92px; width: 48px; height: 48px; font-size: 12px; background: linear-gradient(135deg, #8e1a20, #b3222a); }
.sign-modal { max-width: 360px; }
.sign-wrap { display: flex; justify-content: center; margin-bottom: 12px; }
#sign-canvas { width: 260px; height: 260px; touch-action: none; background: #fdf6e3; border-radius: 50%; border: 3px solid #d9a441; }
.sign-tools { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 12px; }
.tool { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #ddd; cursor: pointer; }
.tool.active { box-shadow: 0 0 0 2px #b3222a; }
.tool.text { width: auto; height: 30px; border-radius: 15px; padding: 0 14px; background: #eee; color: #555; font-size: 13px; }

.poster-modal { max-width: 340px; }
.poster-img { width: 100%; border-radius: 10px; display: block; margin: 0 auto 14px; }
