/* R91 家庭物品收纳清单 H5 */
:root {
  --primary: #8B6914;
  --secondary: #F5E6D3;
  --bg: #FFFBF7;
  --accent: #5B8C5A;
  --text: #2C2416;
  --text-secondary: #7A6F5E;
  --card: #fff;
  --radius: 12px;
  --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 var(--secondary); position: sticky; top: 0; z-index: 40; }
.top-bar__brand { font-weight: 700; font-size: 15px; }
.top-bar__tag { flex: 1; font-size: 11px; color: var(--text-secondary); }
.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(--contact-footer-h) + 80px); min-height: 60vh; }
.section-title { padding: 16px 16px 8px; margin: 0; font-size: 16px; }

.summary-bar { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; padding: 14px 16px; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 80%, #000)); color: #fff; align-items: center; }
.summary-bar strong { display: block; font-size: 18px; }
.summary-bar span { font-size: 10px; opacity: 0.85; }
.mode-toggle { border: 1px solid rgba(255,255,255,0.5); background: rgba(255,255,255,0.15); color: #fff; border-radius: 999px; padding: 8px 10px; font-size: 11px; cursor: pointer; white-space: nowrap; }

.quick-actions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--secondary); }
.quick-actions button { border: 0; background: var(--bg); border-radius: 10px; padding: 10px 4px; cursor: pointer; }
.quick-actions span { display: block; font-size: 20px; }
.quick-actions small { font-size: 10px; color: var(--text-secondary); }

.room-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 16px; }
.room-card { border-radius: var(--radius); padding: 14px; cursor: pointer; position: relative; overflow: hidden; min-height: 100px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.room-icon { font-size: 24px; }
.room-card strong { display: block; margin-top: 6px; font-size: 15px; }
.room-card small { font-size: 11px; color: var(--text-secondary); }
.room-thumb { position: absolute; right: 8px; bottom: 8px; width: 48px; height: 48px; border-radius: 8px; object-fit: cover; opacity: 0.85; }

.sub-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--secondary); }
.sub-back { border: 0; background: none; font-size: 14px; cursor: pointer; color: var(--primary); }

.room-tabs { display: flex; gap: 6px; padding: 10px 16px; overflow-x: auto; background: var(--card); }
.room-tab { flex-shrink: 0; border: 1px solid var(--secondary); background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.room-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.search-bar { padding: 0 16px 8px; }
.search-bar input { width: 100%; border: 1px solid var(--secondary); border-radius: 8px; padding: 10px; font-size: 14px; background: var(--card); }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.chip { border: 1px solid var(--secondary); 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); }

.items-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 16px; }
.item-card { background: var(--card); border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.item-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.item-card__info { padding: 8px 10px; }
.item-card__info strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-card__info small { font-size: 10px; color: var(--text-secondary); }

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

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

.ai-input { width: 100%; border: 1px solid var(--secondary); border-radius: 8px; padding: 10px; font-size: 14px; margin: 10px 0; }

.moving-steps { display: flex; justify-content: space-between; padding: 16px; gap: 4px; }
.moving-step { flex: 1; text-align: center; opacity: 0.4; }
.moving-step.active { opacity: 1; }
.moving-step span { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: var(--secondary); font-size: 12px; font-weight: 700; }
.moving-step.active span { background: var(--primary); color: #fff; }
.moving-step small { display: block; font-size: 10px; margin-top: 4px; }

.progress-stats { display: flex; text-align: center; }
.progress-stats div { flex: 1; }
.progress-stats strong { display: block; font-size: 22px; color: var(--primary); }
.progress-stats span { font-size: 11px; color: var(--text-secondary); }

.boxes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 16px; }
.box-card { background: var(--card); border: 2px dashed var(--primary); border-radius: var(--radius); padding: 14px; cursor: pointer; }
.box-card strong { display: block; font-size: 14px; }
.box-card small { font-size: 11px; color: var(--text-secondary); }

.mine-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--secondary); cursor: pointer; }

.fab-add {
  position: fixed; right: 20px; bottom: calc(var(--contact-footer-h) + 20px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--primary); color: #fff; font-size: 28px; line-height: 1;
  box-shadow: 0 4px 16px rgba(139,105,20,0.35); cursor: pointer; z-index: 55;
}

.item-panel {
  position: fixed; left: 0; right: 0; bottom: calc(var(--contact-footer-h) + env(safe-area-inset-bottom));
  max-width: 480px; margin: 0 auto; background: var(--card);
  border-radius: 16px 16px 0 0; padding: 12px 16px 20px; z-index: 180;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12); max-height: 70vh; overflow: auto;
}
.panel-handle { width: 40px; height: 4px; background: #ddd; border-radius: 2px; margin: 0 auto 12px; }
.panel-photo { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius); }
.panel-meta { font-size: 13px; color: var(--text-secondary); margin: 6px 0; }
.panel-note { font-size: 13px; background: var(--bg); padding: 10px; border-radius: 8px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.panel-actions button { flex: 1; min-width: 70px; }

.camera-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.camera-modal.hidden { display: none; }
.camera-modal .modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.camera-sheet { position: relative; background: var(--card); width: 100%; max-width: 480px; border-radius: 16px 16px 0 0; padding: 20px; max-height: 85vh; overflow: auto; z-index: 1; }
.camera-sheet label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.camera-sheet input, .camera-sheet select { width: 100%; margin-top: 4px; border: 1px solid var(--secondary); border-radius: 8px; padding: 8px; font-size: 14px; }
.camera-preview { background: var(--bg); border: 2px dashed var(--secondary); border-radius: var(--radius); min-height: 120px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 13px; margin: 12px 0; cursor: pointer; }
#cropWrap { max-height: 240px; overflow: hidden; margin: 10px 0; }
#cropWrap img { max-width: 100%; display: block; }

.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 var(--secondary); 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); }

body[data-mode="moving"] { --primary: #FF8C42; --secondary: #FFE8D6; --bg: #FFF9F5; --accent: #2D9CDB; }

/* P1 快捷入口 */
.p1-shortcuts { display: flex; gap: 8px; padding: 0 16px 12px; }
.p1-shortcut { flex: 1; border: 1px solid var(--secondary); background: var(--card); border-radius: 10px; padding: 10px 4px; cursor: pointer; }
.p1-shortcut span { display: block; font-size: 20px; }
.p1-shortcut small { font-size: 10px; color: var(--text-secondary); }

/* P1-1 断舍离 */
.declutter-stats { display: flex; text-align: center; }
.declutter-stats div { flex: 1; }
.declutter-stats strong { display: block; font-size: 22px; }
.declutter-stats span { font-size: 10px; color: var(--text-secondary); }
.declutter-board { display: flex; gap: 8px; padding: 0 12px 16px; overflow-x: auto; }
.declutter-col { flex: 1; min-width: 110px; background: var(--card); border-radius: var(--radius); border-top: 3px solid; padding: 8px; }
.declutter-col h4 { margin: 0 0 8px; font-size: 12px; }
.declutter-list { list-style: none; margin: 0; padding: 0; min-height: 120px; }
.declutter-item { display: flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 8px; padding: 6px; margin-bottom: 6px; cursor: grab; font-size: 11px; }
.declutter-item img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.declutter-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* P1-2 价值 */
.value-hero { text-align: center; }
.value-label { font-size: 13px; color: var(--text-secondary); margin: 0; }
.value-total { font-size: 36px; font-weight: 800; color: var(--primary); margin: 8px 0; }
.value-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--secondary); font-size: 13px; }
.value-row span { flex: 1; }
.value-row strong { color: var(--primary); }
.value-row small { color: var(--text-secondary); width: 36px; text-align: right; }

/* P1-3 共享 */
.share-block h4 { margin: 0 0 8px; }
.share-link-row { display: flex; gap: 8px; margin: 12px 0; }
.share-link-row input { flex: 1; border: 1px solid var(--secondary); border-radius: 8px; padding: 8px; font-size: 11px; }
.share-qr { display: flex; justify-content: center; margin: 12px 0; }
.viewer-badge { background: #EFF6FF; color: #2563EB; padding: 10px; border-radius: 8px; text-align: center; font-size: 13px; }

/* P1-4 引导 */
.onboard-modal { position: fixed; inset: 0; z-index: 250; display: flex; align-items: flex-end; justify-content: center; }
.onboard-modal.hidden { display: none; }
.onboard-sheet { position: relative; background: var(--card); width: 100%; max-width: 480px; border-radius: 16px 16px 0 0; padding: 24px 20px 32px; text-align: center; z-index: 1; }
.onboard-icon { font-size: 48px; margin-bottom: 12px; }
.onboard-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 16px; }
.onboard-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--secondary); }
.onboard-dots span.active { background: var(--primary); width: 20px; border-radius: 4px; }
.link-btn { border: 0; background: none; color: var(--text-secondary); cursor: pointer; font-size: 13px; margin-top: 8px; }

.empty-tip-card { grid-column: 1 / -1; text-align: center; padding: 16px; }
.tip-box { background: var(--secondary); border-radius: 8px; padding: 10px 14px; font-size: 12px; color: var(--text-secondary); margin-top: 8px; }

.room-templates h4 { margin: 0 0 4px; }
.tpl-row { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; background: var(--bg); border-radius: 8px; padding: 10px 12px; margin-top: 8px; cursor: pointer; text-align: left; }
.tpl-row small { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

.p-desc.center { text-align: center; padding: 0 16px; }

/* P2 快捷入口 */
.p2-shortcuts { display: flex; gap: 8px; padding: 0 16px 12px; }
.p2-shortcut { flex: 1; border: 1px solid var(--secondary); background: var(--card); border-radius: 10px; padding: 10px 4px; cursor: pointer; }
.p2-shortcut span { display: block; font-size: 20px; }
.p2-shortcut small { font-size: 10px; color: var(--text-secondary); }

/* P2-1 AI */
.ai-suggest { margin: 8px 0 12px; }
.ai-suggest .filter-chips { padding: 0; }

/* P2-2 平面图 */
.floor-plan-card { text-align: center; }
.floor-canvas { width: 100%; max-width: 340px; border-radius: var(--radius); border: 1px solid var(--secondary); touch-action: none; cursor: crosshair; }
.floor-legend { font-size: 11px; color: var(--text-secondary); margin-top: 8px; }

/* P2-3 标签 */
.label-preview { padding: 16px; text-align: center; }
.label-preview-img { max-width: 100%; border: 1px solid var(--secondary); border-radius: 8px; }

/* PDF 导出（离屏渲染） */
.pdf-export-root { position: fixed; left: -9999px; top: 0; width: 794px; z-index: -1; }
.pdf-sheet { background: #FFFBF7; padding: 32px; font-family: "PingFang SC", sans-serif; color: #2C2416; }
.pdf-header h1 { margin: 0 0 8px; font-size: 24px; color: #8B6914; }
.pdf-header p { margin: 0 0 20px; font-size: 13px; color: #7A6F5E; }
.pdf-rooms { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 20px; }
.pdf-room { background: #fff; border-radius: 8px; padding: 10px; font-size: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.pdf-room strong { display: block; margin-bottom: 4px; }
.pdf-room span { color: #7A6F5E; font-size: 11px; }
.pdf-table { width: 100%; border-collapse: collapse; font-size: 11px; background: #fff; border-radius: 8px; overflow: hidden; }
.pdf-table th { background: #8B6914; color: #fff; padding: 8px 6px; text-align: left; }
.pdf-table td { padding: 7px 6px; border-bottom: 1px solid #F5E6D3; }
.pdf-table tr:nth-child(even) td { background: #FFFBF7; }
.pdf-footer { margin-top: 16px; font-size: 10px; color: #7A6F5E; text-align: center; }
