/* ==========================================
   extras.css —— 离线奖励弹窗、转生弹窗、移动端响应式
   ========================================== */

/* ---------- 离线奖励弹窗 ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal-box {
    background: var(--bg-panel);
    color: var(--text-primary);
    padding: 25px 30px;
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-modal);
    text-align: center;
    border: 1px solid var(--border-card);
}
.modal-box h2 {
    margin-top: 0;
    color: var(--accent-gold);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.modal-box h2 img {
    height: 1.2em;
    vertical-align: middle;
}
.modal-box .offline-time {
    font-size: 1.1em;
    margin: 10px 0;
    color: var(--text-primary);
}
.modal-box .reward-list {
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
    margin: 15px 0;
    background: var(--bg-resource-item);
    border-radius: var(--radius-sm);
    padding: 8px;
}
.modal-box .reward-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-card);
    color: var(--text-primary);
}
.modal-box .note {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 15px 0 10px;
}
.modal-box .note .tooltip {
    cursor: help;
    border-bottom: 1px dotted var(--text-secondary);
    position: relative;
    display: inline-block;
    color: var(--text-secondary);
}
.modal-box .note .tooltip .tooltiptext {
    visibility: hidden;
    width: 220px;
    background-color: var(--bg-tooltip);
    color: var(--text-on-tooltip);
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s;
}
.modal-box .note .tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}
.modal-box button {
    background: var(--accent-gold);
    border: none;
    padding: 10px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: var(--radius-btn);
    cursor: pointer;
    margin-top: 10px;
    color: #fff;
    transition: background 0.2s;
}
.modal-box button:hover {
    background: #9a6d0b;
}

/* ---------- 转生弹窗（已优化） ---------- */
.rebirth-modal-box {
    max-width: 440px;
    text-align: center;
}

/* 暗物质数量区域 */
.dm-quantity-area {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin: 1.2em 0 1em;
    font-size: 1.1rem;
    flex-wrap: wrap;
}

.dm-label {
    color: #555;
}

.dm-number {
    font-size: 2rem;
    font-weight: bold;
    color: #7c3aed;
    text-shadow: 0 0 6px #7c3aed;
}

/* 规则说明 */
.rebirth-desc {
    margin: 1.2em 0 0.6em;
    font-size: 0.92rem;
    color: #444;
    line-height: 1.6;
}

.rebirth-desc p {
    margin: 0;
}

/* 叙事寄语 */
.rebirth-blessing {
    margin: 0.6em 0 1.4em;
    font-size: 0.95rem;
    color: #555;
    font-style: italic;
    line-height: 1.6;
}

.rebirth-blessing p {
    margin: 0.3em 0;
}

/* 转生按钮组 */
.rebirth-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 0.5em;
}

.rebirth-buttons .btn {
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: bold;
    color: #fff;
}

.rebirth-buttons .btn-secondary {
    background: #4a5568;
}

.rebirth-buttons .btn-secondary:hover {
    background: #5a6578;
}

.rebirth-buttons .btn-danger {
    background: #7c3aed;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}

.rebirth-buttons .btn-danger:hover {
    background: #8b5cf6;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.6);
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 700px) {
    #mainContainer { flex-direction: column; }
    #resourcePanel {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding: 10px;
        border-right: none;
        border-bottom: 1px solid var(--border-panel);
    }
    .resource-item {
        min-width: 130px;
        margin-right: 8px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    #clickBtn {
        width: 200px;
        font-size: 1.5rem;
        padding: 15px 25px;
    }
    .building-card { padding: 12px; }
    .building-header { flex-wrap: wrap; gap: 8px; }
    .header-right { flex-direction: row; gap: 12px; }
    .banner-title {
        font-size: 1.4rem;
        letter-spacing: 3px;
    }
    .banner-actions button {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
}

/* ---------- 面板独立滚动（桌面端） ---------- */
#resourcePanel {
    overflow-y: auto;
    height: calc(100vh - 56px);
    padding-bottom: 20px;
}

#contentArea {
    overflow-y: auto;
    height: calc(100vh - 56px);
    padding-bottom: 20px;
}