* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

.allow-copy,
.allow-copy *,
input,
textarea,
[contenteditable="true"] {
    user-select: text;
    -webkit-user-select: text;
    -ms-user-select: text;
    -webkit-touch-callout: default;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    font-family: 'Arial', sans-serif;
}

.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 20%, rgba(0, 212, 255, 0.18), transparent 32%),
        rgba(3, 6, 18, 0.92);
    backdrop-filter: blur(10px);
}

.auth-card {
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 28px;
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.28);
    background: linear-gradient(180deg, rgba(17, 25, 52, 0.96), rgba(5, 9, 24, 0.96));
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45), 0 0 28px rgba(0, 212, 255, 0.14);
}

.auth-register-type {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.auth-register-type label {
    cursor: pointer;
}

.auth-register-type input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-register-type span {
    display: grid;
    place-items: center;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: #aeb8d6;
    font-size: 14px;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.24);
}

.auth-register-type input:checked + span {
    border-color: #00d4ff;
    color: #fff;
    background: rgba(0, 153, 255, 0.24);
    box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.24);
}

.auth-logo {
    display: block;
    width: 104px;
    height: 104px;
    margin: -4px auto 8px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 128, 255, 0.28));
}

.auth-title {
    color: #00d4ff;
    font-size: 30px;
    font-weight: 900;
    text-align: center;
    text-shadow: 0 0 16px rgba(0, 212, 255, 0.75);
}

.auth-subtitle {
    margin: 8px 0 18px;
    color: #aeb8d6;
    font-size: 13px;
    text-align: center;
}

.auth-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
}

.auth-mode-tab {
    min-height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #9faccc;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
}

.auth-mode-tab.active {
    background: linear-gradient(135deg, #00d4ff, #0066ff);
    color: #fff;
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.28);
}

.auth-panel.hidden {
    display: none;
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    outline: none;
}

.auth-combo {
    position: relative;
    margin-bottom: 10px;
}

.auth-combo-input {
    margin-bottom: 0;
    padding-right: 34px;
}

.auth-combo-toggle {
    position: absolute;
    right: 6px;
    inset-block: 0;
    margin-block: auto;
    display: grid;
    place-items: center;
    width: 26px;
    height: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #9fb4e8;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.auth-combo-menu {
    position: absolute;
    top: calc(100% - 4px);
    left: 0;
    width: 100%;
    z-index: 60;
    background: #101a38;
    border: 1px solid rgba(120, 200, 255, 0.35);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    max-height: 200px;
    overflow-y: auto;
}

.auth-combo-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 0;
    background: transparent;
    color: #dfe8ff;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
}

.auth-combo-item:hover,
.auth-combo-item:focus {
    background: rgba(0, 212, 255, 0.14);
    color: #fff;
}


.auth-input:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.16);
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    color: #9faccc;
    font-size: 12px;
    cursor: pointer;
}

.auth-remember-options {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 30px;
    margin: -2px 2px 4px;
}

.auth-remember input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #00d4ff;
}

.auth-remember input:focus-visible {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

.auth-actions {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 6px;
}

.auth-primary,
.auth-secondary {
    margin: 0;
    padding: 11px 14px;
    border: 0;
    border-radius: 18px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
}

.auth-primary { background: linear-gradient(135deg, #00d4ff, #0066ff); }
.auth-secondary { background: linear-gradient(135deg, #ff6b9d, #c44dff); }

.auth-primary:disabled,
.auth-secondary:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.auth-msg {
    min-height: 18px;
    margin-top: 12px;
    color: #ff6b6b;
    font-size: 12px;
    text-align: center;
}

.auth-msg.info { color: #8ec5ff; }
.auth-msg.warn { color: #ff6b6b; }

.auth-notice {
    position: fixed;
    z-index: 1200;
    pointer-events: none;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: min(360px, calc(100vw - 32px));
    min-height: 72px;
    padding: 12px 16px;
    border: 1px solid rgba(93, 255, 194, 0.42);
    border-radius: 8px;
    background: rgba(5, 20, 28, 0.96);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48), 0 0 24px rgba(93, 255, 194, 0.12);
    animation: authNoticeIn 0.32s ease-out both;
}

.auth-notice-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(93, 255, 194, 0.14);
    color: #7dffcb;
    border: 1px solid rgba(93, 255, 194, 0.4);
    font-size: 21px;
    font-weight: 900;
}

.auth-notice.error {
    border-color: rgba(255, 107, 157, 0.48);
    background: rgba(29, 7, 22, 0.97);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48), 0 0 24px rgba(255, 107, 157, 0.14);
}

.auth-notice.error .auth-notice-icon {
    color: #ff8bb4;
    border-color: rgba(255, 107, 157, 0.46);
    background: rgba(255, 107, 157, 0.13);
}

.auth-notice strong {
    display: block;
    color: #eafff7;
    font-size: 15px;
}

.auth-notice p {
    margin-top: 3px;
    color: #9fbbbd;
    font-size: 12px;
    line-height: 1.4;
}

@keyframes authNoticeIn {
    from { opacity: 0; transform: translate(-50%, -14px) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ==================== 整体布局 ==================== */
:root {
    --game-side-rail-width: 72px;
}

.game-layout {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    flex-shrink: 0;
}

/* 游戏画布按固有宽高比(640:860)等比缩放，高度适配视口，
   避免画布底部超出可视区域导致角色被裁切。只影响显示尺寸，不改逻辑坐标。 */
#gameCanvas {
    display: block;
    flex-shrink: 0;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 80px);
    aspect-ratio: 640 / 860;
    align-self: center;
    margin: 0 auto;
}

.game-sidebar,
.game-left-sidebar {
    width: var(--game-side-rail-width);
    min-width: var(--game-side-rail-width);
    background: rgba(0, 0, 0, 0.6);
    flex-shrink: 0;
}

.game-left-sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.game-sidebar {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    position: relative;
}

/* ==================== 侧边栏按钮 ==================== */
.sidebar-btns {
    display: flex;
    width: 100%;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    align-self: stretch;
}

.sidebar-btn {
    width: 44px;
    height: 44px;
    font-size: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(135deg, #555 0%, #333 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    line-height: 1;
    padding: 0;
}

.sidebar-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(150, 150, 150, 0.4);
}

.portal-sidebar-btn {
    margin-top: 56px;
}

.pet-sidebar-btn {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44dff 100%);
    position: absolute;
    top: calc(50% + 18px);
    transform: translateY(-50%);
    margin-top: 0;
}

.shop-sidebar-btn {
    background: linear-gradient(135deg, #ffb347 0%, #ff6f3c 100%);
}

.shop-sidebar-mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 2px 2px rgba(91, 34, 0, 0.42));
}

.bank-sidebar-btn {
    border-color: rgba(255, 210, 72, 0.54);
    background: linear-gradient(145deg, #173748 0%, #0d1f31 100%);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.28), 0 0 15px rgba(255, 196, 45, 0.14);
}

.bank-sidebar-image {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.42));
}

.bag-sidebar-btn {
    border-color: rgba(105, 255, 205, 0.58);
    background: linear-gradient(145deg, #2abf88 0%, #126c65 100%);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.28), 0 0 14px rgba(73, 234, 178, 0.18);
}

.bag-sidebar-mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 2px 2px rgba(0, 54, 45, 0.46));
}

.pet-sidebar-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

.pet-sidebar-btn.has-energy {
    animation: petBtnPulse 1s ease-in-out infinite;
}

/* ==================== 侧边栏面板 ==================== */
.sidebar-panels {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    min-width: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 30;
}

.sidebar-panel {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 50%;
    right: max(24px, calc((100vw - 620px) / 2 - 260px));
    transform: translateY(-50%);
    height: min(760px, calc(100vh - 24px));
    width: min(420px, calc(100vw - 96px));
    color: #ccc;
    background: rgba(7, 11, 26, 0.96);
    border: 1px solid rgba(0, 212, 255, 0.22);
    border-radius: 10px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    overflow: hidden;
    pointer-events: auto;
}

.sidebar-panel .pet-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 56px 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
}

.sidebar-panel .pet-panel-header h2 {
    font-size: 18px;
    color: #00d4ff;
    margin: 0;
}

.pet-panel-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pet-header-energy {
    display: none;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(255, 212, 92, 0.32);
    border-radius: 999px;
    background: rgba(255, 212, 92, 0.10);
    color: #ffd45c;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.pet-tab {
    padding: 6px 14px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    background: transparent;
    color: #aaa;
    cursor: pointer;
    white-space: nowrap;
    margin: 0;
    transition: background 0.2s, color 0.2s;
}

.pet-tab.active { background: #c44dff; color: #fff; border-color: #c44dff; }
.pet-tab:hover { background: rgba(196, 77, 255, 0.3); }

.pet-tab-badge {
    background: #ff4444;
    color: #fff;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 4px;
}

.pet-tab-badge.empty {
    display: none;
}

.pet-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    font-size: 18px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    margin: 0;
}

.pet-close-btn:hover { background: rgba(255, 100, 100, 0.5); }

/* 宠物列表 */
.pet-tab-content { flex: 1; overflow-y: auto; padding: 10px; }

.bag-view-tabs {
    position: sticky;
    top: -10px;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: -2px 0 12px;
    padding: 8px 0;
    background: #070b1a;
}

.bag-view-tab {
    height: 36px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: #aeb8d4;
    font-size: 13px;
    font-weight: 800;
}

.bag-view-tab.active {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.12);
    color: #ffffff;
    box-shadow: inset 0 -2px 0 #00d4ff;
}

.pet-list { display: flex; flex-direction: column; gap: 8px; }

#petPanel {
    width: min(520px, calc(100vw - 40px));
    /* 进化预览内容较高，面板整体加高 60px 保证底部按钮可见 */
    height: min(820px, calc(100vh - 24px));
}

.pet-empty-msg {
    text-align: center;
    color: #777;
    padding: 40px 20px;
    font-size: 14px;
}

.pet-card {
    display: grid;
    grid-template-columns: 144px minmax(0, 1fr);
    align-items: stretch;
    gap: 14px;
    min-height: 142px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.065), rgba(26, 32, 54, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.pet-card:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.095), rgba(26, 42, 68, 0.82));
    border-color: rgba(104, 219, 255, 0.36);
}

.pet-card.deployed {
    border-color: rgba(255, 211, 92, 0.5);
    box-shadow: inset 3px 0 0 #ffd45c;
}

.pet-card-art {
    position: relative;
    width: 144px;
    min-height: 116px;
    overflow: hidden;
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 38%, rgba(255,255,255,0.18), transparent 46%),
        linear-gradient(180deg, rgba(0, 180, 210, 0.13), rgba(255, 184, 77, 0.08));
    border: 1px solid rgba(104, 219, 255, 0.18);
}

.pet-card-art img {
    position: absolute;
    top: 50%;
    left: 0;
    width: 200%;
    max-width: none;
    height: auto;
    transform: translateY(-50%);
    pointer-events: none;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.36));
}

.pet-card-info { min-width: 0; }

.pet-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pet-card-name {
    min-width: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 900;
}

.pet-card-stage {
    width: fit-content;
    margin-top: 4px;
    color: #73dcff;
    font-size: 11px;
    font-weight: 800;
}

.pet-card.auto-locked {
    border-color: rgba(255, 213, 88, 0.42);
    box-shadow: 0 0 12px rgba(255, 199, 55, 0.14);
}

.pet-card-lock {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    vertical-align: middle;
    filter: drop-shadow(0 0 4px rgba(255, 210, 90, 0.55));
}

.pet-role-badge {
    width: fit-content;
    margin-top: 5px;
    padding: 3px 7px;
    border: 1px solid rgba(255, 213, 88, 0.28);
    border-radius: 5px;
    color: #ffe077;
    background: rgba(255, 199, 55, 0.08);
    font-size: 11px;
    font-weight: 900;
}

.pet-card-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 9px;
}

.pet-card-stats > span {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.24);
}

.pet-card-stats small {
    color: #7f8aa8;
    font-size: 10px;
}

.pet-card-stats strong {
    color: #f4f7ff;
    font-size: 12px;
    text-align: right;
}

.pet-card-base {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 6px;
    margin-top: 7px;
    color: #aeb8d4;
    line-height: 1.35;
}

.pet-card-base > span {
    grid-row: 1 / span 2;
}

.pet-card-base strong {
    color: #e8edff;
    font-size: 11px;
}

.pet-card-base small {
    color: #7f8aa8;
    font-size: 10px;
}

.pet-card-deploy {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 3px 7px;
    border-radius: 6px;
    color: #08101d;
    background: #ffd45c;
    font-size: 10px;
    font-weight: 900;
}

.pet-card-deploy:empty {
    display: none;
}

@media (max-width: 420px) {
    .pet-card {
        grid-template-columns: 116px minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .pet-card-art {
        width: 116px;
    }
}

/* 宠物蛋卡片 */
.pet-eggs-list { display: flex; flex-direction: column; gap: 8px; }

.bag-section {
    display: grid;
    gap: 10px;
}

.bag-section + .bag-section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.bag-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #00d4ff;
    font-size: 13px;
    font-weight: 900;
}

.bag-section-head b {
    color: #8290b3;
    font-size: 11px;
    font-weight: 600;
}

#petBagView {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#petBagView::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.treasure-chest-bag-list,
.pet-food-bag-list,
.skill-book-bag-list,
.shop-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pet-empty-msg.compact {
    padding: 18px 10px;
}

.plane-skin-bag-list {
    display: grid;
    gap: 10px;
}

.plane-skin-bag-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) 72px;
    align-items: center;
    gap: 11px;
    min-height: 104px;
    padding: 9px;
    border: 1px solid rgba(92, 225, 255, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(110deg, rgba(45, 214, 238, 0.07), transparent 46%),
        rgba(255, 255, 255, 0.04);
}

.plane-skin-bag-card.equipped {
    border-color: rgba(255, 216, 77, 0.72);
    box-shadow: inset 0 0 18px rgba(255, 216, 77, 0.08);
}

.plane-skin-preview-wrap {
    width: 104px;
    height: 86px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(120, 232, 255, 0.2);
    border-radius: 6px;
    background:
        radial-gradient(circle at 50% 44%, rgba(79, 223, 255, 0.13), transparent 54%),
        #091326;
    overflow: hidden;
}

.plane-skin-preview {
    display: block;
    width: 104px;
    height: 82px;
}

.plane-skin-card-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.plane-skin-card-copy strong {
    color: #ffffff;
    font-size: 15px;
}

.plane-skin-card-copy span {
    color: #8290b3;
    font-size: 11px;
}

.plane-skin-card-copy .plane-skin-attack-stat,
.plane-skin-shop-card .plane-skin-attack-stat {
    color: #65efba;
    font-size: 13px;
    font-weight: 800;
}

.plane-skin-equip-btn {
    width: 72px;
    height: 34px;
    margin: 0;
    padding: 0;
    border-radius: 6px;
    font-size: 12px;
}

.plane-skin-equip-btn:disabled {
    border-color: rgba(255, 216, 77, 0.42);
    background: rgba(255, 216, 77, 0.14);
    color: #ffd84d;
    cursor: default;
    opacity: 1;
    box-shadow: none;
}

.plane-skin-equip-overlay {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 7, 20, 0.84);
    backdrop-filter: blur(7px);
}

.plane-skin-equip-card {
    width: min(330px, 100%);
    padding: 22px;
    border: 1px solid rgba(88, 220, 255, 0.54);
    border-radius: 8px;
    background: #10182c;
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.58), 0 0 24px rgba(44, 211, 255, 0.14);
    text-align: center;
}

.plane-skin-equip-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    border: 1px solid rgba(88, 220, 255, 0.56);
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.12);
    color: #79e8ff;
    font-size: 25px;
}

.plane-skin-equip-card h2 {
    margin: 0;
    color: #fff;
    font-size: 21px;
}

.plane-skin-equip-card p {
    margin: 7px 0 18px;
    color: #8cecff;
    font-size: 14px;
    font-weight: 800;
}

.plane-skin-equip-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.plane-skin-equip-actions button,
.plane-skin-equip-cancel {
    min-height: 44px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 800;
}

.plane-skin-equip-actions button {
    border: 1px solid rgba(75, 224, 255, 0.58);
    background: #087db5;
    color: #fff;
}

.plane-skin-equip-actions button:disabled {
    border-color: rgba(255, 216, 77, 0.4);
    background: rgba(255, 216, 77, 0.12);
    color: #ffd84d;
    cursor: default;
}

.plane-skin-equip-cancel {
    width: 100%;
    margin-top: 10px;
    border: 1px solid rgba(151, 169, 204, 0.35);
    background: #28324a;
    color: #dfe7f7;
}

.plane-skin-equip-actions button:focus-visible,
.plane-skin-equip-cancel:focus-visible {
    outline: 2px solid #ffd84d;
    outline-offset: 2px;
}

.skill-book-bag-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 74px;
    padding: 9px 10px;
    border: 1px solid rgba(255, 212, 92, 0.2);
    border-radius: 8px;
    background: rgba(255, 212, 92, 0.05);
}

.skill-book-icon,
.shop-book-icon,
.treasure-reward-item-icon.book-sparkle {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1.5px solid rgba(255, 77, 79, 0.72);
    background: rgba(255, 255, 255, 0.08);
    animation: skill-book-glow 2.8s ease-in-out infinite;
}

.skill-book-icon {
    width: 56px;
    height: 62px;
    border-radius: 7px;
    font-size: 40px;
}

.shop-book-icon {
    width: 42px;
    height: 48px;
    border-radius: 7px;
    font-size: 28px;
}

/* 精品品质（#ff4d4f）呼吸微光 */
@keyframes skill-book-glow {
    0%, 100% {
        border-color: rgba(255, 77, 79, 0.55);
        box-shadow: 0 0 5px rgba(255, 77, 79, 0.25), inset 0 0 4px rgba(255, 77, 79, 0.1);
    }
    50% {
        border-color: rgba(255, 99, 102, 0.9);
        box-shadow: 0 0 9px rgba(255, 77, 79, 0.4), inset 0 0 7px rgba(255, 77, 79, 0.16);
    }
}

/* 缓慢扫过的低调闪光 */
.skill-book-icon::after,
.shop-book-icon::after,
.treasure-reward-item-icon.book-sparkle::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 34%, rgba(255, 255, 255, 0.26) 47%, rgba(255, 255, 255, 0.05) 53%, transparent 66%);
    background-size: 240% 240%;
    background-position: 130% 0%;
    animation: skill-book-sparkle 3.4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes skill-book-sparkle {
    0% { background-position: 130% 0%; opacity: 0; }
    42% { opacity: 1; }
    70%, 100% { background-position: -40% 100%; opacity: 0; }
}

.skill-book-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.skill-book-copy strong {
    color: #fff;
    font-size: 13px;
}

.skill-book-copy small {
    color: #7dffcb;
    font-size: 11px;
}

.skill-book-bag-card > b {
    color: #ffd45c;
    font-size: 13px;
}

.skill-book-action {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.skill-book-action > b {
    color: #ffd45c;
    font-size: 13px;
}

.skill-book-learned {
    color: #ffd84d;
}

.skill-book-learn-btn {
    padding: 4px 12px;
    border: 1px solid rgba(125, 255, 203, 0.5);
    border-radius: 6px;
    background: rgba(125, 255, 203, 0.14);
    color: #7dffcb;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.skill-book-learn-btn:hover:not(:disabled) {
    background: rgba(125, 255, 203, 0.28);
}

.skill-book-learn-btn:disabled {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.4);
    cursor: default;
}

.bag-chest-card {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 88px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 212, 92, 0.28);
    border-radius: 8px;
    background:
        linear-gradient(110deg, rgba(255, 212, 92, 0.12), rgba(255, 123, 50, 0.05) 46%, rgba(0, 212, 255, 0.05)),
        rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.bag-chest-card.boss {
    border-color: rgba(255, 107, 157, 0.42);
    background:
        linear-gradient(110deg, rgba(255, 212, 92, 0.13), rgba(255, 107, 157, 0.1) 52%, rgba(196, 77, 255, 0.09)),
        rgba(255, 255, 255, 0.04);
}

.bag-chest-art-wrap {
    width: 76px;
    height: 74px;
    display: grid;
    place-items: center;
    overflow: visible;
}

.bag-treasure-box-art {
    width: 74px;
    height: 74px;
    flex: none;
    object-fit: contain;
    filter: drop-shadow(0 5px 10px rgba(34, 203, 255, 0.34));
    animation: bagChestHover 2.4s ease-in-out infinite;
}

.bag-chest-card.boss .bag-treasure-box-art {
    filter: drop-shadow(0 5px 12px rgba(255, 113, 66, 0.5));
}

.bag-chest-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.bag-chest-copy strong {
    color: #fff1b5;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
}

.bag-chest-copy span {
    color: #8f9cbd;
    font-size: 11px;
    line-height: 1.35;
}

.bag-chest-copy .bag-chest-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #8f9cbd;
    font-size: 11px;
    line-height: 1.35;
}

.bag-chest-copy .bag-chest-owner {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    font-style: normal;
    line-height: 1;
    color: #7fd3ff;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    white-space: nowrap;
}

.bag-chest-owner-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.bag-chest-owner-dot.p1 {
    background: #3ea6ff;
    box-shadow: 0 0 5px rgba(62, 166, 255, 0.8);
}

.bag-chest-owner-dot.p2 {
    background: #ffb454;
    box-shadow: 0 0 5px rgba(255, 180, 84, 0.8);
}

@keyframes bagChestHover {
    0%, 100% { transform: translateY(1px) scale(0.98); }
    50% { transform: translateY(-3px) scale(1.02); }
}

.bag-chest-open-btn {
    min-width: 58px;
    height: 34px;
    margin: 0;
    padding: 0 13px;
    border: 1px solid rgba(255, 244, 189, 0.45);
    border-radius: 17px;
    background: linear-gradient(135deg, #ffd45c, #ff7b32);
    color: #321704;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(255, 123, 50, 0.2);
    transition: transform 0.18s, box-shadow 0.18s;
}

.bag-chest-open-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255, 123, 50, 0.34);
}

.bag-chest-empty {
    min-height: 106px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    border: 1px dashed rgba(255, 212, 92, 0.18);
    border-radius: 8px;
    background: rgba(255, 212, 92, 0.025);
    text-align: center;
}

.bag-chest-empty span {
    color: rgba(255, 212, 92, 0.6);
    font-size: 24px;
}

.bag-chest-empty strong {
    color: #aeb8d4;
    font-size: 13px;
}

.bag-chest-empty small {
    color: #66708c;
    font-size: 11px;
}

.food-card,
.shop-card {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
}

.food-can-icon {
    width: 42px;
    height: 48px;
    border-radius: 10px 10px 7px 7px;
    background: linear-gradient(180deg, #e8eef9 0%, #9da9bd 45%, #596274 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    box-shadow: inset 0 3px 0 rgba(255,255,255,0.45), 0 5px 12px rgba(0,0,0,0.25);
    position: relative;
}

.food-can-icon::before,
.food-can-icon::after {
    content: '';
    position: absolute;
    left: 6px;
    right: 6px;
    height: 2px;
    background: rgba(255,255,255,0.55);
}

.food-can-icon::before { top: 6px; }
.food-can-icon::after { bottom: 7px; }

.food-name {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.food-bonuses {
    display: flex;
    gap: 8px;
    color: #9fdcff;
    font-size: 11px;
    margin-top: 3px;
    font-weight: 700;
}

.food-count,
.food-cost {
    color: #ffcc00;
    font-size: 13px;
    white-space: nowrap;
}

.food-cost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.food-cost b {
    color: #fff;
    font-size: 14px;
}

.shop-energy-row,
.wallet-row {
    padding: 10px 16px;
    color: #ffcc00;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 14px;
}

.wallet-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.wallet-row span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.wallet-row b {
    color: #fff;
}

.shop-category-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.shop-category-tab {
    min-width: 0;
    height: 38px;
    padding: 0 6px;
    border: 1px solid rgba(127, 151, 191, 0.32);
    border-radius: 6px;
    background: rgba(12, 20, 39, 0.9);
    color: #9da9c4;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.pet-card-new {
    border-color: rgba(255, 213, 74, 0.95);
    box-shadow: 0 0 0 2px rgba(255, 213, 74, 0.55), 0 0 18px rgba(255, 213, 74, 0.55);
    animation: pet-new-glow 1.4s ease-in-out infinite;
}

@keyframes pet-new-glow {
    0%, 100% { box-shadow: 0 0 0 2px rgba(255, 213, 74, 0.55), 0 0 10px rgba(255, 213, 74, 0.4); }
    50%      { box-shadow: 0 0 0 3px rgba(255, 213, 74, 0.9), 0 0 24px rgba(255, 213, 74, 0.8); }
}

.pet-card-new-badge {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 7px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff9f1c, #ffd54a);
    color: #231a00;
    font-size: 11px;
    font-weight: 800;
    vertical-align: middle;
}

.shop-category-tab.active {
    border-color: #19d4ff;
    background: rgba(21, 169, 221, 0.16);
    color: #fff;
    box-shadow: inset 0 -2px 0 #19d4ff, 0 0 12px rgba(25, 212, 255, 0.16);
}

.shop-items {
    padding: 10px 12px 12px;
    overflow-y: auto;
}

.shop-section {
    display: grid;
    gap: 8px;
}

.shop-section + .shop-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.shop-section h3 {
    margin: 0;
    color: #9fdcff;
    font-size: 13px;
}

.shop-section-list {
    display: grid;
    gap: 10px;
}

.shop-card {
    grid-template-columns: 78px minmax(0, 1fr) 58px;
    gap: 13px;
    min-height: 106px;
    padding: 12px;
    border-color: rgba(0, 212, 255, 0.18);
    background:
        linear-gradient(115deg, rgba(0, 212, 255, 0.07), transparent 42%),
        rgba(255, 255, 255, 0.045);
    overflow: hidden;
}

.skill-book-shop-card {
    grid-template-columns: 58px minmax(0, 1fr) 58px;
    min-height: 88px;
}

.shop-book-note {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid rgba(87, 255, 195, 0.2);
    border-radius: 6px;
    background: rgba(87, 255, 195, 0.07);
    color: #9eabc6;
    font-size: 11px;
}

.shop-book-note strong {
    flex: 0 0 auto;
    color: #7dffcb;
    font-size: 12px;
}

.skill-book-mode {
    display: inline-flex;
    align-items: center;
    height: 19px;
    margin-left: 7px;
    padding: 0 6px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-size: 9px;
    font-style: normal;
    line-height: 1;
    vertical-align: middle;
}

.skill-book-mode.passive {
    color: #61edb7;
    background: rgba(97, 237, 183, 0.08);
}

.skill-book-mode.learn {
    color: #6ecbff;
    background: rgba(110, 203, 255, 0.08);
}

.plane-skin-shop-card {
    grid-template-columns: 104px minmax(0, 1fr) 72px;
    min-height: 112px;
    border-color: rgba(92, 225, 255, 0.25);
    background:
        linear-gradient(110deg, rgba(92, 225, 255, 0.09), transparent 52%),
        rgba(255, 255, 255, 0.045);
}

.plane-skin-shop-card.equipped {
    border-color: rgba(255, 216, 77, 0.62);
}

.plane-skin-shop-card .plane-skin-preview-wrap {
    justify-self: center;
}

.plane-skin-shop-card .food-name {
    margin-bottom: 5px;
    color: #ffffff;
    font-size: 16px;
}

.plane-skin-shop-card .shop-stock {
    margin-top: 0;
    color: #8ea1c8;
    font-size: 11px;
}

.plane-skin-shop-action {
    gap: 7px;
}

.shop-buy-btn.plane-skin-buy-btn {
    width: 70px;
    border-radius: 6px;
    font-size: 11px;
}

.skill-book-shop-card .shop-book-icon {
    justify-self: center;
}

.shop-can-art {
    position: relative;
    width: 72px;
    height: 82px;
    display: grid;
    place-items: center;
    border: 2px solid #d8e2f1;
    border-radius: 10px 10px 13px 13px;
    background:
        linear-gradient(90deg, rgba(255,255,255,.64), transparent 18%, transparent 76%, rgba(20,28,44,.36)),
        linear-gradient(180deg, #edf3fb 0 12%, #96a5ba 13% 20%, #ec568e 21% 79%, #6f7b90 80% 88%, #dce5f2 89%);
    box-shadow: inset 0 2px 3px rgba(255,255,255,.7), 0 8px 18px rgba(0,0,0,.3);
}

.shop-can-rim {
    position: absolute;
    top: -4px;
    left: 4px;
    right: 4px;
    height: 8px;
    border: 1px solid rgba(53, 64, 83, .55);
    border-radius: 50%;
    background: linear-gradient(180deg, #ffffff, #8795aa);
}

.shop-can-label {
    position: relative;
    width: 56px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255,255,255,.8);
    border-radius: 8px;
    background: linear-gradient(145deg, #fff7df, #ffd3b9);
    box-shadow: 0 3px 9px rgba(76, 13, 43, .25);
}

.shop-can-pet {
    font-size: 34px;
    line-height: 1;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,.2));
}

.shop-can-food {
    position: absolute;
    right: -5px;
    bottom: -6px;
    width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #ff5f92;
    font-size: 13px;
    box-shadow: 0 3px 7px rgba(0,0,0,.28);
}

.shop-card-copy {
    min-width: 0;
}

.shop-card .food-name {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.25;
}

.shop-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.shop-benefits span {
    padding: 4px 7px;
    border: 1px solid rgba(87, 255, 195, .2);
    border-radius: 5px;
    background: rgba(87, 255, 195, .08);
    color: #7dffcb;
    font-size: 11px;
    white-space: nowrap;
}

.shop-benefits b {
    color: #fff;
    font-size: 9px;
}

.shop-stock {
    margin-top: 7px;
    color: #75819f;
    font-size: 10px;
}

.shop-card-action {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 8px;
}

.shop-card-action .food-cost {
    font-size: 14px;
    font-weight: 900;
}

.shop-buy-btn {
    width: 58px;
    height: 34px;
    padding: 0;
    margin: 0;
    border-radius: 17px;
    font-size: 12px;
}

.shop-buy-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    box-shadow: none;
}

#bankPanel {
    width: min(520px, calc(100vw - 32px));
    height: auto;
    min-height: 430px;
    border-color: rgba(255, 205, 66, 0.28);
    background: #080e1d;
}

.sidebar-panel .bank-panel-header {
    min-height: 64px;
    padding: 12px 56px 12px 16px;
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: #0c1426;
}

.bank-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bank-heading-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 3px solid #fff0a3;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffe875, #ee9e00);
    color: #754300;
    font-size: 22px;
    font-weight: 1000;
    line-height: 1;
    box-shadow: 0 3px 0 #8b5b00, 0 7px 14px rgba(0, 0, 0, 0.3);
}

.sidebar-panel .bank-heading h2 {
    color: #f7fbff;
    font-size: 20px;
}

.bank-wallet {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    min-height: 76px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #0a1121;
}

.bank-balance-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 0;
    padding: 5px 9px;
}

.bank-balance-item + .bank-balance-item {
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.bank-balance-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.bank-balance-copy small {
    color: #8190ad;
    font-size: 10px;
    line-height: 1;
}

.bank-balance-copy b {
    overflow: hidden;
    color: #fff;
    font-size: 18px;
    line-height: 1.15;
    text-overflow: ellipsis;
}

.bank-currency-icon,
.currency-mini-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    font-weight: 1000;
    line-height: 1;
}

.bank-currency-icon {
    width: 40px;
    height: 40px;
    font-size: 17px;
}

.bank-energy-icon {
    border: 3px solid #ffcca8;
    background: linear-gradient(145deg, #ff7d50, #d93d38);
    color: #fff;
    text-shadow: 0 2px 0 rgba(115, 22, 18, 0.55);
    box-shadow: 0 3px 0 #8e2928, 0 5px 12px rgba(255, 93, 57, 0.2);
}

.bank-silver-icon {
    border: 3px solid #f3fbff;
    background: linear-gradient(145deg, #eef7ff, #91a8c1 62%, #60758e);
    color: #35475e;
    text-shadow: 0 1px 0 #fff;
    box-shadow: 0 3px 0 #50657c, 0 5px 12px rgba(164, 204, 238, 0.18);
}

.bank-gold-icon {
    border: 3px solid #fff1a4;
    background: linear-gradient(145deg, #ffe978, #f2aa09 62%, #bd6f00);
    color: #744200;
    text-shadow: 0 1px 0 #fff3a6;
    box-shadow: 0 3px 0 #955900, 0 5px 12px rgba(255, 190, 37, 0.2);
}

.bank-exchanges {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    overflow-y: auto;
}

.bank-product-card {
    display: flex;
    min-width: 0;
    min-height: 262px;
    flex-direction: column;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    background: #101a2d;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.bank-product-silver {
    border-top: 3px solid #a8d4f1;
}

.bank-product-gold {
    border-top: 3px solid #ffc33b;
}

.bank-product-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 30px;
}

.bank-product-heading h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    line-height: 1;
}

.bank-product-heading strong {
    color: #a9b5ca;
    font-size: 14px;
}

.bank-product-art {
    display: grid;
    place-items: center;
    flex: 1;
    min-height: 112px;
}

.bank-product-coin {
    display: grid;
    place-items: center;
    position: relative;
    width: 92px;
    height: 92px;
    border-width: 7px;
    border-radius: 50%;
    font-size: 34px;
    font-weight: 1000;
    line-height: 1;
}

.bank-product-coin::before {
    content: "";
    position: absolute;
    width: 70px;
    height: 70px;
    border: 2px dashed currentColor;
    border-radius: 50%;
    opacity: 0.32;
}

.bank-product-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 32px;
    margin-bottom: 10px;
    color: #9eabc2;
    font-size: 12px;
}

.bank-product-price strong {
    color: #fff;
    font-size: 18px;
}

.currency-mini-icon {
    width: 26px;
    height: 26px;
    border-width: 2px;
    border-style: solid;
    font-size: 11px;
    font-style: normal;
}

.bank-exchange-btn {
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.bank-silver-btn {
    background: linear-gradient(135deg, #24b8ea, #2475d7);
    box-shadow: 0 7px 15px rgba(36, 139, 222, 0.24);
}

.bank-gold-btn {
    background: linear-gradient(135deg, #ffbd31, #e67900);
    box-shadow: 0 7px 15px rgba(232, 132, 0, 0.24);
}

.bank-exchange-btn:disabled {
    cursor: not-allowed;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #24324a;
    color: #70809d;
    box-shadow: none;
}

.bank-exchange-btn:not(:disabled):hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.bank-exchange-btn:not(:disabled):active {
    transform: translateY(1px);
}

@media (max-width: 520px) {
    #bankPanel {
        right: 8px;
        width: calc(100vw - 16px);
        min-height: 408px;
    }

    .bank-wallet {
        padding-inline: 8px;
    }

    .bank-balance-item {
        gap: 6px;
        padding-inline: 5px;
    }

    .bank-currency-icon {
        width: 34px;
        height: 34px;
        border-width: 2px;
        font-size: 14px;
    }

    .bank-exchanges {
        gap: 8px;
        padding: 10px;
    }

    .bank-product-card {
        min-height: 244px;
        padding: 12px;
    }

    .bank-product-coin {
        width: 76px;
        height: 76px;
        border-width: 6px;
        font-size: 28px;
    }

    .bank-product-coin::before {
        width: 56px;
        height: 56px;
    }
}

.pet-egg-card {
    background: rgba(255, 215, 0, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pet-egg-card:hover { background: rgba(255, 215, 0, 0.12); }

.pet-egg-icon {
    width: 48px;
    height: 54px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 12px;
    background:
        radial-gradient(circle at 50% 38%, rgba(255,255,255,0.24), transparent 48%),
        linear-gradient(180deg, rgba(255, 216, 77, 0.17), rgba(255, 107, 157, 0.08));
    border: 1px solid rgba(255, 216, 77, 0.16);
    font-size: 38px;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(255, 216, 77, 0.22));
}
.pet-egg-info { flex: 1; }
.pet-egg-name { font-size: 14px; font-weight: bold; color: #ffd700; }
.pet-egg-progress { font-size: 11px; color: #aaa; margin-top: 2px; }

/* 宠物详情 */
.pet-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 12px 12px 22px;
    gap: 10px;
    position: relative;
}

.pet-detail-tabs {
    display: flex;
    gap: 8px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pet-detail-tabs::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.pet-detail-tab {
    min-width: 76px;
    margin: 0;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: #9aa6c7;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.pet-detail-tab.active {
    color: #fff;
    border-color: rgba(0, 212, 255, 0.45);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.24), rgba(196, 77, 255, 0.28));
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.16);
}

.pet-detail-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.pet-detail-tab-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    flex: 1;
    /* 内容超高时允许滚动，避免底部按钮被裁切不可达 */
    overflow-y: auto;
    position: relative;
}

.pet-detail-top {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(196, 77, 255, 0.07));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    position: relative;
    flex-shrink: 0;
}

.pet-detail-top .pet-anim-area {
    grid-column: 1;
    grid-row: 1;
}

.pet-detail-top .pet-role-under-anim {
    grid-column: 1;
    grid-row: 2;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
}

.pet-detail-top .pet-stats {
    grid-column: 2;
    grid-row: 1;
}

.pet-detail-top .pet-top-actions {
    grid-column: 1 / -1;
    grid-row: 2;
}

.pet-anim-area {
    width: 232px;
    height: 232px;
    background:
        radial-gradient(circle at 50% 38%, rgba(255,255,255,0.10), transparent 38%),
        linear-gradient(180deg, rgba(10, 16, 34, 0.95), rgba(3, 6, 18, 0.95));
    border: 1px solid rgba(0, 212, 255, 0.18);
    border-radius: 8px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 18px rgba(0, 212, 255, 0.08);
    isolation: isolate;
    cursor: pointer;
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

.pet-anim-area::before {
    content: '';
    position: absolute;
    z-index: 0;
    left: 20px;
    right: 20px;
    bottom: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.14);
    filter: blur(5px);
    transform: scaleX(.9);
    animation: petStageBreath 2.8s ease-in-out infinite;
    pointer-events: none;
}

.pet-anim-area::after {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 0;
    background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.08) 47%, transparent 70%);
    transform: translateX(-125%);
    opacity: 0;
    pointer-events: none;
}

.pet-anim-area:hover {
    border-color: rgba(0, 212, 255, 0.48);
    box-shadow: inset 0 0 22px rgba(0, 212, 255, 0.12), 0 0 18px rgba(0, 212, 255, 0.12);
}

.pet-anim-area:hover::after {
    opacity: 1;
    animation: petStageShine .9s ease-out both;
}

#petCanvas {
    width: 232px;
    height: 232px;
    position: relative;
    z-index: 2;
    display: block;
    touch-action: none;
}

.pet-feed-particles {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
}

.pet-star-badge {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    z-index: 4;
    padding: 2px 12px;
    border: 1px solid rgba(255, 216, 77, 0.65);
    border-radius: 999px;
    background: rgba(7, 14, 32, 0.92);
    color: #ffd84d;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 0 12px rgba(255, 216, 77, 0.25);
    pointer-events: none;
}

.pet-anim-area.feeding {
    animation: feedAreaGlow 0.9s ease-out both;
}

.pet-anim-area.deploying {
    animation: petDeployStage 1.2s cubic-bezier(.2,.8,.25,1) both;
}

.pet-anim-area.reacting {
    animation: petReactStage .72s ease-out both;
}

#petCanvas.eating {
    animation: petEatBounce 0.9s cubic-bezier(.2, 1.4, .35, 1) both;
}

.feed-particle {
    position: absolute;
    z-index: 4;
    font-size: 18px;
    filter: drop-shadow(0 0 8px rgba(255, 216, 77, 0.9));
    animation: feedParticleBurst 0.85s ease-out forwards;
}

.feed-morsel {
    position: absolute;
    z-index: 5;
    left: 4px;
    bottom: 5px;
    font-size: 25px;
    line-height: 1;
    filter: drop-shadow(0 0 9px rgba(255, 216, 77, .95));
    animation: feedMorselIn .82s cubic-bezier(.18,.76,.32,1) forwards;
    transform-origin: center;
}

.pet-stats {
    width: auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pet-stat-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
}

.pet-stat-label { color: #888; }

.pet-role-row {
    justify-content: flex-start;
    gap: 10px;
}

.pet-role-row > span:last-child {
    color: #ffe077;
    font-weight: 900;
}

.pet-base-panel,
.pet-future-panel,
.pet-morph-panel {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    padding: 10px;
}

.pet-future-panel {
    display: none;
}

.pet-section-title {
    color: #00d4ff;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.pet-base-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pet-base-cell {
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    white-space: nowrap;
    min-width: 0;
}

.pet-investment-cell {
    grid-column: 1 / -1;
}

.pet-growth-strong {
    border-color: rgba(255, 213, 88, 0.42);
    background: rgba(255, 199, 55, 0.08);
}

.pet-base-label {
    color: #777;
    font-size: 11px;
    flex: 0 0 auto;
}

.pet-base-value {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.pet-extension-slots {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.pet-extension-slots span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    color: #666;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.18);
}

.pet-morph-panel {
    display: grid;
    gap: 9px;
    position: relative;
    overflow: hidden;
    padding: 11px;
    background:
        radial-gradient(circle at 50% -16%, rgba(255, 211, 94, 0.22), transparent 38%),
        linear-gradient(180deg, rgba(18, 25, 41, 0.98), rgba(6, 10, 23, 0.98));
    border-color: rgba(226, 182, 79, 0.42);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), inset 0 0 28px rgba(68, 154, 190, 0.05);
}

.pet-morph-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 42px;
    right: 42px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 220, 126, 0.9), transparent);
    pointer-events: none;
}

.pet-morph-panel.morphing {
    box-shadow: inset 0 0 36px rgba(255, 211, 94, 0.18), 0 0 28px rgba(61, 189, 219, 0.2);
}

.pet-morph-title {
    display: block;
    color: #ffe299;
    font-size: 12px;
    font-weight: 900;
}

.pet-morph-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 34px;
}

.pet-morph-head .pet-section-title {
    color: #f3c75d;
    font-size: 15px;
}

.pet-morph-head-copy {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.pet-morph-title-row {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #8795b2;
    font-size: 11px;
    white-space: nowrap;
}

.pet-morph-emblem {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(243, 199, 93, 0.46);
    border-radius: 6px;
    background: rgba(243, 199, 93, 0.1);
    box-shadow: inset 0 0 12px rgba(243, 199, 93, 0.12);
}

.pet-morph-emblem span {
    color: #ffd66a;
    font-size: 17px;
    text-shadow: 0 0 10px rgba(255, 214, 106, 0.66);
    animation: morphEmblemPulse 2.2s ease-in-out infinite;
}

.pet-morph-progress-block {
    display: grid;
    gap: 6px;
    padding: 7px 9px 8px;
    border: 1px solid rgba(243, 199, 93, 0.18);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
}

.pet-morph-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #9eabc5;
    font-size: 11px;
}

.pet-morph-progress-head strong {
    color: #ffe299;
    font-size: 12px;
}

.pet-morph-progress-wrap {
    height: 9px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
}

.pet-morph-progress {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #2daac8, #71d2ad, #f2c75f);
    box-shadow: 0 0 12px rgba(112, 214, 181, 0.46);
    transition: width 0.25s ease;
}

.pet-morph-duel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
    gap: 5px;
    align-items: stretch;
}

.pet-morph-card {
    min-width: 0;
    min-height: 226px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 34px 6px 8px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        radial-gradient(circle at 50% 34%, rgba(84, 164, 190, 0.1), transparent 36%),
        linear-gradient(180deg, rgba(13, 21, 36, 0.96), rgba(4, 8, 18, 0.96));
    box-shadow: inset 0 0 20px rgba(73, 170, 199, 0.04);
    position: relative;
    overflow: hidden;
}

.pet-morph-card.main {
    border-color: rgba(228, 187, 88, 0.48);
}

.pet-morph-card.sub {
    border-color: rgba(81, 167, 199, 0.42);
}

.pet-morph-card.sub.selectable {
    cursor: pointer;
}

.pet-morph-card.sub.selectable:hover {
    border-color: rgba(107, 211, 225, 0.72);
    box-shadow: inset 0 0 20px rgba(71, 189, 211, 0.1), 0 0 14px rgba(71, 189, 211, 0.14);
}

.pet-morph-card.morphing {
    animation: morphCardCharge 0.82s ease-out both;
}

.pet-morph-card-role {
    position: absolute;
    top: 9px;
    left: 8px;
    color: #f2d184;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
}

.pet-morph-card-change {
    position: absolute;
    top: 9px;
    right: 8px;
    color: #68cbe0;
    font-size: 10px;
    font-weight: 800;
}

.pet-morph-card-avatar {
    width: min(100%, 154px);
    height: auto;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 7px;
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.23), transparent 43%),
        linear-gradient(145deg, color-mix(in srgb, var(--pet-color), #ffffff 12%), color-mix(in srgb, var(--frame-color), #07101d 34%));
    border: 1px solid rgba(255, 232, 173, 0.22);
    box-shadow: 0 0 20px color-mix(in srgb, var(--pet-color), transparent 62%);
    overflow: hidden;
    position: relative;
    transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

.pet-morph-card-avatar::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 5px;
    border: 1px solid color-mix(in srgb, var(--pet-color), transparent 68%);
    pointer-events: none;
    animation: morphAvatarPulse 2.6s ease-in-out infinite;
}

.pet-morph-card-canvas {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .32));
    pointer-events: none;
}

.pet-morph-card:hover .pet-morph-card-avatar {
    transform: translateY(-1px) scale(1.035);
    border-color: rgba(255, 255, 255, .32);
    box-shadow: 0 0 24px color-mix(in srgb, var(--pet-color), transparent 46%);
}

.pet-morph-card-name {
    position: absolute;
    z-index: 2;
    top: 7px;
    left: 34px;
    right: 34px;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    line-height: 22px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    white-space: nowrap;
}

@keyframes morphAvatarPulse {
    0%, 100% { opacity: .32; transform: scale(.96); }
    50% { opacity: .82; transform: scale(1.03); }
}

.pet-morph-consume-tag {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 20px;
    display: grid;
    place-items: center;
    background: rgba(143, 44, 54, 0.44);
    border-top: 1px solid rgba(255, 121, 126, 0.22);
    color: #ffb5b5;
    font-size: 10px;
    font-weight: 800;
}

.pet-morph-card.sub:has(.pet-morph-consume-tag) {
    padding-bottom: 26px;
}

.pet-morph-card-empty {
    height: 100%;
    display: grid;
    place-items: center;
    gap: 6px;
    color: #7d87a6;
    text-align: center;
    font-size: 12px;
}

.pet-morph-card-empty strong {
    color: #c9d4f6;
    font-size: 13px;
}

.pet-morph-add-sub-btn {
    width: 100%;
    flex: 1 1 auto;
    min-height: 146px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    margin: 0;
    padding: 9px;
    border-radius: 6px;
    border: 1px dashed rgba(93, 186, 210, 0.5);
    background:
        radial-gradient(circle at 50% 30%, rgba(69, 178, 206, 0.14), transparent 46%),
        rgba(255, 255, 255, 0.035);
    color: #fff;
    cursor: pointer;
}

.pet-morph-add-sub-btn:hover {
    transform: none;
    border-color: rgba(102, 213, 230, 0.82);
    background: rgba(52, 161, 190, 0.15);
    box-shadow: 0 0 16px rgba(54, 182, 207, 0.16);
}

.pet-morph-add-sub-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.pet-morph-add-sub-btn span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(105, 211, 226, 0.56);
    background: rgba(58, 170, 195, 0.2);
    color: #a7ecf5;
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 18px rgba(56, 182, 207, 0.24);
}

.pet-morph-add-sub-btn strong {
    font-size: 14px;
    font-weight: 900;
}

.pet-morph-add-sub-btn small {
    color: #d79499;
    font-size: 11px;
}

.pet-morph-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    position: relative;
}

.pet-morph-flow::before {
    content: '';
    position: absolute;
    left: -6px;
    right: -6px;
    top: calc(50% - 14px);
    height: 1px;
    background: linear-gradient(90deg, rgba(243, 199, 93, 0.16), rgba(243, 199, 93, 0.82), rgba(71, 188, 212, 0.26));
}

.pet-morph-energy-core {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(243, 199, 93, 0.64);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 226, 150, 0.28), rgba(28, 44, 59, 0.96) 66%);
    box-shadow: 0 0 17px rgba(243, 199, 93, 0.22), inset 0 0 10px rgba(87, 194, 211, 0.14);
    position: relative;
    z-index: 1;
    animation: morphEnergyFloat 2.4s ease-in-out infinite;
}

.pet-morph-energy-core::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px dashed rgba(104, 204, 222, 0.46);
    border-radius: 50%;
    animation: morphEnergySpin 5s linear infinite;
}

.pet-morph-energy-core span::before {
    content: '›';
    color: #ffe39a;
    font-size: 29px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 0 10px rgba(255, 219, 125, 0.7);
}

.pet-morph-flow b {
    color: #d8ba72;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0;
    font-weight: 900;
}

.pet-morph-action-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 8px;
    align-items: stretch;
}

.pet-morph-fuse-mark {
    min-height: 50px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    border: 1px solid rgba(255, 232, 173, 0.44);
    color: #211b0d;
    font-size: 14px;
    font-weight: 900;
    background: linear-gradient(180deg, #ffe28b, #d99d31);
    box-shadow: 0 0 18px rgba(235, 184, 65, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.42);
    cursor: pointer;
    margin: 0;
    padding: 0 10px;
}

.pet-morph-fuse-mark:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.pet-detail.morph-view-active {
    padding-bottom: 12px;
}

.pet-detail.morph-view-active #petMorphDetailView {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: none;
}

.pet-detail.morph-view-active .pet-detail-actions {
    display: none;
}

@keyframes morphEmblemPulse {
    0%, 100% { transform: scale(0.92); opacity: 0.72; }
    50% { transform: scale(1.08); opacity: 1; }
}

@keyframes morphEnergyFloat {
    0%, 100% { transform: translateY(-2px); }
    50% { transform: translateY(2px); }
}

@keyframes morphEnergySpin {
    to { transform: rotate(360deg); }
}

.pet-morph-success-fx {
    position: fixed;
    z-index: 1200;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 48%, rgba(255, 216, 77, 0.14), transparent 22%),
        radial-gradient(circle at 50% 48%, rgba(0, 212, 255, 0.12), transparent 36%),
        rgba(2, 4, 15, 0.18);
    animation: morphSuccessFade 2.1s ease-out both;
}

.pet-morph-screen-flash {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.82), rgba(255, 216, 77, 0.32) 18%, transparent 46%);
    mix-blend-mode: screen;
    animation: morphScreenFlash 0.72s ease-out both;
}

.pet-morph-vortex {
    position: absolute;
    width: min(430px, 86vw);
    height: min(430px, 86vw);
    border-radius: 50%;
    background:
        conic-gradient(from 0deg, transparent 0 8%, rgba(0, 212, 255, 0.66) 12%, transparent 18% 28%, rgba(255, 107, 157, 0.72) 34%, transparent 42% 54%, rgba(255, 216, 77, 0.82) 60%, transparent 68% 100%),
        radial-gradient(circle, transparent 0 38%, rgba(125, 255, 203, 0.28) 39% 42%, transparent 43%);
    filter: blur(0.2px) drop-shadow(0 0 32px rgba(0, 212, 255, 0.38));
    animation: morphVortexSpin 1.55s cubic-bezier(.16, .9, .24, 1) both;
}

.pet-morph-lightning {
    position: absolute;
    width: min(360px, 78vw);
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, #ffffff, #00d4ff, #ff6b9d, transparent);
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.72), 0 0 42px rgba(255, 107, 157, 0.44);
    opacity: 0;
    transform-origin: center;
    animation: morphLightningStrike 0.76s ease-out both;
}

.pet-morph-lightning.l1 {
    transform: rotate(22deg);
}

.pet-morph-lightning.l2 {
    transform: rotate(-28deg);
    animation-delay: 0.12s;
}

.pet-morph-success-beam {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(520px, 96vw);
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.95), rgba(255, 216, 77, 0.95), rgba(255, 107, 157, 0.95), transparent);
    box-shadow: 0 0 22px rgba(0, 212, 255, 0.46), 0 0 30px rgba(255, 107, 157, 0.36);
    transform: translate(-50%, -50%) scaleX(0);
    animation: morphSuccessBeam 0.72s ease-out both;
}

.pet-morph-success-core {
    position: relative;
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.96) 0 16%, rgba(255, 216, 77, 0.92) 17% 31%, rgba(255, 107, 157, 0.72) 32% 48%, rgba(0, 212, 255, 0.28) 49% 72%, transparent 73%);
    box-shadow: 0 0 34px rgba(255, 216, 77, 0.5), 0 0 56px rgba(196, 77, 255, 0.32);
    animation: morphSuccessCore 1.18s cubic-bezier(.2, .9, .25, 1.1) both;
}

.pet-morph-success-core span {
    color: #2a1740;
    font-size: 46px;
    font-weight: 900;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
}

.pet-morph-success-ring {
    position: absolute;
    width: 168px;
    height: 168px;
    border-radius: 50%;
    border: 2px solid rgba(125, 255, 203, 0.78);
    box-shadow: 0 0 22px rgba(125, 255, 203, 0.42), inset 0 0 18px rgba(125, 255, 203, 0.16);
    animation: morphSuccessRing 1.2s ease-out both;
}

.pet-morph-success-ring.r2 {
    width: 230px;
    height: 230px;
    border-color: rgba(255, 107, 157, 0.62);
    animation-delay: 0.14s;
}

.pet-morph-success-copy {
    position: absolute;
    top: calc(50% + 68px);
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(7, 11, 26, 0.72);
    border: 1px solid rgba(255, 216, 77, 0.32);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34), 0 0 18px rgba(255, 216, 77, 0.22);
    animation: morphSuccessCopy 1.28s ease-out both;
}

.pet-morph-success-copy strong {
    color: #fff4bd;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.1;
}

.pet-morph-success-copy em {
    color: #7dffcb;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.pet-morph-success-sparks {
    position: absolute;
    left: 50%;
    top: 50%;
}

.pet-morph-success-sparks i {
    position: absolute;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: var(--spark-color);
    box-shadow: 0 0 14px var(--spark-color);
    transform: rotate(var(--angle)) translateX(0) scale(0.2);
    animation: morphSuccessSpark 1.35s ease-out var(--delay) both;
}

.pet-morph-star-burst {
    position: absolute;
    z-index: 14;
    left: 50%;
    top: 42%;
    min-width: 178px;
    padding: 14px 18px;
    display: grid;
    justify-items: center;
    gap: 4px;
    border-radius: 18px;
    border: 1px solid rgba(255, 216, 77, 0.48);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.32), transparent 40%),
        linear-gradient(135deg, rgba(255, 216, 77, 0.95), rgba(255, 107, 157, 0.94), rgba(196, 77, 255, 0.92));
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42), 0 0 34px rgba(255, 216, 77, 0.45);
    color: #1b1028;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: morphStarBurst 1.85s ease-out both;
}

.pet-morph-star-burst span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.72);
    color: #ff8f00;
    font-size: 26px;
    text-shadow: 0 0 12px rgba(255, 216, 77, 0.8);
}

.pet-morph-star-burst strong {
    font-size: 18px;
    font-weight: 900;
}

.pet-morph-star-burst em {
    color: rgba(27, 16, 40, 0.74);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.pet-morph-food {
    min-width: 0;
    min-height: 50px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border-radius: 6px;
    border: 1px solid rgba(243, 199, 93, 0.2);
    background: rgba(7, 12, 23, 0.72);
    color: #f4dfab;
}

.pet-morph-food-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: rgba(243, 199, 93, 0.1);
    border: 1px solid rgba(243, 199, 93, 0.2);
    font-size: 23px;
}

.pet-morph-food-use,
.pet-morph-food-count {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.pet-morph-food small {
    color: #7f8ca8;
    font-size: 9px;
    line-height: 12px;
}

.pet-morph-food strong {
    overflow: hidden;
    color: #f4dfab;
    font-size: 11px;
    line-height: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pet-morph-food-count {
    justify-items: end;
}

@keyframes morphStarBurst {
    0% { opacity: 0; transform: translate(-50%, -42%) scale(0.72) rotate(-8deg); filter: blur(2px); }
    16% { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(4deg); filter: blur(0); }
    78% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    100% { opacity: 0; transform: translate(-50%, -62%) scale(0.9) rotate(0deg); }
}

.pet-morph-food-count:not(.warn) strong {
    color: #78dbb3;
}

.pet-morph-food-count.warn strong {
    color: #ff9494;
}

.pet-morph-attr-preview {
    display: grid;
    gap: 6px;
}

.pet-morph-attr-title {
    color: #aebbd2;
    font-size: 12px;
    font-weight: 900;
}

.pet-morph-attr-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.pet-morph-attr-card {
    min-width: 0;
    min-height: 56px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(18px, auto);
    align-items: center;
    gap: 4px 6px;
    padding: 7px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left-width: 3px;
    background: rgba(8, 13, 25, 0.72);
}

.pet-morph-attr-card.hp { border-left-color: #68d6a7; }
.pet-morph-attr-card.atk { border-left-color: #efc35c; }
.pet-morph-attr-card.morph { border-left-color: #54bdd5; }
.pet-morph-attr-card.form { border-left-color: #df8fa4; }
.pet-morph-attr-card.score { border-left-color: #7dd87a; }

.pet-morph-attr-label {
    grid-column: 1;
    grid-row: 1;
    color: #8f9bb5;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.pet-morph-attr-values {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #dce5ff;
    font-size: 11px;
    font-weight: 800;
}

.pet-morph-attr-values span {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pet-morph-attr-values strong {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pet-morph-attr-values em {
    flex: 0 0 auto;
    color: #efc35c;
    font-style: normal;
    font-size: 10px;
}

.pet-morph-attr-values strong {
    color: #78dbb3;
    text-shadow: 0 0 9px rgba(120, 219, 179, 0.2);
}

.pet-morph-attr-delta {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    color: #78dbb3;
    font-size: 10px;
    font-weight: 900;
}

.pet-morph-picker-overlay {
    position: absolute;
    inset: 0;
    z-index: 36;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.pet-morph-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 5, 12, 0.84);
    backdrop-filter: blur(5px);
}

.pet-morph-picker-shell {
    position: relative;
    width: min(380px, 100%);
    max-height: min(540px, calc(100vh - 80px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(226, 182, 79, 0.44);
    background:
        radial-gradient(circle at 76% 0%, rgba(226, 182, 79, 0.16), transparent 38%),
        linear-gradient(180deg, rgba(16, 24, 40, 0.99), rgba(5, 9, 20, 0.99));
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.66), 0 0 28px rgba(226, 182, 79, 0.14);
}

.pet-morph-picker-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 22px;
    line-height: 1;
}

.pet-morph-picker-head span {
    color: #ff9b9b;
    font-size: 10px;
    font-weight: 900;
}

.pet-morph-picker-head h3 {
    color: #fff;
    font-size: 20px;
    margin: 2px 42px 0 0;
}

.pet-morph-picker-list {
    display: grid;
    gap: 8px;
    overflow-y: auto;
    padding-right: 2px;
}

.pet-morph-sub-option {
    width: 100%;
    min-width: 0;
    min-height: 60px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    text-align: left;
}

.pet-morph-sub-option:hover,
.pet-morph-sub-option.active {
    transform: none;
    border-color: rgba(226, 182, 79, 0.64);
    background: rgba(226, 182, 79, 0.11);
    box-shadow: inset 0 0 0 1px rgba(226, 182, 79, 0.1), 0 0 12px rgba(226, 182, 79, 0.1);
}

.pet-morph-sub-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--pet-color), #ffffff 12%), color-mix(in srgb, var(--frame-color), #07101d 34%));
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.pet-morph-sub-icon .pet-morph-sub-canvas {
    width: 48px;
    height: 48px;
}

.pet-morph-sub-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.pet-morph-sub-copy strong,
.pet-morph-sub-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pet-morph-sub-copy strong {
    color: #fff;
    font-size: 13px;
}

.pet-morph-sub-copy small,
.pet-morph-sub-empty {
    color: #9aa6c7;
    font-size: 11px;
}

.pet-morph-sub-empty {
    padding: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    text-align: center;
}

@media (max-width: 520px) {
    #petPanel {
        right: 8px;
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
    }

    .pet-detail-top {
        grid-template-columns: minmax(0, 1fr);
    }

    .pet-detail-top .pet-anim-area {
        grid-column: 1;
        grid-row: auto;
        justify-self: center;
    }

    .pet-detail-top .pet-role-under-anim {
        grid-column: 1;
        grid-row: auto;
        justify-self: stretch;
    }

    .pet-detail-top .pet-stats,
    .pet-detail-top .pet-top-actions {
        grid-column: 1;
        grid-row: auto;
    }

    .pet-morph-duel {
        grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
        gap: 4px;
    }

    .pet-morph-card {
        min-height: 214px;
        padding-inline: 4px;
    }

    .pet-morph-card-avatar {
        max-width: 144px;
    }

    .pet-morph-flow::before {
        left: -4px;
        right: -4px;
    }

    .pet-morph-energy-core {
        width: 38px;
        height: 38px;
    }

    .pet-morph-action-bar {
        grid-template-columns: minmax(0, 1fr) 120px;
        gap: 6px;
    }
}

@media (max-width: 360px) {
    .pet-morph-panel {
        padding-inline: 8px;
    }

    .pet-morph-card-avatar {
        max-width: 126px;
    }

    .pet-morph-action-bar {
        grid-template-columns: 1fr;
    }

    .pet-morph-fuse-mark {
        min-height: 46px;
    }
}

.pet-morph-btn {
    display: none !important;
}

.pet-morph-btn:disabled {
    display: none !important;
}

.pet-detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.pet-feed-btn {
    min-width: 130px;
    padding: 12px 22px;
    font-size: 14px;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44dff 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    margin: 0;
    font-weight: 800;
    box-shadow: 0 0 16px rgba(255, 107, 157, 0.2);
}

.pet-feed-btn.active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16), 0 0 24px rgba(196, 77, 255, 0.42);
}

.pet-deploy-btn {
    padding: 10px 16px;
    font-size: 14px;
    background: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    margin: 0;
}

.pet-top-actions {
    position: static;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.pet-top-actions .pet-deploy-btn,
.pet-top-actions .pet-skill-btn,
.pet-top-actions .pet-feed-btn {
    flex: 1 1 76px;
    width: auto;
    min-width: 0;
    height: 32px;
    padding: 0 10px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: none;
    color: #fff;
    cursor: pointer;
    margin: 0;
}

.pet-top-actions .pet-deploy-btn {
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.22);
}

.pet-skill-btn {
    background: linear-gradient(135deg, #ff6b9d, #c44dff);
    box-shadow: 0 0 16px rgba(196, 77, 255, 0.28);
}

.pet-food-chooser {
    position: absolute;
    z-index: 12;
    left: 0;
    right: 0;
    bottom: 58px;
    display: flex;
    flex-direction: column;
    background: rgba(8, 14, 31, 0.98);
    border: 1px solid rgba(0, 212, 255, 0.36);
    border-radius: 8px;
    padding: 12px;
    min-height: 0;
    max-height: 268px;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.58), 0 0 24px rgba(0, 212, 255, 0.12);
}

.pet-food-chooser.hidden {
    display: none;
}

.pet-food-chooser-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.pet-food-chooser-heading > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.pet-food-chooser-heading strong {
    color: #fff;
    font-size: 14px;
}

.pet-food-chooser-heading small {
    color: #7f8cae;
    font-size: 11px;
}

.pet-food-close {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: #dce4ff;
    background: rgba(255, 255, 255, 0.06);
    font-size: 20px;
    line-height: 1;
}

.pet-food-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 206px;
    overflow-y: auto;
    overflow-x: visible;
    padding: 2px 4px 2px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pet-food-options::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.pet-food-option {
    width: 100%;
    min-width: 0;
    min-height: 72px;
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 9px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(20, 29, 52, 0.94);
    text-align: left;
    color: #fff;
    transform: none;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.pet-food-option:hover {
    transform: none;
    box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.32), 0 0 12px rgba(0, 212, 255, 0.14);
}

.pet-food-option:active {
    border-color: rgba(112, 242, 189, 0.72);
    background: rgba(34, 77, 74, 0.86);
}

.pet-food-option:disabled {
    opacity: 0.62;
    cursor: default;
}

.food-option-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
    white-space: nowrap;
    filter: drop-shadow(0 0 5px rgba(255, 216, 77, 0.28));
}

.food-can-badge {
    position: relative;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.food-can-shell {
    font-size: 40px;
    line-height: 1;
}

.food-can-mark {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -44%) scale(0.72);
    font-size: 19px;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55));
}

.food-option-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.food-option-name-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.food-option-name-row strong {
    min-width: 0;
    flex: 1 1 auto;
}

.food-match-tag {
    flex: 0 0 auto;
    padding: 2px 5px;
    border: 1px solid currentColor;
    border-radius: 6px;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
}

.food-match-tag.matched {
    color: #70f2bd;
    background: rgba(41, 204, 143, 0.12);
}

.food-match-tag.off-type {
    color: #ffd05a;
    background: rgba(255, 185, 58, 0.12);
}

.food-option-copy strong,
.food-option-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.food-option-copy strong {
    font-size: 13px;
    color: #fff;
}

.food-option-copy small {
    font-size: 11px;
    color: #98a6c6;
}

.food-option-count {
    color: #ffd84d;
    font-weight: 800;
    font-size: 12px;
    align-self: flex-start;
    padding: 3px 5px;
    border-radius: 6px;
    background: rgba(255, 216, 77, 0.1);
}

.pet-food-empty {
    color: #9da8c3;
    font-size: 13px;
    padding: 24px 0;
    text-align: center;
}

@media (max-width: 560px) {
    .pet-food-options {
        grid-template-columns: 1fr;
    }
}

.pet-skill-panel {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.pet-skill-panel.hidden {
    display: none;
}

.pet-skill-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 36%, rgba(0, 212, 255, 0.22), transparent 34%),
        rgba(3, 5, 16, 0.76);
    backdrop-filter: blur(6px);
}

.pet-skill-shell {
    position: relative;
    width: min(390px, calc(100vw - 40px));
    max-height: min(620px, calc(100vh - 48px));
    overflow: hidden;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid rgba(0, 212, 255, 0.34);
    background:
        linear-gradient(135deg, rgba(10, 18, 42, 0.98), rgba(18, 8, 38, 0.98)),
        radial-gradient(circle at 80% 0%, rgba(255, 107, 157, 0.26), transparent 38%);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.62), 0 0 34px rgba(0, 212, 255, 0.18);
    animation: skillPanelIn 0.24s ease-out both;
}

.pet-skill-orbit {
    position: absolute;
    width: 190px;
    height: 190px;
    right: -68px;
    top: -78px;
    border: 1px solid rgba(0, 212, 255, 0.28);
    border-radius: 50%;
    box-shadow: 0 0 26px rgba(196, 77, 255, 0.22), inset 0 0 28px rgba(0, 212, 255, 0.12);
    animation: skillOrbit 6s linear infinite;
    pointer-events: none;
}

.pet-skill-orbit::before,
.pet-skill-orbit::after {
    content: '';
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #00d4ff;
    box-shadow: 0 0 14px #00d4ff;
}

.pet-skill-orbit::before { left: 16px; top: 34px; }
.pet-skill-orbit::after { right: 26px; bottom: 28px; background: #ff6b9d; box-shadow: 0 0 14px #ff6b9d; }

.pet-skill-close {
    position: absolute;
    z-index: 3;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pet-skill-close:hover {
    transform: none;
    background: rgba(255, 107, 157, 0.35);
    box-shadow: 0 0 18px rgba(255, 107, 157, 0.35);
}

.pet-skill-heading {
    position: relative;
    padding-right: 40px;
    margin-bottom: 14px;
}

.pet-skill-kicker {
    display: block;
    color: #7dffcb;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
}

.pet-skill-heading h3 {
    color: #fff;
    font-size: 24px;
    margin: 2px 0 4px;
    text-shadow: 0 0 16px rgba(0, 212, 255, 0.48);
}

.pet-skill-heading p {
    color: #9aa6c7;
    font-size: 12px;
}

.pet-passive-card {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-height: 82px;
    margin-bottom: 13px;
    padding: 12px;
    border: 1px solid rgba(255, 212, 92, 0.38);
    border-radius: 8px;
    background: rgba(255, 212, 92, 0.08);
}

.pet-passive-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.09);
    font-size: 25px;
}

.pet-passive-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.pet-passive-copy strong {
    color: #fff;
    font-size: 14px;
}

.pet-passive-copy strong b {
    color: #ffd45c;
}

.pet-passive-copy small {
    color: #7dffcb;
    font-size: 12px;
    font-weight: 800;
}

.pet-passive-copy span {
    color: #9aa6c7;
    font-size: 11px;
}

.pet-passive-upgrade-btn {
    width: 58px;
    height: 34px;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    font-size: 12px;
}

.pet-passive-upgrade-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
    box-shadow: none;
}

.pet-skill-section-title {
    margin: 0 0 8px;
    color: #9aa6c7;
    font-size: 11px;
    font-weight: 800;
}

.pet-skill-grid {
    position: relative;
    display: grid;
    gap: 10px;
    max-height: min(300px, calc(100vh - 290px));
    overflow-y: auto;
    padding-right: 4px;
}

.pet-skill-card {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 78px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
}

.pet-skill-card.unlocked {
    border-color: rgba(0, 212, 255, 0.42);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.16), rgba(196, 77, 255, 0.16));
    box-shadow: inset 0 0 22px rgba(0, 212, 255, 0.06);
}

.pet-skill-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 22px;
}

.pet-skill-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.pet-skill-copy strong {
    color: #fff;
    font-size: 14px;
}

.pet-skill-copy small {
    color: #9aa6c7;
    font-size: 11px;
    line-height: 1.35;
}

.pet-skill-copy small.pet-skill-extra {
    color: #ff9c9e;
}

.pet-skill-state {
    justify-self: end;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffd84d;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.pet-skill-card.unlocked .pet-skill-state {
    color: #7dffcb;
    background: rgba(125, 255, 203, 0.12);
}

.pet-skill-action {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.pet-skill-learn-btn {
    padding: 4px 12px;
    border: 1px solid rgba(255, 77, 79, 0.55);
    border-radius: 6px;
    background: rgba(255, 77, 79, 0.14);
    color: #ff9c9e;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.pet-skill-learn-btn:hover:not(:disabled) {
    background: rgba(255, 77, 79, 0.3);
}

.pet-skill-learn-btn:disabled {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.4);
    cursor: default;
}

/* 技能书学习动画：卡片发光放大，图标翻转发光 */
.pet-skill-card.learning {
    animation: petSkillLearnGlow 0.9s ease forwards;
    pointer-events: none;
}

.pet-skill-card.learning .pet-skill-icon {
    animation: petSkillLearnIcon 0.9s ease;
}

@keyframes petSkillLearnGlow {
    0% { box-shadow: 0 0 0 rgba(255, 77, 79, 0); transform: scale(1); }
    45% { box-shadow: 0 0 26px rgba(255, 77, 79, 0.85); transform: scale(1.05); }
    100% { box-shadow: 0 0 10px rgba(255, 77, 79, 0.4); transform: scale(1); }
}

@keyframes petSkillLearnIcon {
    0% { transform: rotateY(0deg) scale(1); filter: brightness(1); }
    50% { transform: rotateY(360deg) scale(1.3); filter: brightness(1.6); }
    100% { transform: rotateY(720deg) scale(1); filter: brightness(1); }
}

/* 绚丽学习特效：粒子爆发 + 扩散光环 + 金色横幅（挂载在面板外壳，重渲染不中断） */
.skill-learn-fx {
    position: absolute;
    inset: 0;
    z-index: 40;
    pointer-events: none;
}

.skill-learn-spark {
    position: absolute;
    left: 50%;
    top: 50%;
    font-size: 18px;
    line-height: 1;
    opacity: 0;
    text-shadow: 0 0 8px rgba(255, 216, 77, 0.9), 0 0 16px rgba(255, 140, 60, 0.6);
    animation: skillLearnSpark 1.1s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes skillLearnSpark {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(0deg); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1.3) rotate(45deg); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.9) rotate(220deg); }
}

.skill-learn-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 26px;
    height: 26px;
    margin: -13px 0 0 -13px;
    border-radius: 50%;
    border: 3px solid rgba(255, 216, 77, 0.9);
    box-shadow: 0 0 18px rgba(255, 216, 77, 0.8), inset 0 0 10px rgba(255, 216, 77, 0.6);
    animation: skillLearnRing 0.9s ease-out forwards;
}

@keyframes skillLearnRing {
    0% { opacity: 0.95; transform: scale(0.4); }
    100% { opacity: 0; transform: scale(7); }
}

.skill-learn-banner {
    position: absolute;
    left: 50%;
    top: 42%;
    padding: 8px 18px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 176, 32, 0.95), rgba(255, 216, 77, 0.98), rgba(255, 176, 32, 0.95));
    color: #4a2b00;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 1px;
    white-space: nowrap;
    box-shadow: 0 0 24px rgba(255, 216, 77, 0.75), 0 4px 14px rgba(0, 0, 0, 0.35);
    animation: skillLearnBanner 1.5s ease forwards;
}

@keyframes skillLearnBanner {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    18% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
    30% { transform: translate(-50%, -50%) scale(1); }
    75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -95%) scale(1.02); }
}

@keyframes skillPanelIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes skillOrbit {
    to { transform: rotate(360deg); }
}

.pet-back-btn {
    display: none;
}

.pet-feed-msg {
    position: absolute;
    z-index: 12;
    left: 50%;
    top: 50%;
    max-width: min(320px, calc(100% - 38px));
    min-width: 220px;
    margin: 0;
    padding: 13px 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 216, 77, 0.34);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 216, 77, 0.28), transparent 48%),
        linear-gradient(135deg, rgba(16, 24, 42, 0.96), rgba(34, 15, 45, 0.96));
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 216, 77, 0.20);
    color: #fff4bd;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.45;
    text-align: center;
    white-space: pre-line;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: petMsgPop 0.28s ease-out both;
}

.pet-feed-msg:empty {
    display: none;
}

.pet-feed-msg.success {
    border-color: rgba(125, 255, 203, 0.38);
    background:
        radial-gradient(circle at 50% 0%, rgba(125, 255, 203, 0.24), transparent 48%),
        linear-gradient(135deg, rgba(8, 30, 31, 0.96), rgba(25, 16, 48, 0.96));
    color: #dfffee;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.45), 0 0 26px rgba(125, 255, 203, 0.18);
}

.pet-feed-msg.warn {
    border-color: rgba(255, 107, 157, 0.42);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 107, 157, 0.22), transparent 48%),
        linear-gradient(135deg, rgba(42, 14, 26, 0.96), rgba(18, 12, 36, 0.96));
    color: #ffd9e5;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 107, 157, 0.18);
}

@keyframes petMsgPop {
    from { opacity: 0; transform: translate(-50%, -44%) scale(0.92); }
    70% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes morphSuccessFade {
    0% { opacity: 0; }
    8%, 78% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes morphCardCharge {
    0% { transform: scale(1); filter: brightness(1); }
    36% { transform: scale(1.035); filter: brightness(1.3); }
    72% { transform: scale(0.985); filter: brightness(1.12); }
    100% { transform: scale(1); filter: brightness(1); }
}

@keyframes morphScreenFlash {
    0% { opacity: 0; transform: scale(0.62); }
    18% { opacity: 1; transform: scale(1.08); }
    100% { opacity: 0; transform: scale(1.38); }
}

@keyframes morphVortexSpin {
    0% { opacity: 0; transform: scale(0.32) rotate(-160deg); filter: blur(3px) drop-shadow(0 0 12px rgba(0, 212, 255, 0.2)); }
    28% { opacity: 1; transform: scale(0.92) rotate(42deg); filter: blur(0) drop-shadow(0 0 38px rgba(255, 216, 77, 0.38)); }
    76% { opacity: 0.9; transform: scale(1.06) rotate(250deg); }
    100% { opacity: 0; transform: scale(1.28) rotate(390deg); }
}

@keyframes morphLightningStrike {
    0%, 100% { opacity: 0; width: 0; }
    18% { opacity: 1; width: min(360px, 78vw); }
    38% { opacity: 0.24; width: min(430px, 92vw); }
    58% { opacity: 0.86; }
    76% { opacity: 0; width: min(500px, 100vw); }
}

@keyframes morphSuccessBeam {
    0% { opacity: 0; transform: translate(-50%, -50%) scaleX(0); }
    36% { opacity: 1; transform: translate(-50%, -50%) scaleX(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scaleX(1.12); }
}

@keyframes morphSuccessCore {
    0% { opacity: 0; transform: scale(0.25) rotate(-24deg); }
    36% { opacity: 1; transform: scale(1.12) rotate(8deg); }
    68% { opacity: 1; transform: scale(0.94) rotate(18deg); }
    100% { opacity: 0; transform: scale(1.38) rotate(34deg); }
}

@keyframes morphSuccessRing {
    0% { opacity: 0; transform: scale(0.2); }
    32% { opacity: 0.95; transform: scale(0.84); }
    100% { opacity: 0; transform: scale(1.45); }
}

@keyframes morphSuccessCopy {
    0% { opacity: 0; transform: translateY(12px) scale(0.94); }
    28%, 78% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-8px) scale(0.98); }
}

@keyframes morphSuccessSpark {
    0% { opacity: 0; transform: rotate(var(--angle)) translateX(0) scale(0.2); }
    24% { opacity: 1; }
    100% { opacity: 0; transform: rotate(var(--angle)) translateX(var(--distance)) scale(0.95); }
}

/* 蛋孵化 */
.egg-hatch-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0 18px;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.egg-visual {
    width: 138px;
    height: 138px;
    display: grid;
    place-items: center;
    position: relative;
    font-size: 74px;
    isolation: isolate;
}

.egg-aura {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 248, 181, 0.38), transparent 48%),
        conic-gradient(from 0deg, rgba(255,216,77,0), rgba(255,216,77,.9), rgba(196,77,255,.75), rgba(0,212,255,.7), rgba(255,216,77,0));
    filter: blur(1px);
    animation: hatchAuraSpin 3s linear infinite;
    z-index: -1;
}

.egg-shell {
    display: block;
    transform-origin: 50% 80%;
    filter: drop-shadow(0 12px 20px rgba(0,0,0,.35)) drop-shadow(0 0 16px rgba(255,216,77,.65));
}

.egg-visual.hatching .egg-shell {
    animation: eggChargeShake 0.75s ease-in-out both;
}

.egg-visual.hatched .egg-shell {
    animation: eggHatchPop 1.15s ease-out both;
}

.egg-spark {
    position: absolute;
    color: #fff3a8;
    font-size: 20px;
    text-shadow: 0 0 10px #ffd84d;
    animation: hatchSparkFloat 1.8s ease-in-out infinite;
}

.egg-spark-1 { top: 16px; left: 28px; animation-delay: 0s; }
.egg-spark-2 { top: 38px; right: 18px; animation-delay: .35s; }
.egg-spark-3 { bottom: 24px; left: 24px; animation-delay: .7s; }

.hatch-particle {
    position: absolute;
    color: #fff3a8;
    font-size: 18px;
    text-shadow: 0 0 12px #ffd84d;
    animation: hatchParticleBurst 1s ease-out forwards;
    pointer-events: none;
}

.egg-hatch-bar-wrap {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    height: 20px;
    position: relative;
    overflow: hidden;
}

.egg-hatch-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffaa00);
    border-radius: 8px;
    width: var(--hatch-pct, 0%);
    transition: width 0.3s;
}

.egg-hatch-bar-wrap span {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    text-shadow: 0 0 4px #000;
}

@keyframes feedAreaGlow {
    0% { box-shadow: inset 0 0 18px rgba(0, 212, 255, 0.08); }
    35% { box-shadow: inset 0 0 28px rgba(255, 216, 77, 0.28), 0 0 30px rgba(255, 107, 157, 0.34); }
    100% { box-shadow: inset 0 0 18px rgba(0, 212, 255, 0.08); }
}

@keyframes petStageBreath {
    0%, 100% { opacity: .45; transform: scaleX(.82); }
    50% { opacity: .82; transform: scaleX(1.08); }
}

@keyframes petStageShine {
    0% { transform: translateX(-125%); }
    100% { transform: translateX(125%); }
}

@keyframes petDeployStage {
    0% { border-color: rgba(0, 212, 255, .18); box-shadow: inset 0 0 18px rgba(0, 212, 255, .08); }
    38% { border-color: rgba(255, 216, 77, .92); box-shadow: inset 0 0 32px rgba(255, 216, 77, .28), 0 0 26px rgba(0, 212, 255, .44); }
    100% { border-color: rgba(0, 212, 255, .18); box-shadow: inset 0 0 18px rgba(0, 212, 255, .08); }
}

@keyframes petReactStage {
    0%, 100% { border-color: rgba(0, 212, 255, .18); }
    45% { border-color: rgba(255, 107, 157, .72); box-shadow: inset 0 0 24px rgba(255, 107, 157, .16), 0 0 18px rgba(196, 77, 255, .2); }
}

@keyframes petEatBounce {
    0% { transform: scale(1) rotate(0deg); filter: brightness(1); }
    18% { transform: scale(1.18, .86) translateY(8px) rotate(-4deg); filter: brightness(1.35); }
    42% { transform: scale(.92, 1.16) translateY(-10px) rotate(5deg); }
    66% { transform: scale(1.08, .94) translateY(4px) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
}

@keyframes feedParticleBurst {
    0% { opacity: 0; transform: translate(0, 0) scale(.4) rotate(0deg); }
    18% { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(var(--dx) * 1px), calc(var(--dy) * 1px)) scale(1.35) rotate(28deg); }
}

@keyframes feedMorselIn {
    0% { opacity: 0; transform: translate(0, 0) rotate(-22deg) scale(.55); }
    18% { opacity: 1; transform: translate(12px, -18px) rotate(-8deg) scale(1.08); }
    68% { opacity: 1; transform: translate(45px, -48px) rotate(8deg) scale(.88); }
    100% { opacity: 0; transform: translate(52px, -51px) rotate(14deg) scale(.18); }
}

@keyframes hatchAuraSpin {
    from { transform: rotate(0deg) scale(.92); }
    to { transform: rotate(360deg) scale(.92); }
}

@keyframes eggChargeShake {
    0%, 100% { transform: translateX(0) rotate(0deg) scale(1); }
    15% { transform: translateX(-8px) rotate(-8deg) scale(1.03); }
    30% { transform: translateX(8px) rotate(8deg) scale(1.06); }
    45% { transform: translateX(-6px) rotate(-6deg) scale(1.08); }
    60% { transform: translateX(6px) rotate(6deg) scale(1.05); }
    80% { transform: translateX(0) rotate(0deg) scale(1.12); filter: drop-shadow(0 0 26px rgba(255,216,77,.95)); }
}

@keyframes eggHatchPop {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    28% { transform: scale(1.22) rotate(-7deg); filter: brightness(1.8) drop-shadow(0 0 26px #ffd84d); }
    48% { transform: scale(.92) rotate(8deg); }
    70% { transform: scale(1.35) translateY(-8px); opacity: .9; }
    100% { transform: scale(.15) translateY(-24px); opacity: 0; }
}

@keyframes hatchSparkFloat {
    0%, 100% { transform: translateY(0) scale(.9); opacity: .55; }
    50% { transform: translateY(-10px) scale(1.2); opacity: 1; }
}

@keyframes hatchParticleBurst {
    0% { opacity: 0; transform: translate(0, 0) scale(.25) rotate(0deg); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(var(--dx) * 1px), calc(var(--dy) * 1px)) scale(1.45) rotate(180deg); }
}

/* ==================== 分数栏 ==================== */
.score-board {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 4px;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 18px;
    border-radius: 10px 10px 0 0;
    position: relative;
    z-index: 12;
}

.score-board > span {
    white-space: nowrap;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #dfe8ff;
}

.user-pill button {
    margin: 0;
    padding: 3px 7px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 11px;
    cursor: pointer;
}

.user-pill .user-profile-entry {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 112px;
    padding: 4px 7px;
    border: 1px solid rgba(94, 220, 255, 0.26);
    border-radius: 6px;
    background: rgba(0, 212, 255, 0.09);
    color: #effbff;
    font-weight: 800;
}

.user-profile-entry:hover {
    border-color: rgba(94, 220, 255, 0.62);
    background: rgba(0, 212, 255, 0.17);
}

#currentUserName {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#quickRestartBtn {
    display: none;
}

body.logged-in #quickRestartBtn {
    display: inline-block;
}

#awayBtn {
    border-color: rgba(120, 200, 255, 0.5);
    color: #bfe3ff;
}

#awayOverlay {
    z-index: 2400;
}

.quick-restart-confirm {
    position: absolute;
    inset: 0;
    z-index: 2300;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 6, 18, 0.82);
    backdrop-filter: blur(6px);
}

.quick-restart-confirm-card {
    width: min(320px, 100%);
    padding: 24px 22px 20px;
    border: 1px solid rgba(255, 180, 75, 0.58);
    border-radius: 8px;
    background: #11182b;
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.58), 0 0 24px rgba(255, 154, 48, 0.15);
    text-align: center;
    animation: gameOverCardIn 0.2s ease-out both;
}

.quick-restart-confirm-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    border: 2px solid #ffb44b;
    border-radius: 50%;
    background: rgba(255, 161, 56, 0.12);
    color: #ffd176;
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
}

.quick-restart-confirm-card h2 {
    margin: 0;
    color: #fff;
    font-size: 22px;
}

.quick-restart-confirm-card p {
    margin: 8px 0 20px;
    color: #b9c3d9;
    font-size: 14px;
}

.quick-restart-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-restart-confirm-actions button {
    min-height: 44px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.quick-restart-cancel-btn {
    border-color: rgba(151, 169, 204, 0.42) !important;
    background: #28324a;
}

.quick-restart-confirm-btn {
    border-color: rgba(255, 192, 97, 0.64) !important;
    background: #c95f16;
}

.quick-restart-confirm-actions button:hover,
.quick-restart-confirm-actions button:focus-visible {
    outline: 2px solid #72dcff;
    outline-offset: 2px;
}

.quick-restart-confirm-actions button:disabled {
    cursor: wait;
    opacity: 0.58;
}

body.quick-restart-confirm-active .game-sidebar {
    pointer-events: none;
    opacity: 0.48;
}

.life-icon {
    color: #ff4d6d;
    text-shadow: 0 0 10px rgba(255, 77, 109, 0.7);
}

#lives.heal-flash {
    animation: healFlash 0.5s ease-out;
}

@keyframes healFlash {
    0%   { color: #ff4d6d; text-shadow: 0 0 20px #ff4d6d; transform: scale(1.3); }
    100% { color: #fff; text-shadow: none; transform: scale(1); }
}

/* ==================== 暂停遮罩 ==================== */
.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: popupFadeIn 0.3s ease-out;
}

.portal-popup {
    position: absolute;
    inset: 0;
    z-index: 1700;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(1, 4, 18, 0.72);
    backdrop-filter: blur(5px);
}

.portal-inner {
    position: relative;
    width: min(410px, calc(100% - 36px));
    padding: 28px 24px 22px;
    border-radius: 18px;
    border: 1px solid rgba(90, 220, 255, 0.38);
    background:
        radial-gradient(circle at 50% 0%, rgba(96, 236, 255, 0.28), transparent 42%),
        linear-gradient(180deg, rgba(13, 20, 48, 0.98), rgba(5, 8, 24, 0.98));
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.22), 0 22px 70px rgba(0, 0, 0, 0.55);
    color: #fff;
    text-align: center;
    overflow: hidden;
}

.portal-ring {
    width: 96px;
    height: 96px;
    margin: 0 auto 10px;
    border-radius: 50%;
    border: 8px solid rgba(0, 212, 255, 0.45);
    box-shadow: inset 0 0 22px rgba(196, 77, 255, 0.75), 0 0 28px rgba(0, 212, 255, 0.65);
    animation: portalSpin 3.2s linear infinite;
}

.portal-ring::after {
    content: '';
    display: block;
    width: 52px;
    height: 52px;
    margin: 14px auto;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(0,212,255,0.35) 48%, transparent 70%);
}

.portal-inner h2 {
    color: #00d4ff;
    margin: 0 0 6px;
    text-shadow: 0 0 16px rgba(0, 212, 255, 0.8);
}

.portal-inner p {
    color: #b9c7e8;
    font-size: 14px;
    margin-bottom: 14px;
}

.portal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 0;
    padding: 0;
    background: rgba(255,255,255,0.12);
}

.portal-game-list {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}

.portal-game-card {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    background: rgba(255,255,255,0.07);
    text-align: left;
}

.portal-game-card:hover {
    border-color: rgba(0, 212, 255, 0.55);
    background: rgba(0, 212, 255, 0.12);
}

.portal-game-card.is-disabled,
.portal-game-card.is-disabled:hover {
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.045);
    opacity: 0.72;
}

.portal-game-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #00d4ff, #c44dff);
    font-size: 23px;
}

.portal-game-copy strong,
.portal-game-copy small {
    display: block;
}

.portal-game-copy strong {
    color: #fff;
    font-size: 15px;
}

.portal-game-copy small {
    color: #a8b5d8;
    font-size: 12px;
    margin-top: 3px;
    line-height: 1.35;
}

.portal-game-status {
    display: inline-flex;
    width: fit-content;
    margin-top: 7px;
    padding: 2px 8px;
    border: 1px solid rgba(255, 198, 92, 0.35);
    border-radius: 999px;
    color: #ffd47a;
    background: rgba(255, 166, 0, 0.1);
    font-size: 11px;
    line-height: 1.4;
}

.portal-continue-btn {
    margin-top: 2px;
    padding: 10px 24px;
    border-radius: 18px;
    background: linear-gradient(135deg, #555, #30364f);
}

@keyframes portalSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.pause-inner {
    text-align: center;
    color: #fff;
}

.pause-inner h2 {
    font-size: 36px;
    color: #00d4ff;
    text-shadow: 0 0 20px #00d4ff;
    margin-bottom: 30px;
    letter-spacing: 4px;
}

.pause-resume-btn {
    display: block;
    margin: 0 auto 14px;
    padding: 14px 50px;
    font-size: 20px;
    background: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pause-resume-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 25px #00d4ff;
}

.pause-pet-btn {
    display: block;
    margin: 0 auto 14px;
    padding: 12px 40px;
    font-size: 18px;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44dff 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pause-pet-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 25px #c44dff;
}

.pause-hint {
    margin-top: 16px;
    font-size: 13px;
    color: #888;
}

/* ==================== 通用 ==================== */
.hidden {
    display: none !important;
}

/* ==================== 游戏界面 ==================== */
.game-over, .start-screen {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.start-screen {
    z-index: 10;
}

.game-over {
    z-index: 2100;
    background: rgba(2, 5, 16, 0.9);
    backdrop-filter: blur(7px);
}

body.game-over-active .game-sidebar {
    pointer-events: none;
    opacity: 0.48;
}

.game-over-card {
    width: min(360px, calc(100% - 36px));
    padding: 28px 24px 24px;
    border: 1px solid rgba(255, 105, 135, 0.5);
    border-radius: 8px;
    background: rgba(12, 18, 40, 0.98);
    box-shadow: 0 22px 64px rgba(0, 0, 0, 0.58), 0 0 34px rgba(255, 77, 109, 0.16);
    text-align: center;
    animation: gameOverCardIn 0.28s ease-out both;
}

.game-over-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 12px;
    border: 2px solid #ff6b8a;
    border-radius: 50%;
    background: rgba(255, 77, 109, 0.13);
    color: #ff8aa2;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 0 22px rgba(255, 77, 109, 0.26);
}

.game-over-result {
    display: flex;
    justify-content: center;
    gap: 26px;
    margin: 4px 0 22px;
    color: #aeb9d6;
    font-size: 14px;
}

.game-over-result strong {
    color: #fff;
    font-size: 22px;
}

.game-over-reason {
    margin: -6px 0 10px;
    color: #c7d0e8;
    font-size: 13px;
}

.defeat-countdown {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 1px 10px;
    margin: -8px 0 14px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 195, 77, 0.36);
    border-radius: 8px;
    color: #ffe08a;
    background: rgba(255, 177, 51, 0.08);
    text-align: left;
}

.defeat-countdown.unlocked {
    border-color: rgba(82, 224, 174, 0.42);
    color: #7dffcb;
    background: rgba(40, 183, 132, 0.09);
}

.defeat-countdown-icon {
    grid-row: 1 / 3;
    font-size: 24px;
    text-align: center;
}

.defeat-countdown strong {
    font-size: 20px;
    line-height: 1.1;
}

.defeat-countdown small {
    color: #aeb9d6;
    font-size: 11px;
}

.game-over-actions {
    display: grid;
    gap: 10px;
}

.game-over-action {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 62px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    text-align: left;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.game-over-action:hover,
.game-over-action:focus-visible {
    transform: translateY(-1px);
    outline: none;
}

.game-over-action:disabled {
    opacity: 0.46;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.game-over-action-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 900;
}

.game-over-action strong,
.game-over-action small {
    display: block;
}

.game-over-action strong {
    font-size: 17px;
}

.game-over-action small {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 12px;
}

.continue-action {
    border-color: rgba(52, 229, 173, 0.55);
    background: #078f71;
    box-shadow: 0 8px 22px rgba(4, 143, 113, 0.23);
}

.continue-action .game-over-action-icon {
    background: rgba(255, 255, 255, 0.15);
    color: #ff8aa2;
}

.continue-action:hover,
.continue-action:focus-visible {
    border-color: #7dffcb;
    box-shadow: 0 10px 26px rgba(4, 143, 113, 0.34);
}

.restart-action {
    border-color: rgba(87, 185, 255, 0.42);
    background: #164c81;
}

.restart-action .game-over-action-icon {
    background: rgba(255, 255, 255, 0.12);
    color: #8fd7ff;
}

.restart-action:hover,
.restart-action:focus-visible {
    border-color: #83d9ff;
    box-shadow: 0 10px 26px rgba(30, 128, 204, 0.28);
}

@keyframes gameOverCardIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.start-logo {
    width: 132px;
    height: 132px;
    margin-bottom: 6px;
    object-fit: contain;
    filter: drop-shadow(0 10px 22px rgba(0, 128, 255, 0.36));
}

.start-screen h1 {
    margin-bottom: 14px;
    color: #00d4ff;
    text-shadow: 0 0 10px #00d4ff;
}

.game-over h2 {
    margin-bottom: 14px;
    color: #ff9eb2;
    text-shadow: 0 0 12px rgba(255, 77, 109, 0.58);
}

.start-screen p {
    margin: 10px 0;
    color: #ccc;
}

.account-record {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 12px;
    row-gap: 3px;
    width: min(320px, calc(100% - 36px));
    margin: 16px 0 2px;
    padding: 11px 14px;
    border: 1px solid rgba(0, 212, 255, 0.22);
    border-radius: 8px;
    background: rgba(0, 212, 255, 0.06);
    text-align: left;
}

.account-record > span {
    grid-row: 1 / span 2;
    color: #00d4ff;
    font-size: 12px;
    font-weight: 800;
}

.account-record strong {
    color: #fff;
    font-size: 14px;
}

.account-record small {
    color: #8390af;
    font-size: 11px;
}

.records-popup {
    position: absolute;
    inset: 0;
    z-index: 1800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(1, 4, 18, 0.82);
    backdrop-filter: blur(7px);
}

.records-popup-inner {
    position: relative;
    width: min(430px, 100%);
    max-height: calc(100% - 36px);
    padding: 22px 18px 18px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 0%, rgba(0, 212, 255, 0.13), transparent 34%),
        rgba(7, 11, 28, 0.98);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
    overflow: hidden;
}

.profile-identity {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 0 42px 14px 0;
}

.profile-avatar {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(255, 212, 92, 0.58);
    border-radius: 50%;
    background: linear-gradient(145deg, #14cfee, #1b64c7 58%, #ffca52);
    color: #fff;
    font-size: 24px;
    font-weight: 1000;
    box-shadow: 0 8px 24px rgba(0, 160, 220, 0.28);
}

.profile-identity h2 {
    margin: 0 0 2px;
    color: #fff;
    font-size: 20px;
}

.profile-identity strong,
.profile-identity small {
    display: block;
}

.profile-identity strong {
    color: #dffaff;
    font-size: 15px;
}

.profile-identity small {
    width: fit-content;
    margin-top: 5px;
    padding: 3px 8px;
    border: 1px solid rgba(0, 212, 255, 0.22);
    border-radius: 4px;
    color: #d8e9ff;
    background: rgba(0, 162, 220, 0.12);
    font-size: 13px;
    font-weight: 700;
    user-select: text;
}

#profileDisplayName {
    cursor: pointer;
}

.profile-edit-nickname {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 6px 0 0;
    padding: 3px 10px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-radius: 999px;
    background: rgba(0, 162, 220, 0.16);
    color: #9fe8ff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.profile-edit-nickname:hover {
    background: rgba(0, 162, 220, 0.3);
    color: #fff;
}

.profile-nickname-editor {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 0 0 12px;
}

.profile-nickname-input {
    flex: 1 1 160px;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-radius: 6px;
    background: rgba(4, 10, 26, 0.85);
    color: #eaf7ff;
    font-size: 14px;
    outline: none;
}

.profile-nickname-input:focus {
    border-color: #14cfee;
    box-shadow: 0 0 0 2px rgba(20, 207, 238, 0.25);
}

.profile-nickname-save,
.profile-nickname-cancel {
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.profile-nickname-save {
    border: 1px solid rgba(20, 207, 238, 0.6);
    background: linear-gradient(135deg, #14cfee, #1b64c7);
    color: #fff;
}

.profile-nickname-save:disabled {
    opacity: 0.6;
    cursor: default;
}

.profile-nickname-cancel {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #d8e9ff;
}

.profile-nickname-msg {
    flex: 1 1 100%;
    min-height: 16px;
    color: #ffd7d7;
    font-size: 12px;
}

.profile-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 14px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.profile-tab {
    margin: 0;
    padding: 9px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #94a0be;
    font-size: 13px;
    font-weight: 900;
    box-shadow: none;
}

.profile-tab.active {
    background: #25c9e7;
    color: #07111e;
}

.profile-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.profile-stat {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 1px 7px;
    min-height: 66px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.profile-stat > span {
    grid-row: 1 / span 2;
    font-size: 20px;
}

.profile-stat > .point-coin {
    display: inline-grid;
    grid-row: 1 / span 2;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #8ecbff, #2e7cf6 52%, #1b4fc0 100%);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35), 0 2px 5px rgba(0, 0, 0, 0.35);
    font-size: 13px;
    font-style: normal;
    font-weight: 900;
    color: #fff;
}

.profile-stat > .point-coin i {
    font-style: normal;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
    line-height: 1;
}

.profile-stat small {
    color: #7f8aa8;
    font-size: 10px;
}

.profile-stat strong {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    text-overflow: ellipsis;
}

.profile-add-points-btn {
    margin: 8px auto 0;
    padding: 7px 18px;
    border: 0;
    border-radius: 16px;
    background: #1b5fb0;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.profile-add-points-btn:hover {
    background: #2a74d0;
}

.point-preadd-popup {
    position: fixed;
    inset: 0;
    z-index: 6100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 10, 24, 0.72);
}

.point-preadd-card {
    position: relative;
    width: min(420px, calc(100% - 32px));
    padding: 22px 20px 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: #121a30;
    color: #e8eefc;
    text-align: center;
}

.point-preadd-card h3 {
    margin: 0 0 8px;
    color: #00d4ff;
}

.point-preadd-hint {
    margin: 0 0 12px;
    font-size: 12px;
    color: #9fb0d0;
    line-height: 1.5;
}

.point-preadd-field {
    display: grid;
    gap: 6px;
    margin: 0 0 12px;
    font-size: 13px;
    color: #cfe3ff;
    text-align: left;
}

.point-preadd-field input {
    padding: 9px 10px;
    border: 1px solid #31415f;
    border-radius: 8px;
    background: #0b1322;
    color: #fff;
    font-size: 16px;
}

.point-preadd-qr {
    display: flex;
    justify-content: center;
    margin: 6px 0 10px;
}

.point-preadd-qr img {
    padding: 6px;
    border-radius: 8px;
    background: #fff;
}

.point-preadd-msg {
    min-height: 18px;
    margin: 0 0 10px;
    font-size: 13px;
    color: #ffd452;
}

.point-preadd-generate {
    width: 100%;
    padding: 11px;
    border: 0;
    border-radius: 10px;
    background: #1b5fb0;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.point-preadd-generate:disabled {
    opacity: 0.55;
}

/* ==================== 加分成功弹窗 ==================== */
.point-add-success-popup {
    position: fixed;
    inset: 0;
    z-index: 6300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 10, 24, 0.78);
    backdrop-filter: blur(6px);
}

.point-add-success-card {
    position: relative;
    width: min(360px, calc(100% - 32px));
    padding: 34px 24px 26px;
    border: 1px solid rgba(61, 220, 132, 0.35);
    border-radius: 18px;
    background: linear-gradient(180deg, #0e2430, #0a1826 62%);
    color: #e8eefc;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

@keyframes point-add-success-card-in {
    from { transform: scale(0.72); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.point-add-success-burst {
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(circle at 50% 50%, rgba(61, 220, 132, 0.22), transparent 58%),
        radial-gradient(circle at 50% 50%, rgba(0, 212, 255, 0.12), transparent 72%);
    pointer-events: none;
}

@keyframes point-add-success-burst {
    0% { transform: scale(0.4); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: scale(1.18); opacity: 0; }
}

.point-add-success-icon {
    position: relative;
    z-index: 1;
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 32%, #43e58b, #1f9e5a);
    box-shadow: 0 0 0 8px rgba(61, 220, 132, 0.14), 0 10px 28px rgba(31, 158, 90, 0.35);
}

@keyframes point-add-success-icon-pop {
    from { transform: scale(0.4); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.point-add-success-check {
    position: absolute;
    top: 18px;
    left: 22px;
    width: 30px;
    height: 16px;
    border-left: 4px solid #fff;
    border-bottom: 4px solid #fff;
    transform: rotate(-45deg);
    transform-origin: center;
}

@keyframes point-add-success-check-draw {
    from { transform: rotate(-45deg) scale(0); opacity: 0; }
    to { transform: rotate(-45deg) scale(1); opacity: 1; }
}

.point-add-success-anim .point-add-success-card {
    animation: point-add-success-card-in 0.38s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.point-add-success-anim .point-add-success-burst {
    animation: point-add-success-burst 1.1s ease-out forwards;
}

.point-add-success-anim .point-add-success-icon {
    animation: point-add-success-icon-pop 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.35) 0.08s both;
}

.point-add-success-anim .point-add-success-check {
    animation: point-add-success-check-draw 0.35s ease-out 0.42s both;
}

.point-add-success-card h2 {
    position: relative;
    z-index: 1;
    margin: 0 0 8px;
    color: #3ddc84;
    font-size: 24px;
    letter-spacing: 0.06em;
}

.point-add-success-card p {
    position: relative;
    z-index: 1;
    margin: 0 0 20px;
    color: #9fb0d0;
    font-size: 14px;
    line-height: 1.5;
}

.point-add-success-ok {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 12px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, #2ecb7b, #1f9e5a);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(31, 158, 90, 0.32);
}

.point-add-success-ok:hover {
    filter: brightness(1.08);
}

.point-add-success-ok:active {
    transform: translateY(1px);
}

.profile-progress {
    margin: 0 0 10px;
    color: #8f9cbd;
    font-size: 12px;
}

.profile-records .records-list {
    max-height: 390px;
}

@media (max-width: 420px) {
    .profile-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.records-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    font-size: 17px;
}

.records-popup-head {
    padding: 0 42px 14px 2px;
}

.records-popup-head > span {
    color: #00d4ff;
    font-size: 10px;
    font-weight: 900;
}

.records-popup-head h2 {
    margin: 3px 0;
    color: #fff;
    font-size: 22px;
}

.records-popup-head p {
    color: #8f9cbd;
    font-size: 12px;
}

.records-list {
    display: grid;
    gap: 8px;
    max-height: 480px;
    overflow-y: auto;
    scrollbar-width: none;
}

.records-list::-webkit-scrollbar {
    width: 0;
}

.game-record-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 5px 12px;
    padding: 11px 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.game-record-row strong {
    color: #f3f6ff;
    font-size: 13px;
}

.game-record-row b {
    color: #ffd45c;
    font-size: 13px;
}

.game-record-row span,
.game-record-row time {
    color: #7f8aa8;
    font-size: 11px;
}

.game-record-empty {
    padding: 42px 16px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #7f8aa8;
    font-size: 13px;
    text-align: center;
}

button {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 18px;
    background: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px #00d4ff;
}

.mode-btns { display: flex; gap: 16px; justify-content: center; }
.mode-btn { padding: 14px 32px; font-size: 18px; border-radius: 30px; cursor: pointer; border: none; transition: transform 0.2s, box-shadow 0.2s; }
.mode-btn:hover { transform: scale(1.05); }
#soloBtn { background: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%); color: #fff; }
#soloBtn:hover { box-shadow: 0 0 20px #00d4ff; }
#dualBtn { background: linear-gradient(135deg, #ff6b9d 0%, #c44dff 100%); color: #fff; }
#dualBtn:hover { box-shadow: 0 0 20px #c44dff; }

.btn-skip {
    background: linear-gradient(135deg, #666 0%, #444 100%) !important;
}

.btn-skip:hover {
    box-shadow: 0 0 15px #999 !important;
}

/* ==================== 宝箱密码 ==================== */
.math-popup {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1600;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 18px;
    background: rgba(1, 4, 12, 0.88);
    backdrop-filter: blur(8px);
    pointer-events: auto;
    animation: popupFadeIn 0.24s ease-out;
}

@keyframes popupFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.math-popup-inner {
    z-index: 1;
    width: min(420px, calc(100vw - 36px));
    max-height: calc(100vh - 36px);
    background: #090d18;
    border: 1px solid rgba(255, 205, 72, 0.58);
    border-radius: 8px;
    padding: 20px 24px 18px;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.68), 0 0 32px rgba(255, 190, 52, 0.12);
}

.math-popup-glow {
    position: absolute;
    z-index: 4;
    top: -30%;
    left: -45%;
    width: 32%;
    height: 160%;
    opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 240, 170, 0.34), transparent);
    transform: rotate(18deg);
    pointer-events: none;
}

.math-popup-inner.unlocking .math-popup-glow {
    animation: mathLockScan 0.72s ease-in-out;
}

.math-popup-title {
    position: relative;
    z-index: 2;
    margin: 0 0 2px;
    font-size: 24px;
    color: #ffe17a;
}

.math-popup-hint {
    position: relative;
    z-index: 2;
    margin: 0 0 8px;
    font-size: 13px;
    color: #a9b2c8;
}

.math-lock-stage {
    position: relative;
    height: 176px;
    margin: 0 auto 2px;
    overflow: hidden;
    border: 1px solid rgba(84, 205, 255, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(rgba(84, 205, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(84, 205, 255, 0.045) 1px, transparent 1px),
        #050914;
    background-size: 22px 22px;
}

.math-lock-burst {
    position: absolute;
    left: 50%;
    top: 48%;
    width: 34px;
    height: 34px;
    border: 2px solid rgba(255, 232, 143, 0.8);
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
}

.math-chest-art {
    position: absolute;
    left: 50%;
    top: 3px;
    width: 154px;
    height: 142px;
    transform: translateX(-50%);
    transform-origin: 50% 80%;
}

.math-password-chest-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.55));
}

.math-padlock {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 82px;
    width: 50px;
    height: 58px;
    transform: translateX(-50%);
    filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.62));
}

.math-lock-shackle {
    position: absolute;
    left: 11px;
    top: 0;
    width: 28px;
    height: 31px;
    border: 6px solid #ffe17a;
    border-bottom: 0;
    border-radius: 17px 17px 0 0;
    box-shadow: inset 0 0 0 2px rgba(166, 91, 0, 0.28);
    transform-origin: right bottom;
}

.math-lock-body {
    position: absolute;
    left: 3px;
    bottom: 0;
    width: 44px;
    height: 37px;
    border: 2px solid #fff0a3;
    border-radius: 7px;
    background: linear-gradient(135deg, #fff08c 0%, #f5ac1b 50%, #b96a00 100%);
    box-shadow: inset 0 -5px 0 rgba(112, 54, 0, 0.22), 0 0 13px rgba(255, 197, 52, 0.42);
}

.math-lock-body i {
    position: absolute;
    left: 50%;
    top: 10px;
    width: 7px;
    height: 15px;
    border-radius: 5px 5px 3px 3px;
    background: #4b2a0a;
    transform: translateX(-50%);
}

.math-lock-sparks {
    position: absolute;
    z-index: 5;
    left: 50%;
    top: 100px;
    width: 1px;
    height: 1px;
}

.math-lock-sparks i {
    --spark-angle: 0deg;
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: #fff3a3;
    opacity: 0;
    box-shadow: 0 0 10px #ffc83d;
}

.math-lock-sparks i:nth-child(2) { --spark-angle: 45deg; background: #62e9ff; }
.math-lock-sparks i:nth-child(3) { --spark-angle: 90deg; }
.math-lock-sparks i:nth-child(4) { --spark-angle: 135deg; background: #ff7198; }
.math-lock-sparks i:nth-child(5) { --spark-angle: 180deg; }
.math-lock-sparks i:nth-child(6) { --spark-angle: 225deg; background: #62e9ff; }
.math-lock-sparks i:nth-child(7) { --spark-angle: 270deg; }
.math-lock-sparks i:nth-child(8) { --spark-angle: 315deg; background: #ff7198; }

.math-unlock-success {
    position: absolute;
    z-index: 6;
    left: 50%;
    bottom: 7px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #8dffc2;
    opacity: 0;
    transform: translateX(-50%) scale(0.65);
}

.math-unlock-success span {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: #19ba72;
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    box-shadow: 0 0 14px rgba(46, 255, 154, 0.72);
}

.math-unlock-success strong {
    font-size: 16px;
}

.math-popup-inner.unlocking .math-padlock {
    animation: mathLockTurn 0.62s ease-in-out;
}

.math-popup-inner.unlocking .math-chest-art {
    animation: mathChestReady 0.72s ease-in-out;
}

.math-popup-inner.unlocked .math-lock-shackle {
    animation: mathShackleOpen 0.5s cubic-bezier(0.18, 0.9, 0.3, 1.35) forwards;
}

.math-popup-inner.unlocked .math-lock-body {
    animation: mathLockRelease 0.48s ease-out forwards;
}

.math-popup-inner.unlocked .math-chest-art {
    animation: mathChestUnlocked 0.72s cubic-bezier(0.18, 0.9, 0.3, 1.25) both;
}

.math-popup-inner.unlocked .math-lock-burst {
    animation: mathUnlockRing 0.82s ease-out both;
}

.math-popup-inner.unlocked .math-lock-sparks i {
    animation: mathUnlockSpark 0.7s ease-out both;
}

.math-popup-inner.unlocked .math-unlock-success {
    animation: mathSuccessPop 0.46s 0.18s cubic-bezier(0.18, 0.9, 0.3, 1.35) both;
}

.math-popup-inner.password-error .math-lock-stage {
    animation: mathPasswordError 0.35s ease-in-out;
    border-color: rgba(255, 87, 112, 0.7);
}

.math-popup-box-type {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 24px;
    gap: 7px;
    margin: 2px 0 7px;
}

#mathPopupIcon { font-size: 20px; }
#mathPopupLabel { font-size: 14px; color: #dbe5ff; }

.math-health {
    display: grid;
    gap: 5px;
    margin: 0 0 8px;
    padding: 7px 10px 8px;
    border: 1px solid rgba(255, 91, 123, 0.3);
    border-radius: 7px;
    background: rgba(255, 68, 103, 0.07);
}

.math-health-head {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 18px;
    color: #f3f6ff;
    font-size: 12px;
}

.math-health-heart {
    color: #ff4d70;
    font-size: 18px;
    line-height: 1;
    text-shadow: 0 0 10px rgba(255, 77, 112, 0.58);
}

.math-health-value {
    margin-left: auto;
    color: #cbd4e8;
}

.math-health-value b:first-child {
    color: #fff;
    font-size: 14px;
}

.math-health-track {
    height: 8px;
    overflow: hidden;
    border-radius: 4px;
    background: #242b3c;
}

.math-health-fill {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: #ff4d70;
    box-shadow: 0 0 10px rgba(255, 77, 112, 0.5);
    transition: width 0.28s ease;
}

.math-health.low .math-health-fill {
    background: #ff2f3f;
    animation: mathHealthLow 0.7s ease-in-out infinite alternate;
}

@keyframes mathHealthLow {
    from { opacity: 0.62; }
    to { opacity: 1; }
}

.math-password-label {
    margin-bottom: 3px;
    color: #7f8ca8;
    font-size: 12px;
}

.math-problem {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 62px;
    gap: 11px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: #03060d;
    font-size: 34px;
    font-weight: 800;
    color: #fff;
}

.math-operator, .math-equals { color: #5edfff; }
.math-question { color: #ffd452; font-size: 42px; }
.math-expression {
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
    white-space: nowrap;
}

.math-password-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    width: min(260px, 100%);
    height: 46px;
    margin: 0 auto 11px;
    overflow: hidden;
    border: 2px solid rgba(255, 212, 82, 0.54);
    border-radius: 8px;
    background: #121827;
}

.math-password-field > span {
    padding: 0 10px;
    color: #ffd452;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.math-password-field:focus-within {
    border-color: #63e4ff;
    box-shadow: 0 0 0 3px rgba(56, 212, 255, 0.12);
}

.math-input {
    width: 100%;
    height: 100%;
    padding: 0 12px;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    background: #060a13;
    font-size: 23px;
    font-weight: 800;
    text-align: center;
    color: #fff;
    outline: none;
    appearance: textfield;
    -moz-appearance: textfield;
}

.math-input::-webkit-outer-spin-button,
.math-input::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.math-input:disabled {
    opacity: 0.72;
}

.math-popup-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#mathSubmitBtn, #mathSkipBtn {
    min-width: 112px;
    height: 42px;
    margin-top: 0;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 800;
}

#mathSubmitBtn {
    background: linear-gradient(135deg, #ffc832, #ff8b2f);
    color: #321b00;
    box-shadow: 0 7px 18px rgba(255, 152, 44, 0.24);
}

#mathSubmitBtn:hover {
    box-shadow: 0 0 18px rgba(255, 203, 62, 0.72);
}

#mathSubmitBtn:disabled,
#mathSkipBtn:disabled {
    cursor: default;
    opacity: 0.5;
    transform: none;
    box-shadow: none;
}

#mathSkipBtn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #272d3b !important;
    color: #c4cadd;
}

.math-feedback {
    min-height: 20px;
    margin-top: 0;
    font-size: 14px;
    font-weight: 700;
}

.math-feedback.success { color: #00ff88; }
.math-feedback.error { color: #ff4444; }
.math-feedback.unlocking {
    color: #ffe17a;
    animation: mathFeedbackPulse 0.55s ease-in-out infinite alternate;
}

@keyframes mathLockScan {
    0% { left: -45%; opacity: 0; }
    20% { opacity: 1; }
    100% { left: 115%; opacity: 0; }
}

@keyframes mathLockTurn {
    0%, 100% { transform: translateX(-50%) rotate(0); }
    20% { transform: translateX(-50%) rotate(-8deg); }
    42% { transform: translateX(-50%) rotate(9deg); }
    64% { transform: translateX(-50%) rotate(-5deg); }
    82% { transform: translateX(-50%) rotate(3deg); }
}

@keyframes mathChestReady {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.06); filter: brightness(1.18); }
}

@keyframes mathShackleOpen {
    0% { transform: translate(0, 0) rotate(0); }
    45% { transform: translate(0, -10px) rotate(0); }
    100% { transform: translate(8px, -13px) rotate(28deg); opacity: 0.32; }
}

@keyframes mathLockRelease {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: translateY(14px) scale(0.55); opacity: 0; }
}

@keyframes mathChestUnlocked {
    0% { transform: translateX(-50%) scale(1); filter: brightness(1); }
    45% { transform: translateX(-50%) translateY(-9px) scale(1.12); filter: brightness(1.38); }
    100% { transform: translateX(-50%) translateY(0) scale(1.05); filter: brightness(1.12) drop-shadow(0 0 17px rgba(255, 217, 85, 0.6)); }
}

@keyframes mathUnlockRing {
    0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.4); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(5); }
}

@keyframes mathUnlockSpark {
    0% { opacity: 1; transform: rotate(var(--spark-angle)) translateX(16px) scale(1); }
    100% { opacity: 0; transform: rotate(var(--spark-angle)) translateX(82px) scale(0.25); }
}

@keyframes mathSuccessPop {
    0% { opacity: 0; transform: translateX(-50%) scale(0.65); }
    100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

@keyframes mathPasswordError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-7px); }
    50% { transform: translateX(7px); }
    75% { transform: translateX(-4px); }
}

@keyframes mathFeedbackPulse {
    from { opacity: 0.62; }
    to { opacity: 1; }
}

@media (max-width: 480px), (max-height: 700px) {
    .math-popup-inner {
        padding: 14px 16px 12px;
    }

    .math-lock-stage {
        height: 142px;
    }

    .math-chest-art {
        top: 0;
        width: 128px;
        height: 118px;
    }

    .math-padlock {
        top: 64px;
        transform: translateX(-50%) scale(0.88);
    }

    .math-lock-sparks {
        top: 82px;
    }

    .math-unlock-success {
        bottom: 4px;
    }

    .math-popup-box-type {
        margin-bottom: 4px;
    }

    .math-problem {
        min-height: 52px;
        margin-bottom: 7px;
        font-size: 30px;
    }

    .math-password-field {
        height: 42px;
        margin-bottom: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .math-popup,
    .math-popup-inner.unlocking .math-popup-glow,
    .math-popup-inner.unlocking .math-padlock,
    .math-popup-inner.unlocking .math-chest-art,
    .math-popup-inner.unlocked .math-lock-shackle,
    .math-popup-inner.unlocked .math-lock-body,
    .math-popup-inner.unlocked .math-chest-art,
    .math-popup-inner.unlocked .math-lock-burst,
    .math-popup-inner.unlocked .math-lock-sparks i,
    .math-popup-inner.unlocked .math-unlock-success,
    .math-popup-inner.password-error .math-lock-stage,
    .math-feedback.unlocking {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ==================== 开宝箱弹窗 ==================== */
.treasure-popup {
    position: absolute;
    inset: 0;
    z-index: 24;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 6, 22, 0.76);
    backdrop-filter: blur(6px);
}

.treasure-popup-inner {
    position: relative;
    width: min(390px, calc(100% - 34px));
    max-height: calc(100% - 28px);
    padding: 28px 24px 24px;
    border: 1px solid rgba(255, 212, 92, 0.45);
    border-radius: 20px;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 212, 92, 0.28), transparent 38%),
        linear-gradient(180deg, rgba(25, 18, 44, 0.98), rgba(7, 9, 24, 0.98));
    color: #fff;
    text-align: center;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    box-shadow: 0 0 52px rgba(255, 212, 92, 0.22), 0 24px 78px rgba(0, 0, 0, 0.6);
}

.treasure-popup-inner::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.treasure-popup-inner.rewards-open .treasure-chest-visual {
    width: 92px;
    height: 92px;
    margin: 4px auto 8px;
}

.treasure-rays {
    position: absolute;
    inset: -70px;
    background: conic-gradient(from 0deg, transparent, rgba(255, 212, 92, 0.16), transparent 18%, rgba(0, 212, 255, 0.12), transparent 36%);
    animation: portalSpin 6s linear infinite;
    opacity: 0.7;
}

.treasure-popup-inner.opening .treasure-rays {
    animation-duration: 1.2s;
    opacity: 0.95;
}

.treasure-popup-inner > *:not(.treasure-rays) {
    position: relative;
}

.treasure-popup-inner h2 {
    color: #ffd45c;
    margin: 0 0 6px;
    font-size: 30px;
    text-shadow: 0 0 18px rgba(255, 212, 92, 0.8);
}

.treasure-popup-inner p {
    color: #d8cdaa;
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 14px;
}

.treasure-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.treasure-close-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.treasure-chest-visual {
    width: 136px;
    height: 136px;
    margin: 10px auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,212,92,0.22), rgba(255,212,92,0.06) 62%, transparent);
    filter: drop-shadow(0 0 18px rgba(255, 212, 92, 0.65));
    animation: treasureFloat 1.8s ease-in-out infinite;
    position: relative;
    overflow: visible;
}

.treasure-chest-visual.boss {
    background: radial-gradient(circle, rgba(255, 128, 57, 0.28), rgba(255, 67, 92, 0.08) 58%, transparent 72%);
    filter: drop-shadow(0 0 21px rgba(255, 129, 54, 0.72));
}

.treasure-chest-visual.opened {
    animation: treasurePop 0.42s ease-out both;
    background: radial-gradient(circle, rgba(255,212,92,0.34), rgba(0,212,255,0.14) 58%, transparent 72%);
}

.treasure-chest-visual.opening {
    animation: treasureOpenShake 0.24s ease-in-out infinite;
}

.treasure-chest-image {
    display: block;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.popup-treasure-image {
    width: 132px;
    height: 132px;
}

.treasure-chest-visual.opening .popup-treasure-image {
    animation: treasureChestUnlock 0.95s cubic-bezier(.2,.78,.2,1) both;
}

.treasure-chest-visual.opening::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 42px;
    width: 34px;
    height: 84px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,212,92,0.34), transparent);
    filter: blur(4px);
    opacity: 0;
    animation: treasureBeamOpen 0.95s ease-out both;
}

.treasure-confetti {
    position: absolute;
    inset: -22px;
    pointer-events: none;
}

.treasure-confetti::before {
    content: '✦';
    position: absolute;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
    color: #fff3a8;
    font-size: 44px;
    text-shadow: 0 0 16px #ffd45c, 0 0 28px rgba(0, 212, 255, 0.6);
    animation: treasureStarPulse 1.2s ease-in-out infinite;
}

.treasure-confetti span {
    position: absolute;
    left: var(--x);
    top: 50%;
    width: 8px;
    height: 14px;
    border-radius: 3px;
    background: var(--c);
    transform: translate(-50%, -50%) rotate(var(--r));
    box-shadow: 0 0 10px color-mix(in srgb, var(--c), transparent 35%);
    animation: treasureConfettiBurst 1.55s ease-out infinite;
    animation-delay: var(--d);
}

.treasure-reward-view {
    margin: 8px 0 12px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 212, 92, 0.28);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 212, 92, 0.16), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.055));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 10px 24px rgba(0, 0, 0, 0.22);
    animation: rewardPanelIn 0.28s ease-out both;
}

.treasure-reward-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 8px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 212, 92, 0.22), rgba(0, 212, 255, 0.14));
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 34px;
    line-height: 1;
    box-shadow: 0 0 20px rgba(255, 212, 92, 0.2);
}

.treasure-reward-name {
    color: #fff4bd;
    font-size: 20px;
    font-weight: 900;
    text-shadow: 0 0 12px rgba(255, 212, 92, 0.45);
}

.treasure-reward-desc {
    color: #b9c7e8;
    font-size: 13px;
    margin-top: 8px;
}

.treasure-reward-list {
    display: grid;
    gap: 8px;
    text-align: left;
}

.treasure-reward-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(135deg, rgba(255, 212, 92, 0.13), rgba(0, 212, 255, 0.07)),
        rgba(5, 8, 24, 0.48);
    box-shadow: inset 0 0 18px rgba(255, 212, 92, 0.04);
    animation: rewardItemIn 0.34s ease-out both;
    animation-delay: var(--delay);
}

.treasure-reward-item-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 25px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 14px rgba(0, 212, 255, 0.12);
}

.treasure-reward-item-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.treasure-reward-item-copy strong {
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
}

.treasure-reward-item-copy span {
    color: #aebbe0;
    font-size: 12px;
    line-height: 1.3;
}

.treasure-reward-item.is-used {
    border-color: rgba(73, 230, 169, 0.52);
}

.treasure-reward-item.is-discarded {
    opacity: 0.62;
    border-color: rgba(255, 255, 255, 0.08);
}

.treasure-reward-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-top: 7px;
}

.treasure-reward-choice-btn {
    min-width: 0;
    min-height: 36px;
    margin: 0;
    padding: 7px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    white-space: normal;
}

.treasure-reward-choice-btn.use {
    color: #05271d;
    background: #58e6ad;
    border: 1px solid #8affcf;
    box-shadow: 0 5px 14px rgba(88, 230, 173, 0.2);
}

.treasure-reward-choice-btn.discard {
    color: #d6def3;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: none;
}

.treasure-reward-choice-state {
    margin-top: 7px;
    font-size: 12px;
    font-weight: 800;
}

.treasure-reward-choice-state.used {
    color: #70f1bd;
}

.treasure-reward-choice-state.discarded {
    color: #929dbb;
}

.treasure-open-btn {
    padding: 12px 34px;
    border-radius: 22px;
    background: linear-gradient(135deg, #ffd45c, #ff7b32);
    color: #301405;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(255, 160, 48, 0.28);
}

@keyframes treasureFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.03); }
}

@keyframes treasurePop {
    0% { transform: scale(0.86) rotate(-7deg); }
    60% { transform: scale(1.12) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes rewardPanelIn {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rewardItemIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes treasureOpenShake {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-2px) rotate(-2deg); }
    75% { transform: translateY(2px) rotate(2deg); }
}

@keyframes treasureChestUnlock {
    0% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
    28% { transform: translateY(-3px) scale(1.02) rotate(-4deg); }
    52% { transform: translateY(1px) scale(1.06) rotate(4deg); }
    74% { opacity: 1; transform: translateY(-9px) scale(1.18) rotate(0deg); }
    100% { opacity: 0; transform: translateY(-18px) scale(1.34) rotate(0deg); }
}

@keyframes treasureBeamOpen {
    0%, 22% { opacity: 0; transform: translateX(-50%) scaleY(0.35); }
    55% { opacity: 0.95; transform: translateX(-50%) scaleY(1); }
    100% { opacity: 0.15; transform: translateX(-50%) scaleY(1.18); }
}

@keyframes treasureStarPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(0.9) rotate(0deg); opacity: 0.88; }
    50% { transform: translate(-50%, -50%) scale(1.18) rotate(18deg); opacity: 1; }
}

@keyframes treasureConfettiBurst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--r)) scale(0.45);
    }
    16% { opacity: 1; }
    72% { opacity: 0.95; }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(calc(var(--r) + 360deg)) scale(1);
    }
}

/* 接住宝箱后直接收入背包的非阻塞反馈 */
.chest-collected-fx {
    position: absolute;
    z-index: 18;
    left: 50%;
    top: 43%;
    width: 260px;
    height: 204px;
    transform: translate(-50%, -50%);
    display: grid;
    justify-items: center;
    align-content: center;
    pointer-events: none;
    isolation: isolate;
    animation: chestCollectedStage 1.8s cubic-bezier(.2, .75, .2, 1) both;
}

.chest-collected-fx::before {
    content: '';
    position: absolute;
    z-index: -2;
    inset: 12px 0 0;
    border: 1px solid rgba(255, 212, 92, 0.46);
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 26%, rgba(255, 212, 92, 0.3), transparent 40%),
        linear-gradient(180deg, rgba(14, 11, 30, 0.93), rgba(5, 9, 24, 0.88));
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.42),
        0 0 34px rgba(255, 184, 63, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.chest-collected-fx.boss::before {
    border-color: rgba(255, 107, 157, 0.58);
    background:
        radial-gradient(circle at 50% 24%, rgba(255, 107, 157, 0.3), transparent 42%),
        linear-gradient(180deg, rgba(24, 9, 34, 0.95), rgba(7, 8, 26, 0.9));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42), 0 0 38px rgba(255, 107, 157, 0.22);
}

.chest-collected-rays {
    position: absolute;
    z-index: -1;
    top: 5px;
    width: 152px;
    height: 152px;
    border-radius: 50%;
    opacity: 0.55;
    background: repeating-conic-gradient(from 0deg, rgba(255, 231, 145, 0.42) 0 8deg, transparent 8deg 20deg);
    mask-image: radial-gradient(circle, transparent 0 23%, #000 39%, transparent 70%);
    animation: chestCollectedRays 3.8s linear infinite;
}

.chest-collected-icon {
    width: 104px;
    height: 88px;
    display: grid;
    place-items: center;
    filter: drop-shadow(0 0 16px rgba(255, 184, 63, 0.62));
    animation: chestCollectedIcon 1.8s cubic-bezier(.2, .82, .2, 1) both;
}

.collected-treasure-image {
    width: 104px;
    height: 104px;
    object-fit: contain;
}

.chest-collected-fx.boss .chest-collected-icon {
    filter: drop-shadow(0 0 18px rgba(255, 126, 57, 0.75));
}

.chest-collected-fx strong {
    margin-top: 2px;
    color: #fff3b5;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.2;
    text-shadow: 0 0 14px rgba(255, 212, 92, 0.55);
}

.chest-collected-fx.boss strong {
    color: #ffd2e4;
    text-shadow: 0 0 14px rgba(255, 107, 157, 0.62);
}

.chest-collected-fx > span {
    margin-top: 6px;
    color: #aebce0;
    font-size: 12px;
    font-weight: 700;
}

.chest-collected-sparks {
    position: absolute;
    left: 50%;
    top: 53px;
    width: 1px;
    height: 1px;
}

.chest-collected-sparks i {
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 5px;
    border-radius: 1px;
    background: #ffe78e;
    box-shadow: 0 0 9px rgba(255, 212, 92, 0.9);
    opacity: 0;
    animation: chestCollectedSpark 0.82s ease-out var(--delay) both;
}

.chest-collected-fx.boss .chest-collected-sparks i {
    background: #ff9fc5;
    box-shadow: 0 0 9px rgba(255, 107, 157, 0.9);
}

@keyframes chestCollectedStage {
    0% { opacity: 0; transform: translate(-50%, -43%) scale(0.72); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
    24%, 76% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -58%) scale(0.94); }
}

@keyframes chestCollectedIcon {
    0% { transform: translateY(34px) scale(0.42) rotate(-12deg); }
    17% { transform: translateY(-8px) scale(1.1) rotate(5deg); }
    28%, 72% { transform: translateY(0) scale(1) rotate(0deg); }
    100% { transform: translateY(-7px) scale(0.94) rotate(0deg); }
}

@keyframes chestCollectedRays {
    to { transform: rotate(360deg); }
}

@keyframes chestCollectedSpark {
    0% { opacity: 0; transform: rotate(var(--angle)) translateX(20px) scale(0.3); }
    18% { opacity: 1; }
    100% { opacity: 0; transform: rotate(var(--angle)) translateX(88px) scale(1); }
}

/* ==================== 设置面板（侧边栏内） ==================== */
.sidebar-panel .settings-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.settings-pwd-area {
    text-align: center;
    padding: 40px 20px;
}

.settings-pwd-area h3 {
    color: #ffcc00;
    margin-bottom: 16px;
    font-size: 18px;
}

.settings-pwd-input {
    width: 160px;
    padding: 10px 16px;
    font-size: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    outline: none;
    letter-spacing: 4px;
}

.settings-pwd-input:focus { border-color: #00d4ff; box-shadow: 0 0 15px rgba(0, 212, 255, 0.3); }

.settings-pwd-btn {
    margin-top: 14px;
    padding: 10px 36px;
    font-size: 16px;
    background: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}
.settings-pwd-btn:hover { transform: scale(1.05); }

.settings-pwd-msg { margin-top: 10px; font-size: 13px; color: #ff6666; }

.config-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #ccc;
    margin: 6px 0;
    gap: 8px;
}

.config-row input,
.config-row select {
    width: 80px;
    padding: 4px 8px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    text-align: center;
    outline: none;
}

.config-row select {
    width: 110px;
}

/* 展开的下拉选项：原生面板为白底，需用黑字，否则白字白底看不到 */
.config-row select option {
    color: #111;
    background: #fff;
}

.config-row input:focus,
.config-row select:focus {
    border-color: #00d4ff;
}

.test-config-item {
    border-color: rgba(255, 216, 77, 0.24);
    background: linear-gradient(135deg, rgba(255, 216, 77, 0.07), rgba(0, 212, 255, 0.05));
}

.test-buff-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0;
}

.test-buff-row label {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 0 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.18);
    color: #ccc;
    font-size: 12px;
}

.test-config-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0 10px;
}

.test-config-actions .settings-pwd-btn {
    margin-top: 0;
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 16px;
}

.config-hint {
    font-size: 11px;
    color: #666;
    margin: 2px 0;
}

.settings-config-actions {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    margin: 0 0 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.pwd-change-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.settings-config-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.settings-config-item h4 {
    color: #00d4ff;
    margin: 0 0 6px;
    font-size: 15px;
}

/* 系统设置子分组（如“宠物技能配置”下的：导弹/追踪弹/进化等） */
.settings-subgroup {
    margin: 10px 0 2px;
    padding: 8px 10px 6px;
    border-left: 3px solid rgba(0, 212, 255, 0.35);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.settings-subgroup h5 {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #7fd8ff;
}

/* 配置项模糊搜索：命中项保留、未命中项与空分组隐藏 */
.admin-config-filtered {
    display: none !important;
}

.admin-config-search-count {
    align-self: center;
    margin-left: 2px;
    font-size: 12px;
    font-weight: 800;
    color: var(--admin-blue, #3754db);
    white-space: nowrap;
}

.settings-config-item p {
    margin: 2px 0;
    font-size: 13px;
    color: #aaa;
}

.settings-config-item .val { color: #ffcc00; font-weight: bold; }

/* 系统设置多级子菜单（管理端：左树 + 右侧分区内容） */
.admin-settings-host #settingsBody {
    display: flex;
    align-items: stretch;
    gap: 14px;
    height: calc(100vh - 150px);
    min-height: 300px;
}

.admin-settings-host #settingsBody > .settings-tree {
    flex: 0 0 230px;
    overflow-y: auto;
}

.admin-settings-host #settingsBody > .settings-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.admin-settings-actions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
}

.settings-tree {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.settings-tree-group-title {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #cfe3ff;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.settings-tree-group-title:hover {
    background: rgba(255, 255, 255, 0.06);
}

.settings-tree-game > .settings-tree-group-title {
    color: #8fe0ff;
}

.settings-tree-game > .settings-tree-group-title::after {
    content: '▾';
    color: #7f8ca8;
    font-size: 11px;
}

.settings-tree-game.collapsed > .settings-tree-group-title::after {
    content: '▸';
}

.settings-tree-children {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0 4px 14px;
}

.settings-tree-leaf {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #b9c6e2;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.settings-tree-leaf:hover {
    background: rgba(255, 255, 255, 0.06);
}

.settings-tree-leaf.active {
    background: #1b5fb0;
    color: #fff;
}

.settings-tree-leaf em {
    font-style: normal;
    font-size: 11px;
    color: #8b98b8;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 9px;
    padding: 1px 6px;
}

.settings-tree-placeholder {
    padding: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.settings-tree-placeholder h4 {
    color: #00d4ff;
    margin: 0 0 8px;
    font-size: 15px;
}

.settings-tree-placeholder-note {
    margin: 2px 0;
    font-size: 13px;
    color: #aaa;
}

.settings-exit-btn {
    display: block;
    margin: 20px auto 0;
    padding: 10px 30px;
    font-size: 15px;
    background: #555;
    color: #ccc;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}
.settings-exit-btn:hover { transform: scale(1.05); }

/* ==================== 动画 ==================== */
@keyframes petBtnPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 107, 157, 0.3); }
    50%      { box-shadow: 0 0 20px rgba(255, 107, 157, 0.7); }
}

@keyframes gearSpin { 
    from { transform: rotate(0deg); } 
    to   { transform: rotate(360deg); } 
}

/* ==================== 装备系统 ==================== */
.equip-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 8px 42px 8px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #0c1426;
}

.equip-panel-header h2 {
    margin: 0;
    color: #f2f7ff;
    font-size: 16px;
}

.equip-quality-note {
    color: #9fb4e8;
    font-size: 12px;
}

.equip-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.moyu-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 10px;
    align-items: stretch;
}

.moyu-character-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px 10px;
    border: 1px solid rgba(0, 212, 255, 0.18);
    border-radius: 12px;
    background:
        radial-gradient(circle at 50% 34%, rgba(0, 212, 255, 0.13), transparent 56%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.14));
}

.moyu-human {
    position: relative;
    width: 196px;
    height: 272px;
    flex: none;
}

.moyu-human svg {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.45));
}

.moyu-model-item {
    position: absolute;
    z-index: 3;
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 0 7px rgba(0, 212, 255, 0.85));
    pointer-events: none;
}

.moyu-model-item--helmet {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.moyu-model-item--necklace {
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
}

.moyu-model-item--bracelet {
    top: 112px;
    left: 0;
}

.moyu-model-item--weapon {
    top: 112px;
    right: 0;
}

.moyu-model-item--shoes {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.moyu-char-name {
    color: #eef3ff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 3px;
}

.moyu-power {
    color: #9fb4e8;
    font-size: 12px;
}

.moyu-power b {
    color: #ffd45c;
    font-size: 15px;
    font-weight: 900;
    margin-left: 2px;
}

.moyu-rail {
    display: grid;
    gap: 8px;
    align-content: center;
}

.moyu-bottom {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.moyu-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 82px;
    padding: 6px 4px;
    border: 1px solid rgba(0, 212, 255, 0.38);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(13, 27, 54, 0.96), rgba(7, 14, 32, 0.96));
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    text-align: center;
}

.moyu-slot.empty {
    opacity: 0.72;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.24);
}

.moyu-slot-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    font-size: 20px;
}

.moyu-slot strong {
    max-width: 104px;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.moyu-slot small {
    color: #9fb4e8;
    font-size: 10px;
    line-height: 1;
}

.moyu-slot em {
    color: #7dffa8;
    font-size: 10px;
    font-style: normal;
    line-height: 1;
    white-space: nowrap;
}

.moyu-beast-btn {
    min-height: 82px;
    margin: 0;
    padding: 6px 4px;
    border: 1px solid rgba(196, 77, 255, 0.5);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(196, 77, 255, 0.28), rgba(255, 107, 157, 0.22));
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(196, 77, 255, 0.18);
}

.moyu-beast-btn:hover {
    border-color: rgba(255, 107, 157, 0.8);
    background: linear-gradient(135deg, rgba(196, 77, 255, 0.42), rgba(255, 107, 157, 0.34));
}

.moyu-stats {
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
}

.moyu-stats-title {
    margin-bottom: 7px;
    color: #9fb4e8;
    font-size: 12px;
}

.moyu-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.moyu-stat-chip {
    display: grid;
    gap: 1px;
    padding: 5px 4px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    text-align: center;
}

.moyu-stat-chip span {
    color: #9fb4e8;
    font-size: 10px;
}

.moyu-stat-chip b {
    color: #7dffa8;
    font-size: 12px;
    font-weight: 800;
}

.moyu-stat-empty {
    padding: 8px 0 4px;
    color: #8fa3c9;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 460px) {
    .moyu-stage {
        grid-template-columns: minmax(0, 1fr) 96px;
        gap: 6px;
    }

    .moyu-human {
        width: 176px;
        height: 244px;
    }

    .moyu-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==================== 装备视图切换（已穿戴 / 未穿装备） ==================== */
.equip-view-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.equip-view-tab {
    height: 34px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: #aeb8d4;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.equip-view-tab.active {
    border-color: #ffc964;
    background: rgba(255, 201, 100, 0.14);
    color: #fff3d6;
    box-shadow: inset 0 -2px 0 #ffc964;
}

.equip-bag-badge {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    margin-left: 5px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ffc964;
    color: #241703;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.equip-worn-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.equip-unequipped-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.unequipped-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.unequipped-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(255, 201, 100, 0.42);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255, 201, 100, 0.09), rgba(0, 0, 0, 0.12)),
        linear-gradient(180deg, rgba(13, 27, 54, 0.96), rgba(7, 14, 32, 0.96));
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.unequipped-card-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 201, 100, 0.35);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    font-size: 24px;
}

.unequipped-card-info {
    min-width: 0;
    flex: 1;
}

.unequipped-card-name {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.unequipped-card-name b {
    font-size: 14px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unequipped-quality-tag {
    padding: 0 6px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 10px;
    line-height: 16px;
    white-space: nowrap;
}

.unequipped-card-meta {
    margin-top: 4px;
    color: #9fb4e8;
    font-size: 11px;
    line-height: 1.3;
}

.unequipped-equip-btn {
    flex: none;
    height: 30px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid rgba(255, 201, 100, 0.7);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffd98a, #e8a53c);
    color: #241703;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 201, 100, 0.22);
}

.unequipped-equip-btn:hover {
    filter: brightness(1.08);
}

.unequipped-equip-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 1px;
}

.unequipped-empty {
    padding: 46px 16px;
    text-align: center;
    color: #9fb4e8;
}

.unequipped-empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.unequipped-empty p {
    margin: 0 0 6px;
    color: #eef3ff;
    font-size: 15px;
    font-weight: 800;
}

.unequipped-empty span {
    font-size: 12px;
}

.moyu-slot {
    position: relative;
}

.moyu-slot-unequip {
    position: absolute;
    top: -7px;
    right: -7px;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 201, 100, 0.65);
    border-radius: 50%;
    background: #241703;
    color: #ffd98a;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.moyu-slot-unequip:hover {
    background: #5a3c0d;
    color: #fff;
}

@media (max-width: 460px) {
    .unequipped-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.forge-placeholder {
    padding: 36px 16px;
    text-align: center;
    color: #9fb4e8;
}

.forge-placeholder p {
    margin: 4px 0;
    font-size: 14px;
}

/* ==================== 成员家庭任务 ==================== */
.member-task-popup {
    position: fixed;
    inset: 0;
    z-index: 6200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 6, 18, 0.78);
    backdrop-filter: blur(6px);
}

.member-task-card {
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 22px;
    border: 1px solid rgba(0, 212, 255, 0.28);
    border-radius: 14px;
    background: linear-gradient(180deg, #111a38, #080e1d);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    position: relative;
}

.member-task-card h3 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 18px;
}

.member-task-hint {
    margin: 0 0 12px;
    color: #9fb4e8;
    font-size: 13px;
}

.member-task-list {
    display: grid;
    gap: 8px;
}

.member-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.member-task-main {
    display: grid;
    gap: 2px;
}

.member-task-main strong {
    color: #eef3ff;
    font-size: 14px;
}

.member-task-main small {
    color: #9fb4e8;
    font-size: 12px;
}

.member-task-done {
    flex: 0 0 auto;
    padding: 7px 12px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #00d4ff, #0066ff);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.member-task-done.pending {
    background: rgba(255, 255, 255, 0.12);
    color: #9fb4e8;
    cursor: default;
}

.member-task-empty {
    padding: 24px 12px;
    color: #9fb4e8;
    text-align: center;
    font-size: 13px;
}

.member-task-msg {
    margin: 10px 0 0;
    color: #7dffa8;
    font-size: 13px;
    min-height: 18px;
}

.member-task-total {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    background: rgba(0, 212, 255, 0.08);
}

.member-task-total-label {
    color: #9fb4e8;
    font-size: 13px;
}

.member-task-total-value {
    color: #ffd700;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.member-task-total-unit {
    color: #9fb4e8;
    font-size: 13px;
}

.member-task-apply {
    margin: 0 0 0 auto;
    padding: 7px 14px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #00d4ff, #0066ff);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.member-task-apply:disabled {
    background: rgba(255, 255, 255, 0.12);
    color: #9fb4e8;
    cursor: default;
}

.member-task-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.member-task-add {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.member-task-add.selected {
    background: linear-gradient(135deg, #ffa500, #ff6a00);
    border-color: rgba(255, 166, 0, 0.5);
    color: #fff;
}

.member-task-item.selected {
    border-color: rgba(0, 212, 255, 0.4);
    background: rgba(0, 212, 255, 0.06);
}

/* ==================== 任务标签切换（日常/高级） ==================== */
.member-task-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 12px;
}

.member-task-tab {
    padding: 7px 16px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: #9fb4e8;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.member-task-tab.active {
    background: linear-gradient(135deg, #00d4ff, #0066ff);
    color: #fff;
    border-color: transparent;
}

.member-task-tab.sub {
    padding: 5px 12px;
    font-size: 12px;
}

.member-task-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

.member-task-daily {
    display: grid;
    gap: 10px;
}

.member-task-advanced {
    display: grid;
    gap: 10px;
}

.member-task-daily.hidden,
.member-task-advanced.hidden,
.advanced-panel.hidden {
    display: none;
}

.advanced-panel {
    display: grid;
    gap: 10px;
}

/* ==================== 算术答题 ==================== */
.arith-meta {
    color: #9fb4e8;
    font-size: 13px;
    line-height: 1.5;
}

.arith-list {
    display: grid;
    gap: 8px;
}

.arith-question {
    position: relative; /* 标记画布以整个卡片为基准，覆盖顶部留白与数字区 */
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 100px 12px 8px; /* 顶部加高100px，供孩子在数字上方画进位/借位标记 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.arith-index {
    color: #5f7bd0;
    font-size: 13px;
    min-width: 20px;
    align-self: center;
}

/* 竖式：运算符列 + 百/十/个位数字列，按位右对齐（百对百、十对十、个对个） */
.arith-vertical {
    position: relative;
    pointer-events: none; /* 让数字/横线/缝隙区域点击穿透到标记画布，仅输入框可交互 */
    display: grid;
    grid-template-columns: 26px 22px 22px 22px;
    grid-template-rows: auto auto auto auto;
    justify-items: start;
    align-items: end;
    column-gap: 2px;
    row-gap: 14px; /* 数字之间保留一个数字位的纵向间距 */
    width: 118px;
}

/* 鼠标点击的标记画布：覆盖整个卡片（含顶部留白），用于点击标记"1"（进一位/借位） */
.arith-mark {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
}

.arith-a, .arith-b, .arith-op, .arith-line,
.arith-a .arith-digit, .arith-b .arith-digit,
.arith-index {
    pointer-events: none; /* 让点击穿透到画布，输入框不受影响 */
}

/* 上数/下数：横跨数字列，内部数字位右对齐 */
.arith-a,
.arith-b {
    grid-column: 2 / 5;
    display: flex;
    justify-content: flex-end;
    color: #eef3ff;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.1;
}

.arith-a { grid-row: 1; }
.arith-b { grid-row: 2; }

/* 单个数字位：固定列宽，内容右对齐，保证上下数字按位对齐 */
.arith-digit {
    width: 22px;
    text-align: right;
    flex: 0 0 22px;
}

.arith-digit.arith-gap { visibility: hidden; }

.arith-op {
    grid-column: 1;
    grid-row: 2;
    color: #9fb4e8;
    font-size: 16px;
    font-weight: 700;
    justify-self: end;
}

.arith-line {
    grid-column: 2 / 5;
    grid-row: 3;
    width: 100%;
    height: 0;
    border-top: 2px solid #7fd3ff;
}

.arith-vertical .arith-input {
    grid-column: 2 / 5;
    grid-row: 4;
    position: relative;
    z-index: 4;
    width: 100%;
    pointer-events: auto; /* 输入框恢复可交互，可点击输入 */
}

.arith-input {
    width: 100%;
    padding: 6px 0;
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-radius: 8px;
    background: rgba(0, 212, 255, 0.08);
    color: #eef3ff;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 15px;
    letter-spacing: 1ch;       /* 答案数字之间隔开一个字符位 */
    margin-right: -1ch;        /* 抵消末尾 letter-spacing，使个位右对齐到列右缘 */
    text-align: right;         /* 答案位数与上方数字按位右对齐 */
    outline: none;
}

.arith-input:focus {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.14);
}

.arith-submit {
    justify-self: start;
    padding: 7px 16px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #00d4ff, #0066ff);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.arith-submit:disabled {
    background: rgba(255, 255, 255, 0.12);
    color: #9fb4e8;
    cursor: default;
}

.arith-result {
    color: #7dffa8;
    font-size: 13px;
    min-height: 18px;
}

.arith-result.warn {
    color: #ff9a9a;
}

/* 判错标记：卡片红框 */
.arith-question.arith-wrong {
    border-color: rgba(255, 90, 90, 0.85);
    background: rgba(255, 60, 60, 0.08);
    box-shadow: 0 0 0 1px rgba(255, 90, 90, 0.5), 0 0 14px rgba(255, 60, 60, 0.3);
}

.arith-question.arith-wrong .arith-input {
    border-color: rgba(255, 90, 90, 0.9);
    background: rgba(255, 60, 60, 0.12);
    color: #ff9a9a;
}

/* 判错标记：正确答案标签 */
.arith-correct {
    position: absolute;
    right: 12px;
    top: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #ffd65c;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 214, 92, 0.55);
    z-index: 5;
}


/* ==================== 算术满分庆祝动画 ==================== */
.arith-win-overlay {
    position: fixed;
    inset: 0;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(10, 16, 40, 0.72), rgba(2, 4, 16, 0.9));
    backdrop-filter: blur(4px);
    animation: arithWinFade 0.4s ease-out;
}

.arith-win-canvas {
    position: absolute;
    inset: 0;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.arith-win-box {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 60px;
    border-radius: 24px;
    text-align: center;
    background: rgba(12, 20, 48, 0.6);
    border: 2px solid rgba(255, 214, 92, 0.55);
    box-shadow: 0 0 60px rgba(0, 212, 255, 0.35), 0 0 120px rgba(255, 214, 92, 0.25);
    animation: arithWinPop 0.6s cubic-bezier(0.18, 1.5, 0.38, 1);
}

.arith-win-badge {
    font-size: 72px;
    line-height: 1;
    filter: drop-shadow(0 0 18px rgba(255, 214, 92, 0.85));
    animation: arithWinBadge 1.2s ease-in-out infinite;
}

.arith-win-title {
    margin: 0;
    font-size: 72px;
    font-weight: 900;
    letter-spacing: 4px;
    line-height: 1.1;
    background: linear-gradient(90deg, #ffd65c, #ff9a3d, #ff6ec7, #00d4ff, #ffd65c);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 18px rgba(255, 214, 92, 0.8));
    animation: arithWinShine 3s linear infinite;
}

.arith-win-sub {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #eef3ff;
    letter-spacing: 2px;
    text-shadow: 0 0 16px rgba(0, 212, 255, 0.7);
}

.arith-win-grade {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #8cff6e;
    letter-spacing: 3px;
    text-shadow: 0 0 14px rgba(140, 255, 110, 0.7);
}

.arith-win-close {
    margin-top: 10px;
    padding: 14px 32px;
    border: 0;
    border-radius: 30px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #0a1028;
    background: linear-gradient(90deg, #00d4ff, #6ee7ff);
    cursor: pointer;
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.55);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.arith-win-close:hover {
    transform: scale(1.05);
    box-shadow: 0 0 34px rgba(0, 212, 255, 0.85);
}

@keyframes arithWinFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes arithWinPop {
    0% { transform: scale(0.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes arithWinShine {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

@keyframes arithWinBadge {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-16px) rotate(4deg); }
}


/* ==================== 全局加载蒙层 ==================== */
.game-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    pointer-events: auto;
}

.game-loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-width: 168px;
    padding: 28px 32px 26px;
    border-radius: 18px;
    border: 1px solid rgba(90, 220, 255, 0.38);
    background:
        radial-gradient(circle at 50% 0%, rgba(96, 236, 255, 0.28), transparent 42%),
        linear-gradient(180deg, rgba(13, 20, 48, 0.98), rgba(5, 8, 24, 0.98));
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.22), 0 22px 70px rgba(0, 0, 0, 0.55);
    color: #fff;
    animation: popupFadeIn 0.3s ease-out;
}

.game-loading-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 5px solid rgba(0, 212, 255, 0.28);
    border-top-color: #00d4ff;
    box-shadow: inset 0 0 14px rgba(0, 212, 255, 0.35), 0 0 16px rgba(0, 212, 255, 0.4);
    animation: gameLoadingSpin 0.9s linear infinite;
}

.game-loading-text {
    color: #cfe6ff;
    font-size: 15px;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
}

@keyframes gameLoadingSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
