/* R90 工作汇报 H5 */
:root {
  --primary: #2563EB;
  --accent: #F97316;
  --bg: #F8FAFC;
  --text: #0F172A;
  --text-secondary: #64748B;
  --card: #fff;
  --radius: 12px;
  --tabbar-h: 56px;
  --contact-footer-h: 72px;
  --topbar-h: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; font-family: "PingFang SC", -apple-system, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }

.top-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid #E2E8F0; position: sticky; top: 0; z-index: 40; }
.top-bar__brand { flex: 1; font-weight: 700; font-size: 15px; }
.top-bar__btn { border: 0; background: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: 12px; cursor: pointer; text-decoration: none; color: inherit; }

.page-root { padding: 0 0 calc(var(--tabbar-h) + var(--contact-footer-h) + 16px); min-height: 60vh; }
.section-title { padding: 16px 16px 8px; margin: 0; font-size: 16px; }

.hero-card { text-align: center; padding: 24px 16px; background: linear-gradient(135deg, var(--primary), #1D4ED8); color: #fff; }
.hero-card h1 { margin: 0 0 6px; font-size: 22px; }
.hero-card p { margin: 0; font-size: 13px; opacity: 0.9; }

.card { background: var(--card); border-radius: var(--radius); margin: 0 16px 12px; padding: 16px; box-shadow: 0 2px 12px rgba(37,99,235,0.06); }
.p-desc { font-size: 13px; color: var(--text-secondary); margin: 8px 0 0; }
.p-desc.center { text-align: center; }
.empty-tip { text-align: center; padding: 32px 16px; color: var(--text-secondary); font-size: 14px; }

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

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

.q-block { margin-bottom: 16px; }
.q-block label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.q-tag { display: inline-block; background: var(--accent); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; margin-right: 4px; }
.q-block textarea { width: 100%; border: 1px solid #E2E8F0; border-radius: 8px; padding: 10px; font-size: 14px; resize: vertical; min-height: 72px; }
.tpl-scroll { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; padding-bottom: 4px; }
.tpl-chip { flex-shrink: 0; border: 1px solid #E2E8F0; background: var(--bg); border-radius: 999px; padding: 4px 10px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.draft-tip { background: #EFF6FF; padding: 8px 12px; border-radius: 8px; font-size: 12px; margin-bottom: 12px; }

.attach-zone { margin-top: 12px; }
.attach-label { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.attach-preview { display: flex; gap: 8px; flex-wrap: wrap; }
.attach-thumb { position: relative; width: 72px; height: 72px; }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.attach-thumb button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #EF4444; color: #fff; cursor: pointer; }
.attach-add { width: 72px; height: 72px; border: 2px dashed #CBD5E1; border-radius: 8px; background: var(--bg); font-size: 24px; cursor: pointer; color: var(--text-secondary); }

.report-card { background: var(--card); border-radius: var(--radius); margin: 0 16px 10px; padding: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); cursor: pointer; }
.report-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.report-card time { font-size: 11px; color: var(--text-secondary); }
.type-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #EFF6FF; color: var(--primary); }
.type-weekly { background: #FFF7ED; color: var(--accent); }
.type-adhoc { background: #F0FDF4; color: #059669; }
.blocker-tag { color: var(--accent); font-size: 13px; margin-top: 6px; }

.board-stats .stats-row { display: flex; text-align: center; }
.board-stats .stats-row div { flex: 1; }
.board-stats strong { display: block; font-size: 22px; color: var(--primary); }
.board-stats span { font-size: 11px; color: var(--text-secondary); }
.missing-tip { font-size: 12px; color: var(--accent); margin-top: 10px; }

.filter-bar input[type="search"] { width: 100%; border: 1px solid #E2E8F0; border-radius: 8px; padding: 10px; font-size: 14px; margin-bottom: 10px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { border: 1px solid #E2E8F0; background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.board-fields p { font-size: 13px; margin: 6px 0; line-height: 1.5; }
.board-fields span { margin-right: 6px; }
.report-card--board { cursor: default; }

.tab-bar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--contact-footer-h) + env(safe-area-inset-bottom));
  max-width: 480px; margin: 0 auto; height: var(--tabbar-h);
  display: flex; background: var(--card); border-top: 1px solid #E2E8F0; z-index: 50;
}
.tab-item { flex: 1; border: 0; background: none; font-size: 10px; color: var(--text-secondary); cursor: pointer; padding-top: 6px; }
.tab-item span { display: block; font-size: 20px; margin-bottom: 2px; }
.tab-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; max-height: 80vh; overflow: auto; }
.modal__close { position: absolute; top: 12px; right: 16px; border: 0; background: none; font-size: 24px; cursor: pointer; }
.modal-q { margin-bottom: 14px; }
.modal-q strong { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }

.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; }

.contact-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--card); border-top: 1px solid #E2E8F0; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  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-page { min-height: 100vh; display: flex; justify-content: center; padding: 24px 16px calc(24px + var(--contact-footer-h)); }
.share-card { max-width: 400px; width: 100%; text-align: center; }
.share-eyebrow { color: var(--primary); font-weight: 700; font-size: 13px; }
.share-card h1 { font-size: 26px; margin: 8px 0; }
.share-desc { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.share-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 20px 0; }
.share-stats div { background: var(--card); padding: 12px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.share-stats strong { display: block; font-size: 20px; color: var(--primary); }
.share-stats span { font-size: 11px; color: var(--text-secondary); }

/* P1 */
.deadline-banner { margin: 0 16px 10px; padding: 10px 14px; border-radius: 10px; font-size: 13px; background: #EFF6FF; color: var(--primary); }
.deadline-banner--ok { background: #F0FDF4; color: #059669; }
.deadline-banner--warn { background: #FFF7ED; color: var(--accent); }
.tpl-picker { margin-top: 0 !important; }
.comment-badge { font-size: 12px; color: var(--primary); margin-top: 6px; }
.report-card--board { cursor: pointer; }
.comment-list { margin-top: 12px; border-top: 1px solid #E2E8F0; padding-top: 10px; }
.comment-item { font-size: 13px; padding: 8px 0; border-bottom: 1px solid #F1F5F9; }
.comment-item strong { color: var(--primary); margin-right: 6px; }
.comment-item time { display: block; font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.comment-form { display: flex; gap: 8px; margin-top: 12px; }
.comment-form input { flex: 1; border: 1px solid #E2E8F0; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.stats-title { margin: 0 0 12px; font-size: 15px; }
.setting-row { display: block; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.setting-row input { width: 100%; margin-top: 6px; padding: 8px; border: 1px solid #E2E8F0; border-radius: 8px; }
.tab-item { font-size: 9px; }
.tab-item span { font-size: 18px; }

/* P2 */
.field-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.tool-btn { border: 1px solid #E2E8F0; background: var(--bg); border-radius: 999px; padding: 4px 12px; font-size: 11px; cursor: pointer; color: var(--text-secondary); }
.tool-btn--voice.recording { background: #FEE2E2; border-color: #EF4444; color: #EF4444; animation: pulse-voice 1s infinite; }
@keyframes pulse-voice { 50% { opacity: 0.7; } }
.ai-summary-card { background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(249,115,22,0.06)); }
.ai-summary-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ai-badge { font-size: 12px; font-weight: 700; color: var(--primary); }
.ai-summary-text { margin: 0; font-size: 12px; line-height: 1.6; white-space: pre-wrap; font-family: inherit; color: var(--text); background: transparent; border: 0; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-swatch { border: 2px solid #E2E8F0; background: var(--bg); border-radius: 10px; padding: 10px 6px; cursor: pointer; text-align: center; }
.theme-swatch.active { border-color: var(--primary); background: #EFF6FF; }
.theme-swatch__dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; margin: 0 2px 4px; vertical-align: middle; }
.theme-swatch small { display: block; font-size: 10px; color: var(--text-secondary); }

body[data-theme-dark="t5"] .hero-card { background: linear-gradient(135deg, var(--primary), #1E293B); }
body[data-theme-dark="t5"] .card { background: #1E293B; color: #F8FAFC; }
body[data-theme-dark="t5"] .top-bar { background: #1E293B; border-color: #334155; color: #F8FAFC; }
body[data-theme-dark="t5"] .tab-bar { background: #1E293B; border-color: #334155; }
body[data-theme-dark="t5"] .contact-footer { background: #1E293B; border-color: #334155; color: #F8FAFC; }
body[data-theme-dark="t5"] .q-block textarea { background: #0F172A; color: #F8FAFC; border-color: #334155; }
body[data-theme-dark="t5"] .report-card { background: #1E293B; color: #F8FAFC; }
