/* =====================================================================
 * 盒子主题 · 小工具「带图活动倒计时」
 * 文件：assets/css/hezi-widget-activity-countdown.css
 * 约定：所有可调外观通过 CSS 变量注入（由小工具实例在容器上设置）
 *      --hezi-act-radius      卡片圆角
 *      --hezi-act-min-h       单卡最小高度
 *      --hezi-act-accent      主题色（链接 hover / 角标图标）
 *      --hezi-act-content-bg  底部内容区背景（rgba）
 *      --hezi-act-title-size  标题字号
 *      --hezi-act-desc-size   描述字号
 *      --hezi-act-gap         多卡间距
 * ===================================================================== */
.hezi-act {
    --hezi-act-radius: 8px;
    --hezi-act-min-h: 320px;
    --hezi-act-accent: #ff5722;
    --hezi-act-content-bg: rgba(0, 0, 0, 0.7);
    --hezi-act-title-size: 16px;
    --hezi-act-desc-size: 13px;
    --hezi-act-gap: 18px;
    display: block;
    box-sizing: border-box;
}

/* ---------- 布局：堆叠（侧边栏默认） ---------- */
.hezi-act--stack {
    display: flex;
    flex-direction: column;
    gap: var(--hezi-act-gap);
}
/* ---------- 布局：横向滚动 ---------- */
.hezi-act--row {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--hezi-act-gap);
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.hezi-act--row .hezi-act-card {
    flex: 0 0 78%;
    max-width: 280px;
}
/* ---------- 布局：网格（首页默认） ---------- */
.hezi-act--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--hezi-act-gap);
}
/* ---------- 布局：紧凑单列 ---------- */
.hezi-act--compact {
    display: flex;
    flex-direction: column;
    gap: calc(var(--hezi-act-gap) * 0.5);
}
.hezi-act--compact .hezi-act-card {
    --hezi-act-min-h: 200px;
}

/* ---------- 单张活动卡 ---------- */
.hezi-act-card {
    position: relative;
    width: 100%;
    min-height: var(--hezi-act-min-h);
    margin: 0;
    border-radius: var(--hezi-act-radius);
    overflow: hidden;
    box-sizing: border-box;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #e9ecef;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.hezi-act-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}
.hezi-act--compact .hezi-act-card:hover {
    transform: translateY(-2px);
}

/* 角标（倒计时） */
.hezi-act-card__tag {
    position: absolute;
    top: 12px;
    right: 8px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    padding: 3px 11px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    line-height: 1.4;
    color: #333;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 3;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.hezi-act-card__tag i {
    color: var(--hezi-act-accent);
    font-size: 13px;
}

/* 底部内容区 */
.hezi-act-card__body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 15px;
    background: var(--hezi-act-content-bg);
}
.hezi-act-card__title {
    margin: 0 0 5px 0;
    font-size: var(--hezi-act-title-size);
    font-weight: 600;
    line-height: 1.4;
}
.hezi-act-link {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s ease;
}
.hezi-act-link:hover {
    color: var(--hezi-act-accent);
}
.hezi-act-link.disabled {
    pointer-events: none;
    color: #999 !important;
    cursor: default;
}
.hezi-act-card__desc {
    margin: 0;
    font-size: var(--hezi-act-desc-size);
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.5;
}

/* 无图占位提示 */
.hezi-act-card--noimg {
    background-image: linear-gradient(135deg, #f0f2f5 0%, #dfe3e8 100%);
    display: flex;
    align-items: flex-end;
}
.hezi-act-card--noimg .hezi-act-card__body {
    position: static;
}

/* ---------- 暗黑模式（子比 body.dark-theme） ---------- */
body.dark-theme .hezi-act-card__tag {
    background: rgba(40, 44, 52, 0.9);
    color: #e6e6e6;
}
body.dark-theme .hezi-act-card--noimg {
    background-image: linear-gradient(135deg, #2a2d33 0%, #1f2125 100%);
}
body.dark-theme .hezi-act-card__desc {
    color: rgba(255, 255, 255, 0.7);
}

/* ---------- 响应式 ---------- */
@media (max-width: 480px) {
    .hezi-act--row .hezi-act-card {
        flex-basis: 86%;
    }
    .hezi-act--grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
