/* 产品资料（下载 / 视频）前台样式。
   刻意克制：只给间距、对齐和一个播放按钮，颜色全部继承主题，
   免得在不同店铺的主题里显得格格不入。 */

/* ---------------------------------------------------------------------------
   下载资料（驱动 / 说明书）
   一份资料一张卡：左边文件类型标、右边下载按钮，中间是标题 + 版本信息。
   颜色除了文件类型标全部继承主题，深色主题下不会出现黑底黑字。
   --------------------------------------------------------------------------- */

.saas-downloads__group {
    font-size: .95em;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    opacity: .6;
    margin: 1.6em 0 .6em;
}

.saas-downloads__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .6em;
}

.saas-dl {
    display: flex;
    align-items: flex-start;
    gap: .9em;
    padding: .9em 1em;
    border: 1px solid rgba(128, 128, 128, .22);
    border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.saas-dl:hover {
    border-color: rgba(128, 128, 128, .42);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
}

/* 文件类型标：扩展名本身就是最好的图标，认得 PDF / EXE / ZIP 不需要学习 */
.saas-dl__type {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .68em;
    font-weight: 700;
    letter-spacing: .04em;
    color: #fff;
    background: #78808a;
}
.saas-dl__type--pdf   { background: #d64545; }
.saas-dl__type--app   { background: #2f6fd0; }
.saas-dl__type--zip   { background: #8a7a52; }
.saas-dl__type--doc   { background: #2b5797; }
.saas-dl__type--sheet { background: #1e7145; }
.saas-dl__type--slide { background: #c2410c; }

.saas-dl__body {
    flex: 1 1 auto;
    min-width: 0;
}

.saas-dl__title {
    display: block;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

/* 版本信息：各块之间留空隙而不是用「·」串起来，长文件名也不会把它们挤成一团 */
.saas-dl__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5em;
    margin-top: .35em;
    font-size: .85em;
    opacity: .75;
}

.saas-dl__ver {
    font-weight: 600;
    padding: .1em .45em;
    border-radius: 4px;
    background: rgba(128, 128, 128, .16);
    opacity: .95;
}

.saas-dl__date,
.saas-dl__size {
    white-space: nowrap;
}

/* 适用系统：图标而不是文字 —— 一行里塞四个系统名会把版本和日期挤没 */
.saas-dl__os {
    display: inline-flex;
    align-items: center;
    gap: .35em;
}
.saas-dl__os-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6em;
    height: 1.6em;
    border-radius: 5px;
    /* 图标用的是各系统的官方原图，自带配色；这里只负责给它们一块稳定的浅色衬底 ——
       苹果与 Tux 本身就是近黑，没有衬底的话在深色主题里整个糊掉。 */
    background: rgba(128, 128, 128, .14);
}
.saas-dl__os-icon {
    display: block;
}

/* 深色主题：官方图标自带配色、翻不了色，只能把衬底换成接近白的实色，
   这是唯一能同时照顾到黑苹果、黑企鹅和蓝 Finder 的做法。 */
@media (prefers-color-scheme: dark) {
    .saas-dl__os-item {
        background: rgba(255, 255, 255, .92);
    }
}

/* 旧后台只推合并好的文本时的回落 */
.saas-dl__os-text {
    padding: .1em .45em;
    border-radius: 4px;
    background: rgba(128, 128, 128, .16);
}

.saas-dl__notes {
    margin: .5em 0 0;
    font-size: .88em;
    line-height: 1.55;
    opacity: .85;
}
.saas-dl__notes-label {
    font-weight: 600;
    opacity: .75;
}

/* 下载按钮：旧版整行只有一个下划线链接，看不出这是「可以拿走的东西」 */
.saas-dl__btn {
    flex: 0 0 auto;
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: .45em;
    padding: .55em .95em;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: .9em;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.saas-dl__btn:hover,
.saas-dl__btn:focus-visible {
    /* 用半透明灰而不是反色：反色要猜主题的前景/背景，猜错就是一颗看不清的按钮 */
    background: rgba(128, 128, 128, .16);
    text-decoration: none;
}

/* 历史版本：整体缩进并弱化，展开后一眼能看出谁是当前版 */
.saas-dl__history {
    margin-top: .6em;
}
.saas-dl__history summary {
    cursor: pointer;
    font-size: .85em;
    opacity: .7;
}
.saas-dl__history summary:hover {
    opacity: 1;
}
.saas-dl__history > ul {
    list-style: none;
    margin: .5em 0 0;
    padding: 0 0 0 .9em;
    border-left: 2px solid rgba(128, 128, 128, .2);
}
.saas-dl__old {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6em;
    padding: .4em 0;
}
.saas-dl__old .saas-dl__meta {
    margin-top: 0;
}
.saas-dl__old-link {
    font-size: .85em;
}

@media (max-width: 600px) {
    .saas-dl {
        flex-wrap: wrap;
    }
    .saas-dl__btn {
        width: 100%;
        justify-content: center;
        margin-top: .2em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .saas-dl,
    .saas-dl__btn {
        transition: none;
    }
}

.saas-video-thumb {
    position: relative;
}

.flex-control-thumbs li.saas-video-thumb::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 26px;
    height: 18px;
    margin: -9px 0 0 -13px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .7);
    pointer-events: none;
}

.flex-control-thumbs li.saas-video-thumb::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    margin: -4px 0 0 -2px;
    border-style: solid;
    border-width: 4px 0 4px 7px;
    border-color: transparent transparent transparent #fff;
    pointer-events: none;
}

/* --- 独立区块里的视频（主题不跑图库钩子时的兜底） -------------------- */

.saas-videos__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1em;
}

.saas-video__play {
    display: block;
    position: relative;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    line-height: 0;
}

.saas-video__play img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

/* 播放按钮：YouTube 那颗圆角矩形的极简还原，纯 CSS，不引图片 */
.saas-gallery-video__icon,
.saas-video__icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 42px;
    margin: -21px 0 0 -30px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .65);
    transition: background .15s ease-out;
}

.saas-gallery-video__icon::after,
.saas-video__icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -5px;
    border-style: solid;
    border-width: 8px 0 8px 14px;
    border-color: transparent transparent transparent #fff;
}

.saas-video__play:hover .saas-video__icon,
.saas-video__play:focus-visible .saas-gallery-video__icon,
.saas-video__icon {
    background: #c00;
}

.saas-video__title {
    margin-top: .4em;
    font-size: .9em;
    line-height: 1.3;
}

.saas-video iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    .saas-gallery-video__icon,
.saas-video__icon {
        transition: none;
    }
}
