/* --- 论坛功能样式 --- */

.forum-identity-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    margin: 0 0 9px;
    padding: 4px 9px 4px 5px;
    border: 1px solid #ddd;
    border-color: color-mix(in srgb, var(--primary-color) 24%, #ddd);
    border-radius: 16px;
    background: var(--panel-bg, #fff);
    color: inherit;
    font-size: 12px;
    line-height: 1;
}
.forum-identity-chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.forum-identity-chip span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forum-identity-chip small { color: #999; font-size: 10px; flex-shrink: 0; }
.forum-filter-tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.forum-filter-tabs::-webkit-scrollbar { display: none; }
.forum-filter-tab { flex: 0 0 auto; white-space: nowrap; }
.forum-post-meta { margin-top: 6px; color: #999; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forum-author-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.forum-author-actions .btn { padding: 4px 9px; font-size: 12px; border-radius: 14px; white-space: nowrap; }
.forum-range-control { display: flex; align-items: center; gap: 7px; min-width: 0; }
.forum-range-control input { width: 92px; max-width: 24vw; accent-color: var(--primary-color); }
.forum-range-control span { min-width: 24px; color: var(--primary-color); font-size: 12px; text-align: right; }
.forum-setting-hint { margin: 2px 10px 8px; color: #999; font-size: 11px; line-height: 1.45; }
.forum-quiet-hours-row { display: none; align-items: center; justify-content: flex-end; gap: 7px; padding: 5px 12px 10px; color: #888; font-size: 12px; }
.forum-quiet-hours-row input { width: 84px; padding: 5px; border: 1px solid #ddd; border-radius: 7px; background: var(--panel-bg, #fff); color: inherit; }
.forum-notice-window { max-width: 360px; max-height: min(72vh, 560px); overflow: hidden; }
.forum-notice-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.forum-notice-head h3 { margin: 0; font-size: 17px; }
.forum-notice-close { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #f2f2f2; color: #666; font-size: 21px; line-height: 1; }
#forum-notice-list { max-height: calc(min(72vh, 560px) - 54px); overflow-y: auto; margin-top: 10px; }
.forum-notice-item { display: flex; width: 100%; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 4px; border: 0; border-bottom: 1px solid rgba(128,128,128,.16); background: transparent; color: inherit; text-align: left; }
.forum-notice-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.forum-notice-item small { color: #999; font-size: 10px; flex-shrink: 0; }
.forum-npc-profile-window { position: relative; max-width: 370px; max-height: 78vh; overflow-y: auto; }
.forum-npc-profile-close { position: absolute; top: 8px; right: 8px; width: 29px; height: 29px; border: 0; border-radius: 50%; background: #f2f2f2; color: #666; font-size: 20px; }
.forum-npc-profile-head { display: flex; gap: 11px; min-width: 0; padding-right: 28px; }
.forum-npc-profile-head img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.forum-npc-profile-head div { min-width: 0; }
.forum-npc-profile-head h3 { margin: 2px 0 4px; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forum-npc-profile-head p { margin: 0; color: #777; font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.forum-npc-profile-meta { display: flex; gap: 12px; margin: 12px 0 9px; color: #888; font-size: 11px; }
.forum-npc-profile-actions { display: flex; gap: 7px; }
.forum-npc-profile-posts { margin-top: 12px; border-top: 1px solid rgba(128,128,128,.16); }
.forum-npc-profile-posts button { display: flex; align-items: center; justify-content: space-between; gap: 9px; width: 100%; min-width: 0; padding: 10px 2px; border: 0; border-bottom: 1px solid rgba(128,128,128,.12); background: transparent; color: inherit; text-align: left; }
.forum-npc-profile-posts strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.forum-npc-profile-posts small { flex-shrink: 0; color: #999; font-size: 10px; }
.forum-post-compose-row { display: flex; gap: 9px; margin-bottom: 12px; }
.forum-post-compose-row label { flex: 1; min-width: 0; color: #666; font-size: 12px; }
.forum-compose-select { display: block; width: 100%; min-width: 0; margin-top: 4px; padding: 8px 28px 8px 9px; border: 1px solid #ddd; border-radius: 8px; background: var(--panel-bg, #fff); color: inherit; font: inherit; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #888 50%), linear-gradient(135deg, #888 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 10px) 50%; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.forum-compose-anonymous { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; color: #555; font-size: 13px; }
.forum-compose-draft-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 7px; }
.forum-drafts-window { max-width: 370px; max-height: 70vh; overflow: hidden; }
.forum-draft-list { max-height: calc(70vh - 48px); overflow-y: auto; margin-top: 9px; }
.forum-draft-item { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid rgba(128,128,128,.14); }
.forum-draft-item > button:first-child { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 2px; border: 0; background: transparent; color: inherit; text-align: left; }
.forum-draft-item strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.forum-draft-item small { flex-shrink: 0; color: #999; font-size: 10px; }
.forum-draft-delete { flex-shrink: 0; padding: 4px 6px; border: 0; border-radius: 6px; background: transparent; color: #d55; font-size: 11px; }
.forum-post-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.forum-post-tags span { padding: 3px 7px; border-radius: 10px; background: color-mix(in srgb, var(--primary-color) 10%, transparent); color: var(--primary-color); font-size: 11px; }
.forum-poll { display: grid; gap: 7px; margin-top: 12px; }
.forum-poll-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid #ddd; border-radius: 9px; background: var(--panel-bg, #fff); color: inherit; text-align: left; }
.forum-poll-option.selected { border-color: var(--primary-color); background: color-mix(in srgb, var(--primary-color) 8%, var(--panel-bg, #fff)); }
.forum-poll-option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.forum-poll-option small { flex-shrink: 0; color: #888; font-size: 10px; }
.forum-post-edit-window { max-width: 390px; }
.forum-post-edit-window label { display: block; margin-top: 10px; color: #666; font-size: 12px; }
.forum-post-edit-window input, .forum-post-edit-window textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 9px; border: 1px solid #ddd; border-radius: 8px; background: var(--panel-bg, #fff); color: inherit; font: inherit; resize: vertical; }
.forum-edit-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 13px; }
.comment-edited-mark { margin-top: 2px; color: #aaa; font-size: 9px; }
.comment-inline-actions { display: flex; gap: 10px; margin-top: 4px; }
.comment-inline-btn { padding: 0; border: 0; background: transparent; color: #999; font-size: 11px; }
.forum-dm-presence { position: absolute; left: 0; right: 0; top: calc(50% + 7px); display: block; color: #999; font-size: 10px; line-height: 1.2; text-align: center; pointer-events: none; }
#forum-dm-conversation-screen .title-container { position: relative; min-width: 0; }
.post-author-info .author-details { flex: 1; min-width: 0; }
.post-author-info .author-details > div { flex-wrap: nowrap !important; min-width: 0; }
.post-author-info .author-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-message-body { display: flex; flex-direction: column; min-width: 0; max-width: min(76%, 480px); }
.dm-message-body .dm-message-bubble { max-width: 100%; }
.dm-message-time { margin-top: 3px; color: #aaa; font-size: 9px; }
.dm-message-user .dm-message-time { text-align: right; }
#forum-notifications-btn { position: relative; }
#forum-notifications-btn .forum-dm-badge { position: absolute; top: -4px; right: -4px; background: #ff4757; color: #fff; font-size: 10px; padding: 2px 5px; border-radius: 10px; line-height: 1; }

/* 论坛顶栏返回按钮美化：纯色、无渐变、无 Emoji，流畅微触控效果 */
.forum-top-back-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--func-icon-color, #222);
    transition: background-color 0.15s ease, transform 0.1s ease;
    padding: 0;
}

.forum-top-back-btn svg {
    display: block;
    stroke: currentColor;
    transition: transform 0.15s ease;
}

.forum-top-back-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.forum-top-back-btn:active {
    background-color: rgba(0, 0, 0, 0.09);
    transform: scale(0.92);
}

.forum-top-back-btn:active svg {
    transform: translateX(-1.5px);
}

/* 更多按钮未读红点（纯色小圆点） */
.forum-more-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background-color: #ff4757;
    border-radius: 50%;
    border: 1.5px solid #fff;
    pointer-events: none;
}

/* 论坛更多功能居中弹窗样式：纯色扁平卡片设计，无渐变 */
.forum-more-modal-window {
    width: 90%;
    max-width: 340px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
    border: 1px solid #eeeeee;
    box-sizing: border-box;
}

.forum-more-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 8px;
}

.forum-more-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color, #222);
}

.forum-more-modal-close {
    border: none;
    background: #f4f4f5;
    color: #666;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    padding: 0;
}

.forum-more-modal-close:hover {
    background: #e4e4e7;
    color: #111;
}

.forum-more-modal-close:active {
    transform: scale(0.92);
}

.forum-more-modal-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.forum-more-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #ffffff;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    box-sizing: border-box;
}

.forum-more-modal-item:hover {
    background: #f8f9fa;
    border-color: #ededed;
}

.forum-more-modal-item:active {
    background: #f1f2f4;
    transform: scale(0.98);
}

.forum-more-modal-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f3f4f6;
    color: var(--primary-color, #ff80ab);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.forum-more-modal-icon svg {
    stroke: currentColor;
}

.forum-more-modal-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.forum-more-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

.forum-more-item-desc {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forum-more-item-badge {
    background: #ff4757;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1;
    flex-shrink: 0;
}

/* 夜间模式适配（纯纯深灰与纯黑，无渐变） */
body.night-mode-active .forum-more-modal-window {
    background: #1e1e1e;
    border-color: #2e2e2e;
}

body.night-mode-active .forum-more-modal-header {
    border-bottom-color: #2e2e2e;
}

body.night-mode-active .forum-more-modal-title {
    color: #e0e0e0;
}

body.night-mode-active .forum-more-modal-close {
    background: #2a2a2a;
    color: #bbb;
}

body.night-mode-active .forum-more-modal-close:hover {
    background: #333333;
    color: #fff;
}

body.night-mode-active .forum-more-modal-item {
    background: #1e1e1e;
}

body.night-mode-active .forum-more-modal-item:hover {
    background: #262626;
    border-color: #333333;
}

body.night-mode-active .forum-more-modal-item:active {
    background: #2e2e2e;
}

body.night-mode-active .forum-more-modal-icon {
    background: #282828;
}

body.night-mode-active .forum-more-item-name {
    color: #e0e0e0;
}

body.night-mode-active .forum-more-item-desc {
    color: #777777;
}

body.night-mode-active .forum-top-back-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

body.night-mode-active .forum-top-back-btn:active {
    background-color: rgba(255, 255, 255, 0.14);
}

body.night-mode-active .forum-more-badge {
    border-color: #181818;
}

@media (max-width: 390px) {
    #forum-screen .app-header .action-btn-group { gap: 1px; flex-shrink: 0; }
    #forum-screen .app-header .action-btn-group .action-btn { width: 30px; min-width: 30px; height: 32px; padding: 5px; }
    #forum-screen .app-header .title-container { min-width: 0; }
    #forum-screen .content { padding-left: 10px !important; padding-right: 10px !important; }
    .forum-search-bar { gap: 4px; }
    .forum-search-bar .action-btn { width: 34px; min-width: 34px; height: 34px; padding: 6px; }
    #forum-search-input { min-width: 0; padding-left: 10px; padding-right: 8px; }
    .forum-author-actions .btn { padding-left: 7px; padding-right: 7px; }
}

@media (max-width: 320px) {
    .forum-search-bar .action-btn { width: 31px; min-width: 31px; }
    .forum-identity-chip span { max-width: 105px; }
    .forum-range-control input { width: 68px; }
    .forum-author-actions { gap: 3px; }
    .forum-author-actions .btn { font-size: 11px; padding: 3px 6px; }
}

#forum-screen {
    background-color: #ffffff;
}

#forum-screen .app-header {
    background-color: rgba(255, 255, 255, 0.95);
}

.forum-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
    background-color: transparent;
    backdrop-filter: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 0;
}

#forum-search-input {
    flex-grow: 1;
    min-width: 0;
    border: 1px solid rgba(255, 192, 203, 0.3);
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    padding: 12px 18px;
    font-size: 15px;
    border-radius: 22px;
    outline: none;
    color: var(--text-color, #444);
    box-shadow: 0 2px 10px rgba(200, 150, 160, 0.1);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

#forum-search-input:focus {
    border-color: rgba(255, 128, 171, 0.5);
    box-shadow: 0 3px 15px rgba(255, 128, 171, 0.15);
}

#forum-search-input::placeholder {
    color: #b0aab3;
}

.forum-search-bar .action-btn {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(200, 150, 160, 0.1);
    border: 1px solid rgba(255, 192, 203, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
}

.forum-search-bar .action-btn svg {
    fill: var(--primary-color, #ff80ab);
}

.forum-search-bar .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 150, 160, 0.15);
    background-color: rgba(255, 255, 255, 0.9);
}

.forum-search-bar .action-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 6px rgba(200, 150, 160, 0.12);
}

/* 论坛帖子列表 */
#forum-posts-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 论坛筛选标签 */
.forum-filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.forum-filter-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.forum-filter-tab:hover {
    background: rgba(255, 192, 203, 0.1);
    color: var(--primary-color);
}

.forum-filter-tab.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 128, 171, 0.3);
}

.forum-filter-tab.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--primary-color);
}

.forum-post-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.forum-post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.forum-post-card .post-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.forum-post-card .post-summary {
    font-size: 14px;
    color: #888;
    margin: 0 0 12px 0;
    border-left: 3px solid var(--primary-color, #ff80ab);
    padding-left: 10px;
}

.forum-post-card .post-content {
    font-size: 15px;
    color: #555;
    line-height: 1.75;
    white-space: pre-wrap;
    display: none;
}

.forum-post-card.expanded .post-content {
    display: block;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

/* 论坛分享卡片 (嵌入在聊天中) */
.forum-share-card {
    width: 250px;
    background-color: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 12px 15px;
    cursor: pointer;
    border: 1px solid #f0f0f0;
    margin: 0 8px;
    position: relative;
    overflow: visible;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.forum-share-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.forum-share-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f5f5f5;
}

.forum-share-header svg {
    width: 18px;
    height: 18px;
    fill: #aaa;
    flex-shrink: 0;
}

.forum-share-content .forum-share-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.forum-share-content .forum-share-summary {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.forum-share-comment-card .forum-share-comment-block {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.forum-share-comment-card .forum-share-comment-author {
    font-weight: 600;
    color: var(--primary-color, #6366f1);
}

.forum-share-comment-card .forum-share-comment-text {
    word-break: break-word;
}

/* 论坛详情页 */
#forum-post-detail-screen {
    background-color: #ffffff;
}

#forum-post-detail-screen .content {
    padding: 10px;
}

.post-detail-container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 10px;
    overflow: hidden;
}

.post-detail-main {
    padding: 15px;
}

.post-author-info {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.post-meta-data {
    font-size: 12px;
    color: #999;
}

.post-detail-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.4;
    color: #1a1a1a;
}

.post-detail-content-body {
    font-size: 16px;
    line-height: 1.75;
    color: #333;
    white-space: pre-wrap;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.post-detail-actions {
    display: flex;
    justify-content: space-around;
    padding-top: 10px;
}

.post-detail-actions .action-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.post-detail-actions .action-item:hover {
    background-color: #f5f5f5;
}

.post-detail-actions .action-item svg {
    width: 20px;
    height: 20px;
    fill: #888;
}

/* 评论区样式 */
.comments-section {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 15px;
}

.comments-header {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 10px;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 12px;
    flex-shrink: 0;
}

.comment-body {
    flex-grow: 1;
}

.comment-author-name {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.author-badge {
    display: inline-block;
    background: rgba(206, 228, 241, 0.7);
    color: #5a98db;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.comment-content {
    font-size: 15px;
    color: #333;
    margin-top: 4px;
    line-height: 1.6;
}

.comment-timestamp {
    font-size: 12px;
    color: #aaa;
    margin-top: 6px;
}

/* 上下文绑定模态框 */
#forum-binding-modal .modal-window {
    max-width: 380px;
}

.forum-binding-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 15px;
}

.forum-binding-tabs .tab-btn {
    flex: 1;
    padding: 10px 15px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
}

.forum-binding-tabs .tab-btn:hover {
    color: var(--primary-color);
}

.forum-binding-tabs .tab-btn.active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom-color: var(--primary-color);
}

#forum-binding-content-wrapper {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 10px;
}

.forum-binding-content {
    display: none;
}

.forum-binding-content.active {
    display: block;
}

.binding-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.binding-list-item {
    display: flex;
    align-items: center;
    padding: 12px 5px;
    border-bottom: 1px solid #f2f2f2;
}

.binding-list-item:last-child {
    border-bottom: none;
}

.binding-list-item input[type="checkbox"] {
    margin-right: 15px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.binding-list-item label {
    font-size: 15px;
    color: var(--text-color);
    flex-grow: 1;
    cursor: pointer;
}

/* 私信列表右上角删除按钮：纯 SVG，无背景无边框 */
#forum-dm-list-screen .app-header-icon-only {
    background: none !important;
    border: none !important;
    padding: 0;
    margin: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--func-icon-color, #333);
}

#forum-dm-list-screen .app-header-icon-only:hover {
    opacity: 0.8;
}

#forum-dm-list-screen .app-header-icon-only:active {
    opacity: 0.6;
}

#forum-dm-list-screen .forum-dm-header-actions .app-header-icon-only {
    margin: 0;
}

/* 私信列表样式 */
.forum-dm-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    gap: 12px;
}

.forum-dm-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #fafafa;
}

.forum-dm-item:active {
    transform: translateY(0);
}

.dm-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dm-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.dm-last-message {
    font-size: 13px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dm-unread-badge {
    background: #ff4757;
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

/* 私信列表删除模式工具栏 */
.forum-dm-delete-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.forum-dm-item.dm-delete-mode {
    padding-left: 12px;
}

.forum-dm-item .dm-select-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 6px;
    margin-right: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.forum-dm-item.dm-selected .dm-select-checkbox {
    background: var(--accent-color, #007aff);
    border-color: var(--accent-color, #007aff);
}

.forum-dm-item.dm-selected .dm-select-checkbox::after {
    content: '';
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 3px;
}

/* 私信对话样式 */
#forum-dm-message-area {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dm-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.dm-message-user {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.dm-message-npc {
    flex-direction: row;
    justify-content: flex-start;
}

.dm-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.dm-npc-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.dm-message-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}

.dm-message-user .dm-message-bubble {
    background: var(--primary-color);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.dm-message-npc .dm-message-bubble {
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

/* AI回复按钮样式 */
.ai-reply-btn {
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
}

.ai-reply-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.ai-reply-btn:active {
    background: #d0d0d0;
    transform: scale(0.95);
}

.ai-reply-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 小号管理与弹窗样式 */
.forum-alt-edit-window {
    background: #ffffff;
    border-radius: var(--border-radius, 16px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

body.night-mode-active .forum-alt-edit-window {
    background: #1e1e1e !important;
    border: 1px solid #2e2e2e;
}

body.night-mode-active .forum-alt-edit-window h3 {
    color: #e0e0e0;
}

body.night-mode-active .forum-alt-edit-window label {
    color: #aaa !important;
}

body.night-mode-active .forum-alt-edit-window input[type="text"],
body.night-mode-active .forum-alt-edit-window textarea {
    background: #262626 !important;
    border-color: #383838 !important;
    color: #e0e0e0 !important;
}

/* 小号管理样式 */
.forum-alt-identity-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.forum-alt-identity-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.forum-alt-identity-card.forum-alt-identity-active {
    border: 2px solid var(--primary-color, #ff80ab);
    background: rgba(255,128,171,0.05);
}

.forum-alt-identity-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e0e0e0;
}

.forum-alt-identity-active .forum-alt-identity-avatar {
    border-color: var(--primary-color, #ff80ab);
}

.forum-alt-identity-info {
    flex: 1;
    min-width: 0;
}

.forum-alt-identity-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.forum-alt-identity-bio {
    font-size: 12px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.forum-alt-identity-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--primary-color, #ff80ab);
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
}

.forum-alt-identity-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.forum-alt-identity-actions button {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.forum-alt-identity-actions button:hover {
    background: #f5f5f5;
}

.forum-alt-identity-actions .alt-delete-btn:hover {
    background: #fee;
    color: #e74c3c;
    border-color: #e74c3c;
}

.forum-alt-empty-hint {
    text-align: center;
    padding: 30px 15px;
    color: #bbb;
    font-size: 14px;
}

/* 评论回复引用 */
.comment-reply-ref {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
    margin-bottom: 2px;
}

.comment-reply-ref-name {
    color: var(--primary-color, #ff80ab);
    font-weight: 500;
}

/* 回复栏 */
.forum-reply-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 15px;
    background: rgba(255, 128, 171, 0.08);
    border-bottom: 1px solid rgba(255, 128, 171, 0.15);
    font-size: 13px;
    color: #666;
}

.forum-reply-bar-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forum-reply-bar-text span {
    color: var(--primary-color, #ff80ab);
    font-weight: 600;
}

.forum-reply-bar-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}

.forum-reply-bar-close:hover {
    color: #666;
}

/* 评论私信按钮 */
.comment-dm-btn {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 16px;
    border: none;
    background: var(--primary-color, #ff80ab);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.comment-dm-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.comment-dm-btn:active {
    transform: translateY(0);
    opacity: 0.7;
}

/* ==========================================================================
   论坛设置界面美化 (Forum Settings)
   ========================================================================== */

/* 设置界面容器优化 */
#forum-settings-screen .kkt-settings-container {
    padding: 15px 12px;
    gap: 16px;
    display: flex;
    flex-direction: column;
}

/* 卡片化设计 */
.forum-setting-group {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    margin: 0;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.forum-setting-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06), 0 2px 5px rgba(0, 0, 0, 0.03);
}

/* 标题美化 */
.forum-setting-group .kkt-group-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
}

/* 设置项微调 */
.forum-setting-group .kkt-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    min-height: auto;
}

.forum-setting-group .kkt-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.forum-setting-group .kkt-item-label {
    font-size: 14.5px;
    color: #34495e;
    font-weight: 500;
}

/* 输入框和控件优化 */
.forum-setting-group input[type="number"],
.forum-setting-group input[type="text"],
.forum-setting-group input[type="password"],
.forum-setting-group select {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 14px;
    color: #2c3e50;
    transition: all 0.2s ease;
}

.forum-setting-group input:focus,
.forum-setting-group select:focus {
    background-color: #fff !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 255, 128, 171), 0.15) !important;
    outline: none;
}

/* 按钮优化 */
.forum-setting-group .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover, #ff6b9d));
    border: none;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb, 255, 128, 171), 0.3);
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.forum-setting-group .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(var(--primary-rgb, 255, 128, 171), 0.4);
}

.forum-setting-group .btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(var(--primary-rgb, 255, 128, 171), 0.3);
}

/* 辅助说明文字 */
.forum-setting-group p {
    line-height: 1.5;
    color: #7f8c8d !important;
    padding: 0 4px;
}

/* 范围选择器（Slider）轨道美化 */
.forum-setting-group input[type="range"] {
    -webkit-appearance: none;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    outline: none;
    margin: 10px 0;
}

.forum-setting-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.1s;
}

.forum-setting-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* 小号列表样式优化 */
.forum-char-alt-list {
    background: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.forum-char-alt-list li {
    padding: 8px 12px !important;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}
.forum-char-alt-list li:last-child {
    border-bottom: none;
}
.forum-char-alt-list li:hover {
    background-color: #fff;
}


/* 帖子批量删除模式 */
.forum-post-delete-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.forum-post-card.forum-post-delete-mode {
    cursor: pointer;
    user-select: none;
}

.forum-post-select-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    margin-top: 2px;
    transition: all 0.2s ease;
}

.forum-post-card.forum-post-selected .forum-post-select-checkbox {
    background: var(--accent-color, #007aff);
    border-color: var(--accent-color, #007aff);
}

.forum-post-card.forum-post-selected .forum-post-select-checkbox::after {
    content: '';
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 3px;
}
