/* ============================================================
   wp-additions.css
   WordPress 模板专属补充样式
   修复原始 styles.css 未覆盖的 WordPress 独有 class
   加载顺序：main.css 之后
   ============================================================ */

/* ─────────────────────────────────────────────
   1. Empty State（空状态占位）
   来源：page-messages.php / page-forum.php 等
   原始 styles.css 无此组件，empty-state.css 未全局加载
   ───────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    color: var(--text-tertiary);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
    flex-shrink: 0;
}

.empty-state p {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state span {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ─────────────────────────────────────────────
   2. Profile Card Sign Out 按钮
   来源：template-parts/profile-sidebar.php L82
   class: profile-card-signout（原始 HTML 用的是 profile-nav-logout）
   ───────────────────────────────────────────── */
.profile-card-signout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
    border-radius: var(--radius-md);
    text-decoration: none;
}

.profile-card-signout:hover {
    background: rgba(229, 57, 53, 0.05);
    color: #E53935;
}

.profile-card-signout svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   3. Settings Info Box（通知页邮件图标容器）
   来源：page-notifications.php L137
   class: settings-info-box
   ───────────────────────────────────────────── */
.settings-info-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.settings-info-box svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.settings-info-box a {
    color: var(--color-primary);
}

.settings-info-box a:hover {
    text-decoration: underline;
}

/* ─────────────────────────────────────────────
   4. 全局 SVG 防溢出安全网
   对所有无尺寸约束的内联 SVG 设防，
   避免 max-width:100% 导致图标铺满容器
   ───────────────────────────────────────────── */
/* 图标类容器内的 SVG 默认不超过 48px */
.notification-icon svg,
.nav-badge + svg,
.sidebar-card svg:not(.tool-card-icon svg),
.settings-section svg:not(.toggle-slider svg) {
    max-width: 48px;
}

/* nav-badge 徽标 */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--color-primary);
    color: white;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

/* ─────────────────────────────────────────────
   5. Avatar 加载动画（profile-sidebar.php）
   ───────────────────────────────────────────── */
.avatar-loading {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    border-radius: var(--radius-full);
    align-items: center;
    justify-content: center;
}

.avatar-loading.active { display: flex; }

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────
   6. Topbar 额外 class（WordPress 动态生成）
   WordPress index.php 用了 topbar-tools / topbar-nav-scrollable
   ───────────────────────────────────────────── */
.topbar-tools { /* 同 .topbar，无需额外样式 */ }

.topbar-nav-scrollable {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.topbar-nav-scrollable::-webkit-scrollbar { display: none; }

.topbar-nav-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.topbar-scroll-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: var(--transition);
    flex-shrink: 0;
}

.topbar-scroll-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.topbar-scroll-btn svg {
    width: 16px;
    height: 16px;
}

/* ─────────────────────────────────────────────
   7. profile-stat（WordPress 模板用的是 profile-stat，
   原始 HTML 是 profile-stat-item）
   ───────────────────────────────────────────── */
.profile-stat { text-align: center; }
.profile-stat .profile-stat-value { display: block; font-size: 18px; font-weight: 700; }
.profile-stat .profile-stat-label { font-size: 11px; color: var(--text-tertiary); }
