/* ========== 菜单样式 ========== */
.energy_menu {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.energy_menu .item {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: #424040;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    position: relative;
    display: inline-block;
    text-align: center;
    min-width: 100px;
    user-select: none;
}

.energy_menu .item:hover {
    color: rgba(255, 255, 255, 0.8);
}

.energy_menu .item.select {
    position: relative;
    margin-bottom: 10px;
}

.energy_menu .item.select::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #4B4DFF;
    transition: transform 0.3s;
}

/* ========== 主容器 ========== */
.energy {
    position: relative;
    width: 100%;
    min-height: 300px;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
    background: #12151C;
}

.quick-rent-container {
    width: 70%;
    min-width: 360px;
    max-width: 1600px;
}

.quick-rent-panel {
    background: rgba(26, 29, 38, 0.95);
    border-radius: 16px;
    padding: 32px;
    color: #fff;
    width: 100%;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.estimate-link {
    color: #4B4DFF;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.3s;
}

.estimate-link:hover {
    color: #5C5EFF;
}

.input-section {
    margin-bottom: 24px;
}

.input-section label {
    display: block;
    color: #8C8C8C;
    margin-bottom: 12px;
    font-size: 14px;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.energy-input {
    width: 100%;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    padding: 0 16px;
    font-size: 16px;
    transition: all 0.3s;
    outline: none;
}

.energy-input:focus {
    border-color: #4B4DFF;
    box-shadow: 0 0 0 2px rgba(75, 77, 255, 0.1);
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.preset-button {
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.preset-button:hover {
    background: rgba(75, 77, 255, 0.1);
    border-color: #4B4DFF;
}

.duration-buttons {
    display: flex;
    gap: 8px;
}

.duration-button {
    flex: 1;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.duration-button:hover {
    background: rgba(75, 77, 255, 0.1);
}

.duration-button.active {
    background: #4B4DFF;
    border-color: #4B4DFF;
}

.recipient-input {
    width: 100%;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    padding: 0 16px;
    font-size: 16px;
    transition: all 0.3s;
    outline: none;
}

.recipient-input:focus {
    border-color: #4B4DFF;
    box-shadow: 0 0 0 2px rgba(75, 77, 255, 0.1);
}

.energy-available {
    color: #8C8C8C;
    font-size: 12px;
    margin-top: 8px;
}

.cost-estimate {
    text-align: right;
    color: #FFD700;
    font-size: 14px;
    margin: 24px 0;
}

.buy-now-button {
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, #4B4DFF, #5C5EFF);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.buy-now-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(75, 77, 255, 0.2);
}

.buy-now-button:active {
    transform: translateY(0);
}

/* ========== 响应式设计 ========== */
@media (min-width: 1920px) {
    .quick-rent-container { width: 98%; }
}

@media (min-width: 1440px) and (max-width: 1919px) {
    .quick-rent-container { width: 95%; }
}

@media (min-width: 1200px) and (max-width: 1439px) {
    .quick-rent-container { width: 90%; }
}

@media (max-width: 768px) {
    .energy_menu {
        padding: 0 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 0;
    }

    .energy_menu::-webkit-scrollbar { display: none; }

    .energy_menu .item {
        padding: 12px 16px;
        font-size: 14px;
        white-space: nowrap;
        min-width: auto;
    }

    .energy_menu .item.select::after { bottom: 0; }

    .energy { padding: 20px 15px; }

    .quick-rent-container {
        width: 100%;
        min-width: auto;
    }

    .quick-rent-panel { padding: 24px; }

    .panel-header h3 { font-size: 20px; }

    .preset-buttons { grid-template-columns: repeat(2, 1fr); }

    .duration-buttons { flex-wrap: wrap; }

    .duration-button { flex: 1 0 calc(50% - 4px); }
}

/* ========== Toast 提示弹窗 ========== */
.custom-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    animation: slideIn 0.3s ease;
}

.custom-toast .error-icon {
    font-size: 18px;
    color: #ff4d4f;
}

.custom-toast .close-btn {
    margin-left: auto;
    cursor: pointer;
    padding: 0 4px;
}

@keyframes slideIn {
    from { top: -100px; opacity: 0; }
    to { top: 20px; opacity: 1; }
}

/* ========== 简易 layerOut 轻提示 ========== */
.layer-out {
    position: fixed;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-family: 'Microsoft YaHei';
    opacity: 0.7;
    background-color: #000;
    color: #fff;
    font-weight: bold;
    padding: 16px;
    line-height: 25px;
    box-shadow: 3px 3px 8px #000;
    border-radius: 5px;
    z-index: 999998;
}
