/* ===== 重置与全局变量 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0b0d15;
    color: #e0e4f0;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 动态光效背景 */
body::before {
    content: "";
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 180, 255, 0.15) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(255, 120, 220, 0.12) 0%, transparent 35%),
        radial-gradient(circle at 40% 80%, rgba(120, 255, 200, 0.1) 0%, transparent 40%);
    filter: blur(40px);
    animation: lightShift 18s infinite alternate ease-in-out;
    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(#ffffff0f 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

@keyframes lightShift {
    0% { opacity: 0.6; transform: scale(1) translate(0, 0); }
    50% { opacity: 1; transform: scale(1.2) translate(-2%, -1%); }
    100% { opacity: 0.7; transform: scale(0.9) translate(3%, 2%); }
}

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

/* ===== 毛玻璃卡片通用 ===== */
.glass-card {
    background: rgba(20, 25, 40, 0.6);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(120, 160, 255, 0.15);
    border-radius: 28px;
    box-shadow: 0 18px 35px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(70, 130, 255, 0.1) inset, 0 0 20px rgba(0, 160, 255, 0.2);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
}

.glass-card:hover {
    border-color: rgba(100, 180, 255, 0.4);
    box-shadow: 0 25px 45px -12px rgba(0, 120, 255, 0.3), 0 0 0 1px rgba(100, 180, 255, 0.3) inset, 0 0 35px rgba(70, 130, 255, 0.4);
    transform: translateY(-4px);
}

/* ===== 头部导航 ===== */
.site-header {
    background: rgba(10, 15, 25, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid #2a3a60;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo a {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #b0d0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    filter: drop-shadow(0 0 20px #3a86ff66);
    animation: textGlow 3s infinite alternate;
}

@keyframes textGlow {
    0% { filter: drop-shadow(0 0 15px #2a6eff33); }
    100% { filter: drop-shadow(0 0 30px #6e9effaa); }
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: #b0c8ff;
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

nav a:hover {
    color: white;
}

.nav-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}

/* ===== 按钮样式 ===== */
.new-topic-btn, .submit-btn, button.action-btn {
    background: rgba(35, 45, 70, 0.8);
    border: 1px solid #3f5e9c;
    border-radius: 40px;
    padding: 0.7rem 1.5rem;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.new-topic-btn:hover, .submit-btn:hover, button.action-btn:hover {
    background: #2f4170;
    border-color: #6d9eff;
    box-shadow: 0 0 15px #3f7eff;
    transform: scale(1.02);
}

/* 点赞/收藏按钮状态 */
.action-btn.liked {
    color: #ff6b6b;
}
.action-btn.favorited {
    color: gold;
}

/* ===== 表单样式 ===== */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    color: #b7ceff;
    font-weight: 500;
}

input, textarea, select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(8, 12, 26, 0.6);
    border: 1px solid #314d82;
    border-radius: 30px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #6795ff;
    box-shadow: 0 0 0 3px #1e3d7a, 0 0 20px #4f8cff;
}

/* ===== 帖子卡片网格 ===== */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.topic-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    animation: cardFadeIn 0.7s ease backwards;
}

@keyframes cardFadeIn {
    0% { opacity: 0; transform: translateY(20px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.topic-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #c9ddff;
    background: linear-gradient(135deg, #f0f5ff, #c9ddff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.topic-card .meta {
    color: #8da4cc;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px dashed #2f4570;
    padding-bottom: 0.5rem;
}

.topic-card p {
    color: #bfd0ec;
    margin-bottom: 1rem;
    flex: 1;
}

.topic-card .stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    color: #6c89b5;
    font-size: 0.9rem;
}

.topic-footer {
    display: flex;
    justify-content: space-between;
    color: #6c89b5;
    font-size: 0.9rem;
}

/* ===== 帖子详情页 ===== */
.topic-detail .meta {
    display: flex;
    gap: 1rem;
    color: #98b1e0;
    border-bottom: 1px solid #2a4270;
    padding-bottom: 0.8rem;
    margin-bottom: 1.5rem;
}

.topic-detail .content {
    white-space: pre-wrap;
    margin-bottom: 2rem;
}

.actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* 帖子详情卡片缩小 */
.topic-detail.glass-card {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 1.5rem;
}

/* ===== 回复卡片 ===== */
.reply-card {
    margin-bottom: 1rem;
    border-left: 4px solid #4165b0;
    padding: 1.2rem;
}

.reply-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #9bbaff;
}

.reply-meta strong {
    color: #9bbaff;
}

.reply-meta span {
    color: #6c89b5;
}

.reply-content {
    color: #bfd0ec;
}

/* ===== 附件样式 ===== */
.attachments {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.attachments ul {
    list-style: none;
    padding: 0;
}

.attachments li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #2a3a60;
}

.attachments a {
    color: #b0c8ff;
    text-decoration: none;
}

.attachments a:hover {
    color: white;
}

/* 举报按钮 */
.report-reply-btn {
    background: none;
    border: none;
    color: #9c3c3c;
    cursor: pointer;
    margin-left: 1rem;
    font-size: 0.9rem;
}

.report-reply-btn:hover {
    color: #ff6b6b;
}

/* 文件列表（发帖时显示已选附件） */
.file-list {
    margin-top: 0.5rem;
    color: #8da4cc;
}

/* ===== 模态框 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1a1f30;
    border-radius: 28px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid #3e5b99;
    box-shadow: 0 30px 60px #00000080, 0 0 80px #2f6ea0;
}

.modal .close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: #b0c6ff;
    background: none;
    border: none;
    transition: 0.2s;
}

.modal .close:hover {
    color: white;
    transform: rotate(90deg);
}

/* ===== 个人资料页 ===== */
.profile-header {
    text-align: center;
    padding: 2rem;
}

.profile-header .avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3f5e9c;
    margin-bottom: 1rem;
}

.profile-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.profile-header p {
    color: #8da4cc;
    margin-bottom: 1rem;
}

.profile-topics, .profile-replies {
    margin-top: 2rem;
}

.profile-topics ul, .profile-replies ul {
    list-style: none;
    padding: 0;
}

.profile-topics li, .profile-replies li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #2a3a60;
}

.profile-topics a, .profile-replies a {
    color: #b0c8ff;
    text-decoration: none;
}

.profile-topics a:hover, .profile-replies a:hover {
    color: white;
}

/* ===== 管理后台表格 ===== */
.admin-container {
    padding: 2rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.admin-table th, .admin-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #2a3a60;
}

.admin-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.admin-table th {
    background: rgba(30, 40, 60, 0.8);
    color: #b7ceff;
    font-weight: 600;
}

.pagination {
    margin-top: 2rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.pagination a {
    padding: 0.5rem 1rem;
    background: #1a1f30;
    border-radius: 5px;
    text-decoration: none;
    color: #b0c8ff;
}

.pagination a.active {
    background: #3f5e9c;
    color: white;
}

.search-box {
    margin-bottom: 2rem;
}

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    background: #1e3450;
    color: #9bbaff;
    display: inline-block;
    margin-right: 0.3rem;
}

.badge.pinned {
    background: #5e3c9c;
    color: #e0c8ff;
}

.badge.locked {
    background: #9c3c3c;
    color: #ffc8c8;
}

.actions form {
    display: inline;
}

.actions button {
    background: none;
    border: none;
    color: #b0c8ff;
    cursor: pointer;
    text-decoration: underline;
    margin: 0 0.3rem;
    font-size: 0.9rem;
}

.actions button:hover {
    color: white;
}

.success {
    color: #8bc34a;
    margin-bottom: 1rem;
}

.error {
    color: #ff6b6b;
    margin-bottom: 1rem;
}

/* ===== 加载动画 ===== */
.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #1d3557;
    border-top: 4px solid #82b0ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0); }
    100% { transform: rotate(360deg); }
}

/* ===== 信息提示 ===== */
.info-message {
    text-align: center;
    color: #99b5e0;
    font-style: italic;
    padding: 2rem;
}

/* ===== 页脚 ===== */
.site-footer {
    margin-top: 4rem;
    text-align: center;
    color: #4e6991;
    font-size: 0.9rem;
    padding: 2rem 0;
}

/* ===== 头像上传相关 ===== */
.avatar-preview {
    text-align: center;
    margin-bottom: 2rem;
}

.avatar-preview img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3f5e9c;
}

/* ===== 移动端适配（左logo右菜单，字体18px） ===== */
@media (max-width: 768px) {
    body {
        font-size: 18px;
    }
    .site-header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        padding: 0.8rem 0;
    }
    .logo a {
        font-size: 1.6rem;
    }
    nav ul {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.6rem;
        padding: 0;
    }
    nav ul li a {
        font-size: 1.1rem;
        padding: 0.2rem 0;
    }
    .nav-avatar {
        width: 28px;
        height: 28px;
    }
    .glass-card {
        padding: 1.8rem 1.5rem !important;
        margin: 20px auto !important;
        max-width: 96% !important;
        border-radius: 28px;
    }
    input, textarea, select, button {
        font-size: 18px;
        padding: 0.9rem 1.2rem;
        border-radius: 36px;
    }
    .submit-btn, .new-topic-btn {
        width: 100%;
        padding: 1rem;
        font-size: 1.3rem;
    }
    .topics-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    .topic-card {
        padding: 1.8rem;
    }
    .topic-card h3 {
        font-size: 1.8rem;
        margin-bottom: 0.6rem;
    }
    .topic-card p {
        font-size: 1.3rem;
        line-height: 1.5;
    }
    .topic-card .meta {
        font-size: 1.1rem;
        padding-bottom: 0.6rem;
    }
    .stats span {
        font-size: 1.1rem;
        margin-right: 1rem;
    }
    .topic-detail .meta {
        font-size: 1.1rem;
        gap: 1rem;
        padding-bottom: 0.8rem;
    }
    .topic-detail .content {
        font-size: 1.3rem;
    }
    .topic-detail.glass-card {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    .reply-card {
        padding: 1.3rem;
        margin-bottom: 1.3rem;
    }
    .reply-meta {
        font-size: 1.1rem;
    }
    .reply-content {
        font-size: 1.2rem;
    }
    .profile-header .avatar {
        width: 110px;
        height: 110px;
    }
    .profile-header h2 {
        font-size: 2rem;
    }
    .profile-header p {
        font-size: 1.2rem;
    }
    .profile-topics li, .profile-replies li {
        font-size: 1.2rem;
        padding: 0.6rem 0;
    }
    .actions {
        gap: 1rem;
    }
    .action-btn {
        padding: 0.9rem 1.8rem;
        font-size: 1.2rem;
    }
    .modal-content {
        width: 95%;
        padding: 2rem 1.5rem;
    }
    .modal-content h2 {
        font-size: 2rem;
    }
    .modal .close {
        font-size: 2.5rem;
        top: 0.8rem;
        right: 1rem;
    }
    .admin-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 1.1rem;
    }
    .admin-table th, .admin-table td {
        padding: 0.8rem;
    }
    .site-footer {
        font-size: 1.1rem;
        padding: 1.5rem 0;
    }
}

@media (max-width: 480px) {
    .logo a {
        font-size: 1.4rem;
    }
    nav ul {
        gap: 0.4rem;
    }
    nav ul li a {
        font-size: 1rem;
    }
    h1 {
        font-size: 1.8rem;
    }
    .glass-card {
        padding: 1.2rem !important;
    }
}