/* 左侧媒体分享工具栏的响应式样式 */
@media (max-width: 1023px) {
    .sidebar-right-container,
    .sidebar-left-container,
    .left-multimedia-tools {
        display: none !important;
    }
    .main-content-grid {
        grid-template-columns: 1fr !important;
        max-width: 890px;
        margin: 0 auto;
    }
}

.left-multimedia-tools {
    position: fixed;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-left: 68px;
}

/* 统一作者头像样式，与按钮保持一致 */
.author-avatar-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ffffff;
    transition: all 0.25s ease;
    background: #ffffff;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 深色模式头像样式 */
@media (prefers-color-scheme: dark) {
    .author-avatar-wrapper {
        border-color: #1f2937;
        background: #1f2937;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
}

body.dark .author-avatar-wrapper {
    border-color: #1f2937;
    background: #1f2937;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.author-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* 统一悬停效果 */
.author-avatar-wrapper:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.author-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.author-avatar-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    transition: all 0.3s ease;
}

.author-avatar-wrapper:hover {
    transform: scale(1.1);
}

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

.left-multimedia-tools.position-center {
    top: 50%;
    transform: translateY(-50%);
}

.left-multimedia-tools.position-top {
    top: 200px;
}

.left-multimedia-tools.position-bottom {
    bottom: 100px;
}

.left-multimedia-tools {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

/* 统一媒体按钮样式 */
.multimedia-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.25s ease;
    position: relative;
}

/* 深色模式样式 */
@media (prefers-color-scheme: dark) {
    .multimedia-btn {
        background: transparent;
        border-color: rgba(209, 213, 219, 0.2);
        color: #d1d5db;
        box-shadow: none;
    }
}

body.dark .multimedia-btn {
    background: transparent;
    border-color: rgba(209, 213, 219, 0.2);
    color: #d1d5db;
    box-shadow: none;
}

/* 统一工具提示样式 */
.multimedia-tooltip {
    position: absolute;
    left: 54px;
    background: #1f2937;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 工具提示箭头 */
.multimedia-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-right-color: #1f2937;
}

.multimedia-btn:hover .multimedia-tooltip {
    opacity: 1;
    visibility: visible;
    left: 52px;
}

/* 统一数量显示样式 - 只显示数字 */
.multimedia-count {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 6px;
    background: transparent;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    padding: 0;
    border-radius: 0;
    min-width: 20px;
    width: auto;
    text-align: center;
    box-shadow: none;
    z-index: 10;
    border: none;
    display: inline-block;
}

/* 深色模式下的数量显示样式 */
@media (prefers-color-scheme: dark) {
    .multimedia-count {
        background: transparent;
        color: #d1d5db;
        box-shadow: none;
        border: none;
    }
}

body.dark .multimedia-count {
    background: transparent;
    color: #d1d5db;
    box-shadow: none;
    border: none;
}

@media (max-width: 1279px) {
    .left-multimedia-tools {
        display: none !important;
    }
}

/* 标题显示区域样式 */
#pageTitleDisplay {
    transition: all 0.3s ease;
    min-width: 0;
    max-width: 0;
    opacity: 0;
    flex-grow: 0;
}

#pageTitleDisplay.visible {
    opacity: 1;
    min-width: auto;
    max-width: 600px;
    flex-grow: 1;
}

#pageTitleDisplay h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

/* 搜索容器样式 */
#desktopSearchContainer {
    transition: all 0.3s ease;
    max-width: 400px;
    flex-shrink: 0;
}

#desktopSearchContainer.small {
    max-width: 200px;
}

#desktopSearchContainer input {
    transition: all 0.3s ease;
}

/* 手机端隐藏标题显示 */
@media (max-width: 1023px) {
    #pageTitleDisplay {
        display: none !important;
    }
}

/* 文章内容样式 */
.prose {
    @apply text-gray-900 dark:text-gray-100;
}

.prose h2 {
    @apply text-xl font-bold text-gray-900 mb-4 dark:text-white;
}

.prose h3 {
    @apply text-lg font-semibold text-gray-900 mb-3 dark:text-white;
}

.prose p {
    @apply text-gray-700 dark:text-gray-300 mb-4 leading-relaxed;
}

.prose a {
    @apply text-primary hover:text-primary/80 transition-colors underline-offset-2 hover:underline;
}

.prose img {
    /* 图片优先使用原图，如果原图大于内容框，自适应铺满 */
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin: 1.5rem auto;
    transition: all 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: high-quality;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 确保图片加载时保持正确比例，避免布局偏移 */
    aspect-ratio: attr(width) / attr(height);
    display: block;
}

.prose img:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.prose blockquote {
    @apply border-l-4 border-primary pl-4 italic text-gray-700 dark:text-gray-300;
}

.prose code {
    @apply bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded text-sm font-mono;
}

.prose pre {
    @apply bg-gray-900 text-white rounded-lg p-4 overflow-x-auto shadow-md;
}

.prose ul, .prose ol {
    @apply pl-6 mb-4;
}

.prose li {
    @apply mb-2;
}

.prose table {
    @apply w-full border-collapse;
}

.prose th, .prose td {
    @apply border border-gray-200 dark:border-gray-700 px-4 py-2;
}

.prose th {
    @apply bg-gray-50 dark:bg-gray-800 font-semibold;
}

#pageTitleDisplay a,
#pageTitleDisplay span,
#pageTitleDisplay h1 {
    display: inline-block;
    vertical-align: middle;
}

#mainNav {
    transition: all 0.3s ease;
}

@media (max-width: 1023px) {
    #pageTitleDisplay {
        display: none !important;
    }
}
