body { 
    background-color: #f0f2f5; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

/* =================== 粘性底部页脚 ===================
   内容不足一屏时，页脚贴住视口底部；内容超一屏时页脚跟随内容末尾。
   body 在文档流内的可见直接子元素仅为 navbar / 主内容区 / 页脚，
   modal、flash 等均为 position:fixed，不参与 flex 布局，故可安全使用。 */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
/* 主内容区（layout 页 .container-fluid、协议页 .container）占满剩余高度，
   把页脚推向视口底部；内容超出时 flex:1 0 auto 保证页脚不收缩。 */
body > .container-fluid,
body > .container {
    flex: 1 0 auto;
    width: 100%;
}
.site-footer {
    margin-top: auto;
    flex-shrink: 0;
}
.navbar { 
    margin-bottom: 30px; 
}

/* =================== 顶部导航栏：缓慢渐变动画 + 上升气泡 =================== */
.animated-navbar {
    position: relative;
    background: linear-gradient(90deg, #667eea, #764ba2, #5b6abf, #3a7bd5, #667eea);
    background-size: 300% 100%;
    animation: navbar-gradient 18s ease-in-out infinite;
    box-shadow: 0 4px 18px rgba(102, 126, 234, 0.35);
}
@keyframes navbar-gradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
/* 内容区抬高一层，保证气泡在文字/链接之下 */
.navbar-content {
    position: relative;
    z-index: 1;
}
/* 气泡容器：铺满导航栏并把溢出的气泡裁剪在导航栏内 */
.navbar-bubbles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.navbar-bubble {
    position: absolute;
    bottom: -40px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.16) 45%, rgba(255,255,255,0) 70%);
    box-shadow: inset -2px -3px 6px rgba(255,255,255,0.22);
    opacity: 0;
    animation-name: navbar-bubble-rise;
    animation-timing-function: linear;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
}
@keyframes navbar-bubble-rise {
    0%   { transform: translateY(0) translateX(0) scale(1);
           opacity: 0; }
    8%   { opacity: var(--bubble-max-opacity, 0.7); }
    85%  { opacity: var(--bubble-max-opacity, 0.7); }
    100% { transform: translateY(-170px) translateX(var(--bubble-drift, 24px)) scale(1.2);
           opacity: 0; }
}
/* 浅色上叠加文字阴影，保证渐变背景下文字清晰 */
.navbar-dark .navbar-nav .nav-link,
.navbar-dark .navbar-brand {
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}
.card { 
    border: none; 
    border-radius: 16px; 
    margin-bottom: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}
.card:not(.game-board-card):hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
.game-board-card {
    transition: none !important;
}
.game-board-card:hover {
    transform: none !important;
}
/* 表格卡片：让表格随卡片圆角裁切，避免表头底色在圆角外露出白色小角 */
.card > .card-body.p-0:first-child > .table-responsive:first-child {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}
.card > .card-body.p-0:last-child > .table-responsive:last-child {
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}
/* 表格卡片：去掉末行多余底边线，避免卡片底部出现一条白线 */
.card > .card-body.p-0:last-child > .table-responsive:last-child > .table > tbody > tr:last-child > * {
    border-bottom: 0;
}
.btn {
    border-radius: 8px !important;
}

/* ================= 各颜色按钮的基础样式 ================= */
/* 通用基础：无边框、内边距、统一过渡动效（所有按钮共用） */
.btn-primary, .btn-warning, .btn-secondary, .btn-danger, .btn-info, .btn-success, .btn-dark {
    border: none;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}
/* 主按钮专属：蓝紫渐变背景 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ================= 按钮悬停动效 ================= */
/* 悬停上浮：所有按钮统一向上浮动 2px（相同的部分合并到一起） */
.btn-primary:hover,
.btn-warning:hover,
.btn-secondary:hover,
.btn-danger:hover,
.btn-info:hover,
.btn-success:hover,
.btn-dark:hover {
    transform: translateY(-2px);
}
/* 悬停发光阴影：各颜色按钮的阴影颜色不同，单独定义（颜色与按钮主题色对应） */
.btn-primary:hover   { box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4); }  /* 蓝紫渐变 - 主操作按钮 */
.btn-warning:hover   { box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4); }    /* 琥珀黄 - 警告按钮 */
.btn-secondary:hover { box-shadow: 0 6px 20px rgba(122, 122, 122, 0.4); }  /* 中性灰 - 次级按钮 */
.btn-danger:hover    { box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4); }    /* 红色 - 危险/删除按钮 */
.btn-info:hover      { box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4); }   /* 青色 - 信息提示按钮 */
.btn-success:hover   { box-shadow: 0 6px 20px rgba(25, 135, 84, 0.4); }    /* 绿色 - 成功/确认按钮 */
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.avatar-md { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.points-badge { 
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); 
    color: #fff; 
    font-weight: bold; 
    border-radius: 15px; 
    padding: 3px 10px;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
    transition: all 0.3s ease;
}
.points-badge:hover {
    color: #eaeaea;
}
.username-link {
    font-weight: 700 !important;
}
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
input:focus + .slider {
    box-shadow: 0 0 1px #667eea;
}
input:checked + .slider:before {
    transform: translateX(26px);
}
.slider.round {
    border-radius: 34px;
}
.avatar-frame-red { border: 3px solid #dc3545; box-shadow: 0 0 0 2px rgba(220,53,69,.2); }
.avatar-frame-orange { border: 3px solid #fd7e14; box-shadow: 0 0 0 2px rgba(253,126,20,.2); }
.avatar-frame-yellow { border: 3px solid #ffc107; box-shadow: 0 0 0 2px rgba(255,193,7,.2); }
.avatar-frame-green { border: 3px solid #198754; box-shadow: 0 0 0 2px rgba(25,135,84,.2); }
.avatar-frame-cyan { border: 3px solid #0dcaf0; box-shadow: 0 0 0 2px rgba(13,202,240,.2); }
.avatar-frame-blue { border: 3px solid #0d6efd; box-shadow: 0 0 0 2px rgba(13,110,253,.2); }
.avatar-frame-purple { border: 3px solid #6f42c1; box-shadow: 0 0 0 2px rgba(111,66,193,.2); }
.avatar-frame-custom_frame { border: 3px solid var(--frame-color, #0d6efd); box-shadow: 0 0 0 2px rgba(13,110,253,.2); }
.avatar-frame-container {
    position: relative;
    display: inline-block;
}
.avatar-frame-self {
    position: relative;
}
.avatar-frame-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 0;
    background-image: var(--frame-image);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2;
    pointer-events: none;
}
.profile-bg-red { background: radial-gradient(circle at 50% 50%, #ffffff 0%, #dc3545 100%); }
.profile-bg-orange { background: radial-gradient(circle at 50% 50%, #ffffff 0%, #fd7e14 100%); }
.profile-bg-yellow { background: radial-gradient(circle at 50% 50%, #ffffff 0%, #ffc107 100%); }
.profile-bg-green { background: radial-gradient(circle at 50% 50%, #ffffff 0%, #198754 100%); }
.profile-bg-cyan { background: radial-gradient(circle at 50% 50%, #ffffff 0%, #0dcaf0 100%); }
.profile-bg-blue { background: radial-gradient(circle at 50% 50%, #ffffff 0%, #0d6efd 100%); }
.profile-bg-purple { background: radial-gradient(circle at 50% 50%, #ffffff 0%, #6f42c1 100%); }
.profile-bg-custom_bg { background: radial-gradient(circle at 50% 50%, #ffffff 0%, var(--bg-color, #0d6efd) 100%); }
.badge { border-radius: 15px; padding: 0.35em 0.7em; }
.badge.bg-info { background-color: var(--bg-color, #0d6efd); color: var(--text-color, #000000); }
.pagination .page-link {
    border-radius: 10px;
    margin: 0 4px;
    border: none;
    color: #667eea;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}
.pagination .page-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
}
.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}
.list-group-item {
    border: none;
    transition: all 0.3s ease;
    background: transparent;
}
.list-group-item:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(5px);
}
.z-0 { z-index: 0 !important; }
.z-1 { z-index: 1 !important; }
.z-2 { z-index: 2 !important; }
.z-3 { z-index: 3 !important; }
@property --snake-pos {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
@keyframes snakeAnim {
    0% { --snake-pos: 0deg; }
    100% { --snake-pos: 360deg; }
}
@keyframes snakeFadeOut {
    0%, 80% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(50px); }
}
.alert-snake {
    position: relative !important;
    border: 3px solid transparent !important;
    animation: snakeFadeOut 3.8s ease-in-out forwards;
    overflow: hidden;
}
.alert-snake::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 3px;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        transparent var(--snake-pos),
        var(--alert-border) var(--snake-pos),
        var(--alert-border) 360deg
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: snakeAnim 3s ease-in-out forwards;
    pointer-events: none;
}
.card:has(>.card-header){overflow:hidden}

/* ==================== 全局统一美化（认证页 / 聊天 / 错误页 / 签到弹窗） ==================== */

/* ---------- 认证页（登录/注册/找回密码/2FA/强制改密） ---------- */
.auth-row::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 18% 18%, rgba(102, 126, 234, 0.16), transparent 46%),
        radial-gradient(circle at 82% 28%, rgba(118, 75, 162, 0.13), transparent 42%),
        radial-gradient(circle at 55% 90%, rgba(240, 147, 251, 0.11), transparent 45%);
}
.auth-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.12) !important;
    border-radius: 20px !important;
    background: linear-gradient(160deg, #ffffff 0%, #f7f9ff 100%) !important;
    box-shadow: 0 16px 48px rgba(31, 38, 135, 0.14) !important;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    z-index: 1;
    pointer-events: none;
}
.auth-card .card-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}
/* 认证表单输入框聚焦光晕 */
.auth-card .form-control:focus {
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15);
}

/* ---------- 认证页浮动标签输入框 ----------
   未输入且未聚焦：标签居中显示在框内；
   聚焦或有内容后：标签缩小并上移到框的上边框处，一直保持显示。
   占位符仅用于空态检测（:placeholder-shown），视觉上隐藏，由真实 <label> 承担展示。 */
.auth-card .float-label {
    position: relative;
}
.auth-card .float-label .form-control {
    height: auto;
    padding-top: 0.5rem;      /* 顶部给浮动标签留出空间 */
    padding-bottom: 0.5rem;
}
.auth-card .float-label > label {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 400;
    color: #6c757d;
    pointer-events: none;
    white-space: nowrap;
    z-index: 5;
    transition: top 0.18s ease, transform 0.18s ease,
                font-size 0.18s ease, color 0.18s ease,
                background 0.18s ease, padding 0.18s ease;
}
.auth-card .float-label input:focus ~ label,
.auth-card .float-label input:not(:placeholder-shown) ~ label {
    top: 0;
    transform: translateY(-50%) scale(0.8);
    font-size: 0.9rem;
    color: #667eea;
    background: #fff;         /* 遮挡输入框上边框，形成缺口 */
    padding: 0 0.3rem;
}
/* 占位符仅供空态检测，视觉隐藏（避免与浮动标签重复显示） */
.auth-card .float-label .form-control::placeholder {
    color: transparent;
}

/* ---------- 聊天页消息气泡 ---------- */
.message .avatar-frame-container {
    filter: drop-shadow(0 2px 8px rgba(102, 126, 234, 0.18));
}
/* 自己发的消息：蓝紫渐变气泡 + 白色文字 */
.message-self .p-3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25) !important;
    border-radius: 16px 16px 4px 16px !important;
}
.message-self .p-3 p {
    color: #fff !important;
}
/* 他人消息：白底细描边气泡 */
.message:not(.message-self) .p-3 {
    background: #ffffff !important;
    border: 1px solid rgba(102, 126, 234, 0.12) !important;
    box-shadow: 0 2px 10px rgba(31, 38, 135, 0.06) !important;
    border-radius: 16px 16px 16px 4px !important;
}
/* 聊天入口卡（公开频道/私信/群聊） */
.chat-entry-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #ffffff 0%, #f7f9ff 100%) !important;
    border: 1px solid rgba(102, 126, 234, 0.10) !important;
    border-radius: 18px !important;
    box-shadow: 0 6px 24px rgba(31, 38, 135, 0.07) !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease !important;
}
.chat-entry-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.chat-entry-card:hover {
    transform: translateY(-6px);
    border-color: rgba(102, 126, 234, 0.30) !important;
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.16) !important;
}
.chat-entry-card:hover::before {
    width: 100%;
}

/* ---------- 错误页（404/500/413） ---------- */
.error-page .display-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 60%, #f093fb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    filter: drop-shadow(0 8px 24px rgba(102, 126, 234, 0.22));
}
.error-page .col-md-6 {
    background: linear-gradient(160deg, #ffffff 0%, #f7f9ff 100%);
    border: 1px solid rgba(102, 126, 234, 0.12);
    border-radius: 22px;
    padding: 46px 32px;
    box-shadow: 0 16px 48px rgba(31, 38, 135, 0.10);
}
.error-page .btn {
    font-weight: 600;
}

/* ---------- 签到心情弹窗 ---------- */
.mood-option {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mood-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.25);
}
.mood-option.btn-primary {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.35);
    border-color: transparent !important;
}

/* ---------- Flash 消息：分类图标 + 玻璃质感 ---------- */
.flash-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    flex-shrink: 0;
}
.alert-snake {
    background: rgba(255, 255, 255, 0.96) !important;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 12px;
}

/* ==================== 帖子 发布 / 编辑 / 详情（与全局主题统一） ==================== */

/* 发帖 / 编辑页共用表单卡：玻璃渐变 + 顶部渐变线 + 大圆角 */
.editor-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.12) !important;
    border-radius: 20px !important;
    background: linear-gradient(160deg, #ffffff 0%, #f7f9ff 100%) !important;
    box-shadow: 0 16px 48px rgba(31, 38, 135, 0.12) !important;
}
.editor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    z-index: 1;
    pointer-events: none;
}
.post-editor-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}
/* 编辑器输入框聚焦光晕 */
.editor-card .form-control:focus {
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15);
}
/* 图片预览格子：主题化边框与阴影 */
.image-preview-item:hover {
    border-color: rgba(102, 126, 234, 0.55) !important;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.22) !important;
}
.edit-image-thumb {
    border: 1px solid rgba(102, 126, 234, 0.12);
    border-radius: 12px;
}

/* ============ 帖子详情页：仅美化卡片外壳（不影响正文/配图/评论/按钮的展示） ============ */
.post-page-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px !important;
    box-shadow: 0 16px 48px rgba(31, 38, 135, 0.12) !important;
}
.post-page-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    z-index: 2;
    pointer-events: none;
}
/* 详情页标题：渐变字（卡片标题装饰，非正文内容） */
.post-page-title {
    color: transparent;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 55%, #f093fb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 12px rgba(102, 126, 234, 0.25));
}
/* 详情页作者头像光晕 */
.post-page-card .avatar-frame-container {
    filter: drop-shadow(0 4px 14px rgba(102, 126, 234, 0.25));
}
