/* ============================================================
   activity.css · 活动页面
   ============================================================ */

/* ===== 2×2 活动卡片 ===== */
.app-item-2x2 {
    grid-column: span 2;
    grid-row: span 2;
    position: relative;
    border-radius: 22px;
    background-color: rgba(30, 20, 45, 0.78);
    background-image:
        radial-gradient(ellipse 85% 70% at 22% 26%, rgba(192, 132, 252, 0.14), transparent 72%),
        radial-gradient(ellipse 75% 68% at 82% 76%, rgba(236, 72, 153, 0.12), transparent 74%);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    padding: 16px 16px 14px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all .3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 8px 26px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
    isolation: isolate;
}

/* 渐变描边（左上紫 → 右下粉）· 极淡版 */
.app-item-2x2::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(192, 132, 252, 0.18) 0%,
        rgba(192, 132, 252, 0.05) 42%,
        rgba(236, 72, 153, 0.05) 58%,
        rgba(236, 72, 153, 0.18) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
    transition: background .3s;
}

/* 光扫（hover 时从左上掠过） */
.app-item-2x2::after {
    content: '';
    position: absolute;
    top: -20%;
    left: -80%;
    width: 55%;
    height: 140%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.10) 45%,
        rgba(255, 255, 255, 0.14) 50%,
        rgba(255, 255, 255, 0.10) 55%,
        transparent 100%);
    transform: skewX(-18deg);
    pointer-events: none;
    transition: left .85s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.app-item-2x2:hover {
    background-color: rgba(38, 26, 56, 0.88);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(192, 132, 252, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.app-item-2x2:hover::before {
    background: linear-gradient(135deg,
        rgba(192, 132, 252, 0.9) 0%,
        rgba(192, 132, 252, 0.3) 42%,
        rgba(236, 72, 153, 0.3) 58%,
        rgba(236, 72, 153, 0.9) 100%);
}

.app-item-2x2:hover::after {
    left: 140%;
}

.app-item-2x2:active {
    transform: translateY(0) scale(0.98);
}
/* ===== 卡片品牌区 ===== */
.aw-brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    z-index: 3;
    padding: 4px 0;
    overflow: hidden;
}

.aw-brand-en {
    font-family: 'JetBrains Mono', monospace;
    font-size: calc(var(--app-icon-size) * 0.14);
    font-weight: 500;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: rgba(192, 132, 252, 0.9);
    text-shadow:
        0 0 8px rgba(192, 132, 252, 0.7),
        0 0 16px rgba(192, 132, 252, 0.35);
    padding-left: 5px;   /* 抵消 letter-spacing 造成的视觉偏移 */
    line-height: 1;
}

.aw-brand-main {
    font-family: 'WenJinMincho', 'Noto Serif SC', serif;
    font-size: calc(var(--app-icon-size) * 0.68);
    font-weight: 500;
    letter-spacing: 8px;
    line-height: 1;
    text-align: center;
    padding-left: 8px;   /* 抵消 letter-spacing 在尾部多出的空白 */
    color: #f5f3f7;
    text-shadow:
        0 0 6px  rgba(255, 255, 255, 0.75),
        0 0 14px rgba(192, 132, 252, 0.55);
}

.aw-brand-sub {
    font-family: 'Parisienne', cursive;
    font-size: calc(var(--app-icon-size) * 0.34);
    line-height: 1;
    color: rgba(245, 243, 247, 0.88);
    letter-spacing: 0.5px;
    margin-top: 2px;
    text-shadow:
        0 0 10px rgba(192, 132, 252, 0.6),
        0 0 22px rgba(236, 72, 153, 0.35);
}

/* 卡片内布局 */
.activity-widget {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
}

.aw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-bottom: 2px;
}

.aw-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow:
        0 0 10px rgba(192, 132, 252, 0.7),
        0 0 20px rgba(236, 72, 153, 0.35);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.aw-arrow {
    width: 14px;
    height: 14px;
    stroke: rgba(255, 255, 255, 0.7);
    stroke-width: 2.4;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    transition: transform .2s;
}
.app-item-2x2:hover .aw-arrow {
    transform: translateX(2px);
    stroke: #fff;
}

/* 当前阶段胶囊 */
.aw-stage-pill {
    align-self: flex-start;
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg,
        rgba(192, 132, 252, 0.85) 0%,
        rgba(236, 72, 153, 0.78) 100%);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow:
        0 0 14px rgba(192, 132, 252, 0.65),
        0 4px 10px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.45);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all .2s;
}
.app-item-2x2:hover .aw-stage-pill {
    box-shadow:
        0 0 20px rgba(236, 72, 153, 0.7),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* 底部进度 */
.aw-progress {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
    padding-top: 4px;
}

.aw-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.aw-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c084fc 0%, #ec4899 100%);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.8);
    transition: width .45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aw-progress-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.78);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(192, 132, 252, 0.6);
}


/* ===== 活动页面 ===== */
.activity-header {
    display: flex;
    align-items: center;
    padding: 6px 0 12px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}

.activity-back {
    font-size: 24px;
    cursor: pointer;
    padding-right: 12px;
    color: var(--primary);
    transition: color .2s, text-shadow .2s;
}

.activity-back:hover {
    color: var(--accent);
    text-shadow: 0 0 12px rgba(236, 72, 153, 0.7);
}

.activity-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-edit-btn {
    background: rgba(192, 132, 252, 0.12);
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: 12px;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 14px;
    font-family: inherit;
    transition: all .2s;
    flex-shrink: 0;
}

.activity-edit-btn:hover {
    background: rgba(192, 132, 252, 0.22);
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.4);
}

.activity-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 0;
}

/* 简介 */
.activity-desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    padding: 0 8px 16px;
    font-style: italic;
}

/* 阶段胶囊 */
.activity-stages {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 8px 20px;
}

.activity-stage {
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all .2s;
}

.activity-stage.done {
    color: var(--primary);
    background: rgba(192, 132, 252, 0.1);
    border-color: rgba(192, 132, 252, 0.25);
}

.activity-stage.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.55), rgba(236, 72, 153, 0.5));
    border-color: rgba(236, 72, 153, 0.6);
    box-shadow:
        0 0 14px rgba(192, 132, 252, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 查看进展按钮 */
.activity-view-btn {
    display: block;
    width: calc(100% - 16px);
    margin: 0 8px 20px;
    padding: 14px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #c084fc, #ec4899);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    font-family: inherit;
    box-shadow:
        0 6px 20px rgba(192, 132, 252, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: all .2s;
}

.activity-view-btn:hover {
    box-shadow:
        0 6px 26px rgba(236, 72, 153, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* 区段标题 */
.activity-section-title {
    font-size: 13px;
    color: var(--text-dim);
    padding: 4px 8px 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* 记录列表 */
.activity-logs {
    display: flex;
    flex-direction: column;
    padding: 0 8px 8px;
}

.activity-log {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 4px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}

.activity-log:last-child {
    border-bottom: none;
}

.activity-log:hover {
    background: rgba(192, 132, 252, 0.05);
}

.activity-log-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 6px rgba(192, 132, 252, 0.6);
    flex-shrink: 0;
    margin-top: 7px;
}

.activity-log-text {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    word-break: break-word;
}

.activity-log-time {
    font-size: 11px;
    color: var(--text-dim);
    flex-shrink: 0;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.activity-empty {
    font-size: 13px;
    color: var(--text-dim);
    text-align: center;
    padding: 14px 0;
}

/* 奖励列表 */
.activity-rewards {
    display: flex;
    flex-direction: column;
    padding: 0 8px 8px;
}

.activity-reward {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}

.activity-reward:last-child {
    border-bottom: none;
}

.activity-reward:hover {
    background: rgba(192, 132, 252, 0.05);
}

.activity-reward-check {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid rgba(192, 132, 252, 0.4);
    background: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
    position: relative;
    transition: all .2s;
}

.activity-reward.got .activity-reward-check {
    background: linear-gradient(135deg, #c084fc, #ec4899);
    border-color: transparent;
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.5);
}

.activity-reward.got .activity-reward-check::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.activity-reward-name {
    flex: 1;
    font-size: 14px;
    color: var(--text);
}

.activity-reward.got .activity-reward-name {
    color: var(--text-dim);
    text-decoration: line-through;
}

/* 加号按钮 */
.activity-add-btn {
    display: block;
    width: calc(100% - 16px);
    margin: 4px 8px 16px;
    padding: 9px;
    border: 1px dashed rgba(192, 132, 252, 0.4);
    border-radius: 10px;
    background: none;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
}

.activity-add-btn:hover {
    background: rgba(192, 132, 252, 0.08);
    border-color: var(--primary);
}

/* ===== 编辑弹窗里的阶段列表 ===== */
.activity-stage-editor {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.activity-stage-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.activity-stage-toggle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid rgba(192, 132, 252, 0.4);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    flex-shrink: 0;
    transition: all .2s;
    position: relative;
}

.activity-stage-toggle[data-status="done"] {
    background: rgba(192, 132, 252, 0.35);
    border-color: rgba(192, 132, 252, 0.7);
}

.activity-stage-toggle[data-status="active"] {
    background: linear-gradient(135deg, #c084fc, #ec4899);
    border-color: transparent;
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.6);
}

.activity-stage-input {
    flex: 1;
    padding: 4px 8px;
    border: none;
    background: none;
    color: var(--text);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.activity-stage-input:focus {
    color: var(--primary);
}

.activity-stage-del {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    font-family: inherit;
    transition: color .2s;
}

.activity-stage-del:hover {
    color: #fca5a5;
}

/* 编辑弹窗加号 */
.activity-mini-add {
    display: block;
    width: 100%;
    margin-bottom: 14px;
    padding: 7px;
    border: 1px dashed rgba(192, 132, 252, 0.4);
    border-radius: 8px;
    background: none;
    color: var(--primary);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
}

.activity-mini-add:hover {
    background: rgba(192, 132, 252, 0.08);
    border-color: var(--primary);
}

/* 查看进展弹窗 */
.activity-progress-body {
    padding: 4px 0 12px;
}

.activity-progress-section {
    margin-bottom: 14px;
}

.activity-progress-label {
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.activity-progress-item {
    font-size: 14px;
    color: var(--text);
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.activity-progress-item.done {
    color: var(--text-dim);
    text-decoration: line-through;
}

.activity-progress-item .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

.activity-progress-item.done .dot {
    background: var(--text-dim);
}

/* ============================================================
   活动卡片 · 氛围装饰
   ============================================================ */

/* 四角装饰线 */
.aw-deco {
    position: absolute;
    inset: 8px;
    pointer-events: none;
    z-index: 0;
}

.aw-corner {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(192, 132, 252, 0.5);
    filter: drop-shadow(0 0 4px rgba(192, 132, 252, 0.5));
    transition: border-color .3s;
}
.aw-corner.tl {
    top: 0; left: 0;
    border-right: 0;
    border-bottom: 0;
    border-top-left-radius: 8px;
}
.aw-corner.tr {
    top: 0; right: 0;
    border-left: 0;
    border-bottom: 0;
    border-top-right-radius: 8px;
}
.aw-corner.bl {
    bottom: 0; left: 0;
    border-right: 0;
    border-top: 0;
    border-bottom-left-radius: 8px;
}
.aw-corner.br {
    bottom: 0; right: 0;
    border-left: 0;
    border-top: 0;
    border-bottom-right-radius: 8px;
}
.app-item-2x2:hover .aw-corner {
    border-color: rgba(236, 72, 153, 0.85);
    filter: drop-shadow(0 0 8px rgba(236, 72, 153, 0.7));
}

/* 扫描光带 */
.aw-scan {
    position: absolute;
    left: 0;
    right: 0;
    top: -40%;
    height: 40%;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(236, 72, 153, 0.08) 35%,
        rgba(236, 72, 153, 0.22) 50%,
        rgba(236, 72, 153, 0.08) 65%,
        transparent 100%
    );
    filter: blur(3px);
    animation: awScan 5.5s ease-in-out infinite;
}

@keyframes awScan {
    0%   { transform: translateY(0);     opacity: 0; }
    12%  { opacity: 1; }
    88%  { opacity: 1; }
    100% { transform: translateY(360%);  opacity: 0; }
}
