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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    color: #333;
    font-size: 15px;
    line-height: 1.6;
}

body {
    /* 蓝白渐变背景，全屏铺满 */
    background: linear-gradient(180deg, #eaf4ff 0%, #ffffff 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

input, textarea {
    font-family: inherit;
    outline: none;
}

/* ===== 顶部导航栏 ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    z-index: 1000;

    /* 毛玻璃效果 */
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);

    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.navbar .site-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e40af;
    letter-spacing: 1px;
    cursor: pointer;
}

.navbar .site-title:hover {
    text-decoration: none;
    color: #1d4ed8;
}

/* ===== 导航栏右侧（返回主页 + 头像） ===== */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.home-btn {
    padding: 7px 14px;
    border-radius: 999px;
    background-color: rgba(100, 116, 139, 0.08);
    border: 1px solid rgba(100, 116, 139, 0.2);
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.home-btn:hover {
    text-decoration: none;
    background-color: rgba(100, 116, 139, 0.14);
    border-color: rgba(100, 116, 139, 0.32);
    color: #334155;
}

/* ===== 头像按钮 + 下拉菜单 ===== */
.avatar-wrapper {
    position: relative;
    display: inline-block;
}

.avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    display: block;
    background-color: #e5e7eb;
}

.avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;

    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);

    padding: 6px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

/* hover 显示菜单（悬浮在头像按钮或菜单本身） */
.avatar-wrapper:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 向下的小三角（可选装饰） */
.dropdown-menu::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 18px;
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    border-left: 1px solid rgba(255, 255, 255, 0.9);
    transform: rotate(45deg);
}

.dropdown-menu .dropdown-item {
    display: block;
    padding: 10px 18px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-menu .dropdown-item:hover {
    background-color: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.dropdown-menu .dropdown-item.danger {
    color: #dc2626;
}

.dropdown-menu .dropdown-item.danger:hover {
    background-color: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
}

/* ===== 主内容区 ===== */
.main-container {
    /* 顶部导航栏 64px 高度 + 额外内边距 */
    padding-top: 96px;
    padding-bottom: 64px;
    padding-left: 24px;
    padding-right: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ===== 首页 ===== */
.hero-card {
    background-color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 60px 48px;
    box-shadow: 0 10px 40px rgba(30, 64, 175, 0.08);
    text-align: center;
}

.hero-card h1 {
    font-size: 38px;
    font-weight: 800;
    color: #1e3a8a;
    margin-bottom: 18px;
}

.hero-card p {
    font-size: 16px;
    color: #475569;
    max-width: 620px;
    margin: 0 auto 28px;
}

.hero-card .hero-user {
    font-size: 15px;
    color: #1d4ed8;
    font-weight: 600;
}

.hero-card .hero-user .nickname {
    color: #1e40af;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background-color: #2563eb;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: #ffffff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.btn-secondary:hover {
    background-color: #eff6ff;
}

.btn-danger {
    background-color: #ef4444;
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* ===== 表单卡片（登录、注册、我的信息） ===== */
.form-card {
    max-width: 460px;
    margin: 30px auto 0;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 18px;
    padding: 40px 36px;
    box-shadow: 0 10px 40px rgba(30, 64, 175, 0.08);
}

.form-card.profile-card {
    max-width: 620px;
}

.form-card h2 {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 6px;
}

.form-card .form-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 28px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea,
.form-group input[type="file"] {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    color: #0f172a;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #60a5fa;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.form-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.text-count {
    float: right;
    font-size: 12px;
    color: #94a3b8;
}

.text-count.warning {
    color: #f59e0b;
}

.text-count.over {
    color: #ef4444;
}

/* 个人信息头像预览 */
.avatar-preview-section {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 10px;
}

.avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    background-color: #e5e7eb;
    flex-shrink: 0;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-upload-tip {
    flex: 1;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

/* 表单分隔区（修改密码） */
.form-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 28px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #dbeafe;
}

/* ===== 消息提示 ===== */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 18px;
    line-height: 1.5;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* 表单底部链接 */
.form-footer {
    margin-top: 22px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

/* ===== 确认对话框 ===== */
.modal-mask {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-mask.show {
    display: flex;
}

.modal-box {
    background-color: #fff;
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    padding: 28px 28px 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 12px;
}

.modal-text {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-cancel {
    padding: 9px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    background-color: #f1f5f9;
    color: #475569;
}

.btn-cancel:hover {
    background-color: #e2e8f0;
}

/* ===== Flash 消息自动消失动画 ===== */
.alert {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.alert-hide {
    opacity: 0;
    transform: translateY(-6px);
}

/* ===== 导航栏左侧（站点名 + 公共频道按钮） ===== */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.channel-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 999px;
    background-color: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.22);
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.channel-btn:hover {
    background-color: rgba(37, 99, 235, 0.16);
    border-color: rgba(37, 99, 235, 0.35);
}

.channel-btn-icon {
    font-weight: 800;
    font-size: 14px;
}

/* ===== 公共频道：遮罩 + 面板 ===== */
.channel-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background-color: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.channel-overlay.open {
    opacity: 1;
    visibility: visible;
}

.channel-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 50vw;
    max-width: 560px;
    min-width: 320px;
    background-color: #f8fafc;
    box-shadow: 6px 0 30px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.32s ease;
}

.channel-overlay.open .channel-panel {
    transform: translateX(0);
}

.channel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 14px;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #eef2f7;
    flex-shrink: 0;
}

.channel-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: #334155;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.channel-close:hover {
    background-color: #e2e8f0;
}

.channel-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a8a;
}

/* ---- 消息列表 ---- */
.channel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scroll-behavior: smooth;
}

.channel-loading,
.channel-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    padding: 30px 16px;
}

.channel-msg {
    display: flex;
    gap: 10px;
    padding: 8px 16px;
    align-items: flex-start;
}

.channel-msg.mine {
    flex-direction: row-reverse;
}

.channel-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
    background-color: #e5e7eb;
    transition: transform 0.15s ease;
}

.channel-msg-avatar:hover {
    transform: scale(1.08);
}

.channel-msg-body {
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

.channel-msg.mine .channel-msg-body {
    align-items: flex-end;
}

.channel-msg-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 2px;
}

.channel-msg.mine .channel-msg-meta {
    flex-direction: row-reverse;
}

.channel-msg-name {
    font-weight: 600;
    color: #64748b;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-msg-bubble {
    padding: 9px 14px;
    border-radius: 14px;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}

.channel-msg.theirs .channel-msg-bubble {
    border-top-left-radius: 4px;
}

.channel-msg.mine .channel-msg-bubble {
    background-color: #2563eb;
    color: #ffffff;
    border-top-right-radius: 4px;
}

.channel-msg-image {
    max-width: 220px;
    max-height: 220px;
    border-radius: 10px;
    display: block;
    cursor: zoom-in;
    background-color: #eef2f7;
}

/* ---- 输入区 ---- */
.channel-input-area {
    padding: 10px 14px 14px;
    background-color: #ffffff;
    border-top: 1px solid #eef2f7;
    flex-shrink: 0;
}

.channel-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-upload-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #eff6ff;
    color: #2563eb;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s ease;
}

.channel-upload-btn:hover {
    background-color: #dbeafe;
}

.channel-text-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 14px;
    outline: none;
    background-color: #f8fafc;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.channel-text-input:focus {
    border-color: #60a5fa;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

.channel-send-btn {
    padding: 9px 20px;
    border-radius: 999px;
    background-color: #2563eb;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    transition: background-color 0.15s ease;
}

.channel-send-btn:hover {
    background-color: #1d4ed8;
}

.channel-send-btn:disabled {
    background-color: #93c5fd;
    cursor: not-allowed;
}

.channel-login-tip {
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
    padding: 6px 0;
}

.channel-login-tip a {
    color: #2563eb;
    font-weight: 600;
    margin-left: 4px;
}

/* ===== 用户资料卡（点击头像弹出） ===== */
.user-card {
    position: fixed;
    z-index: 4000;
    width: 220px;
    background-color: #ffffff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    animation: userCardIn 0.18s ease;
}

.user-card-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background-color: #e5e7eb;
}

.user-card-info {
    min-width: 0;
}

.user-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #1e3a8a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-card-bio {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.5;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@keyframes userCardIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

body.no-scroll {
    overflow: hidden;
}

/* ===== 主页快捷入口（左上角小按钮） ===== */
.quick-links {
    display: flex;
    justify-content: flex-start;
    gap: 16px;
}

.quick-link-btn {
    width: 128px;
    height: 96px;
    border-radius: 10px;
    background-color: transparent;
    border: 1px solid rgba(37, 99, 235, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.quick-link-btn:hover {
    text-decoration: none;
    border-color: rgba(37, 99, 235, 0.8);
    background-color: rgba(37, 99, 235, 0.06);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
}

.quick-link-label {
    font-size: 15px;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: 2px;
}

/* ===== 快捷网站页面 ===== */
.quicklinks-header {
    text-align: center;
    margin-bottom: 36px;
}

.quicklinks-header h2 {
    font-size: 30px;
    font-weight: 800;
    color: #1e3a8a;
    margin-bottom: 8px;
}

.quicklinks-header p {
    font-size: 14px;
    color: #64748b;
}

.quicklinks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
}

.quicklink-card {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 6px 24px rgba(30, 64, 175, 0.06);
    transition: all 0.22s ease;
}

.quicklink-card:hover {
    text-decoration: none;
    transform: translateY(-5px);
    box-shadow: 0 14px 40px rgba(30, 64, 175, 0.14);
    border-color: rgba(37, 99, 235, 0.3);
}

.quicklink-icon {
    font-size: 44px;
    line-height: 1;
}

.quicklink-name {
    font-size: 17px;
    font-weight: 700;
    color: #1e3a8a;
}

.quicklink-desc {
    font-size: 12px;
    color: #94a3b8;
    word-break: break-all;
    text-align: center;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .channel-panel {
        width: 100vw;
        max-width: none;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .navbar {
        padding: 0 16px;
        height: 56px;
    }

    .navbar-left {
        gap: 10px;
    }

    .channel-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .navbar-right {
        gap: 10px;
    }

    .home-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .main-container {
        padding-top: 88px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero-card {
        padding: 36px 24px;
    }

    .hero-card h1 {
        font-size: 28px;
    }

    .form-card {
        padding: 28px 20px;
    }
}

/* ==========================================================
   论坛
   ========================================================== */
.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.required {
    color: #ef4444;
}

/* ----- 论坛头部 ----- */
.forum-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.forum-title {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.forum-subtitle {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
}

/* ----- 排序 Tab ----- */
.forum-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0;
}

.forum-tab {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    border-radius: 8px 8px 0 0;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.forum-tab:hover {
    text-decoration: none;
    color: #1d4ed8;
    background-color: rgba(37, 99, 235, 0.05);
}

.forum-tab.active {
    color: #1d4ed8;
    border-bottom-color: #2563eb;
    background-color: rgba(37, 99, 235, 0.06);
}

/* ----- 空状态 ----- */
.forum-empty {
    padding: 60px 20px;
    text-align: center;
    color: #94a3b8;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.forum-empty .btn {
    margin-top: 14px;
}

/* ----- 帖子列表 ----- */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.post-card {
    display: block;
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.post-card:hover {
    text-decoration: none;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.09);
    transform: translateY(-2px);
}

.post-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.post-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
    flex-shrink: 0;
}

.post-author {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.post-time {
    font-size: 12px;
    color: #94a3b8;
    margin-left: auto;
    flex-shrink: 0;
}

.post-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
    line-height: 1.4;
}

.post-excerpt {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 8px;
}

.post-thumb {
    margin: 8px 0;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
}

.post-thumb img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
}

.post-media-tag {
    display: inline-block;
    margin: 6px 0 8px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
}

.post-card-foot {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.post-stat {
    font-size: 13px;
    color: #64748b;
}

/* ----- 分页 ----- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.page-link {
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.page-link:hover {
    text-decoration: none;
    background-color: #eff6ff;
}

.page-info {
    font-size: 13px;
    color: #64748b;
}

/* ----- 帖子详情 ----- */
.post-detail {
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    padding: 26px 28px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.post-author-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
}

.post-author-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    min-width: 0;
}

.post-author-link:hover {
    text-decoration: none;
}

.post-avatar-lg {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
    flex-shrink: 0;
}

.post-author-info {
    min-width: 0;
}

.post-author-name {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.post-author-bio {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.post-author-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.post-follow-stats {
    font-size: 13px;
    color: #64748b;
}

.post-follow-stats b {
    color: #0f172a;
}

/* ----- 关注按钮 ----- */
.btn-follow {
    background-color: #2563eb;
    color: #fff;
    border: 1px solid #2563eb;
    padding: 7px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-follow:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-follow.following {
    background-color: #fff;
    color: #64748b;
    border-color: #cbd5e1;
}

.btn-follow.following:hover {
    background-color: #f1f5f9;
    color: #ef4444;
    border-color: #fca5a5;
}

/* ----- 详情正文 / 媒体 ----- */
.post-detail-title {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.4;
    margin: 4px 0 10px;
}

.post-detail-meta {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 16px;
}

.post-detail-content {
    font-size: 15px;
    line-height: 1.9;
    color: #1e293b;
    word-break: break-word;
    margin-bottom: 18px;
}

.post-detail-media {
    margin: 14px 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
}

.post-detail-media img {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    display: block;
}

.post-detail-media video {
    width: 100%;
    max-height: 480px;
    display: block;
}

.post-detail-media audio {
    width: 100%;
    display: block;
    padding: 10px;
}

/* ----- 点赞 ----- */
.post-like-bar {
    margin: 20px 0 8px;
}

.btn-like {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 22px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-like:hover {
    border-color: #f9a8d4;
    color: #ec4899;
}

.btn-like.liked {
    border-color: #ec4899;
    background-color: #fdf2f8;
    color: #ec4899;
}

.like-icon {
    font-size: 16px;
    line-height: 1;
}

/* ----- 评论 ----- */
.post-comments {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.post-comments-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px;
}

.comment-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.comment-input-row textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 52px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-input-row textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.comment-login-tip {
    padding: 12px 16px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 14px;
}

.comment-login-tip a {
    margin-left: 6px;
    color: #2563eb;
    font-weight: 600;
}

.comment-empty {
    padding: 26px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.comment-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    display: flex;
    gap: 12px;
}

.comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
    min-width: 0;
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 14px;
}

.comment-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.comment-author {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    text-decoration: none;
}

.comment-author:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

.comment-time {
    font-size: 12px;
    color: #94a3b8;
}

.comment-content {
    font-size: 14px;
    line-height: 1.7;
    color: #1e293b;
    word-break: break-word;
}

/* ----- 个人空间 ----- */
.profile-space {
    max-width: 760px;
    margin: 0 auto;
}

.profile-space-card {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 18px;
}

.profile-space-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
    flex-shrink: 0;
}

.profile-space-info {
    flex: 1;
    min-width: 160px;
}

.profile-space-name {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px;
}

.profile-space-bio {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 6px;
    word-break: break-word;
}

.profile-space-meta {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

.profile-space-stats {
    display: flex;
    gap: 20px;
    margin-left: auto;
}

.space-stat {
    text-align: center;
    text-decoration: none;
    color: #64748b;
}

.space-stat:hover {
    text-decoration: none;
    color: #2563eb;
}

.space-stat b {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.space-stat:hover b {
    color: #2563eb;
}

.space-stat span {
    font-size: 12px;
}

/* ----- 用户列表（粉丝 / 关注） ----- */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    transition: box-shadow 0.2s ease;
}

.user-list-item:hover {
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.user-list-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
    flex-shrink: 0;
}

.user-list-info {
    min-width: 0;
}

.user-list-name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.user-list-bio {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 420px;
}

/* ----- 发帖媒体表单 ----- */
.forum-media-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 16px;
}

.media-preview {
    margin-top: 10px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
}

.media-preview img,
.media-preview video {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    display: block;
}

.media-preview audio {
    width: 100%;
    display: block;
    padding: 8px;
}

/* ----- 论坛移动端适配 ----- */
@media (max-width: 640px) {
    .forum-header {
        flex-direction: column;
        align-items: stretch;
    }

    .forum-header .btn {
        align-self: flex-start;
    }

    .post-detail {
        padding: 18px 16px;
    }

    .post-author-card {
        align-items: flex-start;
    }

    .post-author-bio {
        max-width: 180px;
    }

    .profile-space-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-space-info {
        min-width: 0;
    }

    .profile-space-stats {
        margin-left: 0;
    }

    .comment-input-row {
        flex-direction: column;
    }

    .comment-input-row .btn {
        align-self: flex-end;
    }
}

/* ----- 个人中心 ----- */
.forum-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.center-stats-card {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.center-stat-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px 10px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.center-stat-item b {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
}

.center-stat-item a {
    text-decoration: none;
    color: inherit;
}

.center-stat-item a b {
    color: #0f172a;
}

.center-stat-item a:hover b {
    color: #2563eb;
}

.center-stat-item span {
    font-size: 12px;
    color: #64748b;
}

.center-post-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.center-post-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #fff;
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    border-left: 3px solid transparent;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.center-post-row:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.center-post-row.pinned {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.center-post-info {
    min-width: 0;
    flex: 1;
}

.center-post-title-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.pin-badge {
    flex-shrink: 0;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
}

.pin-badge-sm {
    font-size: 10px;
    padding: 1px 6px;
    line-height: 1.5;
    vertical-align: 2px;
    margin-right: 5px;
}

.center-post-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.center-post-title:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

.center-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
    flex-wrap: wrap;
}

.center-media-tag {
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 600;
}

.center-post-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-pin {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-pin:hover {
    border-color: #f59e0b;
    color: #d97706;
}

.btn-pin.pinned {
    border-color: #f59e0b;
    background: #fef3c7;
    color: #b45309;
}

.btn-pin.pinned:hover {
    background: #fde68a;
}

@media (max-width: 640px) {
    .center-stats-card {
        grid-template-columns: repeat(2, 1fr);
    }

    .center-post-row {
        flex-direction: column;
        align-items: stretch;
    }

    .center-post-actions {
        justify-content: flex-end;
    }
}

/* ==========================================================
   天气
   ========================================================== */
.weather-card {
    max-width: 720px;
    margin: 0 auto;
    background: linear-gradient(160deg, #1e3a8a 0%, #1d4ed8 45%, #0891b2 100%);
    border-radius: 22px;
    padding: 22px 24px 26px;
    color: #fff;
    box-shadow: 0 16px 44px rgba(30, 64, 175, 0.32);
    position: relative;
}

/* ----- 顶栏：切换箭头 + 城市名 + 添加城市 ----- */
.weather-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.weather-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.weather-nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.weather-city-box {
    min-width: 0;
    text-align: center;
    flex: 1;
}

.weather-city {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weather-area {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 2px;
    min-height: 16px;
}

.weather-add-btn {
    position: absolute;
    top: 22px;
    right: 24px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.weather-add-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.weather-refresh-btn {
    position: absolute;
    top: 22px;
    right: 122px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.weather-refresh-btn.spinning {
    animation: weather-spin 0.8s linear infinite;
}

@keyframes weather-spin {
    to { transform: rotate(360deg); }
}

/* ----- 加载 / 错误 ----- */
.weather-loading {
    padding: 60px 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
}

.weather-error {
    padding: 40px 20px;
    text-align: center;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(252, 165, 165, 0.4);
    border-radius: 14px;
    color: #fecaca;
    font-size: 14px;
    margin-top: 18px;
}

/* ----- 当前天气 ----- */
.weather-now {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 30px 8px 24px;
}

.w-emoji {
    font-size: 72px;
    line-height: 1;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
}

.w-temp-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.w-temp {
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
}

.w-text {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
}

.w-feel {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
}

.w-range {
    margin-left: auto;
    align-self: flex-start;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* ----- 详情网格 ----- */
.w-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 4px 0 18px;
}

.w-detail {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
}

.w-detail-label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}

.w-detail-value {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ----- 三日预报 ----- */
.w-forecast {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-bottom: 18px;
}

.w-forecast-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px 8px;
    text-align: center;
}

.w-forecast-day {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.w-forecast-emoji {
    font-size: 32px;
    line-height: 1;
}

.w-forecast-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.w-forecast-temp {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

/* ----- 观测时间 ----- */
.w-obs {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    padding-top: 4px;
}

/* ----- 底部城市标签 ----- */
.weather-cities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.weather-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.weather-chip:hover {
    background: rgba(255, 255, 255, 0.2);
}

.weather-chip.active {
    background: #fff;
    color: #1d4ed8;
    border-color: #fff;
}

.weather-chip-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.weather-chip-loc {
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    font-size: 11px;
    font-weight: 700;
    color: inherit;
}

.weather-chip-del {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
}

.weather-chip:hover .weather-chip-del {
    color: #fff;
    background: rgba(239, 68, 68, 0.6);
}

.weather-chip.active .weather-chip-del {
    color: #94a3b8;
}

.weather-chip.active .weather-chip-del:hover {
    color: #fff;
    background: #ef4444;
}

/* ----- 添加城市弹窗 ----- */
.weather-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.weather-modal[hidden] {
    display: none;
}

.weather-modal-box {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.weather-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 16px;
}

.weather-modal-input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.weather-modal-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.weather-modal-err {
    min-height: 18px;
    margin: 8px 0 4px;
    font-size: 13px;
    color: #ef4444;
}

.weather-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

/* ----- 天气移动端适配 ----- */
@media (max-width: 640px) {
    .weather-card {
        padding: 18px 14px 20px;
    }

    .weather-add-btn {
        position: static;
        margin-left: auto;
    }

    .weather-refresh-btn {
        position: static;
        margin-left: auto;
    }

    .weather-top {
        gap: 8px;
        flex-wrap: wrap;
    }

    .weather-city {
        font-size: 19px;
    }

    .weather-now {
        flex-wrap: wrap;
        gap: 14px;
        padding: 24px 4px 18px;
    }

    .w-emoji {
        font-size: 54px;
    }

    .w-temp {
        font-size: 50px;
    }

    .w-range {
        margin-left: 0;
    }

    .w-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================
   导航栏：搜索框 + 通知铃铛
   ========================================================== */
.navbar-search {
    position: relative;
    display: flex;
    align-items: center;
}

.navbar-search input {
    width: 170px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(100, 116, 139, 0.2);
    background: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    color: #334155;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, width 0.2s ease;
}

.navbar-search input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    width: 210px;
}

.navbar-search input::placeholder {
    color: #94a3b8;
}

.navbar-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.navbar-bell:hover {
    text-decoration: none;
    background: rgba(100, 116, 139, 0.1);
}

.bell-icon {
    font-size: 18px;
    line-height: 1;
}

.bell-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

/* ==========================================================
   帖子徽标：全局置顶 / 精华
   ========================================================== */
.pin-badge-global {
    background: #ef4444;
}

.pin-badge-featured {
    background: #8b5cf6;
}

/* 管理员操作区 */
.admin-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    margin: 14px 0 6px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}

.admin-actions .btn {
    text-decoration: none;
}

/* ==========================================================
   消息通知页
   ========================================================== */
.notif-page {
    max-width: 720px;
    margin: 0 auto;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notif-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
    position: relative;
}

.notif-item:hover {
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.notif-item.unread {
    background: #eff6ff;
    border-left: 3px solid #2563eb;
}

.notif-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e5e7eb;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-text {
    font-size: 14px;
    color: #334155;
    line-height: 1.6;
    word-break: break-word;
}

.notif-text b {
    color: #0f172a;
}

.notif-post-title {
    color: #1d4ed8;
}

.notif-time {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 3px;
}

.notif-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
}

/* ==========================================================
   全站搜索页
   ========================================================== */
.search-page {
    max-width: 760px;
    margin: 0 auto;
}

.search-title {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    text-align: center;
    margin-bottom: 18px;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
}

.search-bar input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.search-summary {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 24px;
}

.search-summary b {
    color: #1d4ed8;
}

.search-section {
    margin-bottom: 30px;
}

.search-section-title {
    font-size: 17px;
    font-weight: 800;
    color: #1e3a8a;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #dbeafe;
}

/* 用户结果列表 */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.user-list-item:hover {
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.user-list-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e5e7eb;
}

.user-list-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-list-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.user-list-bio {
    font-size: 13px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 420px;
}

/* 帖子结果列表（复用论坛列表卡片，补充少量调整） */
.search-page .post-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-page .post-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    display: block;
    transition: box-shadow 0.2s ease;
}

.search-page .post-card:hover {
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.search-page .post-title {
    margin: 10px 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.5;
}

.search-page .post-excerpt {
    font-size: 14px;
    color: #64748b;
    line-height: 1.7;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-page .post-thumb img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 10px;
}

.search-page .post-media-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.search-page .post-card-foot {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    font-size: 13px;
    color: #94a3b8;
}

/* ==========================================================
   表单辅助（找回密码 / 重置密码 / 编辑帖子）
   ========================================================== */
.form-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: -6px 0 20px;
}

.forgot-password-link {
    color: #2563eb;
    text-decoration: none;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

/* ==========================================================
   论坛侧边栏（搜索 + 热门帖子）
   ========================================================== */
.forum-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.forum-main {
    flex: 1;
    min-width: 0;
}

.forum-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 92px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.sidebar-title {
    font-size: 15px;
    font-weight: 800;
    color: #1e3a8a;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #dbeafe;
}

.sidebar-search {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-search input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.sidebar-search .btn-block {
    width: 100%;
    box-sizing: border-box;
}

.sidebar-empty {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

.sidebar-hot-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-hot-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.sidebar-hot-rank {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.sidebar-hot-rank.top {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #fff;
}

.sidebar-hot-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-hot-title {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    line-height: 1.5;
    word-break: break-word;
}

.sidebar-hot-title:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.sidebar-hot-meta {
    font-size: 12px;
    color: #94a3b8;
}

/* ==========================================================
   背景设置面板（从右侧滑入）
   ========================================================== */
.theme-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.theme-overlay.open {
    opacity: 1;
    visibility: visible;
}

.theme-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 390px;
    max-width: 92vw;
    height: 100%;
    background: #fff;
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s ease;
}

.theme-overlay.open .theme-panel {
    transform: translateX(0);
}

.theme-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.theme-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-close:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.theme-panel-title {
    font-size: 17px;
    font-weight: 800;
    color: #1e3a8a;
}

.theme-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.theme-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 12px;
}

/* 预设背景网格 */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.theme-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 4px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-item:hover {
    background: #f8fafc;
}

.theme-item.active {
    border-color: #2563eb;
    background: #eff6ff;
}

.theme-preview {
    display: block;
    width: 100%;
    height: 46px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.theme-name {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    text-align: center;
}

/* 上传表单 */
.theme-upload-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.theme-upload-form input[type="text"] {
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    font-size: 13px;
}

.theme-file-label {
    display: block;
    text-align: center;
    padding: 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-file-label:hover {
    border-color: #60a5fa;
    color: #2563eb;
}

.theme-tip {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.6;
}

/* 自定义背景列表 */
.theme-bg-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.theme-bg-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.theme-bg-item.active {
    border-color: #2563eb;
    background: #eff6ff;
}

.theme-bg-thumb {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e5e7eb;
}

.theme-bg-thumb.is-css {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

.theme-bg-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.theme-bg-name {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-bg-time {
    font-size: 11px;
    color: #94a3b8;
}

.theme-bg-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.theme-mini-btn {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.theme-mini-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.theme-mini-btn.danger:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* 自定义 CSS 编辑区 */
.theme-css-input {
    width: 100%;
    box-sizing: border-box;
    min-height: 170px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.6;
    resize: vertical;
}

.theme-css-input:focus {
    outline: none;
    border-color: #60a5fa;
    background: #fff;
}

/* 自定义 CSS / JS 双栏编辑框 */
.theme-custom-box {
    box-sizing: border-box;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 14px;
    background: rgba(248, 250, 252, .65);
    margin-top: 4px;
}

.theme-custom-col {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.theme-custom-col-head {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #64748b;
}

.theme-custom-col .theme-css-input {
    min-height: 170px;
}

.theme-js-input {
    width: 100%;
    box-sizing: border-box;
    min-height: 170px;
    padding: 12px;
    border: 1px solid #1e293b;
    border-radius: 10px;
    background: #0f172a;
    color: #e2e8f0;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.6;
    resize: vertical;
}

.theme-js-input:focus {
    outline: none;
    border-color: #60a5fa;
}

@media (max-width: 640px) {
    .theme-custom-box {
        grid-template-columns: 1fr;
    }
}

#theme-css-name {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 10px 0;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    font-size: 13px;
}

/* ==========================================================
   移动端适配
   ========================================================== */
@media (max-width: 480px) {
    .theme-panel {
        width: 100%;
        max-width: 100%;
    }

    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .forum-layout {
        flex-direction: column;
    }

    .forum-sidebar {
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    .navbar-search {
        display: none;
    }
}

@media (max-width: 640px) {
    .notif-item {
        padding: 12px;
        gap: 10px;
    }

    .user-list-bio {
        max-width: 200px;
    }

    .admin-actions {
        padding: 10px 12px;
    }
}
