/* 基础变量定义 */
:root {
    --primary-color: #00f7ff;
    --secondary-color: #0051ff;
    --accent-color: #ff00f7;
    --dark-bg: #0a0a0a;
    --light-bg: #ffffff;
    --card-bg-dark: rgba(16, 16, 16, 0.8);
    --card-bg-light: rgba(255, 255, 255, 0.9);
    --border-glow: 0 0 10px rgba(0, 247, 255, 0.3);
    --text-glow: 0 0 10px rgba(0, 247, 255, 0.5);
    --text-dark: #ffffff;
    --text-light: #1a1a1a;
    --code-bg-dark: rgba(255, 255, 255, 0.1);
    --code-bg-light: rgba(0, 0, 0, 0.1);
}

/* 文章容器样式 */
.post {
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(20px);
}

[data-bs-theme="dark"] .post {
    background: var(--card-bg-dark);
    border: 1px solid rgba(0, 247, 255, 0.1);
    color: var(--text-dark) !important;
}

[data-bs-theme="light"] .post {
    background: var(--card-bg-light);
    border: 1px solid rgba(0, 81, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: var(--text-light) !important;
}

/* 标题样式 */
.post h1,
.post h2,
.post h3,
.post h4,
.post h5,
.post h6 {
    margin: 1rem 0 !important;
    font-weight: bold !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
}

.post h1 { font-size: 2rem !important; }
.post h2 { font-size: 1.5rem !important; }
.post h3 { font-size: 1.25rem !important; }
.post h4 { font-size: 1.1rem !important; }
.post h5 { font-size: 1rem !important; }
.post h6 { font-size: 0.9rem !important; }

/* 标题主题样式 */
[data-bs-theme="light"] .post h1,
[data-bs-theme="light"] .post h2,
[data-bs-theme="light"] .post h3,
[data-bs-theme="light"] .post h4,
[data-bs-theme="light"] .post h5,
[data-bs-theme="light"] .post h6 {
    background: linear-gradient(45deg, var(--secondary-color), #0066cc);
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

[data-bs-theme="dark"] .post h1,
[data-bs-theme="dark"] .post h2,
[data-bs-theme="dark"] .post h3,
[data-bs-theme="dark"] .post h4,
[data-bs-theme="dark"] .post h5,
[data-bs-theme="dark"] .post h6 {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: var(--text-glow);
}

/* 文章内容基础样式 */
.post p,
.post p[style] {
    line-height: 1.8 !important;
    margin-bottom: 1.2rem !important;
    text-align: left !important;
    hyphens: auto !important;
    word-break: break-word !important;
    font-family: inherit !important;
    font-size: inherit !important;
}

/* 链接样式 */
.post a {
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

[data-bs-theme="light"] .post a {
    color: var(--secondary-color) !important;
}

[data-bs-theme="dark"] .post a {
    color: var(--primary-color) !important;
}

.post a:hover {
    transform: translateY(-2px);
    opacity: 0.8;
}

/* 列表样式 */
.post ul,
.post ol {
    padding-left: 2rem !important;
    margin: 1rem 0 !important;
}

.post li {
    margin-bottom: 0.5rem !important;
    line-height: 1.6 !important;
}

/* 代码块样式 */
.post pre,
.post code {
    font-family: monospace !important;
    border-radius: 4px !important;
    padding: 1rem !important;
    margin: 1rem 0 !important;
    overflow-x: auto !important;
}

[data-bs-theme="dark"] .post pre,
[data-bs-theme="dark"] .post code {
    background: var(--code-bg-dark) !important;
}

[data-bs-theme="light"] .post pre,
[data-bs-theme="light"] .post code {
    background: var(--code-bg-light) !important;
}

/* 表格样式 */
.post table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 1rem 0 !important;
}

.post th,
.post td {
    padding: 0.75rem !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

[data-bs-theme="dark"] .post th,
[data-bs-theme="dark"] .post td {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* 引用样式 */
.post blockquote {
    border-left: 4px solid var(--secondary-color) !important;
    margin: 1rem 0 !important;
    padding: 1rem !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

[data-bs-theme="dark"] .post blockquote {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* 图片样式 */
.post img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    margin: 1rem 0 !important;
}

/* YouTube 视频容器 */
.video-container {
    position: relative !important;
    padding-bottom: 56.25% !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 1rem 0 !important;
    border-radius: 8px !important;
}

.video-container iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* 其他元素样式覆盖 */
.post div[style],
.post span[style] {
    color: inherit !important;
    font-family: inherit !important;
    font-size: inherit !important;
}

/* 辅助类 */
.publication-date {
    color: #666;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

[data-bs-theme="dark"] .publication-date {
    color: #999;
}

.lead {
    font-size: 1.2rem;
    margin: 1.5rem 0;
}

[data-bs-theme="light"] .lead {
    color: #666;
}

[data-bs-theme="dark"] .lead {
    color: rgba(255, 255, 255, 0.75);
}

/* 强制移除任何背景 */
.post [style*="background"],
.post *[style*="background"] {
    background: none !important;
}

/* Sidebar 容器样式 - 优化布局 */
.sidebar-container {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-height: calc(100vh - 140px);
    position: sticky;
    top: 100px;
    z-index: 10;
    padding-bottom: 2rem;
}

/* Flash News 模块样式 - 调整高度 */
.flash-news-module {
    flex: 1;
    min-height: 280px;
    max-height: 400px;
    overflow-y: auto;
    position: relative;
}

/* Premium Sponsor 模块样式 - 紧凑布局 */
.premium-sponsor-module {
    flex: 0 0 auto;
    position: relative;
}

/* Advertisement 模块样式 - 紧凑布局 */
.advertisement-module {
    flex: 0 0 auto;
    position: relative;
    max-width: 100%;
}

/* Premium Sponsor 样式 - 减少内边距 */
.premium-sponsor {
    border-radius: 16px;
    padding: 1.2rem;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .premium-sponsor {
    background: var(--card-bg-dark);
    border: 1px solid rgba(0, 247, 255, 0.1);
}

[data-bs-theme="light"] .premium-sponsor {
    background: var(--card-bg-light);
    border: 1px solid rgba(0, 81, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.premium-sponsor:hover {
    transform: translateY(-2px);
}

[data-bs-theme="dark"] .premium-sponsor:hover {
    box-shadow: var(--border-glow);
}

[data-bs-theme="light"] .premium-sponsor:hover {
    box-shadow: 0 8px 25px rgba(0, 102, 204, 0.15);
}

.sponsor-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    text-align: center;
    letter-spacing: 0.5px;
}

[data-bs-theme="light"] .sponsor-title {
    background: linear-gradient(45deg, var(--secondary-color), #0066cc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-bs-theme="dark"] .sponsor-title {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: var(--text-glow);
}

.sponsor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    align-items: center;
}

.sponsor-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    height: 70px;
    background: transparent !important;
    border: none !important;
}

.sponsor-item:hover {
    transform: translateY(-2px) scale(1.02);
    text-decoration: none;
}

.sponsor-logo {
    width: 100px !important;
    height: 42px !important;
    object-fit: contain !important;
    filter: grayscale(0.3) opacity(0.8);
    transition: all 0.3s ease;
}

.sponsor-item:hover .sponsor-logo {
    filter: grayscale(0) opacity(1);
    transform: scale(1.05);
}

/* Advertisement 样式 - 优化尺寸 */
.advertisement-section {
    padding: 0;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0;
    backdrop-filter: none;
    transition: none;
    text-align: center;
}

.advertisement-section:hover {
    transform: none;
    box-shadow: none !important;
}

.advertisement-section img {
    width: 85%;
    max-width: 280px;
    height: auto;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin: 0 auto;
    display: block;
}

.advertisement-section a:hover img {
    transform: translateY(-2px);
    opacity: 0.9;
}

.advertisement-section p {
    margin-top: 0.8rem;
    margin-bottom: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--secondary-color) !important;
    opacity: 1;
}

[data-bs-theme="dark"] .advertisement-section p {
    color: var(--primary-color) !important;
}

[data-bs-theme="light"] .advertisement-section p {
    color: var(--secondary-color) !important;
}

/* 自定义滚动条样式 - 只保留Flash News的滚动条 */
.flash-news-module::-webkit-scrollbar {
    width: 4px;
}

.flash-news-module::-webkit-scrollbar-track {
    background: transparent;
}

.flash-news-module::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
    opacity: 0.6;
}

[data-bs-theme="light"] .flash-news-module::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
}

.flash-news-module::-webkit-scrollbar-thumb:hover {
    opacity: 1;
}

/* 移动端响应式 */
@@media (max-width: 991px) {
    .sidebar-container {
        position: relative !important;
        top: auto !important;
        max-height: none;
        gap: 1rem;
        padding-bottom: 1rem;
    }
    
    .flash-news-module,
    .premium-sponsor-module,
    .advertisement-module {
        position: relative;
        top: auto;
        max-height: none;
        overflow-y: visible;
        min-height: auto;
    }

    .advertisement-section img {
        width: 90%;
        max-width: 320px;
    }
}

@@media (max-width: 768px) {
    .sidebar-container {
        gap: 0.8rem;
    }

    .premium-sponsor {
        padding: 1rem;
    }

    .advertisement-section {
        padding: 0;
    }

    .sponsor-title {
        font-size: 0.95rem;
        margin-bottom: 0.6rem;
    }

    .sponsor-grid {
        gap: 0.6rem;
    }

    .sponsor-item {
        padding: 0.6rem;
        height: 60px;
    }

    .sponsor-logo {
        width: 85px !important;
        height: 35px !important;
    }

    .advertisement-section img {
        width: 95%;
    }

    .advertisement-section p {
        font-size: 0.8rem;
        margin-top: 0.6rem;
    }
}

@@media (max-width: 480px) {
    .sponsor-grid {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .sponsor-item {
        height: 55px;
    }

    .sponsor-logo {
        width: 80px !important;
        height: 32px !important;
    }

    .advertisement-section img {
        width: 100%;
        max-width: 250px;
    }
}

/* 额外的布局优化 */
@@media (min-width: 992px) and (max-height: 800px) {
    .sidebar-container {
        max-height: calc(100vh - 160px);
        gap: 1rem;
    }

    .flash-news-module {
        max-height: 350px;
        min-height: 250px;
    }

    .premium-sponsor {
        padding: 1rem;
    }

    .sponsor-item {
        height: 65px;
        padding: 0.6rem;
    }

    .sponsor-logo {
        width: 90px !important;
        height: 38px !important;
    }

    .advertisement-section img {
        width: 80%;
        max-width: 260px;
    }

    .advertisement-section p {
        font-size: 0.8rem;
        margin-top: 0.6rem;
    }

    .hero-image-link {
        display: block;
    }
    
    .hero-image {
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: cover;
    }
}


[data-bs-theme="dark"] .mexc-cta-card {
    background: rgba(0, 247, 255, 0.06) !important;
    border-color: rgba(0, 247, 255, 0.2) !important;
}
[data-bs-theme="dark"] .mexc-cta-card h6 {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}