/* ============================================================
   站内通知样式（铃铛体系，2026-09-18）
   依赖宿主页 CSS 变量（与 topbar.css 同源）；浅深色由 data-theme 驱动。
   铃铛默认 display:none，JS 探测到登录（/user/notices 200）后加 .show。
   ============================================================ */

/* ── 铃铛按钮 + 红点 ─────────────────────────────────────────────── */
.tb-notice-btn {
    display: none;
    position: relative;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    color: var(--topbar-fg, #374151);
    align-items: center;
    justify-content: center;
}
.tb-notice-btn.show { display: inline-flex; }
.tb-notice-btn:hover { background: var(--topbar-hover, rgba(0,0,0,.06)); }
[data-theme="dark"] .tb-notice-btn { color: #d1d5db; }
[data-theme="dark"] .tb-notice-btn:hover { background: rgba(255,255,255,.08); }

.tb-notice-badge {
    display: none;
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-sizing: border-box;
}
.tb-notice-badge.show { display: block; }

/* ── 下拉面板 ────────────────────────────────────────────────────── */
.tb-notice-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 320px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--topbar-panel-bg, #fff);
    border: 1px solid var(--topbar-panel-border, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 10px 32px rgba(0,0,0,.14);
    z-index: 900;
}
[data-theme="dark"] .tb-notice-panel {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 10px 32px rgba(0,0,0,.5);
}

.tb-notice-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--topbar-panel-border, #e5e7eb);
    position: sticky;
    top: 0;
    background: inherit;
}
[data-theme="dark"] .tb-notice-head { border-color: #374151; }

.tb-notice-markall {
    border: none;
    background: none;
    color: #4f46e5;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}
.tb-notice-markall:hover { text-decoration: underline; }
[data-theme="dark"] .tb-notice-markall { color: #a5b4fc; }

.tb-notice-empty {
    padding: 28px 14px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

.tb-notice-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    color: inherit;
}
.tb-notice-item:hover { background: var(--topbar-hover, rgba(0,0,0,.04)); }
[data-theme="dark"] .tb-notice-item:hover { background: rgba(255,255,255,.06); }
.tb-notice-item + .tb-notice-item { border-top: 1px solid rgba(0,0,0,.05); }
[data-theme="dark"] .tb-notice-item + .tb-notice-item { border-top-color: rgba(255,255,255,.06); }

.tb-notice-dot {
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
}
.tb-notice-item.unread .tb-notice-dot { background: #4f46e5; }

.tb-notice-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tb-notice-item.unread .tb-notice-title { font-weight: 600; }

.tb-notice-time {
    flex: 0 0 auto;
    font-size: 11px;
    color: #9ca3af;
}

/* ── 内容弹窗 ────────────────────────────────────────────────────── */
.tb-notice-modal {
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.tb-notice-modal-card {
    width: min(520px, 100%);
    max-height: 76vh;
    display: flex;
    flex-direction: column;
    background: var(--topbar-panel-bg, #fff);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
[data-theme="dark"] .tb-notice-modal-card { background: #1f2937; }

.tb-notice-modal-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}
.tb-notice-modal-time {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 10px;
}
.tb-notice-modal-body {
    flex: 1;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}
.tb-notice-modal-close {
    align-self: flex-end;
    margin-top: 14px;
    padding: 6px 18px;
    border: none;
    border-radius: 8px;
    background: #4f46e5;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}
.tb-notice-modal-close:hover { background: #4338ca; }
