/* ============================================================================
 * 五一活动 — 主页样式（深蓝主题 + 卡片 + 签到 + 排行榜 + AI 区块 + 邀请弹窗）
 * 全部作用域在 .activity-page 之下，避免污染主题与其他插件
 * ============================================================================ */

.activity-page,
.activity-page *,
.activity-page *::before,
.activity-page *::after { box-sizing: border-box; }

/* ============================================================================
 * .activity-page 自身要突破 Mirages 父容器（#body / #wrap 的 max-width 限制），
 * 让 hero/title-bar 横向占满视口宽度 — 否则背景图被限到中间一块，左右露出 body 黑底。
 *
 * 方案：
 *  ① .activity-page 用 100vw + 负 margin 拉宽到视口
 *  ② 背景图改用 position:fixed 的伪元素覆盖整个视口（不受滚动 / 父容器限宽影响）
 * ============================================================================ */
.activity-page {
    /* 突破父容器限宽：100vw 宽 + 负 margin 居中对齐回视口 */
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;

    background: transparent;             /* 真正的背景图改到下面 ::before 上 */
    color: #fff;
    font-family: "PingFang SC", "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei",
        -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    z-index: 0;                           /* 确保 ::before z-index:-1 在它内部生效 */
}

/* 全屏星空底（fixed 永远填充视口，不受父容器限宽 / 滚动影响） */
.activity-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: #050451 url('/usr/plugins/activity/images/hero/bg.webp') center / cover no-repeat;
}

/* Safari iOS 上 fixed 在 transform 父级里会失效，给个兜底 */
@supports (-webkit-touch-callout: none) {
    .activity-page::before {
        background-attachment: scroll;
    }
}

.activity-page img    { max-width: 100%; display: block; border: 0; }
.activity-page a      { color: inherit; text-decoration: none; }
.activity-page button { font-family: inherit; border: 0; background: none; color: inherit; padding: 0; cursor: pointer; }

/* 主站固定导航在 theme-dark 下半透明 + 模糊会让深蓝背景透出，强制改实色 */
body #navbar.navbar-color,
body #navbar.fixed-top {
    background-color: #343232 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

/* 活动页隐藏 Mirages 主题的页头 banner（"51爆料网-吃瓜爆料聚集地" + 副标题），
 * 避免和 .ap-title-bar 的 "五一活动" 形成两个标题。
 * 这条规则仅在活动页加载（这份 CSS 只挂在活动模板里）。 */
body #masthead,
body .blog-title,
body .blog-description,
body .archive-title { display: none !important; }

/* H5 下隐藏主站的横向滑动分类条（"首页 今日爆料 明星黑料..."），活动页用不到 */
body #mobileCategoryNav,
body #mobileCategorySpacer { display: none !important; }

/* 防止 100vw 突破限宽时出现水平滚动条 / 右侧露出黑/粉边 */
html, body {
    overflow-x: hidden !important;
    max-width: 100%;
}

/* ===== 标题条 ===== */
.activity-page .ap-title-bar {
    background: #313030;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.activity-page .ap-title-bar h1 {
    font-size: 36px;
    font-weight: 600;
    letter-spacing: 0.083em;
    color: #fff;
    margin: 0;
}

/* ===== HERO ===== */
.activity-page .hero {
    position: relative;
    width: 100%;
    background: transparent;       /* 让 .activity-page 的星空底从 hero 透出 */
    overflow: hidden;
    aspect-ratio: 1920 / 648;
    max-height: 648px;
}
.activity-page .hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    pointer-events: none;
}
.activity-page .hero__decor { position: absolute; pointer-events: none; user-select: none; }
.activity-page .hero__decor--left         { left: -0.85%; top: 9.4%;  width: 4.17%; }
.activity-page .hero__decor--right-top    { left: 76.4%;  top: -4.3%; width: 6.56%; opacity: 0.34; }
.activity-page .hero__decor--right-bottom { left: 97.3%;  top: 23.6%; width: 3.65%; }
.activity-page .hero__decor--coin         { left: 60.54%; top: 27.5%; width: 2.94%; }
.activity-page .hero__decor--coin2        { left: 34.59%; top: 12.7%; width: 1.6%;  opacity: 0.20; }

.activity-page .hero__headline {
    position: absolute;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    width: min(1100px, 92%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(10px, 1.2vw, 20px);
    z-index: 2;
    pointer-events: none;
}
.activity-page .hero__title {
    display: block;
    width: clamp(320px, 62vw, 1100px);
    height: auto;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
}
.activity-page .hero__subtitle {
    display: block;
    width: clamp(320px, 55vw, 820px);
    height: auto;
    max-width: 92%;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.activity-page .activity-time {
    position: absolute;
    left: 50%;
    bottom: 7%;
    transform: translateX(-50%);
    width: min(420px, 42%);
    aspect-ratio: 800 / 113;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 注：图片地址由 PHP 模板里 url(...) 拼接，CSS 里用 var */
    background: var(--activity-time-bg) no-repeat center / 100% 100%;
    color: #fff;
    font-size: clamp(13px, 1.05vw, 17px);
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(80, 0, 0, 0.6);
    z-index: 3;
}

.activity-page .breadcrumb {
    position: absolute;
    top: 20px;
    left: 32px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 14px;
    opacity: 0.91;
    z-index: 5;
}
.activity-page .breadcrumb__link    { color: #0AB18C; display: inline-flex; align-items: center; gap: 6px; }
.activity-page .breadcrumb__sep     { color: #0AB18C; display: inline-flex; align-items: center; }
.activity-page .breadcrumb__sep svg { width: 10px; height: 10px; }
.activity-page .breadcrumb__current { color: #BCBCBC; }

/* ===== MAIN ===== */
.activity-page .ap-main {
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px 32px 80px;
    position: relative;
    z-index: 1;
}
.activity-page .ap-layout {
    display: grid;
    grid-template-columns: 683px 369px;
    gap: 20px;
    justify-content: center;
}
.activity-page .ap-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* ===== CARD ===== */
.activity-page .ap-card {
    background: rgba(41, 44, 73, 0.4);
    border: 1px solid #686868;
    border-radius: 12px;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    padding: 20px;
}
.activity-page .ap-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.activity-page .ap-card__title  { font-size: 20px; font-weight: 500; color: #fff; margin: 0; }
.activity-page .ap-card__action { font-size: 16px; color: #818181; cursor: pointer; }
.activity-page .ap-card__action:hover { color: #bcbcbc; }

/* ===== 我的金币 ===== */
.activity-page .coins__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px 14px;
    gap: 24px;
}
.activity-page .coins__cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.activity-page .coins__cell img { width: 36px; height: 36px; flex-shrink: 0; }
.activity-page .coins__cell-info { display: flex; flex-direction: column; align-items: flex-start; }
.activity-page .coins__num {
    font-family: Inter, "Helvetica Neue", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.activity-page .coins__cell--right .coins__cell-info { align-items: flex-end; }
.activity-page .coins__label { font-size: 14px; color: #7B7B7B; font-weight: 500; }

.activity-page .progress {
    height: 6px;
    background: rgba(216, 216, 216, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 6px 0 22px;
    position: relative;
}
.activity-page .progress__fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #FFAA00 0%, #FFD700 60%, #FF6B00 100%);
    background-size: 200% 100%;
    border-radius: 3px;
    transition: width 1.4s cubic-bezier(.22, .9, .32, 1);
    animation: apProgressShine 2.4s linear infinite;
}
@keyframes apProgressShine {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}

.activity-page .coins__sprint-title {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    margin: 0 0 10px;
}
.activity-page .milestone {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid #373737;
    font-size: 14px;
    color: #D4D4D4;
}
.activity-page .milestone:last-child { border-bottom: 0; }
.activity-page .milestone__status {
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.activity-page .milestone__status--done { color: #A102C4; }
.activity-page .milestone__status--done::after {
    content: "✓";
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #A102C4;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
}
.activity-page .milestone__status--pending { color: #858585; font-weight: 400; }

/* ===== 每日签到 ===== */
.activity-page .checkin__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.activity-page .checkin__day {
    position: relative;
    background: #1D1D44;
    border: 1px solid #535353;
    border-radius: 6px;
    padding: 14px 6px 10px;
    text-align: center;
    opacity: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 98px;
    transition: opacity .25s, border-color .25s;
}
.activity-page .checkin__day--active { opacity: 1; border-color: #A102C4; }
.activity-page .checkin__day--done,
.activity-page .checkin__day--missed { opacity: 0.5; }
.activity-page .checkin__day--done::after {
    content: "✓";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #A102C4;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    font-weight: 700;
}
.activity-page .checkin__day img { width: 28px; height: 28px; margin: 0 auto 2px; }
.activity-page .checkin__amount  { font-family: Montserrat, Inter, sans-serif; font-weight: 600; font-size: 16px; color: #fff; }
.activity-page .checkin__label   { font-size: 12px; color: #fff; font-weight: 500; }

/* ===== 紫色按钮 ===== */
.activity-page .btn-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px;
    border-radius: 43px;
    background: linear-gradient(90deg, #B62ACB 0%, #5E00FF 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 4px 24px -5px rgba(227, 43, 255, 0.6),
        inset 0 4px 33.8px -5px rgba(227, 43, 255, 0.6);
    transition: transform .15s, box-shadow .15s;
}
.activity-page .btn-pill::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(215, 7, 247, 0.5) 0%, rgba(215, 7, 247, 0) 100%);
    pointer-events: none;
}
.activity-page .btn-pill > span { position: relative; }
.activity-page .btn-pill:hover  { transform: translateY(-1px); box-shadow: 0 8px 28px -5px rgba(227, 43, 255, 0.8); }
.activity-page .btn-pill:disabled,
.activity-page .btn-pill.is-done {
    cursor: default;
    opacity: 0.7;
    background: linear-gradient(90deg, #5a5a5a 0%, #3a3a3a 100%);
    box-shadow: none;
}
.activity-page .btn-pill.is-done::before { display: none; }
.activity-page .btn-pill:disabled:hover,
.activity-page .btn-pill.is-done:hover { transform: none; box-shadow: none; }

/* ===== 邀请档位 ===== */
.activity-page .invite__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid #373737;
    font-size: 14px;
    color: #D4D4D4;
}
.activity-page .invite__row:last-of-type { border-bottom: 0; margin-bottom: 18px; }
.activity-page .invite__reward {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #FFBF01;
    font-weight: 500;
}
.activity-page .invite__reward img { width: 20px; height: 20px; }

/* ===== AI 区块 ===== */
.activity-page .section { margin-top: 8px; }
.activity-page .section__title { font-size: 20px; font-weight: 500; color: #fff; margin: 0 0 16px; }
.activity-page .ai-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.activity-page .ai-card {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s;
    background: #2a2540;           /* 图片加载前/失败兜底 */
}
.activity-page .ai-card:hover { transform: translateY(-2px); }
.activity-page .ai-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.activity-page .ai-card__label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    text-align: center;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ===== 排行榜 ===== */
.activity-page .lb__row {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid #373737;
    font-size: 16px;
}
.activity-page .lb__row:last-child { border-bottom: 0; }
.activity-page .lb__rank {
    font-family: Montserrat, Inter, sans-serif;
    font-weight: 700;
    color: #868686;
    text-align: center;
    font-size: 16px;
}
.activity-page .lb__rank img { width: 30px; height: auto; margin: 0 auto; display: block; }
.activity-page .lb__user   { color: #fff;    font-weight: 500; }
.activity-page .lb__reward { color: #FF9819; font-weight: 500; white-space: nowrap; }

/* ===== 邀请弹窗 ===== */
.activity-page .ap-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
}
.activity-page .ap-modal.is-open { display: flex; }
.activity-page .ap-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}
.activity-page .ap-modal__panel {
    position: relative;
    width: 379px;
    background: #292929;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 2;
}
.activity-page .ap-modal__close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #333333;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
.activity-page .ap-modal__close:hover { background: #444; }
.activity-page .ap-modal__body { display: flex; gap: 16px; }
.activity-page .ap-modal__qr {
    width: 139px;
    height: 139px;
    border-radius: 8px;
    background: #fff;
    flex-shrink: 0;
    border: 1px solid #979797;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.activity-page .ap-modal__qr canvas,
.activity-page .ap-modal__qr img {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
.activity-page .ap-modal__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 13px;
}
.activity-page .invite-code {
    background: #3A3A3A;
    border-radius: 6px;
    padding: 11px 12px;
}
.activity-page .invite-code__label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #9C9C9C;
    line-height: 17px;
}
.activity-page .invite-code__value {
    display: block;
    font-family: Inter, "Helvetica Neue", sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    line-height: 29px;
    letter-spacing: 0.02em;
    margin-top: 4px;
}
.activity-page .ap-modal__desc {
    font-size: 13px;
    font-weight: 500;
    color: #989898;
    line-height: 1.5;
    margin: 0;
    word-break: break-all;
}
.activity-page .ap-modal__desc a { color: #0AB18C; text-decoration: none; }
.activity-page .ap-modal__actions { display: flex; gap: 9px; }
.activity-page .ap-modal__btn {
    flex: 1;
    height: 50px;
    border-radius: 8px;
    background: #0AB18C;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s;
}
.activity-page .ap-modal__btn:hover { background: #0bbf99; }

/* ===== Toast ===== */
.activity-toast {
    position: fixed;
    left: 50%;
    top: 30%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 22px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s, transform .25s;
}
.activity-toast.is-show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ===== 加载占位 ===== */
.activity-page .ap-state { text-align: center; padding: 20px 0; color: #888; font-size: 14px; }

/* ===== 响应式 ===== */
@media (max-width: 1199px) {
    .activity-page .ap-layout {
        grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
        gap: 16px;
    }
}
@media (max-width: 768px) {
    .activity-page .ap-layout    { display: flex; flex-direction: column; }
    .activity-page .ap-col       { display: contents; }
    .activity-page #aiSection    { order: 99; }
    .activity-page .ap-title-bar { height: 60px; }
    .activity-page .ap-title-bar h1 { font-size: 18px; letter-spacing: 0.05em; }

    .activity-page .hero { aspect-ratio: auto; height: auto; min-height: 230px; padding-bottom: 14px; }
    .activity-page .hero__bg     { height: 100%; }
    .activity-page .hero__decor--left         { left: -2%; top: 60%; width: 11%; }
    .activity-page .hero__decor--right-top    { left: 90%; top: -5%; width: 14%; }
    .activity-page .hero__decor--right-bottom { display: none; }
    .activity-page .hero__decor--coin         { left: 75%; top: 65%; width: 8%; }
    .activity-page .hero__decor--coin2        { display: none; }
    .activity-page .hero__headline { width: 94%; top: 48%; gap: 8px; }
    .activity-page .hero__subtitle { width: 88%; max-width: 520px; }

    .activity-page .activity-time { bottom: 12px; width: min(280px, 80%); font-size: 11px; font-weight: 500; }
    .activity-page .breadcrumb    { position: relative; top: auto; left: auto; font-size: 13px; gap: 8px; padding: 10px 14px 0; }

    .activity-page .ap-main   { padding: 14px 16px 40px; }
    .activity-page .ap-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .activity-page .ap-col    { gap: 14px; }

    .activity-page .ap-card        { padding: 16px; }
    .activity-page .ap-card__title { font-size: 18px; }
    .activity-page .ap-card__head  { margin-bottom: 14px; }
    .activity-page .ap-card__action{ font-size: 14px; }

    .activity-page .coins__row      { padding: 4px 0 10px; gap: 12px; }
    .activity-page .coins__cell img { width: 30px; height: 30px; }
    .activity-page .coins__num      { font-size: 18px; }
    .activity-page .coins__label    { font-size: 12px; }

    .activity-page .checkin__grid   { grid-template-columns: repeat(4, 1fr); gap: 9px; }
    .activity-page .checkin__day    { padding: 12px 4px 8px; min-height: 88px; }
    .activity-page .checkin__day img{ width: 24px; height: 24px; }
    .activity-page .checkin__amount { font-size: 14px; }
    .activity-page .checkin__label  { font-size: 11px; }

    .activity-page .ai-grid         { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .activity-page .ai-card__label  { font-size: 15px; bottom: 10px; }

    .activity-page .lb__row         { font-size: 14px; padding: 10px 0; gap: 10px; }
    .activity-page .lb__rank        { font-size: 14px; }
    .activity-page .lb__rank img    { width: 24px; }

    .activity-page .btn-pill        { padding: 13px; font-size: 15px; }
    .activity-page .milestone       { font-size: 13px; padding: 10px 0; gap: 8px; flex-wrap: wrap; }
    .activity-page .invite__row     { font-size: 13px; }
    .activity-page .invite__reward img { width: 18px; height: 18px; }

    .activity-page .ap-modal__panel { width: 90%; max-width: 340px; padding: 14px; gap: 14px; }
    .activity-page .ap-modal__close { top: -12px; right: -6px; width: 26px; height: 26px; font-size: 16px; }
    .activity-page .ap-modal__body  { gap: 12px; }
    .activity-page .ap-modal__qr    { width: 110px; height: 110px; }
    .activity-page .invite-code     { padding: 8px 10px; }
    .activity-page .invite-code__value { font-size: 20px; line-height: 1.2; }
    .activity-page .ap-modal__desc  { font-size: 12px; }
    .activity-page .ap-modal__actions { gap: 8px; }
    .activity-page .ap-modal__btn   { height: 42px; font-size: 13px; }
}
@media (max-width: 480px) {
    .activity-page .ap-card        { padding: 14px; border-radius: 10px; }
    .activity-page .ap-card__title { font-size: 16px; }
    .activity-page .coins__num     { font-size: 16px; }
    .activity-page .checkin__amount{ font-size: 13px; }
    .activity-page .lb__row        { font-size: 13px; gap: 8px; }
    .activity-page .lb__row > .lb__rank { font-size: 13px; }
    .activity-page .ai-card__label { font-size: 13px; }
}
