/* ========== 全局样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Noto Sans SC',-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
    background: #F0F2F5; 
    color: #333; 
}
a { text-decoration: none; color: inherit; }

/* 头部 */
.app-header {
    /*background: linear-gradient(135deg, #FF4081, #ff6b6b);*/
    background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(0,0,0,0.6));
    backdrop-filter: blur(8px); 
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    color: white;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.2s ease;
}
.app-header h1 { font-size: 20px; font-weight: 600; letter-spacing: 1px; }
.header-right { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.header-avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid white; object-fit: cover; }

/* 按钮通用 */
.btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
    text-align: center;
}
.btn-primary { background: #ff2442; color: white; }
.btn-warning { background: #ffc107; color: #333; }
.btn-danger { background: #dc3545; color: white; }
.btn-success { background: #28a745; color: white; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-like { background: #ff2442; color: white; border-radius: 20px; padding: 8px 18px; }
.btn-unlike { background: #f0f0f0; color: #333; border-radius: 20px; padding: 8px 18px; }

/* 导航按钮 */
.header-right a, .header-right button {
    color: white;
    background: rgba(255,255,255,0.2);
    padding: 6px 15px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}
.header-right a:hover, .header-right button:hover { background: rgba(255,255,255,0.35); }

/* 消息通知 */
.notification-wrap { position: relative; }
.notification-btn { background: none; border: none; color: white; font-size: 20px; cursor: pointer; position: relative; padding: 4px; }
.notification-badge {
    position: absolute; top: -4px; right: -6px;
    background: #ffcc00; color: #333;
    font-size: 11px; font-weight: bold; border-radius: 10px;
    padding: 1px 5px; line-height: 1.2;
}
.notification-dropdown {
    display: none;
    position: absolute; top: 38px; right: 0;
    background: white; color: #333;
    border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    width: 320px; max-height: 400px; overflow-y: auto; z-index: 300;
}
.notification-dropdown.show { display: block; }
.notif-header {
    padding: 14px 16px; font-weight: 600;
    border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between;
}
.notif-item {
    padding: 12px 16px; border-bottom: 1px solid #f9f9f9;
    font-size: 14px; display: flex; align-items: center; gap: 8px;
}
.notif-item img { width: 28px; height: 28px; border-radius: 50%; }
.notif-footer { padding: 10px 16px; text-align: center; border-top: 1px solid #f0f0f0; }
.notif-footer a { color: #ff2442; font-weight: 500; }

.announcement-bar {
    margin: 24px;
    background: #fff3e0; border-left: 4px solid #ff9800;
    padding: 12px 20px; border-radius: 10px; margin-bottom: 20px;
    font-size: 14px; color: #e65100;
}
.section-title {
    font-size: 22px; font-weight: 700; margin: 10px 0 15px;
    border-left: 4px solid #ff2442; padding-left: 8px;
}

/* 瀑布流 */
/*.waterfall { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }*/

.waterfall {
    columns: 150px 5;
}

/* 卡片 */
.card {
    margin-bottom: 16px;
    background: white; border-radius: 16px; overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.card-cover {
    width: 100%; height: 140px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.card-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.card-body { padding: 15px; flex-grow: 1; }
.post-id { font-size: 16px; font-weight: 700; margin-bottom: 6px; word-break: break-word; }
.post-subtitle {
    font-size: 13px; color: #666; margin-bottom: 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-meta {
    font-size: 12px; color: #999;
    display: flex; justify-content: space-between;
    margin-top: auto; padding-top: 8px; border-top: 1px solid #f0f0f0;
    align-items: center;
}
.post-author { display: flex; align-items: center; gap: 4px; }
.post-author img { width: 18px; height: 18px; border-radius: 50%; }
.pinned-badge { background: #ff2442; color: white; font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-left: 5px; }
.empty-state { text-align: center; color: #aaa; padding: 40px; background: white; border-radius: 16px; }

/* 帖子详情弹窗 */
.post-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 200; align-items: center; justify-content: center; }
.post-modal.show { display: flex; }
.post-modal-content { background: white; border-radius: 16px; width: 90%; max-width: 750px; max-height: 85vh; overflow-y: auto; position: relative; }
.modal-close-btn { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 24px; cursor: pointer; z-index: 10; color: #333; }

/* 登录弹窗 */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 250; align-items: center; justify-content: center; }
.modal.show { display: flex; }
.modal-content { background: white; border-radius: 20px; padding: 30px; width: 380px; max-width: 90%; position: relative; }
.modal-close { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 24px; cursor: pointer; color: #999; }
.tab-switch { display: flex; margin-bottom: 25px; border-radius: 30px; background: #f0f0f0; padding: 3px; }
.tab-btn { flex: 1; text-align: center; padding: 10px; border-radius: 30px; cursor: pointer; font-weight: 600; color: #666; background: transparent; border: none; transition: 0.2s; }
.tab-btn.active { background: white; color: #ff2442; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 500; color: #444; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px; border: 1px solid #eee;
    border-radius: 10px; font-size: 14px; background: #fafafa; transition: 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #ff2442; background: white; }
.btn-primary-full { width: 100%; background: #ff2442; color: white; border: none; padding: 12px; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; }
.error-msg { background: #fff0f0; color: #d32f2f; padding: 10px; border-radius: 8px; margin-bottom: 15px; font-size: 14px; border-left: 3px solid #d32f2f; }

/* 个人中心 */
.profile-card {
    background: white; border-radius: 16px; padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); margin-bottom: 20px; text-align: center;
}
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid #ff2442; margin: 0 auto 10px; display: block; }
.stats { display: flex; justify-content: center; gap: 40px; margin: 15px 0; }
.stat-number { font-size: 24px; font-weight: 700; color: #ff2442; }
.stat-label { font-size: 13px; color: #666; margin-top: 4px; }
.settings-card { background: white; border-radius: 16px; padding: 20px; margin-bottom: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.tab-nav { display: flex; background: white; border-radius: 12px; padding: 5px; margin-bottom: 20px; }
.tab-btn-user { flex: 1; text-align: center; padding: 10px; cursor: pointer; font-weight: 600; color: #666; border: none; background: none; border-radius: 8px; }
.tab-btn-user.active { background: #ff2442; color: white; }

/* 列表卡片 */
.list-card { background: white; border-radius: 12px; display: flex; margin-bottom: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.list-cover { width: 60px; min-width: 60px; height: 60px; overflow: hidden; }
.list-cover img { width: 100%; height: 100%; object-fit: cover; }
.list-body { padding: 12px; flex-grow: 1; }
.list-body .title { font-weight: 600; margin-bottom: 4px; }
.list-body .sub { font-size: 13px; color: #666; }
.list-body .meta { font-size: 12px; color: #999; margin-top: 6px; }
.author-avatar { width: 22px; height: 22px; border-radius: 50%; vertical-align: middle; margin-right: 3px; }

/* 管理后台表格等 */
.admin-header { background: #ff2442; color: white; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; }
.admin-header a { color: white; text-decoration: none; margin-left: 15px; background: rgba(255,255,255,0.2); padding: 6px 15px; border-radius: 20px; }
table { width: 100%; border-collapse: collapse; margin-top: 15px; }
th { background: #fafafa; padding: 12px; text-align: left; font-size: 14px; border-bottom: 2px solid #eee; }
td { padding: 12px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.alert { padding: 12px; border-radius: 8px; margin-bottom: 20px; }
.alert-success { background: #e8f5e9; color: #2e7d32; }
.alert-error { background: #ffebee; color: #c62828; }
.pagination { margin-top: 20px; display: flex; gap: 5px; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px;
    text-decoration: none; color: #333; background: white;
}
.pagination a:hover { background: #ff2442; color: white; border-color: #ff2442; }
.pagination .active { background: #ff2442; color: white; border-color: #ff2442; }

/* 消息页面 */
.message-list { background: white; border-radius: 12px; padding: 20px; }
.message-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.message-item:last-child { border-bottom: none; }
.message-avatar { width: 40px; height: 40px; border-radius: 50%; }
.message-content { flex: 1; }
.message-content .text { font-size: 14px; color: #333; }
.message-content .time { font-size: 12px; color: #999; margin-top: 4px; }

/* 帖子详情内联样式补充 */
.detail-container { display: flex; height: 100%; background: white; border-radius: 16px; overflow: hidden; }
.left-panel { width: 45%; min-width: 180px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.left-panel img { width: 100%; height: 100%; object-fit: cover; }
.right-panel { width: 55%; padding: 20px; display: flex; flex-direction: column; overflow-y: auto; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; margin-top: 2px; }
.comment-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.comment-main { flex: 1; }
.comment-header { display: flex; justify-content: space-between; }
.comment-header .user { font-weight: 600; font-size: 14px; }
.comment-header .time { font-size: 12px; color: #999; }
.comment-item .text { margin: 4px 0 0; font-size: 14px; color: #444; line-height: 1.4; }
.comments-list { max-height: 240px; overflow-y: auto; margin-bottom: 15px; }
.comment-form { margin-top: 10px; }
.comment-form textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; resize: vertical; min-height: 60px; }
.comment-form button { margin-top: 8px; padding: 8px 20px; background: #ff2442; color: white; border: none; border-radius: 20px; cursor: pointer; }

/* 响应式 */
@media (max-width: 600px) {
    .detail-container { flex-direction: column; }
    .left-panel { width: 100%; height: 140px; }
    .right-panel { width: 100%; }
}