/* SU Shortcodes 样式 */

/* Row 样式 */
.su-row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

/* Column 样式 */
.su-column {
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

/* Column 尺寸 */
.su-column-size-1-1 {
    width: 100%;
}

.su-column-size-1-2 {
    width: 50%;
}

.su-column-size-1-3 {
    width: 33.333333%;
}

.su-column-size-2-3 {
    width: 66.666667%;
}

.su-column-size-1-4 {
    width: 25%;
}

.su-column-size-3-4 {
    width: 75%;
}

.su-column-size-1-5 {
    width: 20%;
}

.su-column-size-2-5 {
    width: 40%;
}

.su-column-size-3-5 {
    width: 60%;
}

.su-column-size-4-5 {
    width: 80%;
}

.su-column-size-1-6 {
    width: 16.666667%;
}

.su-column-size-5-6 {
    width: 83.333333%;
}

/* Column 居中 */
.su-column-center {
    text-align: center;
}

/* 响应式图片缩放 */
.su-column-responsive-img img {
    max-width: 100%;
    height: auto;
    display: block;
}

.su-column-responsive-img img.aligncenter {
    margin-left: auto;
    margin-right: auto;
}

/* Expand 样式 */
.su-expand {
    margin: 20px 0;
}

.su-expand-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.su-expand-content.su-expand-collapsed {
    max-height: inherit !important;
}

.su-expand-link {
    text-align: center;
    margin-top: 10px;
}

.su-expand-link a {
    display: inline-block;
    padding: 8px 15px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.su-expand-link a:hover {
    background: #e5e5e5;
}

.su-expand-icon {
    font-size: 14px;
}

/* Spoiler 样式 - 使用 HTML5 details/summary */
.su-spoiler {
    margin: 15px 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.su-spoiler summary.su-spoiler-title {
    padding: 10px 15px;
    cursor: pointer;
    user-select: none;
    background: rgba(0, 0, 0, 0.03);
    transition: background 0.2s;
    list-style: none;
    outline: none;
}

/* 隐藏默认的三角形标记 */
.su-spoiler summary::-webkit-details-marker {
    display: none;
}

.su-spoiler summary.su-spoiler-title:hover {
    background: rgba(0, 0, 0, 0.06);
}

.su-spoiler-icon {
    display: inline-block;
    transition: transform 0.2s;
    margin-right: 5px;
    opacity: 0.6;
}

.su-spoiler[open] .su-spoiler-icon {
    transform: rotate(90deg);
}

.su-spoiler-content {
    padding: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fancy 风格 */
.su-spoiler-style-fancy summary.su-spoiler-title {
    background: rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

.su-spoiler-style-fancy summary.su-spoiler-title:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .su-column {
        width: 100% !important;
        margin-bottom: 20px;
    }
}

/* ==============================
   QR Code 样式 - 网盘下载
   ============================== */
.su-download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin: 12px 0;
    position: relative;
    transition: all 0.3s ease;
}

.su-download-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 左侧信息区 */
.su-download-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

/* 图标 */
.su-download-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

/* 默认图标（备用） */
.su-icon-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.su-icon-aliyun {
    background: linear-gradient(135deg, #ff6a00 0%, #ee0979 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.su-icon-115 {
    background: linear-gradient(135deg, #0fb8ad 0%, #1fc8db 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.su-icon-ctfile {
    background: linear-gradient(135deg, #4e54c8 0%, #8f94fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

/* 文本信息 */
.su-download-text {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.su-download-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.su-download-code {
    font-size: 13px;
    color: #6b7280;
}

.su-download-code strong {
    color: #7c3aed;
    font-weight: 700;
}

/* 推荐角标 */
.su-download-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    font-size: 11px;
    border-radius: 6px;
    font-weight: 700;
    margin-left: 4px;
}

/* 右侧下载按钮 */
.su-download-btn {
    padding: 10px 28px;
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
    white-space: nowrap;
    flex-shrink: 0;
}

.su-download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
    background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 100%);
}

/* ==============================
   1. 悬停小弹窗
   ============================== */
.su-qr-hover-popup {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    min-width: 320px;
    background: #ffffff !important;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    color-scheme: only light;
}

.su-qr-hover-popup::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #f9fafb;
}

.su-qr-hover-popup-header {
    padding: 16px 20px 10px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%) !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.su-qr-hover-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827 !important;
    text-align: center;
}

.su-qr-hover-popup-content {
    padding: 18px 20px;
    text-align: center;
    background: #ffffff !important;
}

.su-qr-hover-tip {
    margin: 0 0 16px;
    font-size: 13px;
    color: #6b7280 !important;
    line-height: 1.6;
}

.su-qr-hover-image {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.su-qr-hover-image svg {
    max-width: 280px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.su-qr-hover-code {
    margin: 0;
    font-size: 14px;
    color: #374151 !important;
    font-weight: 500;
}

.su-qr-hover-code strong {
    color: #7c3aed !important;
    font-size: 16px;
    font-weight: 700;
}

.su-qr-hover-popup-footer {
    padding: 12px 20px 16px;
    background: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
}

.su-qr-hover-footer-tip {
    margin: 0;
    font-size: 12px;
    color: #9ca3af !important;
    text-align: center;
    line-height: 1.5;
}

/* 悬停显示：鼠标放在整个横条上都显示，且没有打开大弹窗时 */
.su-download-item:hover:not(.su-qr-modal-open) .su-qr-hover-popup {
    display: block;
}

/* ==============================
   2. 点击大弹窗
   ============================== */
.su-qr-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

.su-qr-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    min-width: 340px;
    max-width: 400px;
    background: white !important;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 1px solid #e5e7eb !important;
    color-scheme: only light;
}

.su-qr-modal-header {
    padding: 18px 20px 12px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%) !important;
    border-bottom: 1px solid #e5e7eb !important;
    position: relative;
}

.su-qr-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827 !important;
    text-align: center;
}

.su-qr-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: #ffffff !important;
    color: #6b7280 !important;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.su-qr-modal-close:hover {
    background: #f3f4f6 !important;
    color: #374151 !important;
}

.su-qr-modal-content {
    padding: 24px 20px;
    text-align: center;
    background: #ffffff !important;
}

.su-qr-modal-tip {
    margin: 0 0 20px;
    font-size: 14px;
    color: #6b7280 !important;
    line-height: 1.6;
}

.su-qr-modal-image {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.su-qr-modal-image svg {
    max-width: 320px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.su-qr-modal-code {
    margin: 0;
    font-size: 15px;
    color: #374151 !important;
    font-weight: 500;
}

.su-qr-modal-code strong {
    color: #7c3aed !important;
    font-weight: 700;
    font-size: 18px;
}

.su-qr-modal-footer {
    padding: 14px 20px 18px;
    background: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
}

.su-qr-modal-footer-tip {
    margin: 0;
    font-size: 13px;
    color: #9ca3af !important;
    text-align: center;
    line-height: 1.5;
}

/* 点击大弹窗显示 */
.su-download-item.su-qr-modal-open .su-qr-overlay,
.su-download-item.su-qr-modal-open .su-qr-modal {
    display: block;
}

.su-download-item.su-qr-modal-open .su-download-btn {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

/* 错误提示 */
.su-qr-code-error {
    color: #dc2626;
    background: #fef2f2;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #fecaca;
    display: inline-block;
    font-size: 14px;
}

/* 防止广告或其他代码注入到我们的弹窗 */
.su-private-popup > *:not(.su-qr-hover-popup-header):not(.su-qr-hover-popup-content):not(.su-qr-hover-popup-footer):not(.su-qr-modal-header):not(.su-qr-modal-content):not(.su-qr-modal-footer) {
    display: none !important;
}

.su-private-popup .su-qr-hover-popup-content > *:not(.su-qr-hover-tip):not(.su-qr-hover-image):not(.su-qr-hover-code) {
    display: none !important;
}

.su-private-popup .su-qr-modal-content > *:not(.su-qr-modal-tip):not(.su-qr-modal-image):not(.su-qr-modal-code) {
    display: none !important;
}

.su-private-popup .su-qr-hover-popup-header > *:not(.su-qr-hover-title) {
    display: none !important;
}

.su-private-popup .su-qr-modal-header > *:not(.su-qr-modal-title):not(.su-qr-modal-close) {
    display: none !important;
}

.su-private-popup .su-qr-hover-popup-footer > *:not(.su-qr-hover-footer-tip) {
    display: none !important;
}

.su-private-popup .su-qr-modal-footer > *:not(.su-qr-modal-footer-tip) {
    display: none !important;
}

/* 还防止伪元素注入 */
.su-private-popup *::before,
.su-private-popup *::after {
    content: none !important;
}

/* ==============================
   暗色模式强制保护 - 终极方案
   ============================== */
/* 强制弹窗在任何情况下都保持浅色模式 */
.su-qr-hover-popup,
.su-qr-modal,
.su-private-popup {
    /* 强制颜色方案为浅色 - 终极 */
    color-scheme: only light !important;
    /* 强制背景色 */
    background-color: #ffffff !important;
    /* 防止浏览器自动应用暗色滤镜 */
    filter: none !important;
    -webkit-filter: none !important;
    /* 强制文字颜色 */
    color: #111827 !important;
    /* 强制不调整颜色 */
    forced-color-adjust: none !important;
    /* 禁用任何可能的暗色模式覆盖 */
    -webkit-forced-color-adjust: none !important;
    /* 禁用浏览器的暗色模式转换 */
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    /* 强制对比度 */
    -webkit-contrast: 100% !important;
    contrast: 100% !important;
}

/* 强制所有子元素继承浅色模式 */
.su-qr-hover-popup *,
.su-qr-modal *,
.su-private-popup * {
    color-scheme: only light !important;
    filter: none !important;
    -webkit-filter: none !important;
    forced-color-adjust: none !important;
    -webkit-forced-color-adjust: none !important;
}

/* 专门针对二维码 SVG 的强制保护 */
.su-qr-hover-image svg,
.su-qr-modal-image svg {
    color-scheme: only light !important;
    filter: none !important;
    -webkit-filter: none !important;
    background-color: #ffffff !important;
    mix-blend-mode: normal !important;
}

/* 强制浏览器不应用暗色模式到弹窗 - 使用所有可能的选择器 */
html body .su-qr-hover-popup,
html body .su-qr-modal,
html body .su-private-popup {
    color-scheme: only light !important;
    background-color: #ffffff !important;
    color: #111827 !important;
    filter: none !important;
}

/* 强制在任何系统设置下保持浅色 */
@media (prefers-color-scheme: dark) {
    .su-qr-hover-popup,
    .su-qr-modal,
    .su-private-popup {
        color-scheme: only light !important;
        background-color: #ffffff !important;
        color: #111827 !important;
    }
    
    .su-qr-hover-popup *,
    .su-qr-modal *,
    .su-private-popup * {
        color-scheme: only light !important;
    }
    
    .su-qr-hover-image svg,
    .su-qr-modal-image svg {
        background-color: #ffffff !important;
        filter: none !important;
        -webkit-filter: none !important;
        color-scheme: only light !important;
    }
}

/* 强制所有浏览器都不应用暗色模式 */
@supports (-ms-ime-align: auto) {
    .su-qr-hover-popup,
    .su-qr-modal,
    .su-private-popup {
        color-scheme: only light !important;
    }
}

@-moz-document url-prefix() {
    .su-qr-hover-popup,
    .su-qr-modal,
    .su-private-popup {
        color-scheme: only light !important;
    }
}
