* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, "Microsoft YaHei", sans-serif;
    background: #1a1a2e;
    color: #eee;
    height: 100vh;
    overflow: hidden;
}
button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #4a6cf7;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}
button:hover { background: #3a5ce5; }
button:disabled { background: #444; color: #888; cursor: not-allowed; }
input, select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #222;
    color: #eee;
    font-size: 14px;
}

/* ============ 登录 ============ */
#loginPanel {
    display: flex; justify-content: center; align-items: center; height: 100vh;
}
.login-box { background: #222; padding: 32px; border-radius: 12px; width: 320px; text-align: center; }
.login-box h1 { color: #4a6cf7; margin-bottom: 20px; }
.login-box .big-btn { width: 100%; padding: 14px; font-size: 16px; border-radius: 8px; }

/* ============ 主面板 ============ */
#mainPanel { display: flex; flex-direction: column; height: 100vh; min-height: 0; }
.page {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 54px;
    min-height: 0;
}

/* ============ 顶部资源条 ============ */
.top-bar {
    display: flex; gap: 10px; align-items: center;
    background: #222; padding: 8px 12px; font-size: 12px; flex-shrink: 0;
    flex-wrap: wrap;
}
.top-bar b { color: #ffd666; }
.mini-btn { padding: 4px 10px; font-size: 13px; }

.stage-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 8px 12px;
    gap: 10px;
}
.player-info { text-align: left; }
.player-name { font-size: 14px; color: #4a6cf7; font-weight: bold; }
.player-power { font-size: 11px; color: #ffd666; }
.res-info {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 12px;
}

/* ============ 关卡页 ============ */
.stage-body {
    flex: 1; display: flex; align-items: center; justify-content: space-between;
    padding: 20px; gap: 10px; overflow: auto;
}
.arrow-btn {
    width: 50px; height: 80px; font-size: 24px;
    background: #2a2a3e; color: #fff; border-radius: 8px;
    flex-shrink: 0;
}
.stage-card {
    flex: 1; max-width: 500px; margin: 0 auto;
    background: #222; border-radius: 12px; padding: 24px; text-align: center;
    position: relative;
}
.stage-card h2 { color: #4a6cf7; margin-bottom: 16px; }
.stage-reward, .stage-cost { color: #aaa; margin-bottom: 8px; font-size: 14px; }
.stage-reward b { color: #ffd666; }
.stage-cost b { color: #8bc34a; }

.stage-team { margin: 20px 0; }
.team-title { font-size: 13px; color: #888; margin-bottom: 8px; }
.team-list { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.team-mini {
    background: #2a2a3e; border-radius: 6px; padding: 8px 12px;
    font-size: 12px; min-width: 100px; text-align: left;
}
.team-mini .star { color: #ffd666; }

.big-btn {
    width: 100%; padding: 14px; font-size: 16px;
    background: #4a6cf7; margin-top: 16px; border-radius: 8px;
}

/* ============ 底部导航 ============ */
.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: flex;
    background: #222;
    border-top: 1px solid #333;
    z-index: 50;
}
.nav-btn {
    flex: 1; padding: 16px 4px; border-radius: 0;
    background: transparent; font-size: 13px; color: #888;
}
.nav-btn.active { color: #4a6cf7; background: #2a2a3e; }

/* ============ 抽卡页 ============ */
#gachaPage { padding: 0; padding-bottom: 54px; }
#gachaPage .top-bar { justify-content: flex-start; }
.pool-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pool-card { background: #2a2a3e; border-radius: 8px; padding: 16px; }
.pool-card h3 { color: #4a6cf7; margin-bottom: 10px; }
.pool-btns { display: flex; gap: 8px; }
.pool-btns button { flex: 1; }
.shop-price { font-size: 13px; color: #aaa; margin-bottom: 10px; }
.shop-price b { color: #ffd666; }

.draw-result {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px;
    background: #1a1a2e; border-top: 1px solid #333; max-height: 200px; overflow: auto;
}
.draw-item {
    background: #2a2a3e; border-radius: 6px; padding: 6px 10px; font-size: 13px;
}
.draw-item.frag { color: #8bc34a; }
.draw-item.frag.limit { color: #ff9800; }

/* ============ 商店页 ============ */
#shopPage { padding: 0; padding-bottom: 54px; }

#shopPage #shopList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    padding: 16px;
}
#shopPage .shop-item {
    background: #2a2a3e;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}
#shopPage .shop-item:hover {
    background: #3a3a5e;
}
#shopPage .shop-item-name {
    font-size: 14px;
    color: #4a6cf7;
    font-weight: bold;
    margin-bottom: 6px;
}
#shopPage .shop-item-price {
    font-size: 12px;
    color: #aaa;
}
#shopPage .shop-item-price b { color: #ffd666; }

/* ============ 升级页（卡槽） ============ */
#slotPage {
    padding: 0;
    padding-bottom: 54px;
    overflow: hidden;
}

.slot-list {
    flex: 1;
    overflow: hidden;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.slot-card {
    flex: 1;
    background: #2a2a3e;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
    overflow: hidden;
}

.slot-card-inner {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}
.slot-role-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #1a1a2e;
}
.slot-card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.slot-card-title {
    font-size: 15px;
    color: #4a6cf7;
    margin-bottom: 4px;
    font-weight: bold;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.slot-role-power {
    color: #ff5252;
    font-size: 13px;
    font-weight: normal;
    margin-left: 12px;
}
.slot-role-attr {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 4px;
}
.slot-role-empty {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

.slot-card-level {
    font-size: 13px;
    color: #ccc;
    margin-bottom: 4px;
}
.slot-card-level b { color: #ffd666; font-size: 15px; }

.slot-card-need {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}
.slot-card-need b { color: #ccc; }

.slot-card-btns {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}
.slot-card-btns button {
    flex: 1;
    padding: 6px 8px;
    font-size: 13px;
    min-width: 0;
}
.slot-card-btns button.warn { background: #e6a23c; }
.slot-card-btns button.warn:hover { background: #d4942f; }

.slot-equip-btn {
    padding: 2px 10px;
    font-size: 12px;
    background: #4a6cf7;
    border-radius: 4px;
    flex-shrink: 0;
    margin: 0;
}

/* ============ 装备抽取页 ============ */
#equipGachaPage { padding: 0; padding-bottom: 54px; }

.equip-gacha-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.eq-draw-btns {
    display: flex;
    gap: 8px;
}
.eq-draw-btns button {
    flex: 1;
    margin-top: 0;
}

.rate-title {
    font-size: 14px;
    color: #4a6cf7;
    font-weight: bold;
    margin-top: 8px;
}
.rate-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rate-item {
    display: flex;
    justify-content: space-between;
    background: #2a2a3e;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

/* 品质颜色 */
.q1 { color: #aaa; }
.q2 { color: #4caf50; }
.q3 { color: #4a6cf7; }
.q4 { color: #ff9800; }
.q5 { color: #ff5252; }
.q6 { color: #ff69b4; }

/* ============ 竞技场 ============ */
.arena-entry-btn {
    position: fixed;
    left: 16px;
    bottom: 70px;
    z-index: 60;
    padding: 10px 16px;
    font-size: 14px;
    background: #e6a23c;
    border-radius: 8px;
}
.arena-entry-btn:hover { background: #d4942f; }

#arenaPage {
    height: calc(100vh - 54px);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.arena-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    padding: 12px 16px;
}

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

.arena-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2a2a3e;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
}
.arena-rank {
    width: 36px;
    text-align: center;
    font-weight: bold;
    color: #ffd666;
    flex-shrink: 0;
}
.arena-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.arena-power {
    color: #ff5252;
    font-size: 13px;
    flex-shrink: 0;
}
.arena-challenge-btn {
    padding: 4px 12px;
    font-size: 12px;
    background: #4a6cf7;
    flex-shrink: 0;
}
.arena-self {
    color: #888;
    font-size: 12px;
    flex-shrink: 0;
}
.arena-load-more {
    text-align: center;
    padding: 12px;
    color: #666;
    font-size: 13px;
}

/* ============ 邮箱 ============ */
.mail-dot {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff5252;
    color: #fff;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}

#mailModal { padding: 16px; }

.mail-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mail-item {
    background: #2a2a3e;
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.mail-item:hover { background: #3a3a5e; }
.mail-item.unread { border-left: 3px solid #ff5252; }
.mail-item-title {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mail-item.unread .mail-item-title { color: #ffd666; font-weight: bold; }
.mail-item-time {
    font-size: 11px;
    color: #888;
    flex-shrink: 0;
}

.mail-bottom {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    flex-shrink: 0;
}
.mail-bottom button { flex: 1; }
.mail-bottom button:last-child { background: #e6a23c; }
.mail-bottom button:last-child:hover { background: #d4942f; }

#mailDetailModal {
    justify-content: center;
    align-items: center;
}
.mail-detail-box {
    background: #222;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.mail-detail-title {
    font-size: 16px;
    color: #4a6cf7;
    font-weight: bold;
    margin-bottom: 6px;
}
.mail-detail-time {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
}
.mail-detail-content {
    font-size: 14px;
    color: #ddd;
    line-height: 1.6;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    margin-bottom: 16px;
    white-space: pre-wrap;
}

/* ============ 弹层 ============ */
.overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85); z-index: 100;
    display: flex; flex-direction: column; padding: 16px;
    overflow: auto;
}
.overlay-header {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 18px; margin-bottom: 12px; flex-shrink: 0;
}
.bag-toolbar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-bottom: 12px; font-size: 13px;
}
.bag-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.bag-item {
    background: #2a2a3e; border-radius: 6px; padding: 10px; font-size: 13px;
}
.bag-item b { color: #ffd666; }
.bag-item.selectable { cursor: pointer; }
.bag-item.selectable:hover { background: #3a3a5e; }
.bag-item.bag-selectable {
    position: relative;
    padding-left: 30px;
    cursor: pointer;
}
.bag-item.bag-worn {
    opacity: 0.6;
    cursor: default;
}
.bag-check {
    position: absolute;
    left: 8px;
    top: 10px;
}
.bag-check input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.bag-worn .bag-check input {
    cursor: not-allowed;
}
.bag-name {
    font-weight: bold;
}
.bag-attr {
    color: #aaa;
    font-size: 12px;
}
.danger-btn {
    background: #ff5252;
}
.danger-btn:hover {
    background: #e04141;
}
.empty { color: #666; padding: 20px; text-align: center; }

.bag-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-shrink: 0;
}
.bag-tab {
    flex: 1;
    padding: 8px;
    background: #2a2a3e;
    color: #888;
    border-radius: 6px;
}
.bag-tab.active {
    background: #4a6cf7;
    color: #fff;
}
.bag-tab-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ============ 布阵 ============ */
.team-tip { font-size: 13px; color: #888; margin-bottom: 12px; }
.team-slots { display: flex; gap: 10px; margin-bottom: 16px; }
.slot {
    flex: 1; background: #2a2a3e; border-radius: 8px;
    padding: 12px; text-align: center; cursor: pointer;
    border: 2px dashed #444;
}
.slot:hover { border-color: #4a6cf7; }
.slot span { font-size: 12px; color: #888; }
.slot-content { margin-top: 8px; font-size: 13px; }

.team-candidates { margin-top: 16px; }

/* ============ 战斗页 ============ */
#battlePage { padding: 0; background: #0f0f1a; }
.battle-top {
    text-align: center; padding: 12px; font-size: 15px;
    background: #1a1a2e; flex-shrink: 0;
}
.battle-top b { color: #ffd666; }
.battle-field {
    flex: 1; display: flex; align-items: center; justify-content: space-around;
    padding: 20px; gap: 20px;
}
.battle-side { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.battle-vs { font-size: 24px; color: #444; font-weight: bold; }

.unit {
    width: 100px;
    margin: 0 auto;
    background: #222;
    border-radius: 8px;
    padding: 6px;
    text-align: center;
    position: relative;
    transition: transform 0.4s;
    overflow: visible;
}
.unit-img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    margin: 0 auto 4px;
    background: #1a1a2e;
}
.unit-name {
    display: none;
}
.unit-hp-bar {
    height: 8px; background: #333; border-radius: 4px; overflow: hidden;
}
.unit-hp-fill {
    height: 100%; background: #4caf50; transition: width 0.3s;
}
.unit-hp-text { font-size: 11px; color: #888; margin-top: 3px; }

.unit.attacking { transform: scale(1.1); }
.unit.hit { animation: shake 0.5s; background: #5a2020; }
.unit.dead { opacity: 0.3; filter: grayscale(1); }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.damage-num {
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    color: #ff5252; font-weight: bold; font-size: 10px;
    animation: floatUp 1.5s forwards; pointer-events: none;
    white-space: nowrap;
}
.damage-num.crit { color: #ffd666; font-size: 11px; }

@keyframes floatUp {
    0% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -30px); }
}

.stun-label {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: #9c27b0;
    color: #fff;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    z-index: 10;
    white-space: nowrap;
}

.battle-bottom {
    padding: 16px; text-align: center; flex-shrink: 0;
}
.skip-btn {
    padding: 10px 30px; background: #555;
}

/* 倍速按钮 */
.speed-btn {
    position: fixed;
    right: 16px;
    bottom: 130px;
    z-index: 60;
    padding: 8px 14px;
    font-size: 13px;
    background: #4a6cf7;
    border-radius: 20px;
    color: #fff;
}
.speed-btn.fast {
    background: #ff9800;
}

/* ============ 结算弹层 ============ */
#battleResult {
    display: flex; justify-content: center; align-items: center;
}
.result-box {
    background: #222; border-radius: 12px; padding: 32px;
    text-align: center; width: 300px;
}
.result-box h2 { color: #4a6cf7; margin-bottom: 16px; }
.result-box p { margin-bottom: 20px; }

/* ============ 设置 / 兑换码弹窗 ============ */
.modal-box {
    background: #222;
    border-radius: 12px;
    padding: 24px;
    width: 360px;
    max-width: 90vw;
    text-align: center;
}
.modal-box.small { width: 300px; }
.modal-title {
    color: #4a6cf7;
    margin-bottom: 16px;
    font-size: 18px;
}
.modal-row {
    text-align: left;
    font-size: 14px;
    color: #ccc;
    margin-bottom: 10px;
}
.modal-row span { color: #ffd666; }
.modal-btns {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.modal-btns button { flex: 1; }
.modal-close {
    margin-top: 12px;
    background: #444;
    width: 100%;
}
#settingModal, #cdkModal, #changeNameModal, #changePassModal, #filterModal, #roleFilterModal {
    justify-content: center;
    align-items: center;
}

/* 筛选行 */
.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
}
.filter-row label {
    width: 60px;
    flex-shrink: 0;
    color: #aaa;
}
.filter-row select {
    flex: 1;
}

/* ============ 商店购买弹窗 ============ */
#buyModal {
    justify-content: center;
    align-items: center;
}
.buy-box {
    background: #222;
    border-radius: 12px;
    padding: 20px;
    width: 300px;
    max-width: 90vw;
    text-align: center;
}
.buy-item-name {
    font-size: 15px;
    color: #4a6cf7;
    font-weight: bold;
    margin-bottom: 4px;
}
.buy-price {
    font-size: 12px;
    color: #888;
    margin-bottom: 14px;
}
.buy-range {
    width: 100%;
    margin-bottom: 10px;
    accent-color: #4a6cf7;
}
.buy-input {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
}
.buy-total {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 14px;
}
.buy-total b { color: #ffd666; font-size: 15px; }

/* ============ 装备 ============ */
#equipModal {
    padding: 16px;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
}

#equipWornList {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0 70px 0;   /* ← 改这里：底部留 70px 给按钮 */
}
.equip-row {
    display: flex;
    gap: 6px;
}
.equip-row .equip-cell {
    flex: 1;
    min-width: 0;
}
.equip-cell {
    background: #2a2a3e;
    border-radius: 8px;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    font-size: 11px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    transition: background 0.15s;
}
.equip-cell:hover { background: #3a3a5e; }
.equip-cell-part {
    font-size: 11px;
    color: #888;
}
.equip-cell-name {
    font-weight: bold;
    font-size: 12px;
    word-break: break-all;
}
.equip-cell-attr {
    font-size: 11px;
    color: #aaa;
}
.equip-cell-attr b { color: #ffd666; }
.equip-cell-empty {
    color: #666;
    font-size: 12px;
}

.equip-item-name .q1, .bag-item .q1, .equip-cell-name .q1 { color: #aaa; }
.equip-item-name .q2, .bag-item .q2, .equip-cell-name .q2 { color: #4caf50; }
.equip-item-name .q3, .bag-item .q3, .equip-cell-name .q3 { color: #4a6cf7; }
.equip-item-name .q4, .bag-item .q4, .equip-cell-name .q4 { color: #ff9800; }
.equip-item-name .q5, .bag-item .q5, .equip-cell-name .q5 { color: #ff5252; }
.equip-item-name .q6, .bag-item .q6, .equip-cell-name .q6 { color: #ff69b4; }

/* 选装备弹窗（居中） */
#equipPickModal {
    z-index: 110;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.6);
}
.pick-box {
    background: #222;
    border-radius: 12px;
    padding: 16px;
    width: 90%;
    max-width: 360px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}
.pick-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 15px;
    flex-shrink: 0;
}
.pick-header button {
    padding: 4px 10px;
    font-size: 12px;
}
#pickList {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.equip-item {
    background: #2a2a3e;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
}
.equip-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.equip-item-name {
    font-weight: bold;
    font-size: 13px;
}
.equip-item-attr {
    color: #aaa;
    font-size: 12px;
}
.equip-item-attr b { color: #ffd666; }
.equip-item-btns {
    margin-top: 6px;
}
.equip-item-btns button {
    padding: 4px 10px;
    font-size: 12px;
}

/* 装备操作小菜单 */
#equipMenuModal {
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.6);
}
.equip-menu-box {
    background: #222;
    border-radius: 10px;
    padding: 16px;
    width: 200px;
    text-align: center;
}
.equip-menu-title {
    font-size: 14px;
    color: #4a6cf7;
    font-weight: bold;
    margin-bottom: 12px;
}
.equip-menu-box button {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    padding: 8px;
    font-size: 13px;
}

/* ============ 升级池子弹窗 ============ */
#poolUpModal {
    z-index: 200;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.85);
}
.pool-up-box {
    background: #222;
    border-radius: 12px;
    padding: 16px;
    width: 90%;
    max-width: 460px;
    max-height: 85vh;
    overflow-y: auto;
    text-align: center;
}
.pool-up-compare {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 12px;
}
.pool-up-col {
    flex: 1;
    min-width: 0;
}
.pool-up-title {
    font-size: 13px;
    color: #4a6cf7;
    font-weight: bold;
    margin-bottom: 6px;
}
.pool-up-arrow {
    display: flex;
    align-items: center;
    font-size: 20px;
    color: #888;
    flex-shrink: 0;
    padding-top: 24px;
}
.pool-up-rates {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pool-up-rates .rate-item {
    font-size: 11px;
    padding: 5px 8px;
}
.pool-up-cost {
    font-size: 13px;
    color: #ffd666;
    margin: 10px 0;
}

/* ============ 备案号 / 版本号 ============ */
.beian-bar {
    position: fixed;
    right: 8px;
    bottom: 56px;
    z-index: 40;
    font-size: 10px;
    color: #666;
    text-align: right;
    line-height: 1.4;
}
.beian-bar a {
    color: #666;
    text-decoration: none;
    display: block;
}
.beian-bar a:hover {
    color: #4a6cf7;
    text-decoration: underline;
}
.version-bar {
    position: fixed;
    left: 8px;
    bottom: 56px;
    z-index: 40;
    font-size: 10px;
    color: #666;
    line-height: 1.4;
}

/* 竞技场玩家详情 */
#arenaPlayerModal {
    padding: 16px;
}
.arena-player-slots {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.arena-slot-card {
    background: #2a2a3e;
    border-radius: 8px;
    padding: 10px 12px;
}
.arena-slot-card .slot-title {
    font-size: 13px;
    color: #4a6cf7;
    font-weight: bold;
    margin-bottom: 4px;
}
.arena-slot-card .slot-info {
    font-size: 12px;
    color: #ccc;
    margin-bottom: 6px;
}
.arena-slot-card .slot-info b { color: #ffd666; }
.arena-slot-card .slot-power { color: #ff5252; }
.arena-slot-empty {
    color: #666;
    font-size: 12px;
}

.slot-equip-title {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
}
.slot-equip-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.slot-equip-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    line-height: 1.5;
}
.slot-equip-line .eq-part {
    color: #4a6cf7;
    min-width: 28px;
    flex-shrink: 0;
}
.slot-equip-line .eq-lv {
    color: #888;
    flex-shrink: 0;
}
.slot-equip-line .eq-attr {
    color: #ffd666;
    flex-shrink: 0;
}
/* 竞技场装备 3 行格子 */
.arena-equip-row {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}
.arena-equip-cell {
    flex: 1;
    min-width: 0;
    background: #1a1a2e;
    border-radius: 4px;
    padding: 4px 2px;
    text-align: center;
    font-size: 10px;
    line-height: 1.4;
}
.aec-part {
    color: #888;
    font-size: 9px;
}
.aec-name {
    font-weight: bold;
    font-size: 10px;
    word-break: break-all;
}
.aec-lv {
    color: #888;
    font-size: 9px;
}
.aec-attr {
    color: #ffd666;
    font-size: 9px;
    word-break: break-all;
}
.aec-empty {
    color: #666;
    font-size: 10px;
}


/* 设置弹窗标题栏 + 关于按钮 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.about-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    padding: 0;
    font-size: 14px;
    font-weight: bold;
    background: #444;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
.about-icon-btn:hover {
    background: #4a6cf7;
    color: #fff;
}

/* ============ 一键穿戴按钮 ============ */
.auto-wear-btn {
    position: absolute;
    right: 20px;
    bottom: 20px;
    padding: 10px 20px;
    background: #e6a23c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 101;
    cursor: pointer;
}
.auto-wear-btn:hover { background: #d4942f; }
.auto-wear-btn:disabled { background: #666; cursor: not-allowed; }



/* 增益选择弹窗 */
#buffModal .pool-card {
    cursor: pointer;
    transition: transform 0.15s;
}
#buffModal .pool-card:hover {
    transform: scale(1.02);
}

/* 继续挑战弹窗 */
#resumeModal {
    justify-content: center;
    align-items: center;
}

/* ============ 增益选择弹窗 ============ */
#buffModal {
    justify-content: center;
    align-items: center;
}

#buffOptions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.buff-option {
    background: #2a2a3e;
    border: 2px solid #666;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}
.buff-option:hover {
    transform: scale(1.03);
    background: #3a3a5e;
}
.buff-name {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 6px;
}
.buff-value {
    font-size: 20px;
    font-weight: bold;
    color: #ffd666;
}

/* ============ 战斗页顶部战力 ============ */
.battle-power {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
}
.bp-my, .bp-enemy {
    font-size: 13px;
    color: #aaa;
}
.bp-my b {
    color: #4caf50;
    font-size: 15px;
}
.bp-enemy b {
    color: #ff5252;
    font-size: 15px;
}
.bp-round {
    color: #888;
    font-size: 13px;
}
.bp-round b {
    color: #ffd666;
}

/* ============ 自动按钮 ============ */
.auto-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    font-size: 12px;
    background: #444;
    color: #aaa;
    border-radius: 14px;
    border: 1px solid #555;
    cursor: pointer;
    z-index: 5;
}
.auto-toggle:hover {
    background: #555;
}
.auto-toggle.on {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
}


.rank-bar {
    display: flex;
    gap: 8px;
}

.rank-btn {
    padding: 4px 12px;
    font-size: 13px;
    background: #e6a23c;
    border-radius: 6px;
    color: #fff;
    border: none;
    cursor: pointer;
}
.rank-btn:hover { background: #d4942f; }

/* 排行榜 + 快捷栏 同一行 */
.stage-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 16px 0;
    flex-shrink: 0;
}

/* ============ 排行榜页 ============ */
#rankPage {
    height: calc(100vh - 54px);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rank-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    padding: 12px 16px;
}

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

.rank-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2a2a3e;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
}
.rank-row.is-self {
    background: #3a3a5e;
    border: 1px solid #4a6cf7;
}
.rank-row .rank-num {
    width: 36px;
    text-align: center;
    font-weight: bold;
    color: #ffd666;
    flex-shrink: 0;
}
.rank-row .rank-num.top1 { color: #ff5252; font-size: 16px; }
.rank-row .rank-num.top2 { color: #ff9800; font-size: 15px; }
.rank-row .rank-num.top3 { color: #ffd666; font-size: 15px; }

.rank-row .rank-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rank-row .rank-value {
    color: #ff5252;
    font-size: 13px;
    flex-shrink: 0;
}
.rank-row .rank-stage {
    color: #4a6cf7;
    font-size: 12px;
    flex-shrink: 0;
}

.rank-tabs {
    display: flex;
    border-top: 1px solid #333;
    background: #222;
    flex-shrink: 0;
}
.rank-tab {
    flex: 1;
    padding: 14px;
    background: transparent;
    color: #888;
    border-radius: 0;
    font-size: 14px;
}
.rank-tab.active {
    color: #4a6cf7;
    background: #2a2a3e;
}

.rank-mine {
    position: sticky;
    bottom: 0;
    background: #222;
    border-top: 1px solid #4a6cf7;
    padding: 10px 16px;
    margin-top: 8px;
    font-size: 13px;
}

/* ===== 抽取页 / 我的页入口 ===== */
.draw-entry-body {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.draw-entry-btn {
    background: #222;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
    text-align: left;
    color: #eee;
    cursor: pointer;
}
.draw-entry-btn:active { background: #2a2a2a; }
.draw-entry-btn .de-title {
    font-size: 20px;
    font-weight: bold;
    color: #ffd666;
    margin-bottom: 6px;
}
.draw-entry-btn .de-sub {
    font-size: 13px;
    color: #888;
}

/* ===== 藏品页 ===== */
.col-tabs {
    display: flex;
    overflow-x: auto;
    background: #1e1e2e;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}
.col-tab {
    flex: 0 0 auto;
    padding: 10px 14px;
    font-size: 13px;
    color: #aaa;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}
.col-tab.active {
    color: #ffd666;
    border-bottom-color: #ffd666;
}
.col-body {
    flex: 1;
    min-height: 0;               /* ← 新增，防止撑爆 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 10px;
}
.col-line-bonus {
    text-align: center;
    font-size: 12px;
    color: #4a6cf7;
    margin-bottom: 6px;
}
.col-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);   /* 3列 → 5列 */
    gap: 4px;
}
.col-item {
    background: #222;
    border: 1px solid #333;
    border-radius: 5px;
    padding: 4px 2px;
    text-align: center;
    cursor: pointer;
    position: relative;
}
.col-item.owned { border-color: #4a6cf7; }
.col-item .ci-name {
    font-size: 10px;              /* 12 → 10 */
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.col-item .ci-star {
    font-size: 9px;               /* 11 → 9 */
    color: #ffd666;
}
.col-item .ci-frag {
    font-size: 9px;               /* 10 → 9 */
    color: #888;
}
.col-item .ci-lock {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 9px;
    color: #666;
}

.col-item-info {
    text-align: left;
    font-size: 13px;
    color: #ccc;
    margin-bottom: 12px;
    line-height: 1.8;
}
.col-item-info b { color: #ffd666; }

/* ===== 藏品抽取底部按钮栏 ===== */
.col-draw-bar {
    flex-shrink: 0;
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    background: #1e1e2e;
    border-top: 1px solid #333;
}
.col-draw-bar .big-btn {
    flex: 1;
    width: auto;
    padding: 8px 0;
    font-size: 13px;
    border-radius: 6px;
}

/* ===== 藏品抽取结果：居中 + 5列网格 + 可滑动 + 点任意处关闭 ===== */
.col-draw-center {
    width: 86%;
    max-width: 460px;
    max-height: 55vh;
    background: #222;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.col-draw-scroll {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px 4px;
    text-align: center;
}
.col-draw-scroll .draw-item {
    font-size: 11px;
    line-height: 1.3;
    padding: 2px 0;
    border: none;
    word-break: break-all;
}

/* ===== 藏品 7 条线加成总览 ===== */
.col-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 8px;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: #1e1e2e;
    border-radius: 6px;
    font-size: 11px;
    color: #aaa;
}
.col-sum-item b {
    color: #ffd666;
    font-weight: normal;
}

/* ===== 战力变更飘字 ===== */
.power-float {
    position: absolute;
    left: 100%;
    top: 50%;
    margin-left: 6px;
    transform: translateY(-50%);
    white-space: nowrap;
    font-size: 13px;
    font-weight: bold;
    pointer-events: none;
    z-index: 9999;
    opacity: 1;
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}
.power-float.up {
    color: #4caf50;
}
.power-float.down {
    color: #ff5252;
}
.power-float .pf-old {
    color: #ffa726;
    margin-right: 4px;
}
/* 往上飘 */
.power-float.up.fly {
    transform: translateY(-30px);
    opacity: 0;
}
/* 往下飘 */
.power-float.down.fly {
    transform: translateY(30px);
    opacity: 0;
}
/* 锚点：装了飘字的父元素需 relative */
.power-anchor {
    position: relative;
    display: inline-block;
}

/* ===== 全局战力变更飘字层 ===== */
#powerFloatLayer {
    position: fixed;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    pointer-events: none;
}

.power-float-tip {
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    position: relative;
    display: inline-block;
}
.power-float-tip .pf-old {
    color: #ffa726;
    margin-right: 6px;
}
.power-float-tip .pf-diff {
    display: inline-block;
    opacity: 1;
    transition: opacity 1s ease-out, transform 1s ease-out;
}
.power-float-tip.up .pf-diff {
    color: #4caf50;
}
.power-float-tip.down .pf-diff {
    color: #ff5252;
}
/* 上升：变化量往上飘 */
.power-float-tip.up .pf-diff.fly {
    transform: translateY(-30px);
    opacity: 0;
}
/* 下降：变化量往下飘 */
.power-float-tip.down .pf-diff.fly {
    transform: translateY(30px);
    opacity: 0;
}

/* ===== 坐骑页 ===== */
.mount-quality-title {
    font-size: 13px;
    color: #888;
    margin: 12px 0 6px;
    text-align: center;
}
.mount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}
.mount-item {
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    position: relative;
}
.mount-item.owned { border-color: #4a6cf7; }
.mount-item.active { border-color: #4caf50; background: #223322; }
.mount-item .mi-name {
    font-size: 12px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mount-item .mi-lv {
    font-size: 11px;
    color: #ffd666;
}
.mount-item .mi-tag {
    font-size: 10px;
    color: #888;
}
.mount-item .mi-active {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    color: #4caf50;
}
.mount-item .mi-lock {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    color: #666;
}
.mount-btns {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.mount-btns .big-btn {
    flex: 1;
    margin-top: 0;
    padding: 10px 0;
    font-size: 13px;
}

/* ===== 头衔页 ===== */
.title-group-title {
    font-size: 13px;
    color: #4a6cf7;
    font-weight: bold;
    margin: 12px 0 6px;
}
.title-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}
.title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    cursor: pointer;
}
.title-row.unlocked { border-color: #4a6cf7; }
.title-row.worn { border-color: #4caf50; background: #223322; }
.title-row.locked { opacity: 0.5; }
.title-row .tr-name {
    flex: 1;
    min-width: 0;
    color: #eee;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.title-row.unlocked .tr-name { color: #ffd666; }
.title-row .tr-bonus {
    color: #4caf50;
    flex-shrink: 0;
}
.title-row .tr-tag {
    font-size: 11px;
    color: #888;
    flex-shrink: 0;
}
.title-row.worn .tr-tag {
    color: #4caf50;
}

/* ===== 头衔页固定高度，让列表内部滚动 ===== */
#titlePage {
    height: calc(100vh - 54px);   /* 减去底部导航 54px */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}
#titlePage .col-body {
    flex: 1;
    min-height: 0;          /* ← 关键：flex 子项要能收缩 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== 玩家详情卡片 ===== */
#arenaPlayerModal {
    justify-content: center;
    align-items: center;
}
.player-card {
    background: #222;
    border-radius: 12px;
    padding: 16px;
    width: 92%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pc-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.pc-name {
    font-size: 16px;
    font-weight: bold;
    color: #4a6cf7;
    line-height: 1.2;
}
.pc-power {
    font-size: 13px;
    color: #ffd666;
    line-height: 1.5;
    padding-top: 2px;
}
.pc-roles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pc-role-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #2a2a3e;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
}
.pc-role-row:hover { background: #3a3a5e; }
.pc-role-row .pr-name {
    flex: 1;
    color: #eee;
    font-weight: bold;
}
.pc-role-row .pr-lv {
    color: #888;
    font-size: 12px;
}
.pc-role-row .pr-power {
    color: #ff5252;
    font-size: 12px;
}
.pc-role-row.empty {
    color: #666;
    cursor: default;
}
.pc-mid {
    display: flex;
    gap: 8px;
}
.pc-mid-btn {
    flex: 1;
    padding: 12px;
    background: #2a2a3e;
    color: #eee;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}
.pc-mid-btn:hover { background: #3a3a5e; }
.pc-titles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.pc-title-cell {
    background: #2a2a3e;
    border-radius: 6px;
    padding: 8px 4px;
    text-align: center;
    font-size: 11px;
    color: #aaa;
}
.pc-title-cell.has {
    color: #ffd666;
}
.pc-title-cell .pt-cat {
    display: block;
    font-size: 10px;
    color: #666;
    margin-bottom: 2px;
}

/* ===== 角色装备弹窗 ===== */
#pcEquipModal {
    padding: 12px;
    justify-content: flex-start;
    align-items: stretch;
}
.pc-equip-wrap {
    background: #222;
    border-radius: 12px;
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.pc-equip-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.pc-equip-header span:first-child {
    font-size: 15px;
    font-weight: bold;
    color: #4a6cf7;
}
.pc-equip-header span:last-child {
    font-size: 13px;
    color: #ff5252;
}
.pc-equip-body {
    flex: 1;
    min-height: 0;
}

/* ===== 藏品弹窗 ===== */
#pcColModal {
    padding: 12px;
    justify-content: flex-start;
    align-items: stretch;
}
.pc-col-wrap {
    background: #222;
    border-radius: 12px;
    padding: 12px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.pc-col-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
    font-size: 13px;
}
.pc-col-header #pcColCount {
    color: #ffd666;
    font-weight: bold;
}
.pc-col-bonus {
    font-size: 11px;
    color: #aaa;
    line-height: 1.5;
}
.pc-col-bonus b { color: #ffd666; }

/* ============ 抽卡蓄力动画（新版） ============ */
.gacha-charge-layer {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: radial-gradient(circle at center, #1a1a2e 0%, #05050a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* === 中心光球 === */
.gacha-orb {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.gacha-orb-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle,
        #ffffff 0%,
        #ffe58a 20%,
        #ffb84d 45%,
        #4a6cf7 75%,
        rgba(74,108,247,0) 100%);
    box-shadow:
        0 0 40px #ffd666,
        0 0 80px rgba(74,108,247,0.7),
        0 0 140px rgba(74,108,247,0.4);
    animation: orbPulse 0.9s ease-in-out infinite;
}
.gacha-orb-flash {
    position: absolute;
    inset: -60%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, transparent 60%);
    opacity: 0;
    animation: orbFlash 0.9s ease-out infinite;
}
@keyframes orbPulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.18); filter: brightness(1.4); }
}
@keyframes orbFlash {
    0% { opacity: 0; transform: scale(0.6); }
    40% { opacity: 0.9; }
    100% { opacity: 0; transform: scale(1.6); }
}

/* === 汇聚光线（从四周射向中心） === */
.gacha-ray {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 120px;
    background: linear-gradient(to bottom,
        rgba(255,214,102,0) 0%,
        rgba(255,214,102,0.9) 50%,
        rgba(255,214,102,0) 100%);
    transform-origin: center top;
    pointer-events: none;
    opacity: 0;
    animation: rayGather 0.9s ease-in infinite;
}
/* 8 条光线，从不同角度射入 */
.gacha-ray.r1 { transform: translate(-50%, -50%) rotate(0deg) translateY(-220px); animation-delay: 0s; }
.gacha-ray.r2 { transform: translate(-50%, -50%) rotate(45deg) translateY(-220px); animation-delay: 0.05s; }
.gacha-ray.r3 { transform: translate(-50%, -50%) rotate(90deg) translateY(-220px); animation-delay: 0.1s; }
.gacha-ray.r4 { transform: translate(-50%, -50%) rotate(135deg) translateY(-220px); animation-delay: 0.15s; }
.gacha-ray.r5 { transform: translate(-50%, -50%) rotate(180deg) translateY(-220px); animation-delay: 0.2s; }
.gacha-ray.r6 { transform: translate(-50%, -50%) rotate(225deg) translateY(-220px); animation-delay: 0.25s; }
.gacha-ray.r7 { transform: translate(-50%, -50%) rotate(270deg) translateY(-220px); animation-delay: 0.3s; }
.gacha-ray.r8 { transform: translate(-50%, -50%) rotate(315deg) translateY(-220px); animation-delay: 0.35s; }

@keyframes rayGather {
    0%   { opacity: 0; height: 200px; filter: blur(2px); }
    40%  { opacity: 1; }
    100% { opacity: 0; height: 20px; filter: blur(0); }
}

/* === 背景星点 === */
.gacha-star {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ffd666;
    box-shadow: 0 0 8px #ffd666, 0 0 16px rgba(255,214,102,0.6);
    opacity: 0;
    animation: starTwinkle 1.5s ease-in-out infinite;
}
.gacha-star.s1 { top: 20%; left: 25%; animation-delay: 0s; }
.gacha-star.s2 { top: 30%; left: 70%; animation-delay: 0.3s; }
.gacha-star.s3 { top: 65%; left: 20%; animation-delay: 0.6s; }
.gacha-star.s4 { top: 75%; left: 75%; animation-delay: 0.15s; }
.gacha-star.s5 { top: 40%; left: 50%; animation-delay: 0.45s; }
.gacha-star.s6 { top: 15%; left: 55%; animation-delay: 0.75s; }

@keyframes starTwinkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1.4); }
}

/* === 底部提示文字 === */
.gacha-charge-text {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    letter-spacing: 4px;
    color: #ffd666;
    text-shadow: 0 0 12px rgba(255,214,102,0.8);
    animation: textBreath 1.2s ease-in-out infinite;
    white-space: nowrap;
}
@keyframes textBreath {
    0%, 100% { opacity: 0.5; letter-spacing: 4px; }
    50% { opacity: 1; letter-spacing: 6px; }
}

/* ============ 抽卡结果全屏弹层 ============ */
.gacha-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: #0a0a14;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gacha-result-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    width: 85%;
    max-width: 640px;
    max-height: 82vh;
    overflow-y: auto;
    padding: 4px;
    -webkit-overflow-scrolling: touch;
    justify-items: center;
    scroll-behavior: smooth;
}

.gacha-skip-tip {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: #888;
    animation: tipBlink 1.4s ease-in-out infinite;
    white-space: nowrap;
}
@keyframes tipBlink {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ============ 单张卡牌 ============ */
.gacha-card {
    position: relative;
    width: 100%;
    height: clamp(80px, 13vh, 150px);
    border-radius: 8px;
    background: #222;
    border: 2px solid #444;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.3) rotateY(90deg);
    transition: opacity 0.3s ease-out, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
    text-align: center;
    box-sizing: border-box;
}
.gacha-card.show {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
}

.gacha-card .gc-img {
    width: 100%;
    height: 72%;
    object-fit: cover;
    background: #1a1a2e;
    flex-shrink: 0;
}
.gacha-card .gc-name {
    font-size: 10px;
    font-weight: bold;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    flex-shrink: 0;
}
.gacha-card .gc-sub {
    font-size: 9px;
    color: #888;
    margin-top: 1px;
    flex-shrink: 0;
}

/* 品质边框 + 光效 */
.gacha-card.q1 { border-color: #666; }
.gacha-card.q2 { border-color: #4caf50; box-shadow: 0 0 8px rgba(76,175,80,0.5); }
.gacha-card.q3 { border-color: #4a6cf7; box-shadow: 0 0 12px rgba(74,108,247,0.6); }
.gacha-card.q4 { border-color: #ff9800; box-shadow: 0 0 16px rgba(255,152,0,0.7); }
.gacha-card.q5 { border-color: #ff5252; box-shadow: 0 0 20px rgba(255,82,82,0.8); }
.gacha-card.q6 { border-color: #ff69b4; box-shadow: 0 0 24px rgba(255,105,180,0.9); }

/* 稀有度光晕（史诗以上） */
.gacha-card.q3::after,
.gacha-card.q4::after,
.gacha-card.q5::after,
.gacha-card.q6::after {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle, currentColor 0%, transparent 60%);
    opacity: 0;
    animation: cardGlow 1.8s ease-out infinite;
    pointer-events: none;
}
.gacha-card.q3::after { color: rgba(74,108,247,0.35); }
.gacha-card.q4::after { color: rgba(255,152,0,0.4); }
.gacha-card.q5::after { color: rgba(255,82,82,0.45); }
.gacha-card.q6::after { color: rgba(255,105,180,0.5); }

@keyframes cardGlow {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.2); }
}

/* 神话/幻境：卡片震动 */
.gacha-card.q5.show,
.gacha-card.q6.show {
    animation: cardShake 0.4s ease-out;
}
@keyframes cardShake {
    0%, 100% { transform: scale(1) rotateY(0deg) translateX(0); }
    25% { transform: scale(1.05) rotateY(0deg) translateX(-3px); }
    75% { transform: scale(1.05) rotateY(0deg) translateX(3px); }
}

/* 碎片类 */
.gacha-card.frag {
    border-color: #4caf50;
    justify-content: center;
}
.gacha-card.frag .gc-name { font-size: 11px; color: #4caf50; }
.gacha-card.frag.limit { border-color: #ff9800; }
.gacha-card.frag.limit .gc-name { color: #ff9800; }

/* 幻境券 */
.gacha-card.ticket {
    border-color: #ffd666;
    box-shadow: 0 0 16px rgba(255,214,102,0.6);
}
.gacha-card.ticket .gc-name { color: #ffd666; font-size: 12px; }

/* 手机端：也保持 5 列，缩小间距和字号 */
@media (max-width: 520px) {
    .gacha-result-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        width: 92%;
    }
    .gacha-card {
        height: clamp(70px, 11vh, 120px);
        border-width: 1.5px;
    }
    .gacha-card .gc-img { height: 70%; }
    .gacha-card .gc-name { font-size: 9px; margin-top: 1px; }
    .gacha-card .gc-sub { font-size: 8px; margin-top: 0; }
}

/* ============ 抽卡蓄力动画 ============ */
.gacha-charge-layer {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: radial-gradient(circle at center, #1a1a2e 0%, #0a0a14 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.gacha-charge-core {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #ffd666 40%, #4a6cf7 70%, transparent 100%);
    box-shadow: 0 0 60px #ffd666, 0 0 120px #4a6cf7;
    animation: chargePulse 0.8s ease-in-out infinite;
    position: relative;
    z-index: 3;
}
.gacha-charge-ring {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 2px solid rgba(74, 108, 247, 0.6);
    animation: chargeRing 1.2s ease-out infinite;
}
.gacha-charge-ring.ring2 {
    border-color: rgba(255, 214, 102, 0.5);
    animation-delay: 0.4s;
}
.gacha-charge-ring.ring3 {
    border-color: rgba(255, 105, 180, 0.4);
    animation-delay: 0.8s;
}
@keyframes chargePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.25); }
}
@keyframes chargeRing {
    0% { transform: scale(0.5); opacity: 0.9; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* ============ 抽卡结果全屏弹层 ============ */
.gacha-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: #0a0a14;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gacha-result-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    width: 85%;
    max-width: 640px;
    max-height: 82vh;
    overflow-y: auto;
    padding: 4px;
    -webkit-overflow-scrolling: touch;
    justify-items: center;
}

.gacha-skip-tip {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: #888;
    animation: tipBlink 1.4s ease-in-out infinite;
    white-space: nowrap;
}
@keyframes tipBlink {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ============ 单张卡牌 ============ */
.gacha-card {
    position: relative;
    width: 100%;
    height: clamp(80px, 13vh, 150px);
    border-radius: 8px;
    background: #222;
    border: 2px solid #444;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.3) rotateY(90deg);
    transition: opacity 0.3s ease-out, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
    text-align: center;
    box-sizing: border-box;
}
.gacha-card.show {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
}

.gacha-card .gc-img {
    width: 100%;
    height: 72%;
    object-fit: cover;
    background: #1a1a2e;
    flex-shrink: 0;
}
.gacha-card .gc-name {
    font-size: 10px;
    font-weight: bold;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    flex-shrink: 0;
}
.gacha-card .gc-sub {
    font-size: 9px;
    color: #888;
    margin-top: 1px;
    flex-shrink: 0;
}

/* 品质边框 + 光效 */
.gacha-card.q1 { border-color: #666; }
.gacha-card.q2 { border-color: #4caf50; box-shadow: 0 0 8px rgba(76,175,80,0.5); }
.gacha-card.q3 { border-color: #4a6cf7; box-shadow: 0 0 12px rgba(74,108,247,0.6); }
.gacha-card.q4 { border-color: #ff9800; box-shadow: 0 0 16px rgba(255,152,0,0.7); }
.gacha-card.q5 { border-color: #ff5252; box-shadow: 0 0 20px rgba(255,82,82,0.8); }
.gacha-card.q6 { border-color: #ff69b4; box-shadow: 0 0 24px rgba(255,105,180,0.9); }

/* 稀有度光晕（史诗以上） */
.gacha-card.q3::after,
.gacha-card.q4::after,
.gacha-card.q5::after,
.gacha-card.q6::after {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle, currentColor 0%, transparent 60%);
    opacity: 0;
    animation: cardGlow 1.8s ease-out infinite;
    pointer-events: none;
}
.gacha-card.q3::after { color: rgba(74,108,247,0.35); }
.gacha-card.q4::after { color: rgba(255,152,0,0.4); }
.gacha-card.q5::after { color: rgba(255,82,82,0.45); }
.gacha-card.q6::after { color: rgba(255,105,180,0.5); }

@keyframes cardGlow {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.2); }
}

/* 神话/幻境：卡片震动 */
.gacha-card.q5.show,
.gacha-card.q6.show {
    animation: cardShake 0.4s ease-out;
}
@keyframes cardShake {
    0%, 100% { transform: scale(1) rotateY(0deg) translateX(0); }
    25% { transform: scale(1.05) rotateY(0deg) translateX(-3px); }
    75% { transform: scale(1.05) rotateY(0deg) translateX(3px); }
}

/* 碎片类 */
.gacha-card.frag {
    border-color: #4caf50;
    justify-content: center;
}
.gacha-card.frag .gc-name { font-size: 11px; color: #4caf50; }
.gacha-card.frag.limit { border-color: #ff9800; }
.gacha-card.frag.limit .gc-name { color: #ff9800; }

/* 幻境券 */
.gacha-card.ticket {
    border-color: #ffd666;
    box-shadow: 0 0 16px rgba(255,214,102,0.6);
}
.gacha-card.ticket .gc-name { color: #ffd666; font-size: 12px; }

/* 手机端：也保持 5 列，缩小间距和字号 */
@media (max-width: 520px) {
    .gacha-result-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        width: 92%;
    }
    .gacha-card {
        height: clamp(70px, 11vh, 120px);
        border-width: 1.5px;
    }
    .gacha-card .gc-img { height: 70%; }
    .gacha-card .gc-name { font-size: 9px; margin-top: 1px; }
    .gacha-card .gc-sub { font-size: 8px; margin-top: 0; }
}

/* ============ 跳过动画按钮 ============ */
.skip-anim-btn {
    padding: 6px 12px;
    font-size: 13px;
    background: #444;
    color: #aaa;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.skip-anim-btn:hover { background: #555; }
.skip-anim-btn.on {
    background: #4caf50;
    color: #fff;
}
.skip-anim-btn.small {
    padding: 4px 10px;
    font-size: 12px;
}

/* ============ 天赋树页 ============ */
#talentPage {
    height: calc(100vh - 54px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.talent-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
}

/* 画布：相对定位容器 */
.talent-lines {
    display: flex;
    justify-content: center;
    min-width: max-content;
}

.talent-canvas {
    position: relative;
    flex-shrink: 0;
}

/* SVG 连线层 */
.talent-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.talent-link {
    stroke: #444;
    stroke-width: 2;
}

.talent-link.active {
    stroke: #4caf50;
    stroke-width: 2.5;
}

/* 节点：绝对定位 */
.talent-node {
    position: absolute;
    width: 88px;
    background: #222;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 6px 4px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.talent-node:hover { transform: scale(1.06); }

.talent-node .tn-name {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.talent-node .tn-lv {
    font-size: 10px;
    color: #ffd666;
}
.talent-node .tn-attr {
    font-size: 9px;
    color: #aaa;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 状态色 */
.talent-node.max {
    border-color: #ffd666;
    box-shadow: 0 0 10px rgba(255,214,102,0.6);
}
.talent-node.active {
    border-color: #4caf50;
    box-shadow: 0 0 6px rgba(76,175,80,0.4);
}
.talent-node.locked {
    opacity: 0.35;
    cursor: not-allowed;
}
.talent-node.locked:hover { transform: none; }

/* 按线配色（节点名颜色） */
.talent-node[data-line="1"] .tn-name { color: #ff5252; }
.talent-node[data-line="2"] .tn-name { color: #4caf50; }
.talent-node[data-line="3"] .tn-name { color: #4a6cf7; }

/* 底部提示 */
.talent-tip {
    flex-shrink: 0;
    text-align: center;
    font-size: 11px;
    color: #666;
    padding: 8px;
    border-top: 1px solid #333;
    background: #1e1e2e;
}

#talentItemModal {
    justify-content: center;
    align-items: center;
}
/* 节点操作弹窗 */
#talentItemModal {
    justify-content: center;
    align-items: center;
}

/* ===== 天赋树查看弹窗 ===== */
#pcTalentModal {
    padding: 12px;
    justify-content: flex-start;
    align-items: stretch;
}
#pcTalentModal .pc-col-wrap {
    background: #222;
    border-radius: 12px;
    padding: 12px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#pcTalentModal .talent-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 8px;
}

.quick-btn {
    padding: 4px 10px;
    font-size: 12px;
    background: #4a6cf7;
    border-radius: 4px;
}

.mine-grid {
    flex: 1;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-content: start;
}
.mine-grid-btn {
    background: #222;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px 12px;
    text-align: left;
    color: #eee;
    cursor: pointer;
}
.mine-grid-btn .mg-title {
    font-size: 18px;
    font-weight: bold;
    color: #ffd666;
    margin-bottom: 6px;
}
.mine-grid-btn .mg-sub {
    font-size: 12px;
    color: #888;
}

/* ===== 关卡快捷按钮 ===== */
.stage-quick-bar {
    display: flex;
    flex-direction: column;    /* 竖排 */
    align-items: flex-end;     /* 靠右 */
    gap: 6px;
    flex-shrink: 0;
}
.quick-btn {
    padding: 4px 10px;
    font-size: 12px;
    background: #4a6cf7;
    border-radius: 4px;
    color: #fff;
    border: none;
    cursor: pointer;
}
.quick-btn:hover { background: #3a5ce5; }

/* ===== 我的页 2×2 网格 ===== */
.mine-grid {
    flex: 1;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-content: start;
}
.mine-grid-btn {
    background: #222;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px 12px;
    text-align: left;
    color: #eee;
    cursor: pointer;
}
.mine-grid-btn:active { background: #2a2a2a; }
.mine-grid-btn .mg-title {
    font-size: 18px;
    font-weight: bold;
    color: #ffd666;
    margin-bottom: 6px;
}
.mine-grid-btn .mg-sub {
    font-size: 12px;
    color: #888;
}

/* ===== 好友页 ===== */
#friendPage {
    height: calc(100vh - 54px);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.friend-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.friend-row {
    background: #2a2a3e;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.friend-row .fr-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #eee;
    font-weight: bold;
}
.friend-row .fr-power {
    color: #ff5252;
    font-size: 12px;
}
.friend-row .fr-online {
    font-size: 11px;
    color: #888;
}
.friend-row .fr-online.online { color: #4caf50; }
.friend-row .fr-btn {
    padding: 4px 10px;
    font-size: 12px;
    background: #4a6cf7;
    border-radius: 4px;
    color: #fff;
    border: none;
    cursor: pointer;
}
.friend-row .fr-btn.danger { background: #ff5252; }
.friend-row .fr-btn:disabled { background: #444; color: #888; }

.friend-row .fr-btn.gift {
    background: #4caf50;
}

/* ===== 私信对话 ===== */
.msg-chat-box {
    background: #222;
    border-radius: 12px;
    padding: 12px;
    width: 90%;
    max-width: 480px;
    height: 70vh;
    display: flex;
    flex-direction: column;
    margin: auto;
}
.msg-chat-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 15px;
    color: #4a6cf7;
    font-weight: bold;
    flex-shrink: 0;
}
.msg-chat-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
    background: #1a1a2e;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.msg-bubble {
    max-width: 75%;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    word-break: break-word;
    white-space: pre-wrap;
}
.msg-bubble.me {
    background: #4a6cf7;
    color: #fff;
    align-self: flex-end;
}
.msg-bubble.other {
    background: #2a2a3e;
    color: #eee;
    align-self: flex-start;
}
.msg-chat-input {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-shrink: 0;
}
.msg-chat-input input {
    flex: 1;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #1a1a2e;
    color: #eee;
    font-size: 13px;
}
.msg-chat-input button {
    padding: 8px 16px;
    font-size: 13px;
}

/* 好友搜索结果行 */
.fs-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #2a2a3e;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
}
.fs-row .fs-name { flex: 1; font-weight: bold; }
.fs-row .fs-online { font-size: 11px; color: #888; }
.fs-row .fs-online.online { color: #4caf50; }

/* 申请行 */
.req-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #2a2a3e;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}
.req-row .rr-info { flex: 1; min-width: 0; }
.req-row .rr-name { font-weight: bold; color: #eee; }
.req-row .rr-time { font-size: 11px; color: #888; }
.req-row .rr-btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}
.req-row .rr-btn.ok { background: #4caf50; color: #fff; }
.req-row .rr-btn.no { background: #666; color: #fff; }

/* 好友行私信按钮的红点，贴紧按钮 */
.friend-row .fr-btn .mail-dot {
    top: -5px;
    right: -5px;
    font-size: 9px;
    min-width: 15px;
    height: 15px;
    line-height: 15px;
    padding: 0 3px;
}

/* ============ 副本入口页 ============ */
#dungeonPage {
    height: calc(100vh - 54px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}
.dungeon-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
}
.dungeon-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dungeon-card {
    background: #222;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.dungeon-card .dc-title {
    font-size: 18px;
    font-weight: bold;
    color: #ffd666;
    margin-bottom: 6px;
}
.dungeon-card .dc-sub {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}
.dungeon-card .dc-info {
    font-size: 12px;
    color: #4a6cf7;
    margin-bottom: 12px;
}
.dungeon-card .big-btn {
    margin-top: 0;
}

/* ============ 副本游戏页 ============ */
#roguePage {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #0a0a14;
    display: flex;
    flex-direction: column;
}
.rogue-hud {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #16162a;
    border-bottom: 1px solid #333;
    font-size: 13px;
    flex-shrink: 0;
    z-index: 5;
}
.rogue-hud b { color: #ffd666; }

.rogue-canvas-wrap {
    flex: 1;
    position: relative;
    min-height: 0;
    overflow: hidden;
}
#rogueCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #0a0a14;
    touch-action: none;   /* 防止触屏滚动 */
}

/* 左下虚拟摇杆 */
.rogue-joystick {
    position: absolute;
    left: 24px;
    bottom: 24px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(74,108,247,0.15);
    border: 2px solid rgba(74,108,247,0.5);
    z-index: 10;
    touch-action: none;
}
.rogue-joystick .rj-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 50px;
    height: 50px;
    margin-left: -25px;
    margin-top: -25px;
    border-radius: 50%;
    background: rgba(74,108,247,0.8);
    box-shadow: 0 0 12px rgba(74,108,247,0.8);
    transition: transform 0.05s linear;
    pointer-events: none;
}

/* 右下攻击按钮 */
.rogue-attack-btn {
    position: absolute;
    right: 24px;
    bottom: 24px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(255,152,0,0.85);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    border: 3px solid rgba(255,214,102,0.7);
    box-shadow: 0 0 20px rgba(255,152,0,0.6);
    z-index: 10;
    touch-action: none;
    padding: 0;
}
.rogue-attack-btn:active {
    background: rgba(255,152,0,1);
    transform: scale(0.94);
}

/* 前往下一房提示 */
.rogue-next-tip {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(0,0,0,0.65);
    z-index: 20;
}
.rogue-next-tip .rnt-text {
    font-size: 20px;
    color: #4caf50;
    font-weight: bold;
    letter-spacing: 2px;
}

/* 结算弹窗 */
#rogueResultModal {
    z-index: 300;
    justify-content: center;
    align-items: center;
}

/* 电脑端：非触屏时隐藏摇杆（仍可键盘 WASD 移动） */
@media (hover: hover) and (pointer: fine) {
    .rogue-joystick {
        opacity: 0.35;
    }
}

/* ===== 副本经验条 ===== */
.rogue-exp-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #16162a;
    border-bottom: 1px solid #333;
    font-size: 12px;
    flex-shrink: 0;
    z-index: 5;
}
.reb-lv {
    color: #ffd666;
    font-weight: bold;
    min-width: 40px;
}
.reb-track {
    flex: 1;
    height: 8px;
    background: #222;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #333;
}
.reb-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4a6cf7, #8bc34a);
    transition: width 0.2s;
}
.reb-text {
    color: #888;
    font-size: 11px;
    min-width: 70px;
    text-align: right;
}

/* ===== 副本增益三选一 ===== */
#rogueBuffModal {
    z-index: 500;
    justify-content: center;
    align-items: center;
}
.rogue-buff-box {
    background: #222;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 460px;
    text-align: center;
}
.rogue-buff-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}
.rogue-buff-opt {
    background: #2a2a3e;
    border: 2px solid #4a6cf7;
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.12s, background 0.12s;
}
.rogue-buff-opt:hover {
    transform: scale(1.02);
    background: #3a3a5e;
}
.rogue-buff-opt .rbo-name {
    font-size: 16px;
    font-weight: bold;
    color: #ffd666;
    margin-bottom: 4px;
}
.rogue-buff-opt .rbo-tier {
    font-size: 13px;
    color: #4caf50;
    margin-bottom: 2px;
}
.rogue-buff-opt .rbo-val {
    font-size: 12px;
    color: #aaa;
}

/* ===== 副本升级弹窗 ===== */
#rogueUpgradeModal {
    z-index: 500;
    justify-content: center;
    align-items: center;
}
.rogue-upgrade-box {
    background: #222;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
}
.rug-coin {
    text-align: center;
    font-size: 15px;
    color: #ffd666;
    margin-bottom: 16px;
}
.rug-coin b {
    color: #4caf50;
    font-size: 18px;
}
.rug-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2a2a3e;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}
.rug-info {
    flex: 1;
    min-width: 0;
}
.rug-name {
    font-size: 15px;
    font-weight: bold;
    color: #ffd666;
    margin-bottom: 4px;
}
.rug-lv {
    font-size: 12px;
    color: #aaa;
}
.rug-lv b {
    color: #4caf50;
}
.rug-cost {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}
.rug-cost b {
    color: #ffd666;
}
.rug-btn {
    padding: 8px 16px;
    font-size: 13px;
    background: #4a6cf7;
    flex-shrink: 0;
}
.rug-btn:disabled {
    background: #444;
    color: #888;
}

/* ===== 赠送道具弹窗 ===== */
.gift-coin-info {
    text-align: center;
    font-size: 13px;
    color: #aaa;
    margin-bottom: 12px;
}
.gift-coin-info b {
    color: #ffd666;
}
.gift-item-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}
.gift-item {
    background: #2a2a3e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}
.gift-item:hover {
    background: #3a3a5e;
}
.gift-item .gi-name {
    font-size: 15px;
    font-weight: bold;
    color: #4caf50;
    margin-bottom: 4px;
}
.gift-item .gi-sub {
    font-size: 12px;
    color: #888;
}

.gift-item .gi-remain {
    font-size: 12px;
    color: #aaa;
    font-weight: normal;
}