/* ── 通知中心：導覽列小鈴鐺＋下拉，與 /notifications 頁 ── */
.navbar-notif { position: relative; }
.notif-btn { position: relative; }
.notif-btn svg { width: 16px; height: 16px; }
.navbar-notif.is-open .notif-btn { color: var(--color-text); background: var(--color-surface-elevated); }
.notif-badge {
    position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px; background: #e0556a; color: #fff; font-size: 0.6rem; font-weight: 700; line-height: 16px;
    text-align: center; box-shadow: 0 0 0 2px var(--color-bg); pointer-events: none;
}
.notif-badge[hidden] { display: none; }

.notif-panel {
    position: absolute; top: calc(100% + 8px); right: -40px; width: 360px; max-width: calc(100vw - 24px);
    background: var(--dropdown-bg); border: 1px solid var(--dropdown-border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); z-index: 120; display: flex; flex-direction: column; overflow: hidden;
    opacity: 0; visibility: hidden; transform: translateY(-4px); pointer-events: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}
.notif-panel.open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.notif-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 12px 14px 10px; border-bottom: 1px solid var(--color-border);
}
.notif-head b { font-size: 0.86rem; color: var(--color-text); }
.notif-head button { font-size: 0.72rem; color: var(--color-accent); padding: 4px 6px; border-radius: 6px; }
.notif-head button:hover { background: var(--color-accent-soft); }
.notif-list { max-height: min(62vh, 460px); overflow-y: auto; overscroll-behavior: contain; padding: 4px; }
.notif-empty { padding: 28px 12px; text-align: center; font-size: 0.8rem; color: var(--color-text-muted); }
.notif-all {
    display: block; text-align: center; padding: 10px; font-size: 0.76rem; color: var(--color-text-secondary);
    border-top: 1px solid var(--color-border);
}
.notif-all:hover { color: var(--color-text); background: var(--color-surface-elevated); }

.notif-item {
    display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: var(--radius-md);
    color: var(--color-text-secondary); position: relative; text-decoration: none;
}
.notif-item:hover { background: var(--color-surface-elevated); color: var(--color-text); }
.notif-item.is-unread { color: var(--color-text); }
.notif-item.is-unread::after {
    content: ''; position: absolute; right: 12px; bottom: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent);
}
.notif-ic {
    position: relative; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-surface-elevated); color: var(--color-text-secondary);
}
.notif-ic > svg { width: 16px; height: 16px; }
.notif-ic > img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.notif-ic-mini {
    position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-accent); color: var(--color-accent-text); box-shadow: 0 0 0 2px var(--dropdown-bg);
}
.notif-ic-mini svg { width: 10px; height: 10px; }
.notif-ic-heart, .notif-ic-heart .notif-ic-mini { color: #e0556a; }
.notif-ic-heart .notif-ic-mini { background: #e0556a; color: #fff; }
.notif-ic-ticket, .notif-ic-calendar, .notif-ic-bell, .notif-ic-megaphone { color: var(--color-accent); }
.notif-ic-check { color: #3fb37f; }
.notif-ic-check .notif-ic-mini { background: #3fb37f; color: #fff; }
.notif-ic-x { color: var(--color-rose); }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; padding-right: 12px; }
.notif-title { font-size: 0.8rem; line-height: 1.45; overflow-wrap: anywhere; }
.notif-sub { font-size: 0.72rem; color: var(--color-text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-time { font-size: 0.68rem; color: var(--color-text-faint); }

@media (max-width: 640px) {
    .notif-panel { position: fixed; top: calc(var(--navbar-height) + 6px); left: 12px; right: 12px; width: auto; max-width: none; }
}

/* ── /notifications ── */
.nf-page { padding: var(--space-2xl) 0 var(--space-3xl); }
.nf-page .container { max-width: 760px; }
.nf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: var(--space-lg); }
.nf-head h1 { font-size: 1.6rem; margin: 4px 0 0; }
.nf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nf-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-md); }
.nf-tab {
    padding: 6px 14px; border-radius: 999px; border: 1px solid var(--color-border); font-size: 0.78rem;
    color: var(--color-text-secondary);
}
.nf-tab:hover { color: var(--color-text); }
.nf-tab.is-on { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-text); font-weight: 600; }
.nf-list { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 6px; }
.nf-list .notif-item { padding: 12px; }
.nf-list .notif-title { font-size: 0.86rem; }
.nf-list .notif-sub { -webkit-line-clamp: 4; }
.nf-empty { padding: 48px 12px; text-align: center; color: var(--color-text-muted); font-size: 0.86rem; }
.nf-more { text-align: center; margin-top: var(--space-md); }

/* 手機推播設定卡（2026-09-24） */
.push-card { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: var(--space-md);
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); scroll-margin-top: calc(var(--navbar-height) + 16px); }
.push-card[data-state="on"] { border-color: rgba(63, 179, 127, 0.45); }
.push-card[data-state="off"] { border-color: rgba(243, 159, 90, 0.45); background: linear-gradient(90deg, var(--color-accent-soft), var(--color-surface) 70%); }
.push-ic { flex: 0 0 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--color-surface-elevated); color: var(--color-accent); }
.push-ic svg { width: 20px; height: 20px; }
.push-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.push-state b { display: block; font-size: 0.9rem; }
.push-state small { display: block; font-size: 0.78rem; color: var(--color-text-muted); line-height: 1.6; margin-top: 2px; }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; align-self: center; }
.push-cats { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.push-cats[hidden] { display: none; }
.push-cats-title { font-size: 0.74rem; color: var(--color-text-muted); flex-basis: 100%; }
.push-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; cursor: pointer; }
.push-cat input { accent-color: var(--color-accent); }
.notif-push-hint { display: block; margin: 4px; padding: 8px 10px; border-radius: var(--radius-md); font-size: 0.76rem; color: var(--color-accent);
    background: var(--color-accent-soft); text-align: center; }
.notif-push-hint[hidden] { display: none; }

/* 安裝 App 釘選（2026-09-24） */
.notif-pin { border: 1px solid rgba(243, 159, 90, 0.4); background: var(--color-accent-soft); margin-bottom: 4px; }
.notif-ic-app { background: none; }
.notif-ic-app img { width: 34px; height: 34px; border-radius: 9px; }
.notif-btn.has-pwa::after { content: ''; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%;
    background: var(--color-accent); box-shadow: 0 0 0 2px var(--color-bg); }
.notif-btn.has-pwa.has-unread::after { display: none; }
.notif-btn.is-pulse { animation: notif-pulse 0.9s ease 2; }
@keyframes notif-pulse { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.35) rotate(-12deg); } 70% { transform: scale(0.95) rotate(8deg); } }

/* 刪除（2026-09-24）：每則右上角 ×、下拉標頭的「刪除已讀」 */
.notif-row { position: relative; transition: opacity .18s ease, transform .18s ease; }
.notif-row.is-leaving { opacity: 0; transform: translateX(16px); }
.notif-row .notif-body { padding-right: 22px; }
.notif-del { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 7px; border: none; padding: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--color-text-faint);
    opacity: 0; transition: opacity var(--transition-fast), background var(--transition-fast), color var(--transition-fast); }
.notif-del svg { width: 13px; height: 13px; }
.notif-row:hover .notif-del, .notif-del:focus-visible { opacity: 1; }
.notif-del:hover { background: rgba(224, 85, 106, 0.14); color: #e0556a; }
@media (hover: none) { .notif-del { opacity: 0.75; } }
.notif-head-acts { display: inline-flex; gap: 2px; }
.notif-head button.is-danger { color: var(--color-text-muted); }
.notif-head button.is-danger:hover { color: #e0556a; background: rgba(224, 85, 106, 0.1); }
/* 收不到推播的檢查清單（2026-09-24） */
.push-help-link { display: inline-block; margin-top: 6px; font-size: 0.76rem; color: var(--color-accent); }
.push-help { margin: calc(-1 * var(--space-md) + 8px) 0 var(--space-md); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
    background: var(--color-surface); scroll-margin-top: calc(var(--navbar-height) + 16px); }
.push-help summary { cursor: pointer; padding: 10px 16px; font-size: 0.82rem; font-weight: var(--font-weight-semibold); color: var(--color-text-secondary); }
.push-help summary:hover { color: var(--color-text); }
.push-help-body { padding: 2px 16px 14px; display: grid; gap: 12px; }
.push-help-group { padding: 10px 12px; border-radius: var(--radius-md); background: var(--color-surface-elevated); }
.push-help-group.is-mine { outline: 1px solid rgba(243, 159, 90, 0.45); }
.push-help-group.is-mine h3::after { content: '這台裝置'; margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 0.66rem; font-weight: 600;
    color: var(--color-accent); background: var(--color-accent-soft); vertical-align: 1px; }
[data-lang="en"] .push-help-group.is-mine h3::after { content: 'This device'; }
.push-help-group h3 { font-size: 0.82rem; margin: 0 0 4px; }
.push-help-group ul { margin: 0; padding-left: 18px; font-size: 0.76rem; color: var(--color-text-muted); line-height: 1.65; }
.push-help-foot { margin: 0; font-size: 0.74rem; color: var(--color-text-muted); line-height: 1.6; }
.notif-ic-rocket, .notif-ic-coin { color: #8ea2ff; }
