/* ================================================
   "他们说"功能样式
   ================================================ */

/* 按钮样式 */
.action-btn-small.tashuo-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(74, 156, 1, 0.1), rgba(74, 156, 1, 0.05));
    color: var(--primary-green);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.action-btn-small.tashuo-btn:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    background: var(--primary-green-alpha);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 156, 1, 0.15);
}

.action-btn-small.tashuo-btn i {
    color: var(--primary-green);
    font-size: 0.9rem;
}

/* 分享按钮样式 */
.action-btn-small.warning,
.quick-btn.warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0;
    border: 1px solid #ff9500;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.1), rgba(255, 149, 0, 0.05));
    color: #ff9500;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    box-sizing: border-box;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* HS编码页面按钮统一尺寸 */
.action-btn-small.warning {
    width: 110px;
    height: 40px;
}

.action-btn-small.tashuo-btn {
    width: 110px;
    height: 40px;
    justify-content: center;
    padding: 0;
}

.action-btn-small.warning:hover,
.quick-btn.warning:hover {
    border-color: #e6860f;
    color: white;
    background: linear-gradient(135deg, #ff9500, #ffb84d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
}

.action-btn-small.warning i,
.quick-btn.warning i {
    color: inherit;
    font-size: 0.9rem;
}

/* 移动端响应式调整 */
@media (max-width: 768px) {
    .action-btn-small.warning,
    .quick-btn.warning {
        font-size: 0.8rem;
        gap: 0.25rem;
    }
    
    .action-btn-small.warning i,
    .quick-btn.warning i {
        font-size: 0.8rem;
    }
    
    /* HS编码页面移动端按钮尺寸 */
    .action-btn-small.warning {
        width: 100px;
        height: 36px;
    }
    
    .action-btn-small.tashuo-btn {
        width: 100px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .action-btn-small.warning,
    .quick-btn.warning {
        font-size: 0.75rem;
        gap: 0.2rem;
    }
    
    .action-btn-small.warning i,
    .quick-btn.warning i {
        font-size: 0.75rem;
    }
    
    /* HS编码页面移动端按钮尺寸 */
    .action-btn-small.warning {
        width: 100px;
        height: 36px;
    }
    
    .action-btn-small.tashuo-btn {
        width: 100px;
        height: 36px;
    }
}

/* 弹窗样式 */
.tashuo-modal .modal-container {
    max-width: 1200px;
    width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .tashuo-modal .modal-container {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(25px);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.tashuo-modal .modal-header {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tashuo-modal .modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white; /* 确保light主题下文字为白色 */
}

.tashuo-modal .modal-title i {
    font-size: 1.5rem;
    color: white; /* 确保light主题下图标为白色 */
}

.tashuo-modal .modal-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tashuo-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.tashuo-modal .modal-body {
    padding: 0;
}

/* 输入框区域 */
.tashuo-input-container {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

[data-theme="dark"] .tashuo-input-container {
    background: rgba(30, 41, 59, 0.5);
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* 匿名用户提示区域样式 */
.tashuo-guest-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 2rem;
}

.guest-prompt-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.guest-prompt-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guest-prompt-icon i {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.guest-prompt-text h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.guest-prompt-text p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.4;
}

.guest-prompt-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.guest-prompt-actions .btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none;
    white-space: nowrap;
}

.guest-prompt-actions .btn.btn-primary {
    background: var(--primary-green);
    color: white;
}

.guest-prompt-actions .btn.btn-primary:hover {
    background: var(--primary-green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 156, 1, 0.2);
}

.guest-prompt-actions .btn.btn-outline {
    background: transparent;
    color: var(--primary-green);
    border: 1px solid var(--primary-green);
}

.guest-prompt-actions .btn.btn-outline:hover {
    background: var(--primary-green-alpha);
}

.guest-settings-area {
    flex-shrink: 0;
}

/* 暗色主题下的匿名用户提示 */
[data-theme="dark"] .guest-prompt-icon {
    background: rgba(30, 41, 59, 0.7);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .tashuo-guest-prompt {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }
    
    .guest-prompt-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    
    .guest-prompt-actions {
        justify-content: center;
    }
    
    .guest-settings-area {
        display: flex;
        justify-content: center;
    }
}

.tashuo-input-wrapper {
    display: flex;
    gap: 1rem;
    position: relative;
}

.tashuo-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.tashuo-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tashuo-input-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tashuo-input-main {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
}

.tashuo-type-selector {
    position: relative;
    min-width: 80px;
}

.tashuo-type-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    justify-content: space-between;
}

.tashuo-type-btn:hover {
    border-color: var(--primary-green);
}

.tashuo-type-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 100;
    margin-bottom: 0.25rem;
    display: none;
}

.tashuo-type-dropdown.active {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

.tashuo-type-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tashuo-type-option:hover {
    background: var(--bg-secondary);
}

.tashuo-type-option.active {
    background: var(--primary-green-alpha);
    color: var(--primary-green);
    font-weight: 600;
}

/* 消息类型标签样式 */
.tashuo-type-label {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tashuo-type-label.notice {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.tashuo-type-label.experience {
    background: rgba(74, 156, 1, 0.1);
    color: var(--primary-green);
}

.tashuo-type-label.complaint {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.tashuo-type-label.chat {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.tashuo-textarea {
    flex: 1;
    min-height: 60px;
    max-height: 200px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    resize: vertical;
    transition: all var(--transition-fast);
    line-height: 1.5;
}

.tashuo-textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(74, 156, 1, 0.1);
}

.tashuo-send-btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary-green);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.tashuo-send-btn:hover {
    background: var(--primary-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 156, 1, 0.2);
}

.tashuo-send-btn:disabled {
    background: var(--gray-300);
    color: var(--gray-500);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tashuo-format-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    flex-wrap: wrap;
}

.tashuo-format-group {
    position: relative;
    display: inline-block;
}

.tashuo-format-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
}

.tashuo-format-btn:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    background: var(--primary-green-alpha);
}

.tashuo-format-btn.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.tashuo-settings-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tashuo-settings-btn:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    background: var(--primary-green-alpha);
}

/* 消息展示区域 */
.tashuo-messages-container {
    padding: 1.5rem 2rem;
    height: 400px;
    overflow-y: auto;
    background: var(--bg-primary);
    position: relative;
}

[data-theme="dark"] .tashuo-messages-container {
    background: rgba(15, 23, 42, 0.7);
}

/* 弹幕样式 */
.tashuo-danmaku-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    /* 优化弹幕容器的渲染性能 */
    will-change: scroll-position;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

/* 聊天容器样式 */
.tashuo-chat-container {
    height: 100%;
    overflow-y: auto;
    padding: 1rem;
    display: none;
}

.tashuo-danmaku {
    position: absolute;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 9999px;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: danmakuMove linear;
    pointer-events: none;
    overflow: hidden;
    background-clip: padding-box;
    outline: 1px solid transparent;
}

[data-theme="dark"] .tashuo-danmaku {
    background: rgba(30, 41, 59, 0.85);
    box-shadow: none;
}

.tashuo-danmaku-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.tashuo-danmaku-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tashuo-danmaku-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 弹幕头像和信息布局 */
.danmaku-content {
    display: flex;
    align-items: center;
    gap: 0.5rem !important;
    padding: 0.5rem 1rem;
    background: rgba(30, 30, 30, 0.85); /* 调整为黑灰色 */
    border-radius: 9999px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    background-clip: padding-box;
    box-shadow: none;
    outline: 1px solid transparent;
    /* 优化弹幕内容的渲染性能 */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.danmaku-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.danmaku-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.danmaku-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.tashuo-danmaku-type {
    font-size: 0.75rem;
    font-weight: 600;
}

.tashuo-danmaku-text {
    color: var(--text-primary);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 气泡聊天样式 - 微信风格 */
.tashuo-chat-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.tashuo-chat-message {
    display: flex;
    gap: 0.75rem;
    animation: fadeInUp 0.3s ease-out;
    margin-bottom: 1rem;
}

/* 其他用户消息（左对齐） */
.tashuo-chat-message.other-user {
    flex-direction: row;
    justify-content: flex-start;
}

.tashuo-chat-message.other-user .tashuo-chat-content {
    align-items: flex-start;
}

.tashuo-chat-message.other-user .tashuo-chat-header {
    justify-content: flex-start;
}

.tashuo-chat-message.other-user .tashuo-chat-bubble {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border-top-left-radius: 0.25rem;
    position: relative;
    color: var(--text-primary);
}

/* 当其他用户有自定义背景色时 */
.tashuo-chat-message.other-user .tashuo-chat-bubble[style*="background"] {
    /* 如果有自定义背景，确保文字颜色合适 */
    color: white;
}

/* 在light主题下，确保没有背景色时文字可见 */
[data-theme="light"] .tashuo-chat-message.other-user .tashuo-chat-bubble:not([style*="background"]) {
    background: #dee2e6;
    color: var(--text-primary);
}

/* 确保自定义文字颜色在light主题气泡中的对比度 */
[data-theme="light"] .tashuo-chat-message.other-user .tashuo-chat-bubble[style*="background"] {
    /* 当有自定义背景时，确保文字颜色合适 */
    color: white;
}

/* 在light主题下，白色文字在默认气泡中显示为深色 */
[data-theme="light"] .tashuo-chat-message.other-user .tashuo-chat-bubble:not([style*="background"]) span[style*="color: #ffffff"],
[data-theme="light"] .tashuo-chat-message.other-user .tashuo-chat-bubble:not([style*="background"]) span[style*="color: rgb(255, 255, 255)"] {
    color: var(--text-primary) !important;
}

/* 在dark主题下，确保没有背景色时文字可见 */
[data-theme="dark"] .tashuo-chat-message.other-user .tashuo-chat-bubble:not([style*="background"]) {
    background: rgba(30, 41, 59, 0.7);
    color: var(--text-primary);
}

/* 当前用户消息（右对齐） */
.tashuo-chat-message.current-user {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.tashuo-chat-message.current-user .tashuo-chat-content {
    align-items: flex-end;
}

.tashuo-chat-message.current-user .tashuo-chat-header {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.tashuo-chat-message.current-user .tashuo-chat-bubble {
    background: var(--primary-green);
    color: white;
    border-radius: var(--radius-lg);
    border-top-right-radius: 0.25rem;
    position: relative;
}

/* 当当前用户有自定义背景色时 */
.tashuo-chat-message.current-user .tashuo-chat-bubble[style*="background"] {
    /* 如果有自定义背景，确保文字颜色合适 */
    color: white;
}

/* 当前用户没有自定义背景时，使用默认绿色 */
.tashuo-chat-message.current-user .tashuo-chat-bubble:not([style*="background"]) {
    background: var(--primary-green);
    color: white;
}

.tashuo-chat-message.current-user .tashuo-chat-name {
    color: var(--text-primary);
}

/* 头像样式 */
.tashuo-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tashuo-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 聊天内容区域 */
.tashuo-chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 70%;
}

.tashuo-chat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.tashuo-chat-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* VIP等级颜色样式在聊天模式中的应用 */
.tashuo-chat-name.vip {
    background: linear-gradient(135deg, #57b401 0%, #4a9c01 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.tashuo-chat-name.svip {
    background: linear-gradient(135deg, #f56c6c 0%, #e74c3c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.tashuo-chat-name.annual {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.tashuo-chat-name.enterprise {
    background: linear-gradient(135deg, #5f3c30 0%, #8b4513 50%, #d4af37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.tashuo-chat-name.admin {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    text-shadow: 0 0 15px rgba(106, 17, 203, 0.4);
}

.tashuo-chat-name.super-admin {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ff6b35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: superAdminGlow 2s ease-in-out infinite alternate;
}

.tashuo-chat-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* 聊天气泡 */
.tashuo-chat-bubble {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 100%;
}

/* 暗色主题下的气泡 */
[data-theme="dark"] .tashuo-chat-bubble {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 推荐聊天消息特殊样式 */
.tashuo-chat-message.chat-recommended .tashuo-chat-bubble {
    border: 2px solid #ffd700 !important;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    position: relative;
}

/* 暗色主题下的推荐聊天消息 */
[data-theme="dark"] .tashuo-chat-message.chat-recommended .tashuo-chat-bubble {
    border: 2px solid #ffd700 !important;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

/* 亮色主题下的推荐聊天消息 */
[data-theme="light"] .tashuo-chat-message.chat-recommended .tashuo-chat-bubble {
    border: 2px solid #ffd700 !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* 暗色主题下其他用户的默认气泡 */
[data-theme="dark"] .tashuo-chat-message.other-user .tashuo-chat-bubble:not([style*="background"]) {
    background: rgba(30, 41, 59, 0.7) !important;
    color: var(--text-primary) !important;
}

/* 暗色主题下当前用户的默认气泡 */
[data-theme="dark"] .tashuo-chat-message.current-user .tashuo-chat-bubble:not([style*="background"]) {
    color: white !important;
}

/* 暗色主题下有自定义背景的气泡 */
[data-theme="dark"] .tashuo-chat-bubble[style*="background"] {
    color: white !important;
}

/* 类型标签在聊天模式下的样式 */
.tashuo-chat-header .tashuo-type-label {
    font-size: 0.7rem;
    padding: 0.125rem 0.375rem;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .tashuo-chat-content {
        max-width: 80%;
    }
    
    .tashuo-chat-avatar {
        width: 36px;
        height: 36px;
    }
    
    .tashuo-chat-bubble {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }
}

/* 等待提示效果 */
.tashuo-loading-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.tashuo-loading-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: pulseScale 2s infinite;
}

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

.tashuo-loading-icon {
    margin-bottom: 1.5rem;
    position: relative;
    width: 80px;
    height: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tashuo-loading-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.tashuo-loading-circle:nth-child(2) {
    width: 80%;
    height: 80%;
    border-top-color: #f59e0b;
    animation-duration: 2s;
    animation-direction: reverse;
}

.tashuo-loading-circle:nth-child(3) {
    width: 60%;
    height: 60%;
    border-top-color: #3b82f6;
    animation-duration: 1s;
}

.tashuo-loading-icon i {
    font-size: 2rem;
    color: var(--primary-green);
    z-index: 1;
}

.tashuo-loading-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.tashuo-loading-message {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    min-height: 3rem;
}

.tashuo-loading-progress {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.tashuo-loading-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-green), var(--primary-green-light));
    width: 0%;
    border-radius: 100px;
    transition: width 0.3s ease;
}

.tashuo-typewriter {
    display: inline-block;
    overflow: hidden;
    border-right: 2px solid var(--primary-green);
    white-space: nowrap;
    margin: 0;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-green) }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

/* 统一弹幕速度 - 根据容器宽度自适应移动速度，优化平滑度 */
@keyframes danmakuMove {
    0% {
        transform: translateX(0) translateZ(0);
        -webkit-transform: translateX(0) translateZ(0);
        opacity: 1;
    }
    98% {
        transform: translateX(calc(-100vw - 100%)) translateZ(0);
        -webkit-transform: translateX(calc(-100vw - 100%)) translateZ(0);
        opacity: 1;
    }
    100% {
        transform: translateX(calc(-100vw - 100%)) translateZ(0);
        -webkit-transform: translateX(calc(-100vw - 100%)) translateZ(0);
        opacity: 0; /* 只在最后2%时间内渐隐，确保平滑过渡 */
    }
}

/* WebKit优化的弹幕动画 */
@-webkit-keyframes danmakuMove {
    0% {
        -webkit-transform: translateX(0) translateZ(0);
        transform: translateX(0) translateZ(0);
        opacity: 1;
    }
    98% {
        -webkit-transform: translateX(calc(-100vw - 100%)) translateZ(0);
        transform: translateX(calc(-100vw - 100%)) translateZ(0);
        opacity: 1;
    }
    100% {
        -webkit-transform: translateX(calc(-100vw - 100%)) translateZ(0);
        transform: translateX(calc(-100vw - 100%)) translateZ(0);
        opacity: 0;
    }
}

/* 新弹幕样式 - 优化性能和平滑度 */
.danmaku-item {
    position: absolute;
    animation: danmakuMove 14s linear forwards; /* 默认14s，JavaScript会动态调整 */
    -webkit-animation: danmakuMove 14s linear forwards;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
    left: 100%; /* 从容器右侧开始 */
    /* 强化硬件加速和渲染优化 */
    will-change: transform;
    -webkit-will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    perspective: 1000px;
    -webkit-perspective: 1000px;
    /* 确保弹幕容器内容不会被截断 */
    overflow: visible;
    /* 额外的平滑优化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
    /* 进一步的渲染优化 */
    contain: layout style paint;
    isolation: isolate;
    border: 1px solid transparent;
}

/* 推荐弹幕特殊样式 - 基础样式 */
.danmaku-item.danmaku-recommended .danmaku-content {
    position: relative !important;
    border-radius: 9999px !important; /* 保持胶囊形状 */
    border: none !important; /* 移除默认边框 */
    /* 添加抗锯齿优化 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 暗色主题下的推荐弹幕 - 使用伪元素避免边角问题 */
[data-theme="dark"] .danmaku-item.danmaku-recommended .danmaku-content {
    background: rgba(45, 45, 45, 0.95) !important;
    border-radius: 9999px !important;
    border: none !important;
}

[data-theme="dark"] .danmaku-item.danmaku-recommended .danmaku-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: #ffd700;
    border-radius: 9999px;
    z-index: -1;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
}

/* 亮色主题下的推荐弹幕 - 使用直接边框 */
[data-theme="light"] .danmaku-item.danmaku-recommended .danmaku-content {
    background: rgba(50, 50, 50, 0.92) !important;
    border: 2px solid #ffd700 !important;
    border-radius: 9999px !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.7) !important;
    /* 亮色主题特殊抗锯齿优化 */
    outline: 1px solid transparent;
    background-clip: padding-box;
}

.danmaku-type {
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    color: white;
}

/* 保持类型的原本颜色和背景 */
.danmaku-type.type-warning {
    background: #ef4444;
    color: white;
}

.danmaku-type.type-info {
    background: var(--primary-green);
    color: white;
}

.danmaku-type.type-danger {
    background: #f59e0b;
    color: white;
}

.danmaku-type.type-success {
    background: #3b82f6;
    color: white;
}

/* 修复light主题下A字母颜色问题 */
[data-theme="light"] .tashuo-format-btn i {
    color: var(--text-secondary);
}

[data-theme="light"] #text-color-btn i {
    color: var(--text-secondary);
}


/* 确保白色文字在light主题下显示为可见颜色 */
[data-theme="light"] #text-color-btn i[style*="color: #ffffff"],
[data-theme="light"] #text-color-btn i[style*="color: rgb(255, 255, 255)"] {
    color: var(--text-secondary) !important;
}

.danmaku-text {
    color: #ffffff; /* 确保文字为白色，在黑灰背景下清晰显示 */
    font-size: 0.875rem;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* 添加文字阴影增强对比度 */
}

.danmaku-user {
    color: rgba(255, 255, 255, 0.8); /* 调整为更清晰的白色 */
    font-size: 0.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* VIP等级颜色样式在弹幕模式中的应用 */
.danmaku-user.vip {
    background: linear-gradient(135deg, #57b401 0%, #4a9c01 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.danmaku-user.svip {
    background: linear-gradient(135deg, #f56c6c 0%, #e74c3c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.danmaku-user.annual {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.danmaku-user.enterprise {
    background: linear-gradient(135deg, #5f3c30 0%, #8b4513 50%, #d4af37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.danmaku-user.admin {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    text-shadow: 0 0 15px rgba(106, 17, 203, 0.6);
}

.danmaku-user.super-admin {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ff6b35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    animation: superAdminGlow 2s ease-in-out infinite alternate;
}

/* 炫酷的等待提示效果 */
.tashuo-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.loading-container {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 4px solid var(--border-light);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-steps {
    text-align: left;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.loading-step.active {
    opacity: 1;
    color: var(--primary-green);
}

.loading-step.completed {
    opacity: 0.8;
    color: var(--text-secondary);
}

.step-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--border-medium);
    color: transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.loading-step.active .step-icon {
    background: var(--primary-green);
    animation: pulse-icon 1.5s infinite;
}

.loading-step.completed .step-icon {
    background: var(--success-color);
    color: white;
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 156, 1, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(74, 156, 1, 0);
    }
}

.step-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* 打字机效果 */
.step-text {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary-green);
    animation: blink-cursor 1s infinite;
}

.loading-step.completed .step-text {
    border-right: none;
    animation: none;
}

@keyframes blink-cursor {
    0%, 50% {
        border-color: var(--primary-green);
    }
    51%, 100% {
        border-color: transparent;
    }
}

/* 聊天消息样式 */
.chat-message {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border-left: 4px solid var(--border-medium);
}

.chat-message.type-warning {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.chat-message.type-info {
    border-left-color: var(--primary-green);
    background: rgba(74, 156, 1, 0.05);
}

.chat-message.type-danger {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.chat-message.type-success {
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.message-type {
    font-weight: bold;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--primary-green);
    color: white;
}

.message-user {
    font-weight: 600;
    color: var(--text-primary);
}

.message-time {
    color: var(--text-secondary);
    margin-left: auto;
}

.message-content {
    color: var(--text-primary);
    line-height: 1.5;
}

 

/* 设置弹窗样式修复 */
.tashuo-settings-overlay {
    z-index: 10001 !important;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(5px);
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.tashuo-settings-overlay .modal-container {
    max-width: 500px;
    width: 90vw;
    border-radius: var(--radius-xl);
    background: var(--bg-primary) !important;
    border: 1px solid var(--border-light);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    position: relative !important;
    z-index: 10002 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
}

.tashuo-settings-overlay .modal-header {
    background: var(--bg-secondary);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tashuo-settings-overlay .modal-title {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.tashuo-settings-overlay .modal-close {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tashuo-settings-overlay .modal-close:hover {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.tashuo-settings-overlay .modal-body {
    padding: 2rem;
}

.tashuo-settings-content h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.tashuo-settings-content .setting-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

.tashuo-settings-content .setting-item label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
}

.tashuo-settings-content .setting-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-green);
}

.tashuo-settings-content .setting-desc {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.4;
    margin-left: 2.25rem;
}

.tashuo-settings-content .setting-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.tashuo-settings-content .btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tashuo-settings-content .btn.btn-primary {
    background: var(--primary-green);
    color: white;
}

.tashuo-settings-content .btn.btn-primary:hover {
    background: var(--primary-green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 156, 1, 0.2);
}

.tashuo-settings-content .btn.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.tashuo-settings-content .btn.btn-secondary:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

/* 格式化工具的颜色选择器和选项 */
.tashuo-color-picker-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 200;
    margin-bottom: 0.25rem;
    display: none;
    padding: 0.75rem;
    min-width: 200px;
}

.tashuo-color-picker-dropdown.active {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

.tashuo-color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tashuo-color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tashuo-color-option:hover {
    transform: scale(1.1);
    border-color: var(--primary-green);
}

.tashuo-color-option.selected {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(74, 156, 1, 0.2);
}

.tashuo-bg-color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tashuo-bg-color-option {
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

.tashuo-bg-color-option:hover {
    transform: scale(1.05);
    border-color: var(--primary-green);
}

.tashuo-bg-color-option.selected {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(74, 156, 1, 0.2);
}

/* Emoji选择器 */
.tashuo-emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 200;
    margin-bottom: 0.25rem;
    display: none;
    padding: 0.75rem 1rem 0.75rem 0.75rem; /* 增加右侧padding，使左右空白区域一致 */
    width: 240px; /* 从220px增加到240px，为右侧空白留出空间 */
    height: auto; /* 改为auto高度，让内容自适应 */
    max-height: none; /* 移除最大高度限制，避免出现滚动条 */
    overflow: visible; /* 改为可见，不显示滚动条 */
}

/* 移动端优化：emoji选择器位置调整 */
@media (max-width: 768px) {
    .tashuo-emoji-picker {
        left: -60px; /* 向左移动60px，避免超出屏幕 */
        width: 280px; /* 移动端增加宽度，确保有足够空间 */
        padding: 0.75rem 1rem; /* 移动端左右padding保持一致 */
        /* 确保不会超出屏幕左边界 */
        transform: translateX(0);
        max-width: calc(100vw - 40px); /* 确保不超出视窗宽度 */
    }
    
    /* 如果emoji按钮靠近屏幕左边缘，调整位置 */
    .tashuo-format-group:first-child .tashuo-emoji-picker,
    .tashuo-format-btn[data-format="emoji"]:first-child ~ .tashuo-emoji-picker {
        left: 0; /* 如果是第一个按钮，不向左移动 */
    }
}

.tashuo-emoji-picker.active {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

.tashuo-emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 从8列减少到6列，适应更窄的宽度 */
    gap: 0.25rem;
}

.tashuo-emoji-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.tashuo-emoji-item:hover {
    background: var(--bg-secondary);
    transform: scale(1.2);
}

/* 特效选择器 */
.tashuo-effects-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 200;
    margin-bottom: 0.25rem;
    display: none;
    padding: 0.75rem;
    min-width: 140px; /* 从180px减少到140px，使菜单更窄 */
    max-width: 160px; /* 添加最大宽度限制 */
}

.tashuo-effects-picker.active {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

.tashuo-effect-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.tashuo-effect-option:hover {
    background: var(--bg-secondary);
}

.tashuo-effect-option.selected {
    background: var(--primary-green-alpha);
    color: var(--primary-green);
}

.tashuo-effect-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 弹幕特效样式增强 */
.danmaku-effect-glow {
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
    animation: glow-pulse 2s infinite alternate;
    color: #ffffff !important; /* 确保发光效果文字可见 */
}

@keyframes glow-pulse {
    0% { text-shadow: 0 0 5px currentColor, 0 0 10px currentColor; }
    100% { text-shadow: 0 0 15px currentColor, 0 0 25px currentColor, 0 0 35px currentColor; }
}

.danmaku-effect-shake {
    animation: shake 0.5s infinite;
    color: #ffffff !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-2px) translateY(-1px); }
    50% { transform: translateX(2px) translateY(1px); }
    75% { transform: translateX(-1px) translateY(2px); }
}

.danmaku-effect-rainbow {
    background: linear-gradient(45deg, #ff0000, #ff8000, #ffff00, #80ff00, #00ff00, #00ff80, #00ffff, #0080ff, #0000ff, #8000ff, #ff0080) !important;
    background-size: 400% 400% !important;
    animation: rainbow 3s infinite !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important; /* 确保原始文字颜色不干扰 */
    font-weight: bold !important; /* 增强彩虹效果的可见性 */
    display: inline-block !important;
    /* 在弹幕中添加轻微阴影以增强可读性 */
    filter: drop-shadow(0.5px 0.5px 1px rgba(0, 0, 0, 0.6)) !important;
}

/* 聊天模式下的彩虹特效修复 - 确保文字可见 */
.tashuo-chat-bubble .danmaku-effect-rainbow {
    /* 在聊天气泡中，彩虹效果需要特殊处理 */
    background: linear-gradient(45deg, #ff0000, #ff8000, #ffff00, #80ff00, #00ff00, #00ff80, #00ffff, #0080ff, #0000ff, #8000ff, #ff0080) !important;
    background-size: 400% 400% !important;
    animation: rainbow 3s infinite !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important; /* 确保原始文字颜色不干扰 */
    font-weight: bold !important;
    /* 移除可能干扰的文字阴影 */
    text-shadow: none !important;
    /* 确保渐变背景能正确显示 */
    display: inline-block !important;
    position: relative !important;
}

/* 为了确保在浅色背景下也能看到彩虹效果，添加轮廓 */
[data-theme="light"] .tashuo-chat-bubble .danmaku-effect-rainbow {
    /* 在浅色主题下，为彩虹文字添加深色轮廓以增强可读性 */
    filter: drop-shadow(0.5px 0.5px 1px rgba(0, 0, 0, 0.8)) drop-shadow(-0.5px -0.5px 1px rgba(0, 0, 0, 0.8)) !important;
}

/* 暗色主题下的彩虹效果特殊优化 */
[data-theme="dark"] .tashuo-chat-bubble .danmaku-effect-rainbow {
    /* 在暗色主题下，使用更强的渐变和轮廓以增强可读性 */
    background: linear-gradient(45deg, #ff4444, #ff9944, #ffff44, #99ff44, #44ff44, #44ff99, #44ffff, #4499ff, #4444ff, #9944ff, #ff4499) !important;
    background-size: 300% 300% !important;
    animation: rainbow 2.5s infinite !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    font-weight: bold !important;
    text-shadow: none !important;
    display: inline-block !important;
    position: relative !important;
    z-index: 1 !important;
    /* 使用更强的白色轮廓增强对比度 */
    filter: drop-shadow(1px 1px 2px rgba(255, 255, 255, 0.9)) 
            drop-shadow(-1px -1px 2px rgba(255, 255, 255, 0.9)) 
            drop-shadow(1px -1px 2px rgba(255, 255, 255, 0.7)) 
            drop-shadow(-1px 1px 2px rgba(255, 255, 255, 0.7)) !important;
    /* 确保在深色背景下有足够的对比度 */
    mix-blend-mode: normal !important;
    isolation: isolate !important;
    /* 强制硬件加速，确保渲染正确 */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    will-change: background-position !important;
    /* 确保不被其他样式覆盖 */
    opacity: 1 !important;
    visibility: visible !important;
}

/* 确保dark主题下气泡容器不会影响彩虹文字的渲染 */
[data-theme="dark"] .tashuo-chat-bubble:has(.danmaku-effect-rainbow) {
    /* 为包含彩虹文字的气泡创建新的堆叠上下文 */
    isolation: isolate;
    position: relative;
    z-index: 0;
}

/* 针对不支持background-clip的浏览器的备用方案 */
@supports not (-webkit-background-clip: text) {
    .tashuo-chat-bubble .danmaku-effect-rainbow,
    .danmaku-effect-rainbow {
        background: none !important;
        color: #ff6b6b !important; /* 备用红色 */
        animation: rainbow-fallback 3s infinite !important;
        text-shadow: 0 0 10px currentColor !important;
        filter: none !important; /* 移除阴影，避免与备用方案冲突 */
    }
    
    /* dark主题下的备用方案使用更亮的颜色 */
    [data-theme="dark"] .tashuo-chat-bubble .danmaku-effect-rainbow,
    [data-theme="dark"] .danmaku-effect-rainbow {
        animation: rainbow-fallback-dark 2.5s infinite !important;
        font-weight: bold !important;
    }
    
    @keyframes rainbow-fallback {
        0%, 16.66% { color: #ff0000; text-shadow: 0 0 8px #ff0000; }
        16.67%, 33.33% { color: #ff8000; text-shadow: 0 0 8px #ff8000; }
        33.34%, 50% { color: #ffff00; text-shadow: 0 0 8px #ffff00; }
        50.01%, 66.66% { color: #00ff00; text-shadow: 0 0 8px #00ff00; }
        66.67%, 83.33% { color: #0080ff; text-shadow: 0 0 8px #0080ff; }
        83.34%, 100% { color: #8000ff; text-shadow: 0 0 8px #8000ff; }
    }
    
    @keyframes rainbow-fallback-dark {
        0%, 16.66% { color: #ff4444; text-shadow: 0 0 12px #ff4444, 0 0 20px rgba(255, 255, 255, 0.5); }
        16.67%, 33.33% { color: #ff9944; text-shadow: 0 0 12px #ff9944, 0 0 20px rgba(255, 255, 255, 0.5); }
        33.34%, 50% { color: #ffff44; text-shadow: 0 0 12px #ffff44, 0 0 20px rgba(255, 255, 255, 0.5); }
        50.01%, 66.66% { color: #44ff44; text-shadow: 0 0 12px #44ff44, 0 0 20px rgba(255, 255, 255, 0.5); }
        66.67%, 83.33% { color: #4499ff; text-shadow: 0 0 12px #4499ff, 0 0 20px rgba(255, 255, 255, 0.5); }
        83.34%, 100% { color: #9944ff; text-shadow: 0 0 12px #9944ff, 0 0 20px rgba(255, 255, 255, 0.5); }
    }
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.danmaku-effect-bounce {
    animation: bounce 1s infinite;
    color: #ffffff !important;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
    40%, 43% { transform: translateY(-10px); }
    70% { transform: translateY(-5px); }
    90% { transform: translateY(-2px); }
}

.danmaku-effect-zoom {
    animation: zoom-pulse 2s infinite;
    color: #ffffff !important;
}

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

/* 暗色主题下的特殊处理 */
[data-theme="dark"] .danmaku-content {
    background: rgba(40, 40, 40, 0.9); /* 暗主题下稍微亮一点的背景 */
}

[data-theme="dark"] .danmaku-text,
[data-theme="dark"] .danmaku-user {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* 亮色主题下确保文字可见 */
[data-theme="light"] .danmaku-text,
[data-theme="light"] .danmaku-user {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* 兼容性处理 - 对于不支持渐变文本的浏览器 */
@supports not (-webkit-background-clip: text) {
    .tashuo-chat-name.vip,
    .danmaku-user.vip {
        color: #57b401 !important;
        font-weight: 700;
        -webkit-text-fill-color: #57b401;
    }
    
    .tashuo-chat-name.svip,
    .danmaku-user.svip {
        color: #f56c6c !important;
        font-weight: 700;
        -webkit-text-fill-color: #f56c6c;
    }
    
    .tashuo-chat-name.annual,
    .danmaku-user.annual {
        color: #ff9800 !important;
        font-weight: 700;
        -webkit-text-fill-color: #ff9800;
    }
    
    .tashuo-chat-name.enterprise,
    .danmaku-user.enterprise {
        color: #8b4513 !important;
        font-weight: 800;
        -webkit-text-fill-color: #8b4513;
    }
    
    .tashuo-chat-name.admin,
    .danmaku-user.admin {
        color: #6a11cb !important;
        font-weight: 800;
        -webkit-text-fill-color: #6a11cb;
    }
    
    .tashuo-chat-name.super-admin,
    .danmaku-user.super-admin {
        color: #ffd700 !important;
        font-weight: 800;
        -webkit-text-fill-color: #ffd700;
    }
}

/* 完整AI审核意见的打字机效果 */
.tashuo-typewriter-complete {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.4;
    max-width: 100%;
}

/* 打字机光标动画 */
@keyframes blink-caret {
    from, to { 
        border-color: transparent;
    }
    50% { 
        border-color: var(--primary-green);
    }
}

/* 权限控制相关样式 */
.format-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

.permission-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.format-disabled:hover .permission-tooltip {
    opacity: 1;
} 

/* 桌面端和移动端显示控制 */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

.desktop-avatar {
    display: block;
}

.tashuo-avatar-and-type {
    display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
    
    .desktop-avatar {
        display: none;
    }
    
    .tashuo-avatar-and-type {
        display: flex;
        align-items: center;
        justify-content: space-between; /* 左侧头像，右侧类型选择 */
        gap: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .tashuo-input-wrapper {
        flex-direction: column; /* 改为垂直布局 */
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .tashuo-avatar {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }
    
    .tashuo-input-container {
        padding: 1rem;
    }
    
    .tashuo-messages-container {
        padding: 1rem;
        height: 300px;
    }
    
    .tashuo-input-main {
        flex-direction: column;
        align-items: stretch;
        width: 100%; /* 占满整个宽度，不受头像影响 */
        margin-left: 0; /* 取消缩进 */
    }
    
    .tashuo-type-selector {
        min-width: auto;
        width: 120px; /* 控制宽度使其更美观 */
        flex-shrink: 0;
    }
    
    .tashuo-textarea {
        width: 100%; /* 占满整个宽度 */
        margin: 0; /* 取消边距 */
    }
    
    .tashuo-send-btn {
        width: 100%;
        justify-content: center;
        margin: 0; /* 取消边距 */
    }
    
    .tashuo-format-toolbar {
        justify-content: flex-start; /* 左对齐图标 */
        align-items: center;
        gap: 0.5rem;
        width: 100%; /* 占满整个宽度 */
        margin: 0; /* 取消边距 */
    }
    
    .tashuo-settings-btn {
        margin-left: auto; /* 设置按钮保持在右侧 */
        height: 32px; /* 与左侧图标高度一致 */
        display: flex;
        align-items: center;
    }
    
    .tashuo-format-btn {
        height: 32px; /* 确保所有按钮高度一致 */
        width: 32px;
    }
    
    .tashuo-chat-bubble {
        max-width: 100%;
    }
} 

/* 暗色主题下的设置弹窗优化 */
[data-theme="dark"] .tashuo-settings-overlay .modal-container {
    background: rgba(15, 23, 42, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .tashuo-settings-overlay .modal-header {
    background: rgba(30, 41, 59, 0.8) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .tashuo-settings-content .setting-item {
    background: rgba(30, 41, 59, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* 确保设置弹窗显示的额外保证 */
.tashuo-settings-overlay {
    animation: fadeIn 0.3s ease-out !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
} 