/* R86 圈子专属展示 H5 */
:root {
  --primary: #1677FF;
  --primary-light: #E6F2FF;
  --primary-dark: #0958D9;
  --accent: #FF6B35;
  --text: #1a1a1a;
  --text-secondary: #666;
  --bg: #f5f5f5;
  --card: #fff;
  --radius: 12px;
  --tabbar-h: 56px;
  --contact-footer-h: 58px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, 'PingFang SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
body.has-tab-bar { padding-bottom: calc(var(--tabbar-h) + var(--contact-footer-h) + env(safe-area-inset-bottom, 0)); }
body.share-page { padding-bottom: calc(var(--contact-footer-h) + env(safe-area-inset-bottom, 0)); }
.hidden { display: none !important; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; }
.panel { padding-bottom: 16px; }

.circle-header__cover {
  height: 180px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center; font-size: 64px;
  border-radius: 0 0 20px 20px;
}
.circle-header__body { padding: 16px 20px; }
.circle-header__body h1 { margin: 0 0 6px; font-size: 22px; }
.circle-header__body p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.circle-header__stats { display: flex; gap: 20px; margin-top: 12px; color: var(--primary); font-weight: 600; font-size: 14px; }

.announce { margin: 12px 16px; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.announce--important { background: #FFF1F0; color: #CF1322; }

.quick-grid { display: flex; flex-wrap: wrap; padding: 8px; }
.quick-item {
  width: 33.33%; border: 0; background: none; padding: 12px 0; cursor: pointer; text-align: center;
}
.quick-item span { display: block; font-size: 28px; }
.quick-item small { color: var(--text-secondary); font-size: 12px; }

.section-title { padding: 8px 16px; font-size: 15px; margin: 0; }
.card {
  background: var(--card); border-radius: var(--radius); margin: 0 16px 12px; padding: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.post-mini p { margin: 6px 0 0; font-size: 13px; color: var(--text-secondary); }

.publisher textarea { width: 100%; border: 1px solid #eee; border-radius: 8px; padding: 10px; resize: vertical; margin-bottom: 10px; }
.btn-primary {
  background: var(--primary); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 24px; font-size: 15px; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; display: inline-block;
}
.btn-primary.btn-full, .btn-outline.btn-full { width: 100%; display: block; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); border-radius: 999px; padding: 12px; cursor: pointer; margin-top: 10px; }

.post { animation: fadeInUp 0.4s ease both; }
.post-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.post-head time { color: var(--text-secondary); }
.post-imgs { display: flex; gap: 6px; margin: 10px 0; }
.post-imgs span { flex: 1; aspect-ratio: 1; background: var(--primary-light); border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.post-actions button { border: 0; background: none; cursor: pointer; font-size: 13px; color: var(--text-secondary); }

.toolbar { display: flex; gap: 10px; padding: 12px 16px; align-items: center; }
.toolbar input { flex: 1; border: 0; border-radius: 999px; padding: 10px 14px; background: var(--card); }
.toolbar button { border: 0; background: var(--card); width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer; }

.filter-tabs { display: flex; gap: 8px; padding: 0 16px 12px; overflow-x: auto; }
.filter-tab { border: 0; background: var(--card); padding: 8px 14px; border-radius: 999px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.filter-tab.active { background: var(--primary); color: #fff; }

.member-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px; }
.member-list { padding: 0 16px; }
.member-card {
  background: var(--card); border-radius: var(--radius); padding: 12px; text-align: center;
  animation: fadeInUp 0.4s ease both; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.member-card--list { display: flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 10px; }
.member-avatar { font-size: 36px; line-height: 1; }
.member-card strong { display: block; margin-top: 6px; font-size: 14px; }
.tag { display: inline-block; font-size: 10px; padding: 2px 6px; background: var(--primary-light); color: var(--primary); border-radius: 4px; margin: 2px; }

.cal-bar { display: flex; justify-content: space-between; padding: 16px; align-items: center; }
.cal-mini { display: flex; flex-wrap: wrap; padding: 12px 16px; background: var(--card); margin: 0 16px 12px; border-radius: var(--radius); }
.cal-day { width: 14.28%; text-align: center; padding: 6px 0; font-size: 13px; position: relative; }
.cal-day.has-dot::after { content: ''; width: 5px; height: 5px; background: var(--primary); border-radius: 50%; display: block; margin: 2px auto 0; }

.event-card { display: flex; gap: 12px; cursor: pointer; }
.event-card--tl { border-left: 3px solid var(--primary); margin-left: 24px; }
.event-cover { width: 64px; height: 64px; flex-shrink: 0; background: var(--primary-light); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.event-body { flex: 1; min-width: 0; }
.event-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.event-head h4 { margin: 0; font-size: 15px; flex: 1; }
.status { font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.status--upcoming { background: var(--primary-light); color: var(--primary); }
.status--ongoing { background: #E8F8EF; color: #07C160; }
.status--ended { background: #f0f0f0; color: #999; }
.progress { height: 4px; background: #eee; border-radius: 2px; margin: 8px 0 4px; overflow: hidden; }
.progress__fill { height: 100%; }

.search-input { display: block; width: calc(100% - 32px); margin: 12px 16px; padding: 10px 14px; border: 0; border-radius: 999px; }
.resource-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px 16px; }
.resource-card { background: var(--card); border-radius: var(--radius); padding: 10px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.resource-thumb { height: 80px; background: var(--primary-light); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 32px; position: relative; }
.resource-type { position: absolute; top: 4px; left: 4px; font-size: 10px; background: rgba(0,0,0,0.5); color: #fff; padding: 1px 6px; border-radius: 4px; }
.resource-card h4 { margin: 8px 0 4px; font-size: 13px; line-height: 1.3; }
.resource-card small { color: var(--text-secondary); font-size: 11px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-card strong { display: block; font-size: 24px; color: var(--primary); }
.stat-card span { font-size: 12px; color: var(--text-secondary); }
.trend-bars { display: flex; align-items: flex-end; gap: 8px; height: 80px; margin-top: 12px; }
.trend-bar { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 8px; }

.profile-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; text-align: center; padding: 32px 20px;
}
.profile-avatar { font-size: 56px; display: block; }
.stats-row { display: flex; text-align: center; padding: 16px 0; }
.stats-row div { flex: 1; }
.stats-row strong { display: block; font-size: 20px; color: var(--primary); }
.menu button, .menu-link { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 14px 0; border-bottom: 1px solid #f0f0f0; font-size: 15px; cursor: pointer; color: inherit; text-decoration: none; }
.theme-picker { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.theme-swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.theme-swatch.active { border-color: var(--text); }

.tab-bar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--contact-footer-h) + env(safe-area-inset-bottom, 0));
  max-width: 480px; margin: 0 auto; height: var(--tabbar-h);
  display: flex; background: var(--card); border-top: 1px solid #eee; z-index: 50;
}
.tab-bar-item { flex: 1; border: 0; background: none; font-size: 11px; color: var(--text-secondary); cursor: pointer; padding-top: 6px; }
.tab-bar-item span { display: block; font-size: 20px; margin-bottom: 2px; }
.tab-bar-item.active { color: var(--primary); font-weight: 600; }

.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.modal__sheet {
  position: relative; background: var(--card); width: 100%; max-width: 480px;
  border-radius: 16px 16px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); max-height: 80vh; overflow: auto;
}
.modal__close { position: absolute; top: 12px; right: 16px; border: 0; background: none; font-size: 24px; cursor: pointer; }
.modal-hero { font-size: 64px; text-align: center; margin-bottom: 12px; }

.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.78); color: #fff; padding: 12px 20px; border-radius: 8px; z-index: 300; pointer-events: none;
}

.contact-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--card); border-top: 1px solid #eee; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0));
  max-width: 480px; margin: 0 auto;
}
.contact-footer__btns { display: flex; gap: 8px; }
.contact-footer__cta { flex: 1; text-align: center; background: var(--primary); color: #fff !important; padding: 10px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; }
.contact-footer__btn { flex: 1; text-align: center; background: var(--bg); padding: 10px; border-radius: 999px; font-size: 13px; border: 0; cursor: pointer; text-decoration: none; color: inherit; }
.contact-footer__brand { margin: 6px 0 0; text-align: center; font-size: 10px; color: var(--text-secondary); }

.share-card { max-width: 480px; margin: 0 auto; padding: 40px 24px; text-align: center; }
.share-logo { font-size: 64px; margin: 16px 0; }
.share-desc { color: var(--text-secondary); margin-bottom: 24px; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heartBurst {
  0% { transform: scale(0); } 50% { transform: scale(1.3); } 100% { transform: scale(1); }
}
.heart-burst { animation: heartBurst 0.4s ease; }

/* P1 · 动态 / 资源树 / 打卡 / 后台 */
.publisher--p1 .publisher__tools { display: flex; justify-content: space-between; align-items: center; }
.btn-icon { cursor: pointer; font-size: 22px; padding: 4px 8px; }
.post-like, .post-action-btn { border: 0; background: none; cursor: pointer; font-size: 13px; color: var(--text-secondary); margin-right: 16px; }
.post-like.is-on { color: #FF4D4F; }
.post-imgs--grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.link-btn { border: 0; background: none; color: var(--primary); font-size: 13px; cursor: pointer; padding: 0; }
.comment-sheet { margin: 0 16px 12px; background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.comment-sheet__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.comment-sheet__head button { border: 0; background: none; font-size: 22px; cursor: pointer; }
.comment-item { display: flex; gap: 10px; margin-bottom: 12px; font-size: 13px; }
.comment-item p { margin: 4px 0; }
.comment-item time { color: var(--text-secondary); font-size: 11px; }
.comment-avatar { font-size: 28px; }
.comment-input { display: flex; gap: 8px; margin-top: 10px; }
.comment-input input { flex: 1; border: 1px solid #eee; border-radius: 999px; padding: 8px 12px; }
.comment-input button { border: 0; background: var(--primary); color: #fff; border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.comment-empty { text-align: center; color: var(--text-secondary); font-size: 13px; padding: 16px; }

.resource-toolbar { display: flex; gap: 8px; padding: 0 16px; align-items: center; }
.resource-toolbar .search-input { margin: 12px 0; flex: 1; width: auto; }
.view-toggle { border: 0; background: var(--card); padding: 10px 12px; border-radius: 999px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.resource-layout--tree { display: flex; gap: 8px; padding: 0 16px; }
.resource-tree { width: 38%; flex-shrink: 0; background: var(--card); border-radius: var(--radius); padding: 8px; max-height: 360px; overflow-y: auto; }
.tree-node { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 8px; font-size: 12px; cursor: pointer; border-radius: 6px; }
.tree-node--child { padding-left: 16px; }
.tree-node.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.resource-main { flex: 1; min-width: 0; }
.resource-layout--tree .resource-grid { padding: 0; grid-template-columns: 1fr; }
.resource-downloaded h4 { color: #07C160; }

.sub-header { display: flex; align-items: center; gap: 12px; padding: 16px; }
.sub-back { border: 0; background: var(--card); padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.checkin-hero { display: flex; text-align: center; margin-top: 0; }
.checkin-streak, .checkin-total { flex: 1; }
.checkin-streak strong, .checkin-total strong { display: block; font-size: 32px; color: var(--primary); }
.checkin-streak span, .checkin-total span { font-size: 12px; color: var(--text-secondary); }
.checkin-cal { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
.ck-day { width: calc(14.28% - 4px); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; border-radius: 50%; background: #f5f5f5; }
.ck-day--empty { background: transparent; }
.ck-day--done { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.ck-day--today { box-shadow: 0 0 0 2px var(--primary); }
.btn-disabled { opacity: 0.6; cursor: not-allowed; }
.badge-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.badge-card { width: calc(25% - 8px); text-align: center; padding: 10px 4px; background: #f5f5f5; border-radius: 8px; opacity: 0.45; filter: grayscale(1); }
.badge-card.unlocked { opacity: 1; filter: none; background: var(--primary-light); }
.badge-card span { display: block; font-size: 24px; }
.badge-card small { font-size: 10px; color: var(--text-secondary); }
.checkin-rank ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 2; }

.admin-tabs { margin-bottom: 0; }
.admin-panel { margin-top: 0; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.admin-row--audit { flex-direction: column; align-items: stretch; }
.admin-row--audit p { margin: 4px 0 0; font-size: 13px; color: var(--text-secondary); }
.admin-row__acts { display: flex; gap: 8px; }
.admin-row__acts button { border: 0; background: var(--primary-light); color: var(--primary); padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.tab-bar.hidden { display: none; }
body.has-tab-bar.tab-hidden { padding-bottom: calc(var(--contact-footer-h) + env(safe-area-inset-bottom, 0)); }

/* P2 · 导出 / 申请 / 提醒 / 留言墙 */
.p2-block { margin-bottom: 12px; }
.p2-block h3 { margin: 0 0 10px; font-size: 16px; }
.p2-desc { margin: 0 0 12px; font-size: 12px; color: var(--text-secondary); }
.p2-empty { text-align: center; color: var(--text-secondary); font-size: 13px; padding: 16px; }
.p2-export-row h4 { margin: 0 0 10px; font-size: 14px; }
.btn-sm { padding: 10px 16px; font-size: 13px; }

.reminder-banner { display: flex; align-items: center; justify-content: space-between; margin: 12px 16px 0; padding: 12px 14px; background: linear-gradient(90deg, var(--primary-light), #fff); border-left: 4px solid var(--primary); }
.reminder-banner strong { display: block; font-size: 14px; }
.reminder-dismiss { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--text-secondary); padding: 4px 8px; }
.event-reminders { margin-top: 0; }
.event-reminder-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.event-reminder-row:last-child { border-bottom: 0; }
.reminder-toggle { border: 0; background: var(--bg); padding: 6px 12px; border-radius: 999px; font-size: 12px; cursor: pointer; }
.reminder-toggle.on { background: var(--primary-light); color: var(--primary); }

.message-wall { max-height: 280px; overflow-y: auto; margin-bottom: 12px; }
.message-card { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f5f5f5; font-size: 13px; }
.message-card p { margin: 4px 0; line-height: 1.4; }
.message-card time { font-size: 11px; color: var(--text-secondary); }
.message-avatar { font-size: 28px; flex-shrink: 0; }
.message-form { display: flex; flex-direction: column; gap: 8px; }
.message-form input, .message-form textarea { border: 1px solid #eee; border-radius: 8px; padding: 10px; font-size: 14px; }

.leaderboard { display: flex; flex-direction: column; gap: 8px; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--bg); border-radius: 8px; }
.lb-rank { width: 28px; text-align: center; font-size: 16px; }
.lb-avatar { font-size: 28px; }
.lb-info { flex: 1; min-width: 0; }
.lb-info strong { display: block; font-size: 14px; }
.lb-info small { color: var(--text-secondary); font-size: 11px; }
.lb-score { font-weight: 700; color: var(--primary); font-size: 15px; }

.admin-row time { font-size: 11px; color: var(--text-secondary); display: block; margin-top: 4px; }

