/**
 * 广告屏蔽检测通知样式
 *
 * @version 2.0
 * @date 2025-11-06
 * @features
 *   - 优雅的渐变背景
 *   - 平滑的淡入淡出动画
 *   - 响应式移动端适配
 *   - 多语言布局支持
 *   - 深色主题兼容
 */

/* ========== 通知条主体 ========== */
.adblock-notice {
    /* 定位 */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;

    /* 外观 */
    background: linear-gradient(135deg, var(--color-brand-secondary) 0%, var(--color-brand-primary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px 20px;

    /* 动画（初始状态：隐藏在顶部） */
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 显示状态 */
.adblock-notice.show {
    transform: translateY(0);
    opacity: 1;
}

/* 隐藏状态 */
.adblock-notice.hide {
    transform: translateY(-100%);
    opacity: 0;
}

.adblock-notice--mobile.hide {
    transform: translateY(100%);
}

/* ========== 内容布局 ========== */
.adblock-notice-content {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

/* 图标 */
.adblock-notice-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

/* 文本区域 */
.adblock-notice-text {
    flex: 1;
    min-width: 200px;
}

.adblock-notice-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
    font-weight: 600;
    line-height: 1.3;
}

.adblock-notice-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
    line-height: 1.4;
}

/* ========== 按钮组 ========== */
.adblock-notice-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* VIP 按钮（最突出） */
.btn-vip {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: #1a1a1a;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-height: 40px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.btn-vip:hover {
    background: linear-gradient(135deg, #ffdf00 0%, #ffc700 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 215, 0, 0.6);
}

.btn-vip:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

/* 主按钮（知道了） */
.btn-primary {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 36px;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 次要按钮（今天不再提醒） */
.btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 36px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.1);
}

/* 文字链接（一周内不提示） */
.link-dismiss {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.link-dismiss:hover {
    color: white;
    text-decoration: none;
}

/* 关闭按钮（×） */
.btn-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    padding: 0 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    margin-left: auto;
    min-width: 36px;
    min-height: 36px;
}

.btn-close:hover {
    opacity: 1;
}

/* 帮助链接 */
.help-link {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    text-decoration: underline;
    white-space: nowrap;
    transition: color 0.2s ease;
    display: inline-block;
    margin-top: 4px;
}

.help-link:hover {
    color: white;
    text-decoration: none;
}

/* ========== Toast 反馈提示 ========== */
.adblock-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;

    /* 动画（初始状态：隐藏） */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Toast 显示状态 */
.adblock-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========== 响应式设计 ========== */

/* 平板和小屏幕 */
@media (max-width: 768px) {
    .adblock-notice {
        top: auto;
        bottom: 0;
        padding: 10px 15px;
        transform: translateY(100%);
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.18);
    }

    .adblock-notice-content {
        gap: 12px;
    }

    .adblock-notice-icon {
        font-size: 20px;
    }

    .adblock-notice-text strong {
        font-size: 14px;
    }

    .adblock-notice-text p {
        font-size: 13px;
    }

    .adblock-notice-icon,
    .help-link {
        display: none;
    }

    /* 按钮组占满宽度 */
    .adblock-notice-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
    }

    /* 按钮尺寸调整 */
    .btn-vip {
        font-size: 14px;
        padding: 9px 20px;
        min-height: 36px;
        order: -1; /* VIP 按钮优先显示 */
        width: 100%;
        justify-content: center;
    }

    .btn-primary,
    .btn-secondary {
        font-size: 13px;
        padding: 7px 14px;
        min-height: 32px;
    }

    /* 关闭按钮移到右上角 */
    .btn-close {
        position: absolute;
        top: 10px;
        right: 10px;
        margin-left: 0;
    }

    /* Toast 位置调整 */
    .adblock-toast {
        bottom: 15px;
        right: 15px;
        left: 15px;
        text-align: center;
    }
}

/* 小手机 */
@media (max-width: 480px) {
    .adblock-notice {
        padding: 8px 12px;
    }

    .adblock-notice-text strong {
        font-size: 13px;
    }

    .adblock-notice-text p {
        font-size: 12px;
    }

    .btn-vip {
        font-size: 13px;
        padding: 8px 18px;
        min-height: 34px;
    }

    .btn-primary,
    .btn-secondary {
        font-size: 12px;
        padding: 6px 12px;
        flex: 1;
        min-width: 80px;
    }

    .link-dismiss {
        font-size: 12px;
        width: 100%;
        text-align: center;
        margin-top: 4px;
    }
}

/* ========== 长文本语言适配 ========== */

/* 波兰语、德语等长词语言 */
[lang="pl"] .adblock-notice-text p,
[lang="de"] .adblock-notice-text p {
    font-size: 13px;
    word-break: break-word;
}

/* 泰语、日语等特殊字体 */
[lang="th"] .adblock-notice-text,
[lang="ja"] .adblock-notice-text,
[lang="ko"] .adblock-notice-text {
    line-height: 1.6;
}

/* ========== RTL 语言支持（阿拉伯语、希伯来语，预留） ========== */
[dir="rtl"] .adblock-notice-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .btn-close {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .adblock-notice-actions {
    flex-direction: row-reverse;
}

/* ========== 深色主题适配 ========== */
[data-theme="dark"] .adblock-notice {
    background: linear-gradient(135deg, var(--color-brand-secondary) 0%, var(--color-bg-secondary) 100%);
}

[data-theme="dark"] .adblock-toast {
    background: rgba(45, 55, 72, 0.95);
}

/* ========== 高对比度模式支持 ========== */
@media (prefers-contrast: high) {
    .adblock-notice {
        border: 2px solid white;
    }

    .btn-primary,
    .btn-secondary {
        border-width: 2px;
    }
}

/* ========== 减少动画模式（可访问性） ========== */
@media (prefers-reduced-motion: reduce) {
    .adblock-notice,
    .adblock-toast,
    .btn-primary,
    .btn-secondary {
        transition: none;
    }
}

/* ========== 打印样式（隐藏通知） ========== */
@media print {
    .adblock-notice,
    .adblock-toast {
        display: none !important;
    }
}
