.gifts-page {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    background: var(--bg-color);
}

.gifts-page .gift-summary {
    display: flex;
    min-height: 78px;
    padding: 15px;
    align-items: center;
    justify-content: space-around;
    background: #fff;
    text-align: center;
}

.gifts-page .gift-summary > div {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    flex-direction: column;
}

.gifts-page .gift-summary > div + div {
    border-left: 1px solid var(--border-color);
}

.gifts-page .gift-summary span {
    color: var(--text-sub);
    font-size: 11px;
}

.gifts-page .gift-summary strong {
    margin-top: 5px;
    color: var(--text-main);
    font-size: 18px;
}

.gifts-page .gift-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    min-height: 44px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid var(--border-color);
    background: #fff;
}

.gifts-page .gift-tab {
    position: relative;
    min-height: 44px;
    color: #666;
    font-size: 13px;
}

.gifts-page .gift-tab.active {
    color: var(--primary-color);
    font-weight: bold;
}

.gifts-page .gift-tab.active::after {
    position: absolute;
    right: 35%;
    bottom: 0;
    left: 35%;
    height: 2px;
    border-radius: 2px;
    background: var(--primary-color);
    content: "";
}

.gifts-page .gift-catalog {
    display: grid;
    padding: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.gifts-page .gift-card {
    min-width: 0;
    min-height: 190px;
    border-radius: 8px;
    background: #fff;
}

.gifts-page .gift-card-button {
    display: flex;
    width: 100%;
    min-height: 190px;
    padding: 14px 8px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--text-main);
}

.gifts-page .gift-visual {
    display: flex;
    width: 58px;
    height: 58px;
    margin-bottom: 8px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 26px;
}

.gifts-page .gift-tone-pink { background: #ffe8ee; color: #e64980; }
.gifts-page .gift-tone-green { background: #e6f7ef; color: #268d62; }
.gifts-page .gift-tone-yellow { background: #fff4cc; color: #b98500; }
.gifts-page .gift-tone-blue { background: #e8f1ff; color: #3976c6; }
.gifts-page .gift-tone-purple { background: #f2eaff; color: #8056c9; }
.gifts-page .gift-tone-red { background: #ffe9e6; color: #cf5547; }

.gifts-page .gift-card-button strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gifts-page .gift-rarity {
    margin-top: 5px;
    color: #9a6c1d;
    font-size: 10px;
}

.gifts-page .gift-price {
    margin-top: 5px;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: bold;
}

.gifts-page .gift-card-button small {
    margin-top: 5px;
    color: var(--text-sub);
    font-size: 10px;
}

.gifts-page .gift-empty {
    padding: 80px 20px 30px;
    color: var(--text-sub);
    text-align: center;
}

.gifts-page .gift-empty > i {
    margin-bottom: 14px;
    color: #ccc;
    font-size: 42px;
}

.gifts-page .gift-empty h2 {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: normal;
}

.gifts-page .gift-empty p {
    font-size: 12px;
}

.gifts-page .gift-layer {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: flex;
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
    align-items: flex-end;
}

.gifts-page .gift-layer-mask {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.42);
}

.gifts-page .gift-detail-sheet {
    position: relative;
    z-index: 1;
    width: 100%;
    max-height: calc(100vh - 44px);
    max-height: calc(100dvh - 44px);
    border-radius: 8px 8px 0 0;
    overflow-y: auto;
    background: #fff;
}

.gifts-page .gift-detail-header {
    display: flex;
    min-height: 52px;
    padding: 0 15px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.gifts-page .gift-detail-header h2 {
    font-size: 16px;
    font-weight: bold;
}

.gifts-page .gift-detail-close {
    width: 36px;
    height: 36px;
    color: var(--text-sub);
    font-size: 18px;
}

.gifts-page .gift-detail-content {
    display: flex;
    padding: 24px 15px calc(18px + env(safe-area-inset-bottom));
    align-items: center;
    flex-direction: column;
}

.gifts-page .gift-detail-content > .gift-visual {
    width: 76px;
    height: 76px;
    margin-bottom: 12px;
    font-size: 34px;
}

.gifts-page .gift-detail-content > h2 {
    font-size: 18px;
    font-weight: bold;
}

.gifts-page .gift-detail-rarity {
    margin-top: 6px;
    color: #9a6c1d;
    font-size: 11px;
}

.gifts-page .gift-detail-content > p {
    max-width: 300px;
    margin-top: 10px;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

.gifts-page .gift-detail-stats {
    width: 100%;
    margin: 18px 0 0;
    padding: 0 10px;
}

.gifts-page .gift-detail-stats > div {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.gifts-page .gift-detail-stats dt {
    color: var(--text-sub);
}

.gifts-page .gift-detail-stats dd {
    margin: 0;
    color: var(--text-main);
}

.gifts-page .gift-to-reward {
    min-width: 132px;
    min-height: 40px;
    margin-top: 20px;
    padding: 8px 20px;
    border-radius: 20px;
    background: var(--primary-color);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.gifts-page .gift-to-reward:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.gifts-page.gift-layer-open {
    overflow-y: hidden;
}

@media (max-width: 359px) {
    .gifts-page .gift-catalog {
        padding-right: 8px;
        padding-left: 8px;
        gap: 8px;
    }

    .gifts-page .gift-card,
    .gifts-page .gift-card-button {
        min-height: 180px;
    }
}
