/*
 * 书签管理小组件（固定 1x1）
 *
 * 布局跟普通站点图标一致：上面一块 72×72 的圆角色块（--icon），下面一行名字。
 * 以前把整格 96 高（72 图标 + 24 名字区）全染成玫红，看着是根竖长条，跟旁边
 * 1x1 的方块对不上 —— 现在色块只占 var(--icon)，名字交给 .ext-name 放在外面。
 *
 * 配色照 mtab 前台那张卡片的 bgColor（#FA636E），图标直接用它的 bookmark.svg。
 */

.app-card--ext {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 跟 .app 一样：图标和名字之间 6px，不加 padding，一行正好 72 + 6 + 18 */
    gap: 6px;
}

.ext-tile {
    width: var(--icon);
    height: var(--icon);
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: var(--icon-radius);
    /* 图标铺满整块，溢出部分按圆角裁掉 */
    overflow: hidden;
    cursor: pointer;
    color: #fff;
    /* 图标本身是整块红底白书签，底色交给图 */
    background: transparent;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .28),
        0 6px 14px rgba(15, 23, 42, .16),
        0 1px 3px rgba(15, 23, 42, .12);
    transition: transform .16s ease, box-shadow .16s ease;
}

.ext-tile:hover {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .3),
        0 12px 22px rgba(15, 23, 42, .22),
        0 1px 3px rgba(15, 23, 42, .12);
}

.ext-tile:active {
    transform: translateY(0) scale(.98);
}

.ext-tile:focus-visible {
    outline: 2px solid rgba(250, 99, 110, .75);
    outline-offset: 3px;
}

.ext-ico {
    /*
     * 铺满整块色块。
     * svg 自己的 viewBox 已经收紧到图形边界（原来 50×50 里图形只占 35×32，
     * 所以以前缩在中间一块、四周一圈空 —— 就是「图标没撑满」）。
     */
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    object-fit: cover;
}

.ext-name {
    /* 尺寸照 .app-name（mtab 的 .iconName：12px / line-height 1.5） */
    width: 100%;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 400;
    color: var(--text);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- 下载面板（.cal-sheet 外壳里的白卡） ---------- */

.ext-panel {
    position: relative;
    width: min(480px, 100%);
    max-height: min(680px, 100%);
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 22px;
    background: #fff;
    color: #1f2329;
    box-shadow: 0 32px 80px rgba(10, 16, 28, .28);
}

/* 抬头：淡玫红渐变压在最上面，跟下面的白底自然过渡 */
.ext-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 26px 20px;
    background: linear-gradient(180deg, #ffecef 0%, #fff9fa 78%, #fff 100%);
}

.ext-head-ico {
    width: 54px;
    height: 54px;
    flex: none;
    border-radius: 15px;
    box-shadow: 0 6px 16px rgba(250, 99, 110, .32);
}

.ext-head-txt h1 {
    margin: 0;
    font-size: 21px;
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: .2px;
}

.ext-head-txt p {
    margin: 5px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: #7b8290;
}

.ext-body {
    padding: 0 26px;
}

.ext-sec {
    padding: 18px 0;
    border-top: 1px solid #f2f3f6;
}

.ext-body .ext-sec:first-child {
    padding-top: 6px;
    border-top: 0;
}

.ext-sec h2 {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.1px;
    color: #a3aab6;
}

/* ---------- 支持的浏览器 ---------- */

.ext-browsers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ext-browsers li {
    padding: 6px 14px;
    border: 1px solid #eef0f4;
    border-radius: 999px;
    background: #f7f8fa;
    font-size: 13px;
    line-height: 1.4;
    color: #3b4250;
}

.ext-dim {
    margin: 11px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: #9aa1ad;
}

/* ---------- 安装步骤：玫红小圆序号 ---------- */

.ext-steps {
    counter-reset: extstep;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ext-steps li {
    display: flex;
    gap: 11px;
    font-size: 13px;
    line-height: 1.7;
    color: #3b4250;
    counter-increment: extstep;
}

.ext-steps li + li {
    margin-top: 10px;
}

.ext-steps li::before {
    content: counter(extstep);
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border-radius: 50%;
    background: rgba(250, 99, 110, .12);
    color: #de4356;
    font-size: 11px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

.ext-steps code {
    padding: 1px 6px;
    border-radius: 5px;
    background: #f2f3f6;
    color: #4a5160;
    font-size: 12px;
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    word-break: break-all;
}

/* ---------- 底部按钮 ---------- */

.ext-foot {
    padding: 14px 26px 24px;
}

.ext-dl {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 12px;
    /*
     * 回到最初那版平涂红 #FA636E。
     * 中间换过一次渐变（#FA636E → #EE4E6B），尾色偏玫红，整颗按钮看着发闷、不够红；
     * 平涂这一个颜色反倒更亮更红。
     */
    background: #FA636E;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .3px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(250, 99, 110, .32);
    transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.ext-dl:hover {
    background: #F04A5A;
    box-shadow: 0 10px 22px rgba(240, 74, 90, .4);
}

.ext-dl:active {
    transform: scale(.99);
}

.ext-dl:disabled {
    opacity: .62;
    cursor: default;
    box-shadow: none;
}

@media (max-width: 560px) {
    .ext-head {
        padding: 20px 18px 16px;
        gap: 13px;
    }

    .ext-head-ico {
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }

    .ext-head-txt h1 {
        font-size: 19px;
    }

    .ext-body {
        padding: 0 18px;
    }

    .ext-foot {
        padding: 12px 18px 18px;
    }
}
