/* ========================== 💬 评论区 v3.5 ========================== */
.message-board {
    width: 100%;
    max-width: 1200px;
    margin-top: 30px;
    background: #1f2937;
    padding: 25px;
    border-radius: 16px;
    border: 1px solid #374151;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    border-bottom: 1px solid #374151;
    padding-bottom: 12px;
    margin-bottom: 16px;
}
.comment-title {
    margin: 0;
    font-size: 1.15rem;
    color: #f9fafb;
    font-weight: 700;
}
.comment-count {
    font-size: 0.85rem;
    color: #6b7280;
}
.comment-empty {
    text-align: center;
    color: #6b7280;
    padding: 32px 10px;
    font-size: 0.9rem;
}

.message-list {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 16px;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.message-list::-webkit-scrollbar { width: 6px; }
.message-list::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 3px; }
.message-list::-webkit-scrollbar-track { background: transparent; }

/* 整个楼层 */
.comment-thread {
    background: #111827;
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid #1f2937;
    transition: border-color 0.2s;
}
.comment-thread:hover { border-color: #374151; }

/* 单条评论（顶级 + 回复共用） */
.comment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.comment-item.is-pending { opacity: 0.55; }

.comment-avatar {
    flex-shrink: 0;
    padding-top: 2px;
}

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

.comment-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.comment-nickname {
    color: var(--accent-char, #93c5fd);
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.2px;
}
.comment-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    line-height: 1.5;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.comment-time {
    color: #6b7280;
    font-size: 0.72rem;
    cursor: help;
}

.comment-content {
    color: #e5e7eb;
    font-size: 0.94rem;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}

/* @某人 的引用块（楼中楼回复时显示原内容片段） */
.comment-quote {
    background: rgba(59, 130, 246, 0.08);
    border-left: 2px solid #3b82f6;
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    line-height: 1.4;
}
.comment-quote-at {
    color: #60a5fa;
    font-weight: 600;
    margin-right: 6px;
}
.comment-quote-text {
    color: #9ca3af;
}

/* 操作按钮：悬浮显示 */
.comment-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.15s;
}
.comment-item:hover .comment-actions,
.comment-item:focus-within .comment-actions { opacity: 1; }
.comment-action-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: 0.2s;
}
.comment-action-btn:hover { background: #374151; color: #e5e7eb; }
.comment-action-danger:hover { background: rgba(239, 68, 68, 0.18); color: #ef4444; }

/* 回复列表容器（楼中楼） */
.reply-container {
    margin-left: 44px; /* 32px 头像 + 12px gap */
    margin-top: 10px;
    padding-left: 12px;
    border-left: 2px solid rgba(147, 197, 253, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 回复项目稍微瘦一些 */
.comment-item.is-reply .comment-nickname { font-size: 0.86rem; }
.comment-item.is-reply .comment-content { font-size: 0.88rem; }

/* 触屏设备：操作按钮始终可见（没有 hover） */
@media (hover: none) {
    .comment-actions { opacity: 1; }
}

/* =============== 输入区 =============== */
.replying-bar {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 0.8rem;
}
.replying-bar-info { flex: 1; min-width: 0; }
.replying-bar-label { display: block; margin-bottom: 4px; }
.replying-bar-quote {
    color: #9ca3af;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.replying-bar-close {
    cursor: pointer;
    font-weight: bold;
    color: #6b7280;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}
.replying-bar-close:hover { color: #ef4444; }

.message-input-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #111827;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #4b5563;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.message-input-area:focus-within {
    border-color: var(--btn-mix, #8b5cf6);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.18);
}
.message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #f9fafb;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.5;
    outline: none;
    resize: none;
    min-height: 32px;
    max-height: 120px;
    padding: 4px 2px;
}
.message-input::placeholder { color: #6b7280; }

.message-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.message-counter {
    font-size: 0.72rem;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}
.btn-send {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    border: none;
    padding: 7px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    transition: 0.2s;
    white-space: nowrap;
}
.btn-send:hover:not(:disabled) { opacity: 0.92; transform: translateY(-1px); }
.btn-send:disabled { cursor: not-allowed; }

/* 窄屏适配 */
@media (max-width: 640px) {
    .message-board { padding: 16px; }
    .reply-container { margin-left: 0; padding-left: 10px; }
    .comment-thread { padding: 12px; }
}


footer { margin-top: 40px; color: #6b7280; font-size: 0.85rem; text-align: center; padding-bottom: 20px; }
.wechat-box { display: inline-block; background: #064e3b; color: #6ee7b7; padding: 4px 10px; border-radius: 4px; margin-left: 5px; font-family: monospace; }

/* 模态框 */
.modal-overlay { 
    display: none; 
    position: fixed; 
    top: 0 !important; 
    left: 0 !important; 
    right: 0 !important;   /* ✅ 添加right和bottom确保完全覆盖 */
    bottom: 0 !important;
    width: 100vw; 
    height: 100vh;
    background: rgba(0,0,0,0.85); 
    z-index: 9999 !important;  /* ✅ 提高z-index */
    justify-content: center; 
    align-items: flex-start; 
    backdrop-filter: blur(8px);
    overflow-y: auto;
    padding: 20px 0;
    margin: 0 !important;  /* ✅ 确保没有margin */
    padding: 20px 0 !important; /* ✅ 上下留白防止贴边 */
}
.modal { background: var(--card-bg); padding: 30px; border-radius: 16px; width: 90%; max-width: 420px; max-height: 85vh; overflow-y: auto; text-align: center; position: relative; border: 1px solid #4b5563; box-shadow: 0 20px 50px rgba(0,0,0,0.7); animation: modalPop 0.3s ease-out; margin: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent; }
.modal::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-track { background: transparent; margin: 16px 0; }
.modal::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.modal::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
.modal-large { max-width: 600px; width: 95%; max-height: 80vh; display: flex; flex-direction: column; padding: 25px; }
@keyframes modalPop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h2 { margin-top: 0; color: white; font-size: 1.5rem; }
.modal input, .modal select, .modal textarea { width: 100%; padding: 14px; margin: 12px 0; background: #111827; border: 1px solid #4b5563; color: white; border-radius: 8px; box-sizing: border-box; font-size: 1rem; outline: none; }
.modal input:focus { border-color: var(--badge-user); }
.close-btn { position: absolute; top: 15px; right: 20px; cursor: pointer; color: #aaa; font-size: 1.8rem; line-height: 1; }
.close-btn:hover { color: white; }

/* 通用功能弹窗版式（投稿 / 邮件 / 反馈 / 充值逐步迁移） */
.ui-modal-shell {
    width: 92%;
    padding: 0 !important;
    overflow: hidden;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.ui-modal-header {
    background: #1f2937;
    padding: 20px;
    border-bottom: 1px solid #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.ui-modal-title {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ui-modal-badge {
    font-size: 0.7rem;
    background: #374151;
    padding: 2px 8px;
    border-radius: 10px;
    color: #9ca3af;
    white-space: nowrap;
}

.ui-modal-tip {
    padding: 10px 25px;
    font-size: 0.8rem;
    line-height: 1.5;
    border-bottom: 1px solid;
}

.ui-modal-tip-gold {
    background: rgba(251, 191, 36, 0.1);
    border-bottom-color: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.ui-modal-tip-violet {
    background: rgba(99, 102, 241, 0.12);
    border-bottom-color: rgba(129, 140, 248, 0.22);
    color: #c4b5fd;
}

.ui-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.ui-modal-footer {
    padding: 0 25px 22px;
}

.ui-modal-submit {
    margin-top: 25px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

[data-theme="light"] .ui-modal-header {
    background: rgba(240,245,255,0.9);
    border-bottom-color: rgba(180,200,240,0.3);
}

[data-theme="light"] .ui-modal-badge {
    background: rgba(100,140,220,0.08);
    color: #64748b;
}

[data-theme="light"] .ui-modal-tip-gold {
    background: rgba(251,191,36,0.08);
    border-bottom-color: rgba(251,191,36,0.15);
    color: #92400e;
}

[data-theme="light"] .ui-modal-tip-violet {
    background: rgba(99,102,241,0.06);
    border-bottom-color: rgba(129,140,248,0.15);
    color: #4338ca;
}

.filter-scroll-area { flex: 1; overflow-y: auto; text-align: left; padding: 10px 5px; }
.filter-scroll-area::-webkit-scrollbar { width: 6px; }
.filter-scroll-area::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 3px; }

.drawer-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(55, 65, 81, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.9);
    color: #d1d5db;
    font-size: 0.8rem;
}

.drawer-action-btn,
.drawer-secondary-btn,
.drawer-primary-btn {
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.drawer-action-btn {
    margin-left: auto;
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(75, 85, 99, 0.9);
    color: #e5e7eb;
    padding: 9px 14px;
    font-size: 0.85rem;
}

.drawer-action-btn:hover,
.drawer-secondary-btn:hover,
.drawer-primary-btn:hover {
    transform: translateY(-1px);
}

.mail-feedback-modal {
    width: 92%;
}

.mail-feedback-header {
    background: #1f2937;
    padding: 20px;
    border-bottom: 1px solid #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.mail-feedback-badge {
    font-size: 0.7rem;
    background: #374151;
    padding: 2px 8px;
    border-radius: 10px;
    color: #9ca3af;
}

.mail-feedback-tip {
    padding: 10px 25px;
    font-size: 0.8rem;
    line-height: 1.5;
    border-bottom: 1px solid;
}

.mail-feedback-tip-gold {
    background: rgba(251, 191, 36, 0.1);
    border-bottom-color: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.mail-feedback-tip-violet {
    background: rgba(99, 102, 241, 0.12);
    border-bottom-color: rgba(129, 140, 248, 0.22);
    color: #c4b5fd;
}

.mail-feedback-body {
    padding: 22px 25px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.mail-modal-list {
    max-height: 48vh;
    overflow-y: auto;
    padding-right: 6px;
}

.mail-modal-list::-webkit-scrollbar,
.feedback-modal-body::-webkit-scrollbar {
    width: 8px;
}

.mail-modal-list::-webkit-scrollbar-thumb,
.feedback-modal-body::-webkit-scrollbar-thumb {
    background: rgba(75, 85, 99, 0.9);
    border-radius: 999px;
}

.mail-feedback-helper {
    margin-top: 14px;
    font-size: 0.78rem;
    line-height: 1.7;
    color: #9ca3af;
}

.feedback-modal-body {
    padding-top: 18px;
}

.feedback-highlight {
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(129, 140, 248, 0.28);
    color: #dbeafe;
    font-size: 0.9rem;
    line-height: 1.7;
}

.feedback-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feedback-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f3f4f6;
}

.feedback-label-helper {
    color: #9ca3af;
    font-size: 0.78rem;
    font-weight: 500;
}

.feedback-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.feedback-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(17, 24, 39, 0.92);
    border: 1px solid rgba(75, 85, 99, 0.9);
    border-radius: 14px;
    cursor: pointer;
    color: #e5e7eb;
    transition: all 0.18s ease;
}

.feedback-option:hover {
    background: rgba(31, 41, 55, 0.98);
    border-color: rgba(99, 102, 241, 0.6);
}

.feedback-option input {
    width: auto;
    margin: 0;
    accent-color: #8b5cf6;
}

.feedback-option span {
    font-size: 0.92rem;
    font-weight: 600;
}

.drawer-textarea,
.drawer-input {
    width: 100%;
    background: rgba(17, 24, 39, 0.96);
    border: 1px solid rgba(75, 85, 99, 0.92);
    color: #f9fafb;
    border-radius: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.drawer-textarea {
    min-height: 180px;
    padding: 14px 16px;
    line-height: 1.7;
    resize: vertical;
    margin: 0;
}

.drawer-input {
    padding: 13px 14px;
    margin: 0;
}

.drawer-textarea:focus,
.drawer-input:focus {
    border-color: rgba(129, 140, 248, 0.95);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
    background: rgba(15, 23, 42, 0.98);
}

.feedback-count {
    text-align: right;
    font-size: 0.76rem;
    color: #9ca3af;
}

.drawer-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
}

.drawer-secondary-btn,
.drawer-primary-btn {
    flex: 1;
    padding: 13px 16px;
    font-size: 0.95rem;
    font-weight: 700;
}

.drawer-secondary-btn {
    background: rgba(55, 65, 81, 0.95);
    color: #e5e7eb;
    border: 1px solid rgba(75, 85, 99, 0.9);
}

.drawer-primary-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.28);
}

.mail-feedback-footer {
    padding: 0 25px 22px;
}

@media (max-width: 768px) {
    .mail-feedback-modal {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px) !important;
        max-height: 88vh !important;
        border-radius: 16px;
    }

    .mail-feedback-header {
        padding: 16px;
        align-items: flex-start;
    }

    .mail-feedback-tip,
    .mail-feedback-body,
    .mail-feedback-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .mail-modal-list {
        max-height: 44vh;
    }

    .feedback-type-grid {
        grid-template-columns: 1fr;
    }

    .drawer-actions {
        flex-direction: column;
    }
}

/* 投稿相关 */
.form-label { display: block; font-size: 0.85rem; color: #9ca3af; margin-bottom: 6px; font-weight: 600; }
.input-modern { width: 100%; background: #111827; border: 1px solid #4b5563; color: white; padding: 12px; border-radius: 8px; font-size: 0.95rem; outline: none; transition: all 0.2s; box-sizing: border-box; }
.input-modern:focus { border-color: var(--badge-user); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); background: #0f1522; }
.textarea-modern { font-family: 'Consolas', monospace; line-height: 1.4; resize: vertical; }
.toggle-group { display: flex; background: #111827; padding: 4px; border-radius: 8px; border: 1px solid #4b5563; }
.toggle-group input { display: none; }
.toggle-btn { flex: 1; text-align: center; padding: 8px; cursor: pointer; border-radius: 6px; font-size: 0.9rem; color: #9ca3af; transition: all 0.2s; font-weight: 600; }
.toggle-group input:checked + .toggle-btn { background: #374151; color: white; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }

/* 排行榜 */
.leaderboard-section { width: 100%; max-width: 1200px; margin-top: 30px; }
.leaderboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding: 0 5px; }
.leaderboard-scroll { 
    display: flex; 
    overflow-x: auto; 
    gap: 15px; 
    padding: 15px 5px 20px 15px; 
    /* scroll-behavior: smooth;  <--- 务必删除这行！JS 驱动滚动时不能开 CSS 平滑 */
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 针对所有浏览器的滚动条隐藏设置 */
.leaderboard-scroll::-webkit-scrollbar { 
    /* 保持原有的 height: 6px; 属性，但添加 display: none; */
    height: 0px !important; /* 强制高度为 0 */
    display: none; /* 隐藏滚动条 */
}
.leaderboard-scroll::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 3px; }
.leaderboard-scroll::-webkit-scrollbar-track { background: #111827; }

.rank-card { min-width: 260px; background: #1f2937; border: 1px solid #374151; border-radius: 12px; padding: 15px; display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.2s; position: relative; }
.rank-card:hover { transform: translateY(-3px); border-color: #6b7280; background: #252f3f; }
.rank-card-top { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.rank-card-name { font-weight: 600; color: var(--text-main); }
.rank-card-bottom { display: flex; justify-content: space-between; align-items: center; }
.rank-likes { color: #ff6b9d; font-size: 0.85rem; }
.rank-badge { position: absolute; top: -8px; left: -8px; width: 24px; height: 24px; background: #ef4444; color: white; border-radius: 50%; text-align: center; line-height: 24px; font-weight: bold; font-size: 0.8rem; box-shadow: 0 2px 4px rgba(0,0,0,0.3); z-index: 2; }
.rank-card:nth-child(n+4) .rank-badge { background: #4b5563; }
.rank-info { font-size: 0.85rem; color: #9ca3af; margin-bottom: 8px; display: flex; justify-content: space-between; }
.rank-prompt { font-family: 'Consolas', monospace; font-size: 0.8rem; color: #e5e7eb; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; background: #111827; padding: 8px; border-radius: 6px; }
.rank-actions { display: flex; justify-content: space-between; align-items: center; }
.btn-like { background: rgba(239, 68, 68, 0.1); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.2); padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; cursor: pointer; display: flex; align-items: center; gap: 4px; transition: all 0.2s; }
.btn-like:hover, .btn-like.liked { background: #ef4444; color: white; border-color: #ef4444; }

/* 关键动画 */
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }

