/* ============================================
   飘雪电影论坛 - 公共样式表
   所有页面引用此CSS
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scrollbar-gutter: stable;
    padding-right: var(--sbw, 0px);
}

body {
    background: #0f0c29;
    min-height: 100vh;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #e5e7eb;
    padding-bottom: 80px;
}

a { text-decoration: none; color: inherit; }

/* ========== 顶部导航栏 ========== */
.top-bar {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(15px);
    padding: 10px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.top-bar .logo i { font-size: 28px; color: #6366f1; }

.top-bar .user-area {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.top-bar .user-area .btn {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-login {
    background: rgba(99,102,241,0.3);
    color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.5) !important;
}
.btn-login:hover { background: rgba(99,102,241,0.5); }

.btn-register {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}
.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}

/* ========== 用户区块 ========== */
.user-block {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.avatar-wrapper {
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
}

.vip-badge-tag {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: 800;
    color: #fff;
    padding: 1px 6px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    z-index: 5;
    line-height: 1.5;
    pointer-events: none;
}

.vip-badge-tag-home {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    padding: 3px 12px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
    z-index: 5;
    pointer-events: none;
}

.avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    object-fit: cover;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    overflow: hidden;
}

.avatar-img img { width: 100%; height: 100%; object-fit: cover; }

.user-text { display: flex; flex-direction: column; }
.user-welcome { font-size: 12px; color: #9ca3af; }
.user-name { font-size: 14px; font-weight: 600; color: #e5e7eb; }

.admin-badge {
    display: inline-block;
    background: linear-gradient(135deg, #dc2626, #f97316);
    color: #fff;
    font-size: 10px;
    padding: 1px 8px;
    border-radius: 10px;
    margin-left: 4px;
    font-weight: 700;
}

/* ========== 等级徽章 ========== */
.level-badge-link { text-decoration: none; color: inherit; display: inline-flex; }
.level-badge-link:hover .level-badge { border-color: rgba(99,102,241,0.45); }
.level-badge {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px 12px;
    border-radius: 10px;
    margin-left: 6px;
    min-width: 140px;
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.25);
}
.level-badge .lv-top { display: flex; align-items: center; gap: 3px; font-size: 12px; white-space: nowrap; }
.level-badge .lv-icon { color: #fbbf24; font-size: 10px; flex-shrink: 0; }
.level-badge .lv-num { font-weight: 700; font-size: 13px; flex-shrink: 0; }
.level-badge .lv-sep { color: #6b7280; margin: 0 1px; flex-shrink: 0; }
.level-badge .lv-exp { font-size: 11px; color: #9ca3af; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.level-badge .lv-exp b { color: #d1d5db; }
.level-badge .lv-exp-max { color: #fde68a; font-weight: 700; }

.level-badge .lv-bar {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}

.level-badge .lv-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a5b4fc);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.level-badge.level-high { background: rgba(245,158,11,0.15); color: #fcd34d; border-color: rgba(245,158,11,0.25); }
.level-badge.level-high .lv-bar-fill { background: linear-gradient(90deg, #f59e0b, #fcd34d); }

.level-badge.level-max {
    background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(245,158,11,0.2));
    color: #fde68a;
    border-color: rgba(239,68,68,0.3);
    animation: levelGlow 2s ease-in-out infinite;
}

.level-badge.level-max .lv-bar-fill { background: linear-gradient(90deg, #ef4444, #f59e0b); }

@keyframes levelGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(245,158,11,0.3); }
    50% { box-shadow: 0 0 16px rgba(239,68,68,0.5); }
}

/* ========== 下拉菜单 ========== */
.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: rgba(30,27,75,0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 0;
    min-width: 200px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    display: none;
    z-index: 200;
    overflow: hidden;
}

.dropdown.show { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-header .dh-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.dropdown-header .dh-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.dropdown-header .dh-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dropdown-header .dh-info { display: flex; flex-direction: column; }
.dropdown-header .dh-name { font-size: 14px; font-weight: 600; color: #e5e7eb; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    color: #d1d5db;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.dropdown-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.dropdown-item i { width: 18px; text-align: center; font-size: 14px; color: #6366f1; }
.dropdown-item.admin-item i { color: #f97316; }

.dropdown-item.logout-item {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 6px;
    padding-top: 12px;
    color: #fca5a5;
}
.dropdown-item.logout-item i { color: #ef4444; }

/* ========== 页面容器 ========== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px 40px; }

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #c7d2fe;
    margin: 30px 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    padding: 20px;
    color: #4b5563;
    font-size: 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 20px;
}

/* ========== 全局 Toast 提示 ========== */
.global-toast-container { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 9999; max-width: 520px; width: auto; }
.toast-msg {
    padding: 12px 20px; border-radius: 12px; font-size: 13px;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    animation: toastSlideIn 0.35s ease;
    margin-bottom: 8px;
    word-break: break-all;
}
.toast-success { background: rgba(16,185,129,0.22); border: 1px solid rgba(16,185,129,0.45); color: #6ee7b7; }
.toast-error { background: rgba(239,68,68,0.22); border: 1px solid rgba(239,68,68,0.45); color: #fca5a5; }
.toast-info { background: rgba(99,102,241,0.22); border: 1px solid rgba(99,102,241,0.45); color: #a5b4fc; }
.toast-private { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.4); color: #fca5a5; }
.toast-public { background: rgba(16,185,129,0.22); border-color: rgba(16,185,129,0.45); color: #6ee7b7; }
@keyframes toastSlideIn { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: translateY(0); } }

.site-footer { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; width: 100%; border-top: 1px solid rgba(255,255,255,0.08); padding: 24px 20px; text-align: center; color: #4b5563; font-size: 12px; background: #0f0c29; }
.site-footer p { margin: 0; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .top-bar { padding: 10px 15px; }
    .top-bar .logo { font-size: 16px; }
    .user-welcome { display: none; }
    .level-badge, .level-badge-link { display: none; }
}
