/* ========== 福利中心【PC三栏并排｜平板双栏｜手机单列｜主标题完整，右侧小字省略｜图标强锁定】 ========== */
.welfare-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
    box-sizing: border-box;
    display: grid;
    /* 核心改动：大屏3列，自适应 */
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 0 20px;
    overflow: hidden;
}
.welfare-container * {
    box-sizing: border-box;
}

/* ---- 卡片基础 ---- */
.welfare-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.03);
    transition: box-shadow .22s ease;
    overflow: hidden;
}
.welfare-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.welfare-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 10px;
}
.welfare-card-title {
    font-size: 17px;
    font-weight: 600;
    color: #1d2129;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.welfare-card-more {
    font-size: 12px;
    color: rgba(29,33,41,.55);
    background: rgba(255,255,255,.82);
    padding: 4px 9px;
    border-radius: 7px;
    flex-shrink: 0;
}

.welfare-card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
}

/* ---- 按钮核心：图标｜标题(auto不截断)｜描述(1fr剩余空间，超出打点) ---- */
.welfare-item {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 18px auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: none;
    border-radius: 9px;
    background: #ffffff;
    cursor: pointer;
    transition: all .2s ease;
    text-align: left;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    overflow: hidden;
}
.welfare-item:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 7px rgba(0,0,0,.075);
}
.welfare-item:active {
    transform: translateX(1px);
}

/* ---- 图标强锁18px，防止大图撑坏布局 ---- */
.welfare-item-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    max-width: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 4px;
    line-height: 1;
}
.welfare-item-icon img {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
    border: none;
    outline: none;
}

/* 主标题 auto，优先完整展示 */
.welfare-item-text {
    font-size: 14px;
    font-weight: 500;
    color: #1d2129;
    white-space: nowrap;
}

/* 右侧描述拿剩余空间，空间不足自动省略 */
.welfare-item-desc {
    font-size: 12px;
    color: #86909c;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

/* ---- 三色卡片底色 ---- */
.welfare-card--yellow {
    background: linear-gradient(180deg, #fffbf0 0%, #fff3d6 100%);
}
.welfare-card--green {
    background: linear-gradient(180deg, #f3fbf7 0%, #e1f3ea 100%);
}
.welfare-card--blue {
    background: linear-gradient(180deg, #f2f7fd 0%, #e0edfb 100%);
}

/* --------弹窗样式-------- */
.welfare-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.46);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.welfare-modal-wrap {
    width: 100%;
    max-width: 480px;
    background: rgba(255,255,255,.97);
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,.16);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: welfareFadeIn .3s cubic-bezier(.4,0,.2,1);
}
@keyframes welfareFadeIn {
    from {opacity: 0; transform: translateY(16px) scale(.98)}
    to {opacity: 1; transform: translateY(0) scale(1)}
}

.welfare-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
.welfare-modal-title {
    margin: 0;
    color: #1d2129;
    font-size: 18px;
    font-weight: 600;
}
.welfare-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(0,0,0,.03);
    font-size: 20px;
    color: #86909c;
    cursor: pointer;
    border-radius: 50%;
    transition: all .2s;
    outline: none;
}
.welfare-modal-close:hover {
    background: rgba(241,64,75,.08);
    color: #e13a45;
    transform: rotate(90deg);
}

.welfare-modal-body {
    padding: 22px;
    max-height: 70vh;
    overflow-y: auto;
}
.welfare-modal-text {
    margin: 0 0 16px;
    color: #334155;
    font-size: 14px;
    line-height: 1.7;
}
.welfare-modal-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid rgba(0,0,0,.05);
    background: #fafbfc;
}
.welfare-modal-list {
    margin: 0 0 18px;
    padding-left: 20px;
}
.welfare-modal-list li {
    margin-bottom: 9px;
    color: #566072;
    font-size: 14px;
    line-height: 1.7;
}

.welfare-modal-btn {
    width: 100%;
    padding: 13px 0;
    background: linear-gradient(180deg, #f04853 0%, #e23843 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s ease;
    outline: none;
    box-shadow: 0 2px 6px rgba(226,56,67,.2);
    margin-bottom: 14px;
}
.welfare-modal-btn:hover {
    background: linear-gradient(180deg, #e23843 0%, #d12c36 100%);
    box-shadow: 0 4px 12px rgba(226,56,67,.25);
}
.welfare-modal-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(226,56,67,.2);
}
.welfare-modal-btn--secondary {
    background: #fff;
    color: #e23843;
    border: 1px solid rgba(226,56,67,.25);
    box-shadow: none;
}
.welfare-modal-btn--secondary:hover {
    background: #fef6f7;
    box-shadow: 0 2px 6px rgba(226,56,67,.1);
}

.welfare-modal-body > *:last-child {
    margin-bottom: 0;
}

.welfare-modal-body::-webkit-scrollbar { width: 5px; }
.welfare-modal-body::-webkit-scrollbar-track { background: transparent; }
.welfare-modal-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.1); border-radius: 3px; }
.welfare-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.18); }

/* =========暗黑模式适配========= */
.io-black-mode .welfare-card {
    box-shadow: 0 1px 3px rgba(0,0,0,.22);
}
.io-black-mode .welfare-card--yellow {
    background: linear-gradient(180deg, #35312a 0%, #2b2822 100%);
}
.io-black-mode .welfare-card--green {
    background: linear-gradient(180deg, #24302b 0%, #1d2823 100%);
}
.io-black-mode .welfare-card--blue {
    background: linear-gradient(180deg, #232d38 0%, #1c2530 100%);
}
.io-black-mode .welfare-card-title {
    color: #d0d4db;
}
.io-black-mode .welfare-card-more {
    background: rgba(255,255,255,.055);
    color: rgba(208,212,219,.62);
}
.io-black-mode .welfare-item {
    background: #2a2d31;
    box-shadow: 0 1px 2px rgba(0,0,0,.16);
}
.io-black-mode .welfare-item-text {
    color: #d0d4db;
}
.io-black-mode .welfare-item-desc {
    color: #8a93a0;
}

.io-black-mode .welfare-modal { background: rgba(0,0,0,.72); }
.io-black-mode .welfare-modal-wrap {
    background: rgba(30,33,39,.97);
    border-color: rgba(255,255,255,.065);
    box-shadow: 0 12px 40px rgba(0,0,0,.52);
}
.io-black-mode .welfare-modal-header { border-bottom-color: rgba(255,255,255,.065); }
.io-black-mode .welfare-modal-title { color: #d0d4db; }
.io-black-mode .welfare-modal-close { background: rgba(255,255,255,.045); color: #8a93a0; }
.io-black-mode .welfare-modal-close:hover { background: rgba(226,56,67,.16); color: #e23843; }
.io-black-mode .welfare-modal-text { color: #c4c9d2; }
.io-black-mode .welfare-modal-list li { color: #b0b7c3; }
.io-black-mode .welfare-modal-img { border-color: rgba(255,255,255,.06); background: #23272e; }

.io-black-mode .welfare-modal-btn {
    background: linear-gradient(180deg, #c73a43 0%, #b02d36 100%);
    box-shadow: 0 2px 6px rgba(0,0,0,.32);
}
.io-black-mode .welfare-modal-btn:hover {
    background: linear-gradient(180deg, #d4424c 0%, #bc333d 100%);
    box-shadow: 0 4px 10px rgba(0,0,0,.36);
}
.io-black-mode .welfare-modal-btn--secondary {
    background: transparent;
    color: #e23843;
    border-color: rgba(226,56,67,.32);
}
.io-black-mode .welfare-modal-btn--secondary:hover {
    background: rgba(226,56,67,.09);
}

/* 灰度模式强制保留彩色 */
.io-grey-mode .welfare-card,
.io-grey-mode .welfare-modal-btn {
    filter: none !important;
}

/* =========响应式适配【重点修改】========= */
@media (max-width: 992px) {
    .welfare-container {
        grid-template-columns: repeat(2,1fr);
        padding: 0 16px;
        gap: 16px;
    }
}
@media (max-width: 768px) {
    .welfare-container {
        grid-template-columns: 1fr;
        padding: 0 16px;
        gap: 16px;
    }
    .welfare-card {
        padding: 16px;
    }
    .welfare-card-title {
        font-size: 16px;
    }
    .welfare-item {
        padding: 10px 12px;
    }
    .welfare-modal {
        padding: 16px;
    }
    .welfare-modal-body {
        padding: 18px;
    }
    .welfare-modal-header {
        padding: 16px 20px;
    }
}

@media (max-width: 375px) {
    .welfare-container {
        padding: 0 14px;
        gap: 14px;
    }
    .welfare-card {
        padding: 14px;
        border-radius: 12px;
    }
}
