/* 插件容器布局 */
.plugin-container {
    display: flex;
    gap: 0;
    align-items: flex-start;
    max-width: 1650px;
    margin: 0 auto;
}

/* 评论区域容器样式 */
.comment-section {
    margin-top: 0;
    padding-top: 20px;
    width: 100%;
}

.comment-container {
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    max-width: 90%;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.plugin-main-content {
    flex: 1;
    min-width: 0;
    padding-right: 0;
}

/* 随机工具侧边栏 */
.random-tools-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    margin-left: 20px;
    align-self: flex-start;
    height: fit-content;
    z-index: 10;
}

/* 确保侧边栏和主内容高度一致 */
.plugin-container {
    align-items: stretch;
}

/* 调整工具页面白色背景卡片宽度 */
.plugin-main-content .container-xl {
    max-width: 100% !important;
    padding: 0;
}

.plugin-main-content .center-block {
    max-width: 100% !important;
    width: 100% !important;
}

/* 调整主内容区域卡片宽度 */
.plugin-main-content .card {
    max-width: 90%;
    margin: 0 auto;
}

.sidebar-card {
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    overflow: hidden;
    margin: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    color: #555;
    border-bottom: 1px solid #eee;
}

.sidebar-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-title .icon {
    font-size: 14px;
}

.refresh-btn {
    background: #ffffff;
    border: 1px solid #dee2e6;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.refresh-btn .icon {
    font-size: 12px;
}

.refresh-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.sidebar-content {
    padding: 12px 16px;
}

.random-tools-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.random-tool-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #ffffff;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.random-tool-item:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.random-tool-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
    background: white;
    padding: 2px;
    border: 1px solid #eee;
}

.random-tool-name {
    flex: 1;
    font-size: 12px;
    color: #555;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.random-tool-item:hover .random-tool-name {
    color: #007bff;
}

/* 舔狗日记样式 */
.dog-diary-container {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dog-diary-content {
    text-align: center;
    padding: 16px;
    border-radius: 6px;
}

.dog-diary-content p {
    margin: 0;
    font-size: 13px;
    color: inherit;
    line-height: 1.6;
    font-style: normal;
}

/* 暗黑模式下的舔狗日记样式 */
body.dark-mode .dog-diary-content p {
    color: inherit;
}

/* 背景颜色标签通用样式 */
.bg-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    background-color: #007bff;
    white-space: nowrap;
}

/* 随机工具背景标签 */
.bg-tag.bg-tools {
    background-color: #17a2b8;
}

/* 舔狗日记背景标签 */
.bg-tag.bg-diary {
    background-color: #dc3545;
}

/* 随机文章背景标签 */
.bg-tag.bg-article {
    background-color: #28a745;
}

/* 换一换按钮背景标签 */
.bg-tag.bg-refresh {
    background-color: #6c757d;
}

/* 暗黑模式下的背景标签样式 */
body.dark-mode .bg-tag {
    opacity: 0.9;
}

/* 随机文章日期样式 */
.random-article-date {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* 随机文章样式 */
.random-article-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: #ffffff;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.random-article-item:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.random-article-title {
    font-size: 12px;
    color: #555;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.random-article-item:hover .random-article-title {
    color: #007bff;
}



/* 加载状态 */
.loading-tools {
    text-align: center;
    padding: 16px;
    color: #6c757d;
}

.loading-tools .icon {
    font-size: 16px;
    animation: spin 1s linear infinite;
}

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

/* 响应式设计优化 - 侧边栏始终固定在右侧 */
@media (max-width: 1200px) {
    .plugin-container {
        /* 保持flex布局，不切换为column */
        max-width: 100%;
    }
    
    .plugin-main-content {
        /* 主内容区域自动适应剩余空间 */
        padding-right: 0;
    }
    
    .random-tools-sidebar {
        /* 保持固定宽度和右侧位置 */
        width: 260px; /* 稍微缩小宽度以适应较小屏幕 */
        position: sticky;
        top: 20px;
        margin-left: 15px;
        align-self: flex-start;
        height: fit-content;
        z-index: 10;
    }
    
    .sidebar-card {
        margin: 0;
    }
}

@media (max-width: 768px) {
    .random-tools-sidebar {
        display: none;
    }
    
    .plugin-main-content {
        width: 100%;
        padding-right: 0;
    }
    
    .plugin-container {
        gap: 0;
    }
}

/* 仅手机显示类 - 现在调整为在所有设备上显示 */
.mobile-only {
    display: block;
}

/* 添加特定按钮的样式，确保在所有设备上显示 */
.mt-5.text-center a.btn-outline-danger,
.mt-5.text-center a.btn-outline-light,
.mt-5.text-center a.btn-outline-primary {
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* 暗黑模式适配 */
body.dark-mode .sidebar-card {
    background: #242424;
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode .random-tool-item {
    background: #2a2a2a;
    border-color: rgba(255,255,255,0.1);
}

body.dark-mode .random-tool-item:hover {
    background: #333;
    border-color: rgba(255,255,255,0.2);
}

body.dark-mode .random-tool-name {
    color: #ddd;
}

body.dark-mode .random-tool-item:hover .random-tool-name {
    color: #a78bfa;
}

/* 暗黑模式下的随机文章样式 */
body.dark-mode .random-article-item {
    background: #2a2a2a;
    border-color: rgba(255,255,255,0.1);
}

body.dark-mode .random-article-item:hover {
    background: #333;
    border-color: rgba(255,255,255,0.2);
}

body.dark-mode .random-article-title {
    color: #ddd;
}

body.dark-mode .random-article-item:hover .random-article-title {
    color: #a78bfa;
}

body.dark-mode .random-tool-icon {
    background: #242424;
    border-color: rgba(255,255,255,0.1);
}

body.dark-mode .sidebar-header {
    background: #1a1a1a;
    color: #ddd;
    border-color: rgba(255,255,255,0.1);
}

body.dark-mode .refresh-btn {
    background: #242424;
    border-color: rgba(255,255,255,0.1);
    color: #ddd;
}

body.dark-mode .refresh-btn:hover {
    background: #333;
    border-color: rgba(255,255,255,0.2);
}