/* R262 style.css · facility-meter-cards · v1.0 */
:root {
  --primary: #059669;
  --secondary: #34D399;
  --accent: #F59E0B;
  --bg: #ECFDF5;
  --card: #FFFFFF;
  --text: #064E3B;
  --text-secondary: #047857;
  --border: #A7F3D0;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --tile-bg: #D1FAE5;
  --meter-low: #FEF3C7;
  --meter-full: #FEE2E2;
  --contact-footer-h: 92px;
  --segment-h: 48px;
  --font-scale: 1;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-chrome-h: calc(var(--contact-footer-h) + var(--safe-area-bottom));
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: calc(16px * var(--font-scale)); }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto;
}
body.has-contact-footer { padding-bottom: calc(var(--contact-footer-h) + var(--segment-h) + 12px + var(--safe-area-bottom)); }

button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

.app-header { padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.app-header h1 { font-size: 17px; }
.app-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.header-row { display: flex; justify-content: space-between; align-items: center; }
.header-share { font-size: 16px; padding: 8px; color: var(--primary); }

.segment-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px 10px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 56px; z-index: 99; }
.segment-btn { border: none; background: var(--tile-bg); color: var(--text); padding: 8px 4px; border-radius: 8px; font-size: 11px; font-weight: 600; cursor: pointer; min-height: 40px; }
.segment-btn.active { background: var(--primary); color: #fff; }

#main { padding: 12px 16px 20px; min-height: 40vh; }
.page-title { font-size: 18px; margin-bottom: 4px; }
.page-slogan { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }

.btn { border: none; border-radius: 10px; padding: 12px; font-size: 14px; font-weight: 600; min-height: 44px; cursor: pointer; display: inline-block; text-align: center; background: var(--tile-bg); color: var(--text); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-block { width: 100%; margin-top: 8px; }
.btn-sm { padding: 6px 10px; min-height: 32px; font-size: 12px; }
.btn-chip { border: 1px solid var(--border); background: var(--card); padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; cursor: pointer; }
.btn-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-icon { border: none; background: transparent; font-size: 20px; cursor: pointer; color: var(--text-secondary); }
.btn-icon.active { color: var(--danger); }
.btn-back { border: none; background: transparent; color: var(--primary); font-weight: 600; margin-bottom: 8px; cursor: pointer; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.sort-select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); font-size: 12px; }
.search-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.result-count { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }

.facility-list { display: flex; flex-direction: column; gap: 10px; }
.facility-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; animation: fadeUp 0.35s ease both; }
.facility-card.compact { padding: 12px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-top h3 { font-size: 15px; flex: 1; }
.card-meta, .card-price { font-size: 12px; color: var(--text-secondary); margin: 4px 0; }
.card-beds { font-size: 14px; margin: 6px 0; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn-compare.active { background: var(--accent); color: #fff; }

.bed-meter { height: 10px; background: #E5E7EB; border-radius: 999px; overflow: hidden; margin: 6px 0; }
.bed-fill { height: 100%; background: var(--success); border-radius: 999px; transition: width 0.4s ease; }
.bed-fill.bed-low { background: var(--warning); }
.bed-fill.bed-full { background: var(--danger); width: 100% !important; }
.bed-pct { font-size: 11px; color: var(--text-secondary); }

.meter-wrap { display: flex; justify-content: center; margin: 12px 0; }
.map-canvas { width: 100%; border-radius: 8px; border: 1px solid var(--border); }
.map-fallback { font-size: 12px; color: var(--text-secondary); padding: 12px; text-align: center; }

.detail-tabs { display: flex; gap: 6px; margin: 12px 0; flex-wrap: wrap; }
.detail-tabs .tab { border: 1px solid var(--border); background: var(--tile-bg); padding: 6px 10px; border-radius: 8px; font-size: 12px; cursor: pointer; }
.detail-tabs .tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab-panel { font-size: 13px; margin-bottom: 12px; }
.tab-panel.hidden { display: none; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-fav-detail.active { background: var(--danger); color: #fff; }

.compare-table-wrap { overflow-x: auto; margin-bottom: 12px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 12px; background: var(--card); }
.compare-table th, .compare-table td { border: 1px solid var(--border); padding: 8px 6px; text-align: center; }
.compare-table th { background: var(--tile-bg); font-weight: 600; }
.compare-best { background: linear-gradient(#fff, #D1FAE5); font-weight: 700; }

.booking-form label { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 600; }
.booking-form input, .booking-form select { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; margin-top: 4px; }
.booking-list { font-size: 12px; margin-top: 12px; padding-left: 16px; }

.review-item { background: var(--tile-bg); padding: 10px; border-radius: 8px; margin-bottom: 8px; font-size: 13px; }

.about-view h2 { margin-bottom: 8px; }
.about-view h3 { margin: 16px 0 8px; font-size: 14px; }
.font-modes, .theme-modes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.version-tag { font-size: 11px; color: var(--text-secondary); margin-top: 16px; }
.link-catalog { display: block; margin-top: 8px; }

.editor-panel { background: #FEF3C7; border: 1px dashed var(--warning); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.editor-panel label { display: block; margin-bottom: 8px; font-size: 12px; }
.editor-panel input { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 6px; margin-top: 4px; }

.sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 900; display: flex; align-items: flex-end; }
.sheet-panel { background: var(--card); width: 100%; border-radius: 16px 16px 0 0; padding: 16px; }
.sheet-panel label { display: block; margin-bottom: 10px; font-size: 12px; }
.sheet-panel select, .sheet-panel input { width: 100%; padding: 8px; margin-top: 4px; border: 1px solid var(--border); border-radius: 8px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 950; }
.poster-modal { background: var(--card); border-radius: 12px; padding: 12px; max-width: 360px; width: 100%; }
.poster-modal img { max-width: 100%; border-radius: 8px; }

.empty-hint { text-align: center; padding: 20px; color: var(--text-secondary); font-size: 13px; }
.section-header { margin-bottom: 12px; }
.section-header h2 { font-size: 16px; }

.share-main { padding: 24px 16px; min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.share-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px 20px; text-align: center; width: 100%; }
.share-icon { font-size: 40px; margin-bottom: 8px; }
.share-slogan { color: var(--text-secondary); font-size: 13px; margin: 8px 0 16px; }
.share-qr { display: flex; justify-content: center; margin: 12px 0; }
.share-link { font-size: 11px; color: var(--text-secondary); margin-bottom: 12px; word-break: break-all; }

.toast-container { position: fixed; left: 50%; bottom: calc(var(--bottom-chrome-h) + var(--segment-h) + 16px); transform: translateX(-50%); z-index: 9999; pointer-events: none; }
.toast-item { background: rgba(0,0,0,0.78); color: #fff; padding: 10px 16px; border-radius: 10px; margin-top: 6px; opacity: 0; transition: opacity 0.3s; font-size: 13px; max-width: 90vw; }
.toast-item.show { opacity: 1; }

.contact-footer { position: fixed; left: 0; right: 0; bottom: 0; background: #1a1a1a; z-index: 850; padding: 0.55rem 0.75rem calc(0.55rem + var(--safe-area-bottom)); min-height: var(--contact-footer-h); }
.contact-footer__btns { display: grid; grid-template-columns: repeat(3, minmax(0, 88px)); justify-content: center; gap: 0.4rem; max-width: 320px; margin: 0 auto; }
.contact-footer__cta, .contact-footer__btn { display: flex; align-items: center; justify-content: center; min-height: 36px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.contact-footer__cta { background: #E87722 !important; color: #fff; }
.contact-footer__btn { background: #333; color: #fff; border: none; cursor: pointer; }
.contact-footer__brand { text-align: center; color: #888; font-size: 10px; margin-top: 6px; }

body.has-contact-footer .zw-root .zw-fab,
body.has-contact-footer .em-entry-btn {
  bottom: calc(var(--contact-footer-h) + var(--segment-h) + 12px + var(--safe-area-bottom)) !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
