/* ==========================================================================
   网盘下载插件 · 前台卡片样式（仅前台加载，体积比后台全套小一半）
   与 assets/netdisk.css 中的卡片段落保持一致；改卡片样式时两边同步。
   ========================================================================== */

/* 跟随系统深色模式（由插件设置 auto_dark 打开）：用 !important 覆盖卡片里的 inline 样式 */
@media (prefers-color-scheme: dark) {
    .em-netdisk--auto-dark {
        background: #161a21 !important;
        border-color: #2b3444 !important;
        box-shadow: none !important;
    }
    .em-netdisk--auto-dark .em-netdisk__title { color: #eef2f8 !important; }
    .em-netdisk--auto-dark .em-netdisk__meta { color: #98a4b8 !important; }
    .em-netdisk--auto-dark .em-netdisk__chip { background: #232935 !important; color: #c3cbd8 !important; }
    .em-netdisk--auto-dark .em-netdisk__chip b { color: #e6ebf3 !important; }
    .em-netdisk--auto-dark .em-netdisk__share { background: #1e2839 !important; color: #8db4ff !important; }
    .em-netdisk--auto-dark .em-netdisk__btn--alt {
        background: #161a21 !important;
    }
}

/* 前台轻提示（点下载自动复制提取码后出现） */
.em-netdisk__toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 12px);
    max-width: 86vw;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(23, 31, 45, .92);
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 99999;
}
.em-netdisk__toast.is-show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* 卡片底部说明 */
.em-netdisk__note { word-break: break-word; }

/* 打码后的提取码：点一下才显示 */
.em-netdisk__chip.is-masked b { color: #8a93a5 !important; }

.em-netdisk {
    margin: 22px 0;
    padding: 14px 16px;
    border: 1px solid #e8ebf2;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 1px 2px rgba(20, 28, 45, .04);
    box-sizing: border-box;
    transition: border-color .18s ease, box-shadow .18s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

.em-netdisk:hover {
    border-color: #d7e2ff;
    box-shadow: 0 6px 18px rgba(47, 107, 255, .1);
}

.em-netdisk__badge {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 44px;
    text-align: center;
    letter-spacing: .5px;
}

.em-netdisk__title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1f2430;
    line-height: 1.45;
    word-break: break-word;
}

.em-netdisk__meta {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #7b8494;
    line-height: 1.6;
}

.em-netdisk__code {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 4px;
    background: #f2f4f8;
    color: #5b6472;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.em-netdisk__code:hover { background: #e8ecf4; color: #2f6bff; }

.em-netdisk__code:focus-visible {
    outline: 2px solid rgba(47, 107, 255, .45);
    outline-offset: 1px;
}

.em-netdisk__code b {
    font-weight: 600;
    letter-spacing: .5px;
    color: #374151;
}

/* 卡片里可点击复制的信息片段（提取码 / 解压密码） */
.em-netdisk__chip { cursor: pointer; }

.em-netdisk__size { white-space: nowrap; }

/* 一键复制「标题 + 链接 + 提取码」，方便读者转发 */
.em-netdisk__share {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f1f5ff;
    color: #2f6bff;
    font-size: 12px;
    line-height: 18px;
    cursor: pointer;
    text-decoration: none;
}

.em-netdisk__share:hover { text-decoration: underline; }

.em-netdisk__share:focus-visible {
    outline: 2px solid rgba(47, 107, 255, .45);
    outline-offset: 1px;
}

/* 多下载源时右侧按钮组 */
.em-netdisk__links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex: none;
}

/* 卡片样式：line / plain 用 !important 覆盖卡片上的 inline 样式 */
.em-netdisk--line {
    padding: 12px 0 !important;
    border: 0 !important;
    border-top: 1px solid #e8ebf2 !important;
    border-bottom: 1px solid #e8ebf2 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.em-netdisk--plain {
    margin: 18px 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.em-netdisk__btn {
    flex: none;
    display: inline-block;
    height: 36px;
    padding: 0 18px;
    border-radius: 8px;
    /* 不用 !important：主按钮白色、备用按钮品牌色都由卡片内联样式给出 */
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    line-height: 36px;
    text-decoration: none !important;
    white-space: nowrap;
    transition: filter .16s ease, opacity .15s ease, transform .16s ease;
}

.em-netdisk__btn:hover {
    filter: brightness(1.06);
    opacity: .96;
    transform: translateY(-1px);
}

.em-netdisk__btn:active {
    filter: brightness(.96);
    transform: none;
}

.em-netdisk__btn:focus-visible {
    outline: 2px solid rgba(47, 107, 255, .45);
    outline-offset: 2px;
}

@media (max-width: 520px) {
    .em-netdisk { padding: 12px; gap: 10px; }
    .em-netdisk__badge { width: 40px; height: 40px; line-height: 40px; border-radius: 10px; }
    /* 窄屏按钮组独占一行：主按钮铺满，备用网盘按钮两列平分 */
    .em-netdisk__links { width: 100% !important; }
    .em-netdisk__btn {
        height: 34px;
        line-height: 34px;
        padding: 0 14px;
        width: 100% !important;
        text-align: center;
        box-sizing: border-box;
        margin-top: 2px;
    }
    .em-netdisk__btn--alt { width: auto !important; flex: 1 1 auto; }
}


/* v1.3.30 前台富文本过滤会清掉 data-*，卡片数据改由这个隐藏节点承载 */
.em-netdisk__data { display: none !important; }

/* 付费解锁卡片 */
.em-netdisk--paid { border-color: #f0e3d2; }
.em-netdisk__btn--paid { background: linear-gradient(135deg, #ff9433, #e06b00) !important; color: #fff !important; }
.em-netdisk__btn--paid:hover { filter: brightness(1.04); }
.em-netdisk--auto-dark .em-netdisk__btn--paid { background: linear-gradient(135deg, #ff9d45, #f07a12) !important; }
