/* R129 会议签到/会议回执H5 · style.css */

:root {
  --primary: #1565C0;
  --accent: #FF6D00;
  --bg: #F5F7FA;
  --text: #263238;
  --text-secondary: #607D8B;
  --card: #FFFFFF;
  --success: #4CAF50;
  --danger: #F44336;
  --warning: #FF9800;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --contact-footer-h: 72px;
  --font-stack: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-stack);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
body.has-contact-footer { padding-bottom: calc(var(--contact-footer-h) + env(safe-area-inset-bottom)); }
body.has-contact-footer .zw-root .zw-fab { bottom: calc(var(--contact-footer-h) + 12px + env(safe-area-inset-bottom)); }
.hidden { display: none !important; }
button, input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid #e0e0e0;
  position: sticky; top: 0; z-index: 50;
}
.top-bar h1 { font-size: 1rem; }
.top-actions { display: flex; gap: 6px; align-items: center; }
.theme-select { font-size: 0.7rem; padding: 4px 6px; border-radius: 8px; border: 1px solid #ddd; max-width: 88px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid #ddd;
  background: var(--card); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin: 12px 16px; padding: 16px; }
.section { }
.section-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; }

.hero-section {
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000));
  color: #fff; margin-top: 0; border-radius: 0 0 var(--radius) var(--radius);
  padding: 28px 20px;
}
.hero-title { font-size: 1.5rem; font-weight: 700; margin: 8px 0; }
.hero-meta { opacity: 0.92; font-size: 0.9rem; margin-top: 4px; }
.brand-link { color: #fff; font-size: 0.8rem; opacity: 0.85; text-decoration: underline; }
.countdown { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.cd-block { background: rgba(255,255,255,0.2); border-radius: 8px; padding: 8px 12px; text-align: center; min-width: 52px; }
.cd-block b { display: block; font-size: 1.3rem; }
.cd-block small { font-size: 0.65rem; opacity: 0.85; }
.countdown-live { font-weight: 600; font-size: 1.1rem; }

.speakers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
.speaker-card { text-align: center; padding: 12px; background: var(--bg); border-radius: var(--radius); }
.speaker-card img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; }
.speaker-card h3 { font-size: 0.95rem; }
.speaker-card p, .speaker-card small { font-size: 0.75rem; color: var(--text-secondary); }

.faq-item { border-bottom: 1px solid #eee; }
.faq-q { width: 100%; text-align: left; padding: 12px 0; background: none; border: none; font-weight: 600; cursor: pointer; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s; color: var(--text-secondary); font-size: 0.9rem; }
.faq-item.open .faq-a { max-height: 200px; padding-bottom: 12px; }

.rsvp-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.rsvp-btn {
  flex: 1; min-width: 100px; padding: 12px 8px; border: 2px solid #e0e0e0; border-radius: var(--radius);
  background: var(--card); font-size: 0.85rem; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
}
.rsvp-btn.accept.selected { border-color: var(--success); background: #E8F5E9; }
.rsvp-btn.decline.selected { border-color: var(--danger); background: #FFEBEE; }
.rsvp-btn.tentative.selected { border-color: var(--warning); background: #FFF3E0; }
.rsvp-btn.selected { transform: scale(1.03); box-shadow: var(--shadow); }
.rsvp-form { max-height: 0; overflow: hidden; transition: max-height 0.4s; }
.rsvp-form.expanded { max-height: 600px; margin-top: 16px; }
.rsvp-form label { display: block; margin-bottom: 10px; font-size: 0.85rem; color: var(--text-secondary); }
.field-input {
  width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 1rem;
}
.rsvp-voucher { margin-top: 16px; padding: 16px; background: var(--bg); border-radius: var(--radius); text-align: center; }
.rsvp-voucher code { font-size: 1.2rem; color: var(--primary); letter-spacing: 0.15em; }
.deadline-tip { color: var(--danger); text-align: center; padding: 16px; }

.checkin-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid #eee; }
.checkin-tabs .tab {
  flex: 1; padding: 10px; background: none; border: none; cursor: pointer; color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -2px; font-weight: 600;
}
.checkin-tabs .tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.code-inputs { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.code-input {
  width: 44px; height: 48px; text-align: center; font-size: 1.2rem; font-weight: 700;
  border: 2px solid #ddd; border-radius: 8px;
}
.code-input:focus { border-color: var(--primary); outline: none; }
.code-input.shake { animation: shake 0.4s; }
.qr-wrap { position: relative; aspect-ratio: 1; max-height: 240px; background: #111; border-radius: var(--radius); overflow: hidden; }
.qr-wrap video { width: 100%; height: 100%; object-fit: cover; }
.qr-frame { position: absolute; inset: 15%; border: 2px solid var(--accent); border-radius: 8px; pointer-events: none; }
.manual-list { list-style: none; margin-top: 12px; max-height: 200px; overflow-y: auto; }
.manual-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #eee; }
.manual-list button { padding: 6px 12px; background: var(--primary); color: #fff; border: none; border-radius: 8px; cursor: pointer; }
.hint { font-size: 0.8rem; color: var(--text-secondary); text-align: center; margin-bottom: 8px; }

.success-card { text-align: center; padding: 16px 0; }
.success-icon { width: 56px; height: 56px; line-height: 56px; border-radius: 50%; background: var(--success); color: #fff; font-size: 1.8rem; margin: 0 auto 12px; }
.success-icon.pulse { animation: pulse 1s ease 2; }
.materials { margin-top: 16px; }
.material-item { display: block; padding: 10px 12px; background: var(--bg); border-radius: 8px; margin-bottom: 8px; }
.success-actions { display: flex; gap: 8px; margin-top: 12px; }

.timeline { border-left: 2px solid var(--primary); margin-left: 8px; padding-left: 16px; }
.timeline-item { position: relative; margin-bottom: 20px; padding-bottom: 8px; }
.timeline-item::before {
  content: ''; position: absolute; left: -23px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--primary);
}
.timeline-item.saved::before { background: var(--accent); }
.timeline-item time { font-size: 0.8rem; color: var(--text-secondary); }
.timeline-item h3 { font-size: 1rem; margin: 4px 0; }
.agenda-save { margin-top: 8px; padding: 6px 10px; border: 1px solid var(--primary); color: var(--primary); background: var(--card); border-radius: 999px; font-size: 0.75rem; cursor: pointer; }
.track-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.track-tab { padding: 6px 12px; border-radius: 999px; border: 1px solid #ddd; background: var(--card); cursor: pointer; font-size: 0.8rem; }
.track-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.seat-legend { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 12px; }
.seat-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 12px; vertical-align: middle; }
.dot.checked-in { background: var(--success); }
.dot.reserved { background: var(--primary); }
.dot.empty { background: #ECEFF1; }
.seat-grid { display: grid; gap: 4px; max-width: 360px; margin: 0 auto; }
.seat {
  aspect-ratio: 1; min-height: 32px; border: none; border-radius: 4px; font-size: 0.7rem; font-weight: 700;
  cursor: pointer; color: #fff;
}
.seat.empty { background: #ECEFF1; color: #90A4AE; }
.seat.reserved { background: var(--primary); }
.seat.checked-in { background: var(--success); }
.seat.mine { outline: 2px solid var(--accent); outline-offset: 1px; }
.seat-detail { margin-top: 12px; padding: 12px; background: var(--bg); border-radius: 8px; text-align: center; }

.stats-dashboard { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card {
  padding: 16px 12px; background: var(--bg); border-radius: var(--radius); text-align: center;
}
.stat-card b { display: block; font-size: 1.4rem; color: var(--primary); }
.stat-card span { font-size: 0.75rem; color: var(--text-secondary); }
.ring-wrap { display: flex; flex-direction: column; align-items: center; }
.progress-ring { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #e0e0e0; stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--success); stroke-width: 8; transition: stroke-dashoffset 1s ease; }

.btn { display: inline-block; padding: 12px 20px; border-radius: var(--radius); font-weight: 600; cursor: pointer; border: none; font-size: 0.95rem; }
.btn-primary { background: var(--primary); color: #fff; width: 100%; margin-top: 8px; }
.btn-outline { background: var(--card); color: var(--primary); border: 1px solid var(--primary); flex: 1; text-align: center; padding: 10px; border-radius: var(--radius); cursor: pointer; }

.contact-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: #fff; border-top: 1px solid #eee; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}
.contact-footer__btns {
  display: grid; grid-template-columns: repeat(3, minmax(0, 88px)); gap: 8px;
  max-width: 320px; margin: 0 auto; justify-content: center;
}
.contact-footer__cta, .contact-footer__btn {
  text-align: center; padding: 0.48rem 0.2rem; border-radius: 8px; font-size: 0.72rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.contact-footer__cta { background: #c41e1e !important; color: #fff !important; }
.contact-footer__btn { background: #f5f5f5; color: #333; border: none; cursor: pointer; }
.contact-footer__brand { margin: 6px 0 0; text-align: center; font-size: 0.65rem; color: #999; }

.toast-box { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 300; pointer-events: none; }
.toast-item {
  background: rgba(38,50,56,0.92); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 0.85rem; margin-bottom: 8px; opacity: 0; transform: translateY(-8px); transition: all 0.3s;
}
.toast-item.show { opacity: 1; transform: translateY(0); }
.empty-tip { text-align: center; color: var(--text-secondary); padding: 16px; font-size: 0.85rem; }

.anim-fade { animation: fadeInUp 0.5s ease both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(76,175,80,0.5)} 50%{box-shadow:0 0 0 12px transparent} }

@media (min-width: 768px) {
  .card { max-width: 720px; margin-left: auto; margin-right: auto; }
}

/* Share / Invite */
.share-page .share-main, .invite-page .invite-main { max-width: 480px; margin: 0 auto; padding: 24px 16px; }
.share-hero, .invite-card {
  background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); text-align: center;
}
.share-hero { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 75%, #000)); color: #fff; margin-bottom: 16px; }
.share-open-btn, .invite-card .share-open-btn {
  display: block; margin-top: 12px; padding: 12px; background: var(--primary); color: #fff !important; border-radius: var(--radius); font-weight: 700;
}

@media (max-width: 374px) {
  #celebration-canvas { display: none; }
}
