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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --gradient-soft: linear-gradient(135deg, #eef2ff 0%, #fce7f3 100%);
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.05);
    --shadow: 0 4px 20px rgba(99,102,241,.08);
    --shadow-lg: 0 20px 40px rgba(99,102,241,.15);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all .3s cubic-bezier(.4, 0, .2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(99,102,241,.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 60%, rgba(236,72,153,.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }

/* ========== 顶部导航 ========== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(226,232,240,.6);
    padding: 14px 0;
}

.navbar-inner {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 18px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -.3px;
}

.logo-emoji { font-size: 24px; -webkit-text-fill-color: initial; }

.nav-links { display: flex; align-items: center; gap: 6px; }

.nav-links a {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-links a:hover { background: var(--gradient-soft); color: var(--primary); }
.nav-links a.active { background: var(--gradient); color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.3); }

.btn-nav-primary {
    background: var(--gradient) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.btn-nav-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,.45); }

/* ========== 主容器 ========== */
.container { max-width: 780px; margin: 0 auto; padding: 24px 20px 100px; position: relative; z-index: 1; }

/* ========== Hero 头部 ========== */
.hero {
    padding: 40px 20px 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 32px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -.5px;
    margin-bottom: 8px;
}

.hero p { color: var(--text-muted); font-size: 15px; }

/* ========== 筛选标签 ========== */
.filter-bar {
    display: flex;
    gap: 8px;
    margin: 24px 0 20px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
    flex-shrink: 0;
    padding: 8px 18px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.filter-chip.active {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,.3);
}

/* ========== 帖子卡片 ========== */
.post-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226,232,240,.6);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient);
    opacity: 0;
    transition: var(--transition);
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99,102,241,.2);
}
.post-card:hover::before { opacity: 1; }

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99,102,241,.25);
}

.avatar.anon { background: linear-gradient(135deg, #cbd5e1, #94a3b8); box-shadow: none; }

.post-meta { flex: 1; min-width: 0; }
.post-meta .name { font-weight: 700; color: var(--text); font-size: 15px; }
.post-meta .info { font-size: 12.5px; color: var(--text-light); margin-top: 2px; display: flex; gap: 8px; align-items: center; }
.post-meta .info span { display: flex; align-items: center; gap: 3px; }

.tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .2px;
}
.tag-confession { background: linear-gradient(135deg, #fce7f3, #fbcfe8); color: #db2777; }
.tag-gossip { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #2563eb; }

.post-content {
    color: var(--text);
    line-height: 1.75;
    font-size: 15px;
    margin-bottom: 14px;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-actions {
    display: flex;
    gap: 18px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.post-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 8px;
    transition: var(--transition);
    font-family: inherit;
}

.post-actions button:hover { background: var(--gradient-soft); color: var(--primary); }
.post-actions button.liked { color: #ec4899; }

/* ========== 浮动按钮 ========== */
.fab {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 300;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(99,102,241,.45);
    transition: var(--transition);
    z-index: 90;
    animation: fabPulse 2.5s ease-in-out infinite;
}

.fab:hover { transform: scale(1.08) rotate(90deg); box-shadow: 0 12px 32px rgba(99,102,241,.55); }

@keyframes fabPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(99,102,241,.45); }
    50% { box-shadow: 0 8px 24px rgba(99,102,241,.45), 0 0 0 12px rgba(99,102,241,.08); }
}

/* ========== 空状态 ========== */
.empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}
.empty .emoji { font-size: 64px; margin-bottom: 16px; display: block; opacity: .6; }
.empty p { font-size: 15px; }

/* ========== 表单卡片 ========== */
.form-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(226,232,240,.6);
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}

.form-textarea { min-height: 160px; resize: vertical; line-height: 1.7; }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 6px 20px rgba(99,102,241,.35);
    width: 100%;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(99,102,241,.45); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--gradient-soft); }

.btn-block { width: 100%; }

/* ========== 类型选择（发帖页） ========== */
.type-select { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }

.type-option { position: relative; cursor: pointer; }
.type-option input { position: absolute; opacity: 0; pointer-events: none; }

.type-option .option-inner {
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    transition: var(--transition);
    background: #fff;
}

.type-option .option-emoji { font-size: 28px; display: block; margin-bottom: 6px; }
.type-option .option-label { font-size: 14px; font-weight: 700; color: var(--text-muted); }

.type-option:hover .option-inner { border-color: var(--primary); transform: translateY(-2px); }

.type-option input:checked + .option-inner {
    border-color: var(--primary);
    background: var(--gradient-soft);
    box-shadow: 0 6px 20px rgba(99,102,241,.15);
}
.type-option input:checked + .option-inner .option-label { color: var(--primary); }

/* ========== 匿名勾选 ========== */
.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    margin-bottom: 24px;
}

.checkbox-wrap:hover { background: var(--gradient-soft); }

.checkbox-wrap input { display: none; }

.checkbox-wrap .box {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: #fff;
    flex-shrink: 0;
}

.checkbox-wrap input:checked + .box {
    background: var(--gradient);
    border-color: transparent;
}
.checkbox-wrap input:checked + .box::after {
    content: '✓';
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.checkbox-wrap .label-text { font-size: 14px; font-weight: 600; color: var(--text); }

/* ========== 提示 ========== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown .3s ease;
}
.alert-success { background: #dcfce7; color: #15803d; }
.alert-error { background: #fee2e2; color: #b91c1c; }

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

/* ========== 登录/注册页 ========== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at 15% 25%, rgba(99,102,241,.15) 0%, transparent 45%),
        radial-gradient(circle at 85% 75%, rgba(236,72,153,.15) 0%, transparent 45%),
        linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before,
.auth-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .5;
}
.auth-page::before { width: 400px; height: 400px; background: #a5b4fc; top: -100px; left: -100px; }
.auth-page::after { width: 400px; height: 400px; background: #f9a8d4; bottom: -100px; right: -100px; }

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 24px 60px rgba(99,102,241,.18);
    position: relative;
    z-index: 1;
    animation: cardIn .5s cubic-bezier(.4, 0, .2, 1);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
    text-align: center;
    font-size: 48px;
    margin-bottom: 8px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.auth-title {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 6px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}
.auth-footer a { font-weight: 700; color: var(--primary); }
.auth-footer a:hover { text-decoration: underline; }

/* ========== 控制台 ========== */
.profile-header {
    background: var(--gradient);
    border-radius: var(--radius);
    padding: 32px;
    color: #fff;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(99,102,241,.3);
}

.profile-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 0%, rgba(255,255,255,.2) 0%, transparent 50%);
}

.profile-content { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; }

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: rgba(255,255,255,.25);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
}

.profile-info h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.profile-info p { font-size: 13px; opacity: .9; display: flex; gap: 10px; flex-wrap: wrap; }
.profile-badge {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(255,255,255,.25);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226,232,240,.6);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--gradient-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}

.stat-card .num {
    font-size: 30px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -1px;
}
.stat-card .label { font-size: 13px; color: var(--text-muted); margin-top: 2px; font-weight: 600; }

.section-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226,232,240,.6);
    margin-bottom: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-item {
    padding: 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border-bottom: 1px solid #f8fafc;
}
.post-item:last-child { border-bottom: none; }
.post-item:hover { background: #f8fafc; }

.post-item .content { color: var(--text); font-size: 14px; line-height: 1.6; margin-bottom: 8px; }
.post-item .meta { font-size: 12px; color: var(--text-light); display: flex; gap: 12px; flex-wrap: wrap; }
.post-item .meta span { display: flex; align-items: center; gap: 3px; }

.action-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

/* ========== 详情页评论 ========== */
.comment {
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
    animation: fadeIn .3s ease;
}
.comment:last-child { border-bottom: none; }

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

.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-avatar {
    width: 32px; height: 32px; border-radius: 10px;
    background: var(--gradient-soft); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.comment-name { font-weight: 700; font-size: 14px; color: var(--text); }
.comment-time { font-size: 12px; color: var(--text-light); margin-left: auto; }
.comment-text { color: var(--text); font-size: 14.5px; line-height: 1.7; padding-left: 42px; }

/* ========== 返回按钮 ========== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 20px;
    transition: var(--transition);
    margin-bottom: 16px;
}
.back-link:hover { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }

/* ========== 响应式 ========== */
@media (max-width: 640px) {
    .hero h1 { font-size: 26px; }
    .navbar-inner { padding: 0 16px; }
    .container { padding: 16px 16px 100px; }
    .form-card { padding: 24px 20px; }
    .auth-card { padding: 32px 24px; }
    .nav-links a { padding: 7px 12px; font-size: 13px; }
    .logo { font-size: 16px; }
    .logo-emoji { font-size: 20px; }
    .profile-header { padding: 24px; }
    .profile-avatar { width: 60px; height: 60px; font-size: 24px; }
    .profile-info h1 { font-size: 18px; }
}
/* ==================== 消息中心 / 好友 ==================== */

/* 导航栏红点 */
.nav-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.nav-badge::after {
    content: attr(data-count);
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239,68,68,.4);
    animation: badgePulse 2s infinite;
}
.nav-badge[data-count="0"]::after { display: none; }

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 好友列表卡片 */
.friend-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid #f8fafc;
    position: relative;
}
.friend-item:hover { background: #f8fafc; transform: translateX(3px); }
.friend-item:last-child { border-bottom: none; }

.friend-avatar {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99,102,241,.2);
}

.friend-info { flex: 1; min-width: 0; }
.friend-info .name { font-weight: 700; font-size: 15px; color: var(--text); }
.friend-info .sub {
    font-size: 12.5px;
    color: var(--text-light);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.friend-info .unread-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
    vertical-align: middle;
}

/* 聊天页 */
.chat-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 62px);
    max-width: 780px;
    margin: 0 auto;
    position: relative;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,.02);
}
.chat-header .name { font-weight: 800; font-size: 16px; color: var(--text); }
.chat-header .status { font-size: 12px; color: #22c55e; display: flex; align-items: center; gap: 4px; }
.chat-header .status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34,197,94,.6);
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 72%;
    animation: msgIn .3s cubic-bezier(.4, 0, .2, 1);
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg.me { margin-left: auto; flex-direction: row-reverse; }

.msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.msg.me .msg-avatar { background: linear-gradient(135deg, #cbd5e1, #94a3b8); }

.msg-bubble {
    padding: 10px 15px;
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    word-break: break-word;
    white-space: pre-wrap;
    position: relative;
    max-width: 100%;
}
.msg-bubble::before {
    content: '';
    position: absolute;
    bottom: 8px;
    left: -5px;
    width: 10px;
    height: 10px;
    background: inherit;
    transform: rotate(45deg);
    border-radius: 2px;
}
.msg.me .msg-bubble {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,.3);
}
.msg.me .msg-bubble::before { left: auto; right: -5px; }

.msg-time {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
    text-align: center;
    width: 100%;
}

.day-divider {
    text-align: center;
    font-size: 11px;
    color: var(--text-light);
    margin: 10px 0;
    position: relative;
}
.day-divider span {
    background: #f8fafc;
    padding: 0 12px;
    position: relative;
    z-index: 1;
}

/* 输入区 */
.chat-input-wrap {
    padding: 12px 16px 18px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-shrink: 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,.02);
}

.chat-input-wrap textarea {
    flex: 1;
    padding: 12px 18px;
    border: 1.5px solid var(--border);
    border-radius: 22px;
    resize: none;
    font-family: inherit;
    font-size: 14.5px;
    outline: none;
    max-height: 120px;
    line-height: 1.5;
    transition: var(--transition);
    background: #f8fafc;
}
.chat-input-wrap textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}

.chat-send-btn {
    padding: 0 22px;
    height: 44px;
    background: var(--gradient);
    color: #fff;
    border: none;
    border-radius: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(99,102,241,.3);
    white-space: nowrap;
}
.chat-send-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(99,102,241,.4); }
.chat-send-btn:active { transform: translateY(0); }
.chat-send-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 好友申请条目 */
.request-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    margin-bottom: 10px;
    transition: var(--transition);
}
.request-item:hover { border-color: rgba(99,102,241,.25); box-shadow: 0 4px 16px rgba(99,102,241,.06); }
.request-item .content { flex: 1; min-width: 0; }
.request-item .text { font-size: 14px; color: var(--text); line-height: 1.6; }
.request-item .text strong { color: var(--primary); }

/* 加好友按钮（帖子卡片内） */
.friend-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 8px;
    transition: var(--transition);
    font-family: inherit;
}
.friend-action-btn:hover { background: var(--gradient-soft); color: var(--primary); }
.friend-action-btn.pending { opacity: .55; cursor: not-allowed; }

/* 标签页切换 */
.tabs {
    display: flex;
    gap: 4px;
    padding: 6px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    border: 1px solid rgba(226,232,240,.6);
}
.tabs a {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition);
    text-decoration: none;
    position: relative;
}
.tabs a:hover { background: #f8fafc; color: var(--primary); }
.tabs a.active {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.tabs a .badge-count {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    background: #ef4444;
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    margin-left: 4px;
    vertical-align: middle;
}

/* 移动端适配 */
@media (max-width: 640px) {
    .chat-wrapper { height: calc(100vh - 56px); }
    .msg { max-width: 82%; }
    .chat-send-btn { padding: 0 18px; }
}
/* ==================== 好友申请按钮（美化版） ==================== */
.req-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.req-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: .3px;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
    transition: all .28s cubic-bezier(.4, 0, .2, 1);
    -webkit-tap-highlight-color: transparent;
}

.req-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* 同意按钮：绿色渐变 */
.req-btn-accept {
    background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, .35);
}

.req-btn-accept::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    transition: left .5s;
}

.req-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, .5);
}
.req-btn-accept:hover::before { left: 100%; }
.req-btn-accept:active { transform: translateY(0); box-shadow: 0 4px 14px rgba(16, 185, 129, .35); }

/* 拒绝按钮：白底描边 */
.req-btn-reject {
    background: #fff;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .03);
}

.req-btn-reject:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #ef4444;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(239, 68, 68, .15);
}
.req-btn-reject:active { transform: translateY(0); }

/* 处理中状态（防止重复点击） */
.req-btn.loading {
    opacity: .6;
    pointer-events: none;
}