/* ================================================================
   舒禾 Timeline - CSS
   Mobile-first RWD
   ================================================================ */

/* ── Reset & Tokens ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d0d12;
  --bg-card:     #17171f;
  --bg-card-2:   #1e1e28;
  --border:      rgba(255,255,255,.07);
  --accent:      #d67baa;
  --accent-glow: rgba(214,123,170,.25);
  --accent-2:    #f0a8c8;
  --text-1:      #f0eef8;
  --text-2:      #a09aae;
  --text-3:      #6b6577;
  --live:        #4ade80;
  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   20px;
  --header-h:    56px;
  --shadow:      0 4px 24px rgba(0,0,0,.45);
  --font:        'Noto Sans TC', system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: light) { :root {
  --bg:          #f4f1f8;
  --bg-card:     #ffffff;
  --bg-card-2:   #faf8fc;
  --border:      rgba(0,0,0,.08);
  --text-1:      #1a1625;
  --text-2:      #5e5875;
  --text-3:      #9b95a8;
  --shadow:      0 4px 16px rgba(0,0,0,.12);
}}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ── Age Gate ───────────────────────────────────────────────── */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.age-gate.hidden { display: none; }
.age-gate-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 28px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.age-gate-icon { font-size: 48px; margin-bottom: 12px; }
.age-gate-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 16px;
}
.age-gate-body {
  font-size: 15px;
  color: var(--text-2);
  margin: 0 0 6px;
  line-height: 1.6;
}
.age-gate-warn {
  font-size: 14px;
  color: #f87171;
  font-weight: 600;
  margin: 12px 0 28px;
}
.age-gate-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.btn-age-leave,
.btn-age-enter {
  flex: 1;
  padding: 12px 8px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-age-leave:hover, .btn-age-enter:hover { opacity: .85; }
.btn-age-leave {
  background: var(--surface-3, #2a2a38);
  color: var(--text-2);
  border: 1px solid var(--border);
  outline: 2px solid var(--accent);
}
.btn-age-enter {
  background: var(--accent);
  color: #fff;
}

/* ── Announce Bar ───────────────────────────────────────────── */
.announce-bar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 20px 16px 24px;
}
.announce-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.announce-contact {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.line-qrcode {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.announce-contact-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}
.line-id {
  font-size: 16px;
  color: var(--text-1);
}
.line-id strong { color: #06c755; font-size: 18px; }
.line-note  { font-size: 13px; color: var(--accent); font-weight: 500; }
.line-note2 { font-size: 12px; color: var(--text-3); }
.announce-rules { display: flex; flex-direction: column; gap: 14px; }
.announce-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  margin: 0;
}
.announce-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  margin: 0 0 6px;
  text-transform: none;
}
.announce-section ol,
.announce-section ul {
  margin: 0 0 6px 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.8;
}
.announce-tip {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.7;
  margin: 0;
}
@media (min-width: 600px) {
  .announce-inner { flex-direction: row; align-items: flex-start; gap: 28px; }
  .announce-contact { flex-direction: column; align-items: center; text-align: center; flex-shrink: 0; width: 130px; }
  .line-qrcode { width: 120px; height: 120px; }
  .announce-rules { flex: 1; }
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(13,13,18,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

@media (prefers-color-scheme: light) {
  .site-header { background: rgba(244,241,248,.9); }
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .02em;
}
.logo-icon { font-size: 22px; }
.logo-sep {
  color: var(--text-3);
  font-size: 16px;
  margin: 0 2px;
}
.logo-sub {
  background: linear-gradient(135deg, #f9a8d4, #fb7185);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .02em;
}
.logo-text {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right { display: flex; align-items: center; gap: 10px; }

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(74,222,128,.12);
  border: 1px solid rgba(74,222,128,.25);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  color: var(--live);
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(.7); }
}

.btn-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  transition: color .2s, border-color .2s, transform .3s;
}
.btn-refresh:hover { color: var(--accent); border-color: var(--accent); }
.btn-refresh.spinning svg { animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Main ───────────────────────────────────────────────────── */
.main-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

/* ── States ─────────────────────────────────────────────────── */
.hidden { display: none !important; }

.loading-state, .empty-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-2);
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.empty-icon, .error-icon { font-size: 40px; }

.btn-retry {
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.btn-retry:hover { filter: brightness(1.1); }

/* ── Feed List ──────────────────────────────────────────────── */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Feed Card ──────────────────────────────────────────────── */
.feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s;
}
.feed-card:hover { border-color: rgba(214,123,170,.3); }

/* Card header row */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px 10px;
}
.card-time-badge {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  min-width: 48px;
  text-align: center;
}
.badge-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.badge-time {
  font-size: 10px;
  color: var(--text-3);
  line-height: 1;
  margin-top: 2px;
}

.card-title-wrap { flex: 1; min-width: 0; }
.card-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.4;
  word-break: break-word;
}
.card-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  background: var(--accent-glow);
  border-radius: 99px;
  font-size: 11px;
  color: var(--accent-2);
  font-weight: 500;
}

/* Photo strip (horizontal scroll on mobile) */
.card-photos {
  padding: 0 16px 12px;
}
.photos-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.photos-strip::-webkit-scrollbar { display: none; }

.photo-thumb {
  flex-shrink: 0;
  scroll-snap-align: start;
  width: 110px; height: 110px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  background: var(--bg-card-2);
  transition: transform .18s, opacity .18s;
  border: 1px solid var(--border);
}
.photo-thumb:hover { transform: scale(1.04); opacity: .9; }

.photo-placeholder {
  flex-shrink: 0;
  width: 110px; height: 110px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-2);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 22px;
}

/* No photos */
.no-photos {
  padding: 0 16px 12px;
  font-size: 12px;
  color: var(--text-3);
}

/* Description accordion */
.card-desc-section {
  border-top: 1px solid var(--border);
}
.card-desc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
}
.card-desc-toggle:hover { color: var(--accent); }
.toggle-arrow {
  transition: transform .22s;
  font-size: 11px;
  color: var(--text-3);
}
.card-desc-toggle[aria-expanded="true"] .toggle-arrow { transform: rotate(180deg); }

.card-desc-content {
  display: none;
  padding: 0 16px 14px;
  font-size: 13px;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
}
.card-desc-content.expanded { display: block; }

/* ── Load More ──────────────────────────────────────────────── */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 24px 0 0;
}
.btn-load-more {
  padding: 12px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 500;
  transition: border-color .2s, color .2s;
}
.btn-load-more:hover { border-color: var(--accent); color: var(--accent); }
.btn-load-more:disabled { opacity: .5; cursor: not-allowed; }

/* ── Lightbox ───────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox.hidden { display: none; }

.lb-content {
  max-width: min(90vw, 800px);
  max-height: 80dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-content img {
  max-width: 100%;
  max-height: 80dvh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lb-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-close:hover { background: rgba(255,255,255,.22); }

.lb-prev, .lb-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  background: rgba(255,255,255,.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s;
}
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.22); }

.lb-counter {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 99px;
}

/* ── Tablet+ ────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .main-wrap { padding: 28px 24px 100px; }
  .photo-thumb, .photo-placeholder { width: 130px; height: 130px; }
  .card-heading { font-size: 15px; }
  .card-desc-content { font-size: 14px; }
}

@media (min-width: 900px) {
  .photo-thumb, .photo-placeholder { width: 150px; height: 150px; }
}

/* ── Reduced Motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
