/* ==========================================================================
   蹦蹦家族 - 門市夥伴成長護照樣式表 (style.css)
   【極簡按鈕導向 ‧ 大字體大觸控 ‧ 手機首選設計】
   ========================================================================== */

:root {
    --primary: #ff8c69;
    --primary-dark: #ea580c;
    --primary-light: #fff7ed;
    --secondary: #10b981;
    --secondary-light: #ecfdf5;
    --gold: #f59e0b;
    --gold-dark: #b45309;
    --gold-light: #fef3c7;
    --dark: #0f172a;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-active: #ea580c;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

html, body {
    width: 100%;
    min-height: 100%;
    min-height: 100dvh;
    background-color: #f1f5f9;
}

body {
    font-family: 'Outfit', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ==========================================================================
   App Container (RWD 響應自適應)
   ========================================================================== */
.app-layout {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: calc(50px + var(--safe-bottom));
    background: #ffffff;
    margin: 0 auto;
}

/* ==========================================================================
   App Header (頂部導航列)
   ========================================================================== */
.app-header {
    background: rgba(255, 255, 255, 0.96);
    padding: calc(12px + var(--safe-top)) 16px 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header-left-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.header-user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8c69 0%, #ea580c 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
    flex-shrink: 0;
}

.header-user-info {
    display: flex;
    flex-direction: column;
}

.user-greeting {
    font-size: 1rem;
    font-weight: 900;
    color: var(--dark);
    line-height: 1.2;
}

.user-level-badge {
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.desktop-nav-bar {
    display: none;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.desktop-nav-btn {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.desktop-nav-btn.active {
    background: #ea580c;
    border-color: #ea580c;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.3);
}

.header-right-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-store-select-wrap {
    display: none;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    padding: 6px 12px;
    border-radius: var(--radius-full);
}
.header-store-select-wrap i {
    color: #16a34a;
    font-size: 0.9rem;
}
.header-store-select {
    border: none;
    background: transparent;
    font-weight: 800;
    color: #15803d;
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
}

.menu-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fef2ee;
    border: 1.5px solid #ffe4d9;
    color: #ea580c;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.15s ease;
}
.menu-toggle-btn:active {
    background: #fed7aa;
    transform: scale(0.92);
}

/* ==========================================================================
   Content Body
   ========================================================================== */
.content-body {
    flex: 1;
    padding: 14px;
    width: 100%;
}

.tab-panel {
    display: none;
    animation: slideUpFade 0.25s ease;
}
.tab-panel.active {
    display: block;
}
@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.rwd-dashboard-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.rwd-col-action, .rwd-col-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* ==========================================================================
   1. Clean Top Bonus Pill Card (簡潔個人獎金看板)
   ========================================================================== */
.bonus-summary-pill-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
    border: 2px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
}

.pill-stat-main {
    display: flex;
    flex-direction: column;
}
.pill-stat-lbl {
    font-size: 0.8rem;
    font-weight: 800;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 5px;
}
.pill-stat-val {
    font-size: 1.75rem;
    font-weight: 900;
    color: #b45309;
    line-height: 1.1;
    margin-top: 2px;
}

.pill-stat-badge {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   2. Three Big Tactile Product Buttons (三大重點品項大按鈕)
   ========================================================================== */
.product-selection-section {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.section-hero-title {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.section-hero-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.big-product-btn-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

/* Big Interactive Product Card Button */
.big-prod-btn {
    width: 100%;
    background: #ffffff;
    border: 2.5px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    touch-action: manipulation;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.big-prod-btn:hover {
    border-color: #fdba74;
    background: #fffdfa;
}

.big-prod-btn:active {
    transform: scale(0.98);
}

/* Active Highlighted State */
.big-prod-btn.active {
    border-color: #ea580c;
    background: #fff7ed;
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.18);
}
.big-prod-btn.active .radio-indicator {
    background: #ea580c;
    border-color: #ea580c;
    color: #ffffff;
}

.prod-btn-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.radio-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: transparent;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.prod-btn-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.prod-btn-name {
    font-size: 1rem;
    font-weight: 900;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.3;
}

.prod-hot-tag {
    background: #fee2e2;
    color: #dc2626;
    font-size: 0.68rem;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 4px;
}

.prod-btn-spec {
    font-size: 0.8rem;
    font-weight: 800;
    color: #78350f;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.spec-chip {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 800;
}

.prod-btn-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 10px;
    flex-shrink: 0;
}

.prod-btn-bonus-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 900;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.3);
    white-space: nowrap;
}

/* ==========================================================================
   3. Big Clear Submission Area (大按鈕送出區域)
   ========================================================================== */
.direct-submit-panel {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 12px;
}

.selected-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #cbd5e1;
}

.selected-prod-title {
    font-size: 0.88rem;
    font-weight: 900;
    color: var(--dark);
}
.selected-prod-bonus {
    font-size: 1.1rem;
    font-weight: 900;
    color: #ea580c;
}

.store-select-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.store-select-compact label {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-muted);
    white-space: nowrap;
}
.store-select-compact select {
    flex: 1;
    min-height: 44px;
    padding: 8px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 16px !important;
    font-weight: 700;
    color: #0f766e;
    background: #ffffff;
    outline: none;
}

/* Big Prominent Submit Button */
.btn-big-submit {
    width: 100%;
    min-height: 56px;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.12rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.4);
    touch-action: manipulation;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-big-submit:hover {
    box-shadow: 0 10px 28px rgba(234, 88, 12, 0.45);
}

.btn-big-submit:active {
    transform: scale(0.97);
    background: linear-gradient(135deg, #d97706 0%, #c2410c 100%);
}

/* Custom Entry Toggle */
.custom-entry-toggle-wrap {
    text-align: center;
    margin-top: 10px;
}
.btn-toggle-custom {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: underline;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.custom-entry-drawer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
}
.custom-entry-drawer.hidden {
    display: none;
}
.custom-entry-drawer .form-group {
    margin-bottom: 10px;
}
.custom-entry-drawer label {
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 4px;
}
.custom-entry-drawer input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px !important;
    background: #fff;
    outline: none;
}

/* ==========================================================================
   4. Bulletin Stream & Leaderboard Cards
   ========================================================================== */
.bulletin-stream-card, .leaderboard-card {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.bulletin-header, .leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.bulletin-header h4, .leaderboard-header h4 {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-pulse {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary);
    animation: blinkDot 1.4s infinite;
}
@keyframes blinkDot { 0% { opacity: 0.3; } 50% { opacity: 1; } 100% { opacity: 0.3; } }

.bulletin-stream-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bulletin-item {
    background: #f8fafc;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.25s ease;
    animation: itemPushDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes itemPushDown {
    0% { opacity: 0; transform: translateY(-12px) scale(0.97); background: #fef3c7; }
    60% { background: #fef3c7; }
    100% { opacity: 1; transform: translateY(0) scale(1); background: #f8fafc; }
}

.item-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.item-avatar-initial {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-details { flex: 1; min-width: 0; }

.item-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86rem;
    color: var(--dark);
    margin-bottom: 2px;
}

.item-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: auto;
}

.item-content-desc {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.35;
}

.item-note {
    font-size: 0.76rem;
    color: #78350f;
    margin-top: 3px;
    font-weight: 600;
}

.item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    margin-left: 8px;
    flex-shrink: 0;
}

.bonus-amount-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: #ffffff;
    font-weight: 900;
    font-size: 0.92rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.btn-prop {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    padding: 6px 12px;
    min-height: 36px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    touch-action: manipulation;
    transition: transform 0.1s ease;
}
.btn-prop:active { transform: scale(0.9); background: #fef3c7; }
.btn-prop.voted { border-color: var(--primary); background: #fff3ef; color: var(--primary); }

.leaderboard-list { display: flex; flex-direction: column; gap: 8px; }
.leader-row {
    display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
    border-radius: var(--radius-sm); border: 1.5px solid var(--border-color); background: #fafafa;
}
.leader-row.rank-1 { background: #fffbeb; border-color: #fde68a; }
.rank-num { font-size: 1.35rem; margin-right: 8px; flex-shrink: 0; }
.leader-info { flex: 1; min-width: 0; }
.leader-name { font-size: 0.95rem; font-weight: 900; color: var(--dark); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.store-tag { font-size: 0.74rem; font-weight: 800; background: #e2e8f0; color: #475569; padding: 2px 7px; border-radius: 4px; }
.leader-amt { font-size: 0.84rem; color: var(--text-muted); }
.leader-amt strong { color: #b45309; font-weight: 900; }

/* ==========================================================================
   Sidebar Drawer
   ========================================================================== */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.5); z-index: 998; backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px); transition: opacity 0.3s ease;
}
.sidebar-overlay.hidden { display: none; }

.sidebar-drawer {
    position: fixed; top: 0; right: 0; width: 85%; max-width: 320px; height: 100vh;
    height: 100dvh; background: #ffffff; z-index: 999; box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
    display: flex; flex-direction: column; transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: var(--safe-bottom);
}
.sidebar-drawer.open { transform: translateX(0); }

.drawer-header {
    padding: calc(16px + var(--safe-top)) 16px 16px 16px;
    border-bottom: 1px solid var(--border-color); display: flex;
    justify-content: space-between; align-items: flex-start;
    background: linear-gradient(135deg, #fff8f5 0%, #ffffff 100%);
}
.drawer-user-card { display: flex; align-items: center; gap: 12px; }
.drawer-avatar {
    width: 46px; height: 46px; border-radius: 50%; background: var(--primary);
    color: #fff; font-weight: 900; font-size: 1.2rem; display: flex;
    align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(255, 140, 105, 0.3);
}

.drawer-close-btn {
    width: 40px; height: 40px; border-radius: 50%; background: #f1f5f9; border: none;
    font-size: 1.15rem; color: var(--text-muted); cursor: pointer; display: flex;
    align-items: center; justify-content: center; touch-action: manipulation;
}

.drawer-nav { flex: 1; padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.nav-section-title { font-size: 0.72rem; font-weight: 800; color: #94a3b8; text-transform: uppercase; margin-bottom: 6px; margin-left: 4px; }

.drawer-nav-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 48px; border-radius: var(--radius-md);
    background: transparent; border: none; text-align: left; cursor: pointer; touch-action: manipulation;
    transition: all 0.15s ease; width: 100%; position: relative;
}
.drawer-nav-item.active { background: #fff3ef; }
.drawer-nav-item.active .title { color: #ea580c; font-weight: 900; }
.drawer-nav-item i { font-size: 1.2rem; flex-shrink: 0; }
.icon-orange { color: var(--primary); }
.icon-gold { color: var(--gold); }
.icon-muted { color: #94a3b8; }
.item-info { flex: 1; display: flex; flex-direction: column; }
.item-info .title { font-size: 0.95rem; font-weight: 800; color: var(--dark); line-height: 1.3; }
.item-info small { font-size: 0.74rem; color: var(--text-muted); }
.arrow { font-size: 0.75rem !important; color: #cbd5e1; }
.nav-badge-dev { background: #f1f5f9; color: #94a3b8; font-size: 0.62rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-left: auto; border: 1px solid #e2e8f0; }
.item-disabled { opacity: 0.6; cursor: not-allowed !important; }

.drawer-footer { padding: 14px; border-top: 1px solid var(--border-color); background: #fafafa; }

/* ==========================================================================
   Policies Tab
   ========================================================================== */
.section-title-wrap {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 10px; margin-bottom: 14px;
}
.section-title { font-size: 1.1rem; font-weight: 900; color: var(--dark); margin-bottom: 2px; }
.section-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }

.policy-stream-list { display: flex; flex-direction: column; gap: 14px; }
.policy-card {
    background: #ffffff; border: 1.5px solid var(--border-color); border-radius: var(--radius-md);
    padding: 16px; box-shadow: var(--shadow-sm);
}
.policy-card.pin-highlight {
    border-color: #fed7aa;
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}
.policy-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.policy-tag {
    font-size: 0.7rem; font-weight: 800; padding: 2px 8px; border-radius: var(--radius-full);
    display: inline-flex; align-items: center; gap: 4px;
}
.tag-urgent { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.tag-standard { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.tag-info { background: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.policy-date { font-size: 0.72rem; color: var(--text-muted); }
.policy-title { font-size: 1rem; font-weight: 900; color: var(--dark); margin-bottom: 8px; line-height: 1.4; }
.policy-body-content {
    font-size: 0.84rem; color: var(--text-main); line-height: 1.55; background: #f8fafc;
    border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px;
}
.policy-body-content p { margin-bottom: 6px; }
.policy-body-content p:last-child { margin-bottom: 0; }
.policy-body-content code { background: #fef08a; color: #854d0e; padding: 1px 6px; border-radius: 4px; font-weight: 900; }
.policy-footer { display: flex; justify-content: flex-end; }
.btn-policy-ack {
    background: #f8fafc; border: 1px solid var(--border-color); padding: 8px 14px;
    border-radius: var(--radius-full); font-size: 0.78rem; font-weight: 800; color: var(--text-muted);
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    touch-action: manipulation;
}
.btn-policy-ack.acked { background: #ecfdf5; border-color: #a7f3d0; color: #059669; }

#confettiCanvas {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 10000;
}

/* ==========================================================================
   RWD Layout Breakpoints
   ========================================================================== */
@media (min-width: 768px) {
    body {
        background-color: #f1f5f9;
        display: flex;
        justify-content: center;
    }

    .app-layout {
        max-width: 100%;
        background: #ffffff;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
    }

    .app-header {
        padding: 14px 24px;
    }

    .desktop-nav-bar {
        display: flex;
    }

    .header-store-select-wrap {
        display: flex;
    }

    .content-body {
        padding: 20px 24px;
    }

    .rwd-dashboard-layout {
        display: grid;
        grid-template-columns: minmax(360px, 480px) 1fr;
        gap: 20px;
        align-items: start;
    }

    .rwd-policy-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .app-layout {
        max-width: 1280px;
        margin: 16px auto;
        border-radius: var(--radius-lg);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
        border: 1px solid var(--border-color);
        overflow: hidden;
    }

    .app-header {
        padding: 16px 32px;
    }

    .content-body {
        padding: 24px 32px 40px 32px;
    }

    .rwd-dashboard-layout {
        grid-template-columns: 500px 1fr;
        gap: 28px;
    }

    .rwd-policy-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}


/* ==========================================================================
   Product Category Tabs & Threshold Rule Banners
   ========================================================================== */
.prod-category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.prod-category-tabs::-webkit-scrollbar {
    display: none;
}
.prod-cat-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.prod-cat-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}
.prod-cat-btn.active {
    background: #ea580c;
    border-color: #ea580c;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
}
.prod-cat-btn .cat-pill-badge {
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    background: #fef3c7;
    color: #b45309;
}
.prod-cat-btn.active .cat-pill-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.prod-group-panel {
    display: none;
}
.prod-group-panel.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.rule-group-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.spec-chip.spec-rule {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    font-weight: 800;
}

.selected-prod-rule {
    margin-top: 4px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #dc2626;
    background: #fef2f2;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}
.selected-prod-rule.hidden {
    display: none;
}

.catalog-toggle-btn {
    width: 100%;
    margin-top: 14px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--radius-md);
    color: #475569;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.catalog-toggle-btn:hover {
    background: #f8fafc;
    border-color: #ea580c;
    color: #ea580c;
}

.catalog-modal-wrap {
    margin-top: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.catalog-modal-wrap.hidden {
    display: none;
}


/* ==========================================================================
   🚨 Prominent Big Red Alert Card & Warning Box (業績抽查重大警示)
   ========================================================================== */
.audit-warning-card {
    background: linear-gradient(135deg, #fff1f2 0%, #fee2e2 100%);
    border: 2.5px solid #ef4444;
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.18);
    animation: gentlePulse 3s infinite ease-in-out;
}

@keyframes gentlePulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.18);
        border-color: #ef4444;
    }
    50% {
        box-shadow: 0 8px 26px rgba(239, 68, 68, 0.35);
        border-color: #dc2626;
    }
}

.audit-warning-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1.5px dashed #fca5a5;
    flex-wrap: wrap;
}

.audit-warning-badge {
    background: #dc2626;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.5px;
}

.audit-warning-title {
    font-size: 1.12rem;
    font-weight: 900;
    color: #b91c1c;
    line-height: 1.3;
}

.audit-warning-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audit-warning-rules {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 1.5px solid #fecaca;
}

.audit-rule-item {
    font-size: 0.98rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.audit-rule-item.rule-half {
    color: #ea580c;
}

.audit-rule-item.rule-zero {
    color: #dc2626;
    font-size: 1.02rem;
}

.audit-rule-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 900;
    white-space: nowrap;
}
.audit-rule-tag.tag-half {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
}
.audit-rule-tag.tag-zero {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.submit-audit-reminder {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    line-height: 1.4;
}


/* ==========================================================================
   📱 Member Phone Input & Time Audit Display
   ========================================================================== */
.member-phone-input-wrap {
    margin-bottom: 12px;
}
.member-phone-input-wrap label {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 5px;
}
.member-phone-input-box {
    position: relative;
    display: flex;
    align-items: center;
}
.member-phone-input-box i {
    position: absolute;
    left: 12px;
    color: #ea580c;
    font-size: 0.95rem;
    pointer-events: none;
}
.member-phone-input-box input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px 10px 38px;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 16px !important;
    font-weight: 700;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.member-phone-input-box input:focus {
    border-color: #ea580c;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}
.member-phone-hint {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 700;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Feed Stream Meta (Time & Phone Audit Tags) */
.item-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    flex-wrap: wrap;
}
.meta-time-tag {
    font-size: 0.72rem;
    font-weight: 800;
    color: #475569;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.meta-phone-tag {
    font-size: 0.72rem;
    font-weight: 800;
    color: #0284c7;
    background: #e0f2fe;
    padding: 2px 7px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
