/* index.css — page-specific styles for index.html (home / tabs) */

/* ── App footer ───────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 20px 16px 80px;
  color: var(--text-secondary);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
  background: var(--bg);
}
.app-footer a { color: var(--text-secondary); text-decoration: none; }
/* RT-10451 AC2: footer-sub 对比度修复 — #aaa (≈2.6:1 on #F7F5F2) → #4B5563 (≈6.2:1) 满足 WCAG AA 小文本 4.5:1 */
.app-footer .footer-sub { font-size: 11px; color: #4B5563; margin-top: 4px; }

/* RT-10451 AC5: Coming Up card padding 标准化 — 将 index.html 内联 style="padding:4px 16px" 提取为类 */
.card.coming-up-card { padding: 8px 16px; }

/* ── Notice-history link ──────────────────────── */
.notice-history-link {
  text-align: right;
  margin: 4px 4px 12px;
}
.notice-history-link button {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 4px;
  font-weight: 500;
}

/* ── Photo modal (index-only) ─────────────────── */
.photo-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}
.photo-modal.show { opacity: 1; pointer-events: all; }
.photo-modal-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  z-index: 10;
}
.photo-modal-back {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.photo-modal-back-arrow { font-size: 22px; line-height: 1; }
.photo-modal-counter {
  position: absolute;
  top: 14px;
  right: 18px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity var(--t-base);
}
.photo-modal-counter.show { opacity: 1; }
.photo-modal-content {
  width: min(90vw, 440px);
  height: min(72vw, 360px);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  user-select: none;
  touch-action: pan-y;
  transition: transform 0.08s linear;
  will-change: transform;
}
.photo-modal-content.dragging { transition: none; }
.photo-modal-hint {
  position: absolute;
  bottom: 24px;
  color: rgba(255,255,255,0.45);
  font-size: 12px;
}
.photo-modal-edge-hint {
  position: absolute;
  bottom: 52px;
  background: rgba(255,255,255,0.18);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  opacity: 0;
  transition: opacity var(--t-base);
  pointer-events: none;
}
.photo-modal-edge-hint.show { opacity: 1; }

/* ── New-post modal ───────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 400;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal-sheet {
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 20px 20px 32px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--t-slow) cubic-bezier(.32,1,.31,1);
}
.modal-overlay.show .modal-sheet { transform: translateY(0); }
.modal-sheet h3 { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.modal-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.modal-sheet label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 4px;
  color: var(--text);
}
.modal-sheet input, .modal-sheet textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  color: var(--text);
  background: var(--bg);
}
.modal-sheet input:focus, .modal-sheet textarea:focus { border-color: var(--primary); }
.modal-sheet textarea { min-height: 72px; resize: vertical; }
.required-asterisk { color: var(--danger); margin-left: 2px; }

.segment-tabs {
  display: flex;
  background: var(--bg);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 10px;
}
.segment-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--t-fast), color var(--t-fast);
}
.segment-tab.active { background: var(--card); color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

.post-more { display: none; }
.post-more.show { display: block; }

.type-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.type-chip {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  background: white;
  color: var(--text-secondary);
  font-family: inherit;
}
.type-chip.active { background: var(--primary); color: white; border-color: var(--primary); }

.template-collapsed-row {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13.5px;
  margin-bottom: 8px;
}
.template-collapsed-row.show { display: flex; }
.template-collapsed-row .label { color: var(--text-secondary); }
.template-collapsed-row .current-type { font-weight: 600; flex: 1; }
.template-collapsed-row .expand-hint { color: var(--primary); font-size: 12px; }

.template-field { margin-bottom: 8px; }

.image-upload-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
}
.image-thumb-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.image-thumb {
  width: 56px; height: 56px;
  border-radius: 10px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.remove-thumb {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px;
  background: var(--danger); color: white;
  border: none; border-radius: 50%;
  font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

.visibility-note {
  font-size: 12.5px;
  color: var(--text-secondary);
  background: #F0F7F2;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 10px;
  line-height: 1.5;
}
.publish-rules-link {
  display: block;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12.5px;
  cursor: pointer;
  padding: 6px 0;
  font-family: inherit;
}
.post-required-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--danger);
  margin-top: 6px;
  min-height: 22px;
}
.post-required-counter.complete { color: var(--success); }
.prc-list { color: var(--text-secondary); font-size: 11.5px; }

.modal-btns { display: flex; gap: 10px; margin-top: 16px; }
.btn-cancel {
  flex: 1;
  padding: 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-post {
  flex: 2;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-post:disabled { opacity: 0.45; cursor: not-allowed; }

.preselect-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 10px;
}
.clear-preselect {
  background: none; border: none;
  color: var(--primary); cursor: pointer;
  font-size: 14px; padding: 0 2px; line-height: 1;
}

/* ── Publishing rules popover ─────────────────── */
.publish-rules-popover {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}
.publish-rules-popover.show { opacity: 1; pointer-events: all; }
.popover-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 360px;
}
.popover-card h4 { margin-bottom: 12px; }
.popover-card ul { padding-left: 0; list-style: none; }
.popover-card li { padding: 5px 0; font-size: 13.5px; color: var(--text); }
.popover-card li.no { color: var(--danger); }
.timing-note { font-size: 12px; color: var(--text-secondary); margin-top: 10px; }
.popover-close {
  display: block; width: 100%;
  margin-top: 14px;
  padding: 11px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ── Post-detail overlay ──────────────────────── */
.post-detail-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 450;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--t-slow) cubic-bezier(.32,1,.31,1);
}
.post-detail-overlay.show { transform: translateX(0); }
.post-detail-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.post-detail-topbar .back-btn {
  background: none; border: none;
  font-size: 24px; cursor: pointer;
  color: var(--primary); padding: 0 4px;
}
.post-detail-topbar .title { font-size: 16px; font-weight: 700; }
.post-detail-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
.post-status-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.post-status-pill.published { background: #D1FAE5; color: #065F46; }
.post-status-pill.pending { background: #FEF3C7; color: #92400E; }
.post-status-pill.rejected { background: #FEE2E2; color: #991B1B; }
.post-detail-body { padding: 12px 16px 32px; }
.post-detail-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.post-detail-image-row {
  position: relative;
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
}
.post-detail-image-row .scroll-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: 12px;
}
.post-detail-image-row .scroll-track::-webkit-scrollbar { display: none; }
.post-detail-image-row .img-cell {
  min-width: 100%;
  height: 200px;
  scroll-snap-align: start;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}
.post-detail-image-row .page-counter {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(0,0,0,0.55); color: white;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  pointer-events: none;
}
.first-reply-preview {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
}
.first-reply-preview .reply-label {
  font-size: 11.5px; color: var(--text-secondary);
  font-weight: 600; margin-bottom: 8px;
}
.first-reply-preview .reply-row { display: flex; gap: 10px; align-items: flex-start; }
.first-reply-preview .reply-content { flex: 1; font-size: 13px; line-height: 1.5; }
.first-reply-preview .reply-name { font-weight: 600; margin-bottom: 2px; }
.first-reply-preview .reply-time { font-weight: 400; color: var(--text-secondary); font-size: 11.5px; margin-left: 6px; }
.first-reply-preview .view-all-btn {
  display: block; width: 100%;
  margin-top: 10px;
  background: none; border: 1px solid var(--border);
  color: var(--primary); padding: 8px;
  border-radius: 8px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.first-reply-preview .empty-reply { font-size: 12.5px; color: var(--text-secondary); text-align: center; padding: 6px 0; }

/* ── My-posts: pending / rejected / approved states ─ */
.review-status-bar {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-secondary);
  padding-top: 8px;
}
.review-only-self { font-size: 11.5px; color: var(--text-secondary); margin-top: 4px; }
.pending-badge {
  background: #FEF3C7; color: #92400E;
  border-radius: 999px; padding: 2px 8px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.rejection-banner {
  background: #FEE2E2; border-radius: 10px;
  padding: 10px 12px; margin-top: 8px; font-size: 13px;
}
.rejection-banner .reason-row { margin-top: 4px; color: var(--text-secondary); }
.rejection-banner .label { font-weight: 600; color: var(--text); }
.btn-edit-republish {
  display: inline-block; margin-top: 8px;
  padding: 7px 14px;
  background: var(--danger); color: white;
  border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}

/* ── Tab onboarding overlay ───────────────────── */
.tab-onboard-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 700;
  opacity: 0; pointer-events: none; transition: opacity var(--t-base);
}
.tab-onboard-overlay.show { opacity: 1; pointer-events: all; }
.tab-onboard-tooltip {
  position: fixed;
  z-index: 701;
  background: var(--card);
  border-radius: 14px;
  padding: 14px 16px 12px;
  width: 220px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  font-size: 13.5px;
}
.tab-onboard-tooltip::after {
  content: '';
  position: absolute; bottom: -8px;
  left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--card);
}
.tt-step { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.tt-title { font-weight: 700; margin-bottom: 4px; }
.tt-body { color: var(--text-secondary); line-height: 1.45; margin-bottom: 10px; }
.tt-actions { display: flex; justify-content: space-between; align-items: center; }
.tt-skip { background: none; border: none; color: var(--text-secondary); font-size: 13px; cursor: pointer; font-family: inherit; }
.tt-next {
  background: var(--primary); color: white;
  border: none; border-radius: 8px;
  padding: 7px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.nav-item.onboard-spotlight { position: relative; z-index: 702; }

@media (min-width: 768px) {
  body { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
}
