/* ============================================================================
   附件下载卡片（{% dl id %} 生成）
   跟着站点主题色走：白天蓝、夜间粉、生化绿——用的是 custom.css 里的
   --accent / --accent-rgb 变量，所以三个模式都能自动适配。
   ========================================================================== */

.dl-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0;
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid rgba(var(--accent-rgb), .22);
    background: rgba(255, 255, 255, .55);
    text-decoration: none !important;
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.dl-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--accent-rgb), .6);
    box-shadow: 0 8px 22px rgba(var(--accent-rgb), .18);
}

.dl-icon {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 17px;
    background: rgba(var(--accent-rgb), .12);
    color: var(--accent-deep);
}

/* 文件类型淡色（低饱和，不抢主题色） */
.dl-icon.i-zip { background: rgba(224, 163, 62, .16);  color: #b57d21; }
.dl-icon.i-pdf { background: rgba(224, 90, 90, .15);   color: #c24545; }
.dl-icon.i-bin { background: rgba(111, 168, 220, .18); color: #3a7fb5; }
.dl-icon.i-img { background: rgba(88, 179, 104, .16);  color: #3e8f52; }
.dl-icon.i-code { background: rgba(138, 124, 224, .16); color: #6b5bd0; }
.dl-icon.i-net { background: rgba(70, 180, 175, .16);  color: #2f8f8a; }
.dl-icon.i-doc { background: rgba(150, 160, 175, .18); color: #67717f; }

.dl-body { flex: 1; min-width: 0; display: block; }

.dl-name {
    display: block;
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.35;
    word-break: break-all;
}

.dl-card:hover .dl-name { color: var(--accent-deep); }

.dl-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 4px;
    font-size: .76rem;
    color: rgba(var(--accent-rgb), .9);
    opacity: .8;
}

.dl-dot { opacity: .5; }

.dl-hash {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: .72rem;
    letter-spacing: .2px;
}

.dl-note {
    display: block;
    margin-top: 4px;
    font-size: .76rem;
    opacity: .65;
}

.dl-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-rgb), .38);
    background: rgba(255, 255, 255, .5);
    color: var(--accent-deep);
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: .18s ease;
}

.dl-card:hover .dl-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ---------- 多文件：清单组 ---------- */
.dl-group {
    margin: 18px 0;
    border-radius: 13px;
    overflow: hidden;
    border: 1px solid rgba(var(--accent-rgb), .22);
    background: rgba(255, 255, 255, .5);
}

.dl-group-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 16px;
    background: rgba(var(--accent-rgb), .09);
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent-deep);
}

.dl-count {
    margin-left: auto;
    font-weight: 400;
    font-size: .76rem;
    opacity: .8;
}

.dl-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-top: 1px solid rgba(var(--accent-rgb), .12);
    text-decoration: none !important;
    color: inherit;
    transition: background .15s ease;
}

.dl-row:hover { background: rgba(var(--accent-rgb), .07); }

.dl-row .dl-icon { width: 34px; height: 34px; border-radius: 9px; font-size: 14px; }
.dl-row .dl-name { font-size: .88rem; font-weight: 500; }
.dl-row .dl-meta { margin-top: 1px; font-size: .72rem; }

.dl-go {
    flex: none;
    font-size: .76rem;
    font-weight: 600;
    color: var(--accent-deep);
    opacity: .75;
}

.dl-row:hover .dl-go { opacity: 1; }

/* ---------- 失效 / 缺失 ---------- */
.dl-card.is-dead,
.dl-row.is-dead {
    opacity: .5;
    filter: grayscale(.5);
    cursor: not-allowed;
}

.dl-card.is-dead .dl-name { text-decoration: line-through; }
.dl-card.is-dead .dl-btn { border-color: rgba(var(--accent-rgb), .2); color: inherit; background: transparent; }

.dl-missing {
    font-size: .8rem;
    opacity: .7;
    border-left: 3px solid #d0453f;
    padding-left: 10px;
}

/* ---------- 夜间模式 ---------- */
html.dark-mode .dl-card,
html.dark-mode .dl-group { background: rgba(24, 27, 35, .55); }

html.dark-mode .dl-btn { background: rgba(255, 255, 255, .06); }

/* ---------- 生化模式 ---------- */
html.bio .dl-card,
html.bio .dl-group {
    border-radius: 3px;
    background: var(--bio-panel-2) !important;
    border-color: var(--bio-line);
}

html.bio .dl-card:hover { border-color: var(--bio-line-strong); }
html.bio .dl-card .dl-name,
html.bio .dl-row .dl-name { font-family: var(--bio-mono); }
html.bio .dl-meta { color: var(--bio-dim); opacity: 1; font-family: var(--bio-mono); }
html.bio .dl-btn { border-radius: 3px; background: rgba(111, 224, 138, .10); }
html.bio .dl-card:hover .dl-btn { background: var(--accent); color: #06110a; }
html.bio .dl-group-head {
    background: rgba(111, 224, 138, .08);
    color: var(--accent-deep);
    font-family: var(--bio-mono);
    letter-spacing: .5px;
}
html.bio .dl-row { border-top-color: var(--bio-line); }
html.bio .dl-row:hover { background: rgba(111, 224, 138, .08); }
html.bio .dl-go { color: var(--accent); }

/* ============================================================================
   下载倒计时弹窗
   ========================================================================== */
.dl-gate {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 14, 18, .55);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}
.dl-gate.show { opacity: 1; pointer-events: auto; }

.dl-gate-box {
    width: min(420px, 100%);
    padding: 22px 24px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(var(--accent-rgb), .25);
    box-shadow: 0 24px 60px rgba(20, 40, 60, .28);
    transform: translateY(10px) scale(.98);
    transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.dl-gate.show .dl-gate-box { transform: none; }

.dl-gate-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent-deep);
    letter-spacing: .5px;
}

.dl-gate-file {
    margin-top: 12px;
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.4;
    word-break: break-all;
}

.dl-gate-meta {
    margin-top: 4px;
    font-size: .76rem;
    opacity: .6;
}

.dl-gate-count {
    margin-top: 16px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.dl-gate-count b {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 2.2rem;
    line-height: 1;
    color: var(--accent);
    font-weight: 600;
}
.dl-gate-count span { font-size: .78rem; opacity: .65; }

.dl-gate-bar {
    margin-top: 10px;
    height: 3px;
    border-radius: 2px;
    background: rgba(var(--accent-rgb), .15);
    overflow: hidden;
}
.dl-gate-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 1s linear;
}

.dl-gate-note {
    margin: 14px 0 0;
    font-size: .74rem;
    line-height: 1.6;
    opacity: .6;
}

.dl-gate-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}
.dl-gate-cancel {
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-rgb), .3);
    background: transparent;
    color: inherit;
    font-size: .8rem;
    cursor: pointer;
    transition: .18s;
}
.dl-gate-cancel:hover { background: rgba(var(--accent-rgb), .1); }

/* 夜间 */
html.dark-mode .dl-gate { background: rgba(4, 6, 10, .62); }
html.dark-mode .dl-gate-box { background: rgba(24, 27, 35, .96); border-color: rgba(var(--accent-rgb), .3); }

/* 生化 */
html.bio .dl-gate { background: rgba(3, 6, 5, .72); }
html.bio .dl-gate-box {
    background: rgba(8, 12, 11, .96);
    border: 1px solid var(--bio-line-strong);
    border-radius: 3px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
html.bio .dl-gate-head,
html.bio .dl-gate-count b { font-family: var(--bio-mono); }
html.bio .dl-gate-cancel { border-radius: 3px; }