* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #eef0f3;
  color: #222;
}

body.modal-open {
  overflow: hidden;
}

/* ============ 手机演示页面 ============ */
#page {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.08);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #f0f0f0;
}

.site-logo {
  height: 34px;
  width: auto;
  border-radius: 6px;
}

.site-name {
  margin-left: 10px;
  font-size: 17px;
  font-weight: 700;
}

.share-btn {
  margin-left: auto;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #f5f6f8;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.share-btn .bi {
  width: 20px;
  height: 20px;
  font-size: 20px;
  line-height: 1;
}

.share-btn:active {
  background: #e8eaee;
}

.article {
  padding: 18px 16px 28px;
}

.article-cover {
  height: 168px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 16px;
}

.cover-text {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 4px;
}

.cover-sub {
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.92;
}

.article-title {
  font-size: 22px;
  line-height: 1.4;
  font-weight: 700;
}

.article-meta {
  margin: 8px 0 14px;
  font-size: 13px;
  color: #999;
}

.article p {
  margin-bottom: 14px;
  font-size: 15px;
  line-height: 1.75;
  color: #444;
}

.article-card {
  margin: 4px 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.article-card ul {
  padding-left: 18px;
}

.article-card li {
  font-size: 14px;
  color: #555;
  line-height: 1.9;
}

.site-footer {
  padding: 18px 16px 30px;
  text-align: center;
  font-size: 12px;
  color: #bbb;
  border-top: 1px solid #f5f5f5;
}

/* ============ 分享面板 ============ */
.share-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s;
}

.share-mask.show {
  opacity: 1;
  visibility: visible;
}

.share-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10000;
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: 18px 18px 0 0;
  transform: translateX(-50%) translateY(105%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0.35, 1);
  padding-bottom: env(safe-area-inset-bottom);
}

.share-sheet.show {
  transform: translateX(-50%) translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #e3e5e9;
  margin: 10px auto 4px;
}

.sheet-title {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  padding: 8px 0 4px;
}

.platform-row {
  display: flex;
  justify-content: space-evenly;
  padding: 18px 6px 16px;
}

.share-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.share-item:active .icon-circle {
  transform: scale(0.92);
}

.icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.icon-circle .bi {
  width: 26px;
  height: 26px;
  font-size: 26px;
  line-height: 1;
}

.icon-circle .bi.bi-tencent-qq {
  transform: translateX(2px);
}

.icon-circle.poster { background: linear-gradient(135deg, #4ade80, #16a34a); }
.icon-circle.copy { background: #64748b; }
.icon-circle.more { background: #9ca3af; }
.icon-circle.wechat { background: #07c160; }
.icon-circle.qq { background: #12b7f5; }

.item-label {
  font-size: 12px;
  color: #555;
}

#genPoster.loading .icon-circle {
  opacity: 0.55;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.94); }
}

.cancel-btn {
  width: calc(100% - 32px);
  border: none;
  background: #f2f3f5;
  margin: 0 16px 16px;
  padding: 11px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  border-radius: 24px;
}

.cancel-btn:active {
  background: #e5e7eb;
}

/* ============ 海报预览层 ============ */
.poster-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.88);
  padding: 20px;
}

.poster-overlay.show {
  display: block;
}

.poster-img {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.poster-actions {
  display: flex;
  gap: 12px;
  max-width: 480px;
  margin: 18px auto 0;
}

.poster-actions button {
  flex: 1;
  padding: 12px 0;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  cursor: pointer;
}

#savePoster {
  background: #16a34a;
  color: #fff;
  font-weight: 600;
}

#closePoster {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.poster-tip {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

/* ============ 提示 Toast ============ */
/* 生成海报截图期间，隐藏“海报生成中…”等临时提示浮层 */
body.capturing #toast {
  visibility: hidden;
}

#toast {
  position: fixed;
  left: 50%;
  top: 18%;
  z-index: 10002;
  max-width: 78%;
  padding: 9px 18px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 14px;
  text-align: center;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  visibility: visible;
}

/* ============ 二维码隐藏容器 ============ */
.qr-hidden {
  position: fixed;
  left: -9999px;
  top: 0;
}
