:root {
    --primary-color: #4a90e2;
    --primary-hover: #357abd;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-light: #7f8c8d;
    --border-radius: 12px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 16px rgba(0,0,0,0.1);
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* 布局容器 */
.container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
}

/* 头部导航 */
header {
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    position: sticky;
    top: 20px;
    z-index: 100;
}

.logo-area { display: flex; align-items: center; gap: 12px; }
.logo-area img { height: 35px; width: auto; }
.logo-area h1 { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--text-main); }

nav a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}
nav a:hover { background-color: #eef5fc; }

/* 按钮通用 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    text-decoration: none;
}
.btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn:disabled { background: #cbd5e0; cursor: not-allowed; transform: none; }
.btn-danger { background: #e74c3c; }
.btn-danger:hover { background: #c0392b; }
.btn-secondary { background: #95a5a6; }
.btn-success { background: #2ecc71; }
.btn-success:hover { background: #27ae60; }

/* 帖子卡片 - 改为可点击 */
.post-item {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
}
.post-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #eef2f7;
}

.post-title {
    font-size: 1.3rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
    pointer-events: none;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-preview-img {
    max-height: 150px;
    width: auto;
    border-radius: 8px;
    margin-top: 12px;
    object-fit: cover;
}

/* 附件样式 */
.attachments {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.attachment-item {
    display: inline-block;
    margin: 5px;
    padding: 5px 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #eef2f7;
    cursor: pointer;
    transition: all 0.2s;
}

.attachment-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.attachment-item a {
    text-decoration: none;
    color: inherit;
}

/* 详情页内容 */
.post-detail-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}
.post-content {
    margin-top: 20px;
    font-size: 1.05rem;
    white-space: pre-wrap;
    word-break: break-word;
}
.post-content a { color: var(--primary-color); text-decoration: none; border-bottom: 1px dashed; }
.post-content a:hover { border-bottom-style: solid; }
.post-image-full { 
    max-width: 100%; 
    border-radius: var(--border-radius); 
    margin: 20px 0; 
    cursor: pointer;
    transition: transform 0.3s;
}
.post-image-full:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* 评论区 */
.comments-section {
    margin-top: 30px;
    background: var(--card-bg);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}
.comment {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}
.comment:last-child { border-bottom: none; }

/* 表单元素 */
input[type="text"], input[type="password"], textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    margin-bottom: 0px;
    border: 2px solid #eef2f7;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: inherit;
}
input:focus, textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}
textarea { min-height: 120px; resize: vertical; }

/* 弹窗 (Modal) */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}
.modal-box {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: popIn 0.3s ease;
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* 分页 */
.pagination { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 30px; padding-bottom: 30px;}

/* 图片预览模态框 */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.image-preview-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.image-preview-modal .download-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

/* 通知系统 */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
}

.notification.success { border-left-color: var(--success-color); }
.notification.error { border-left-color: var(--error-color); }
.notification.warning { border-left-color: var(--warning-color); }
.notification.info { border-left-color: var(--primary-color); }

.notification .icon {
    font-size: 1.2rem;
}

.notification .message {
    flex: 1;
    color: var(--text-main);
}

.notification .close-btn {
    cursor: pointer;
    color: #999;
    font-size: 1.2rem;
}

.notification .close-btn:hover {
    color: var(--text-main);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 适配移动端 */
@media (max-width: 600px) {
    .container { margin: 10px auto; padding: 0 10px; }
    header { padding: 10px 15px; flex-direction: column; gap: 10px; }
    .post-detail-card { padding: 15px; }
    h1 { font-size: 1.1rem; }
    .notification-container {
        left: 20px;
        right: 20px;
    }
    .notification {
        min-width: auto;
    }
}

/* 页脚 */
.app-footer {
    margin-top: 0px;
    padding-top: 0px;
    border-top: 1px solid #eee;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    padding-bottom: 0px;
}

.app-footer a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 5px;
}

/* 内容区域自动撑开 */
#post-list, #post-detail, #adminContent > div {
    flex: 1;
}

/* 返回按钮 */
.back-btn {
    display: inline-block;
    margin-bottom: 20px;
    cursor: pointer;
}