* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f5f5; color: #1a1a1a; line-height: 1.6;
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 500px; margin: 0 auto; min-height: 100vh; background: #fff; }
.page { padding: 16px; padding-bottom: 150px; }
.page-center { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 32px 16px; text-align: center; }

/* Typography */
.logo { font-size: 2rem; font-weight: 800; color: #111; letter-spacing: -0.5px; }
.tagline { color: #666; margin-top: 8px; font-size: 1.05rem; line-height: 1.6; }
.shop-name { font-size: 1.25rem; font-weight: 700; }
.shop-sub { color: #888; font-size: 0.9rem; }
.section-title { font-size: 1.05rem; font-weight: 700; margin: 20px 0 12px; }
.empty { color: #999; text-align: center; padding: 40px 0; font-size: 0.95rem; }
.hint { color: #888; font-size: 0.85rem; margin: 4px 0 12px; }
.count-hint { text-align: center; color: #bbb; font-size: 0.8rem; margin-top: 16px; }

/* Header */
.header { display: flex; align-items: center; gap: 12px; padding: 12px 0 16px; border-bottom: 1px solid #eee; margin-bottom: 16px; }
.header .shop-name { flex: 1; }
.header-share { text-align: center; padding: 24px 0 16px; }
.header-share h1 { font-size: 1.3rem; font-weight: 700; }

/* Buttons */
.btn { display: inline-block; padding: 10px 18px; border-radius: 10px; font-size: 0.95rem; font-weight: 600; border: 1px solid #ddd; background: #fff; cursor: pointer; text-align: center; transition: all 0.15s; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: #111; color: #fff; border-color: #111; }
.btn-primary:active { background: #333; }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 14px; font-size: 1.05rem; border-radius: 12px; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; }
.btn-done { background: #10b981; color: #fff; border-color: #10b981; font-size: 0.8rem; padding: 6px 12px; white-space: nowrap; }
.btn-done:active { background: #059669; }

/* Forms */
.form-card { padding: 16px 0; }
.input { width: 100%; padding: 12px 14px; border: 1.5px solid #e0e0e0; border-radius: 10px; font-size: 1rem; margin-bottom: 12px; background: #fafafa; transition: border 0.2s; }
.input:focus { outline: none; border-color: #111; background: #fff; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\"%3E%3Cpath d=\"M6 8L1 3h10z\" fill=\"%23999\"/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; margin-top: 8px; }
label input[type="checkbox"] { margin-right: 6px; }

/* Alert */
.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 0.9rem; }
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* Cards */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.card { background: #fafafa; border-radius: 12px; padding: 14px; border: 1px solid #eee; display: block; }
.card:active { background: #f0f0f0; }
.card-row { display: flex; align-items: center; gap: 12px; }
.card-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.card-thumb-empty { background: #e8e8e8; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card-info strong { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 0.8rem; color: #888; }

/* Reminder card */
.reminder-card { border-left: 3px solid #f59e0b; }

/* Stats */
.stats-row { display: flex; gap: 12px; margin: 16px 0; }
.stat { flex: 1; text-align: center; background: #fafafa; border-radius: 12px; padding: 12px 8px; border: 1px solid #eee; }
.stat-num { display: block; font-size: 1.3rem; font-weight: 700; color: #111; }
.stat-label { display: block; font-size: 0.75rem; color: #888; margin-top: 2px; }

/* Tags */
.tag-group { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tag { display: inline-block; padding: 8px 14px; border-radius: 20px; background: #f0f0f0; font-size: 0.85rem; cursor: pointer; user-select: none; border: 1.5px solid transparent; transition: all 0.15s; }
.tag:active { transform: scale(0.96); }
.tag-active { background: #111; color: #fff; border-color: #111; }
.tag-radio { cursor: pointer; }

/* Photo area */
.photo-area { background: #fafafa; border: 2px dashed #ddd; border-radius: 12px; min-height: 160px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; cursor: pointer; overflow: hidden; }
.photo-area:active { background: #f0f0f0; }
.photo-placeholder { color: #bbb; font-size: 1rem; text-align: center; line-height: 1.8; }
.photo-preview-img { width: 100%; max-height: 300px; object-fit: cover; }

/* Search */
.search-bar { margin-bottom: 16px; }
.search-results { margin-top: -8px; margin-bottom: 12px; }
.search-item { padding: 10px 12px; background: #fafafa; border: 1px solid #eee; border-radius: 8px; cursor: pointer; font-size: 0.9rem; margin-bottom: 4px; }
.search-item:active { background: #f0f0f0; }
.search-item span { color: #888; font-size: 0.8rem; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item { display: flex; gap: 12px; align-items: flex-start; }
.timeline-photo { width: 80px; height: 80px; border-radius: 10px; object-fit: cover; flex-shrink: 0; cursor: pointer; transition: transform 0.2s; }
.timeline-photo.zoomed { transform: scale(2.5); z-index: 100; position: relative; border-radius: 4px; }
.timeline-info { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; }
.timeline-date { font-weight: 600; color: #111; }

/* Bottom nav */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 500px; padding: 12px 16px 20px; background: #fff; border-top: 1px solid #eee; display: flex; flex-direction: column; gap: 8px; }

/* Recommend */
.result-card { padding: 8px 0; }
.rec-num { width: 32px; height: 32px; border-radius: 50%; background: #111; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }
.cta-hint { text-align: center; padding: 20px 0; color: #666; font-size: 0.9rem; }
.next-remind { text-align: center; padding: 16px; background: #fffbeb; border-radius: 12px; margin: 16px 0; font-size: 0.9rem; color: #92400e; }

/* Actions on landing */
.actions { margin-top: 32px; width: 100%; max-width: 320px; }
.actions .sub { margin-top: 16px; font-size: 0.85rem; color: #aaa; }
.hero { margin-bottom: 16px; }

/* Desktop tweaks */
@media (min-width: 501px) {
    .container { border-left: 1px solid #eee; border-right: 1px solid #eee; }
}


/* ===== Overlay ===== */
.overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.92);z-index:9999;align-items:center;justify-content:center}
.overlay.active{display:flex}
.overlay img{max-width:95%;max-height:90vh;border-radius:8px}
.overlay-close{position:absolute;top:16px;right:16px;color:#fff;font-size:2rem;cursor:pointer;width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,0.15);border-radius:50%;border:none}
.share-box{background:#f9fafb;border-radius:14px;padding:16px;margin:16px 0;text-align:center;border:1px solid #e5e7eb}
.share-url{font-size:0.78rem;color:#6b7280;word-break:break-all;background:#fff;padding:10px;border-radius:8px;margin:8px 0;border:1px solid #e5e7eb;max-height:80px;overflow-y:auto;text-align:left}
.profile-header{text-align:center;padding:20px 0;border-bottom:1px solid #f0f0f0;margin-bottom:16px}
.profile-avatar{width:72px;height:72px;border-radius:50%;background:#1a1a2e;color:#fff;display:flex;align-items:center;justify-content:center;font-size:2rem;margin:0 auto 12px;overflow:hidden}
.profile-avatar img{width:100%;height:100%;object-fit:cover}
.profile-name{font-size:1.3rem;font-weight:700}
.profile-meta{color:#999;font-size:0.9rem;margin-top:2px}
.cust-hero{background:linear-gradient(135deg,#1a1a2e,#16213e);color:#fff;text-align:center;padding:32px 16px 24px;border-radius:0 0 20px 20px;margin:-16px -16px 16px}
.cust-hero h1{font-size:1.5rem;font-weight:700;margin-bottom:4px}
.cust-hero p{opacity:0.7;font-size:0.9rem}
.cust-stats{display:flex;gap:16px;justify-content:center;margin-top:16px}
.cust-stat{text-align:center}
.cust-stat-num{font-size:1.4rem;font-weight:700}
.cust-stat-label{font-size:0.75rem;opacity:0.7}
.hero-icon{font-size:4rem;display:block;margin-bottom:16px}
.hero-title{font-size:1.5rem;font-weight:800;color:#1a1a2e;margin-bottom:4px}
.card-badge{display:inline-block;padding:2px 8px;border-radius:10px;font-size:0.72rem;font-weight:600}
.badge-red{background:#fef2f2;color:#dc2626}
.badge-yellow{background:#fffbeb;color:#d97706}
.badge-green{background:#f0fdf4;color:#16a34a}
.tag-sm{padding:4px 10px;font-size:0.78rem;border-radius:12px}
.timeline-actions{display:flex;gap:6px;margin-top:6px}
.timeline-tags{display:flex;flex-wrap:wrap;gap:4px;margin-top:2px}
.nav-row{display:flex;gap:8px}
.nav-row .btn{flex:1}
.btn-xs{padding:4px 10px;font-size:0.78rem;border-radius:6px}
.btn-danger{background:#fef2f2;color:#dc2626;border-color:#fecaca}
.btn-outline{background:transparent;border:1.5px solid #d0d0d0}
.btn-done{background:#10b981;color:#fff;border-color:#10b981;font-size:0.8rem;padding:6px 12px;white-space:nowrap}
.btn-done:active{background:#059669}
.toast{position:fixed;top:20px;left:50%;transform:translateX(-50%);z-index:9999;background:#1a1a2e;color:#fff;padding:12px 24px;border-radius:12px;font-weight:600;font-size:0.95rem;box-shadow:0 8px 30px rgba(0,0,0,0.2);animation:toastIn 0.3s;pointer-events:none;max-width:90%}
@keyframes toastIn{from{opacity:0;transform:translateX(-50%) translateY(-20px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}
@keyframes fadeIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.page{animation:fadeIn 0.2s}
@media(min-width:501px){.container{border-left:1px solid #eee;border-right:1px solid #eee;box-shadow:0 0 40px rgba(0,0,0,0.05)}}


/* 鈹€鈹€ Camera capture 鈹€鈹€ */
#camVideo { border-radius: 14px; }
.cam-flash { animation: camFlash 0.15s ease-out; }
@keyframes camFlash { 0% { opacity: 0.3; } 100% { opacity: 1; } }
#capturedGallery img { transition: transform 0.2s; }
#capturedGallery img:hover { transform: scale(1.05); }

/* === Mobile touch optimizations === */
@media (max-width: 500px) {
    .btn, .tag, .search-drop .item { min-height: 44px; min-width: 44px; }
    .input { font-size: 16px; } /* prevent iOS zoom on focus */
    .quick-form .submit-btn { padding: 18px; font-size: 1.15rem; }
}

/* === Capture minimal mode === */
.capture-mini .tag { transition: all 0.1s; }
.capture-mini .tag-active { background: #111; color: #fff; border-color: #111; }