/* ==================== 弹窗样式 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #F0F0F0;
}

.modal-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #F5F5F5;
    color: #333;
}

/* ==================== 商城弹窗 ==================== */
.shop-tabs {
    display: flex;
    background: #F8F8F8;
    padding: 5px;
    margin: 15px 20px;
    border-radius: 25px;
}

.shop-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 20px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-tab.active {
    background: white;
    color: #FF6B9D;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.shop-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
}

.shop-section {
    display: none;
}

.shop-section.active {
    display: block;
}

.shop-item {
    display: flex;
    align-items: center;
    background: #F8F8F8;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 10px;
}

.shop-item-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #FFE4E1, #FFB6C1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 15px;
}

.shop-item-info {
    flex: 1;
}

.shop-item-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.shop-item-desc {
    font-size: 12px;
    color: #999;
}

.shop-item-actions {
    display: flex;
    gap: 8px;
}

.shop-footer {
    padding: 15px 20px;
    border-top: 1px solid #F0F0F0;
    background: #F8F8F8;
}

.resource-display {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 16px;
    font-weight: bold;
}

/* ==================== 签到弹窗 ==================== */
.checkin-content {
    padding: 20px;
    overflow-y: auto;
}

.checkin-streak {
    text-align: center;
    margin-bottom: 20px;
}

.streak-title {
    font-size: 14px;
    color: #999;
    margin-bottom: 5px;
}

.streak-days {
    font-size: 32px;
    font-weight: bold;
    color: #FF6B9D;
}

.checkin-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #F5F5F5;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.calendar-day.checked {
    background: linear-gradient(135deg, #C8E6C9, #A5D6A7);
}

.calendar-day.current {
    background: linear-gradient(135deg, #FFE4E1, #FFB6C1);
    border: 2px solid #FF6B9D;
    animation: pulse 2s infinite;
}

.day-number {
    font-weight: bold;
    color: #666;
}

.day-reward {
    font-size: 12px;
}

.checkin-rewards {
    background: #F8F8F8;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
}

.reward-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.reward-list {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.reward-item {
    background: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
}

.reward-weekly {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #DDD;
}

/* ==================== 任务弹窗 ==================== */
.tasks-content {
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
}

.task-item {
    background: #F8F8F8;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-item.completed {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
}

.task-info {
    flex: 1;
}

.task-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.task-desc {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.task-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-progress .progress-bar {
    flex: 1;
    height: 6px;
    background: #E0E0E0;
    border-radius: 3px;
    overflow: hidden;
}

.task-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF6B9D, #FF8E53);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: #666;
    min-width: 50px;
    text-align: right;
}

.task-reward {
    font-size: 12px;
    color: #FF6B9D;
    text-align: right;
}

.tasks-footer {
    padding: 15px;
    text-align: center;
    color: #999;
    font-size: 12px;
    border-top: 1px solid #F0F0F0;
}

/* ==================== 设置弹窗 ==================== */
.settings-content {
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 14px;
    color: #999;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #F8F8F8;
    border-radius: 12px;
    margin-bottom: 10px;
}

.setting-item.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-item.clickable:hover {
    background: #F0F0F0;
}

.setting-name {
    font-weight: 500;
    color: #333;
}

.setting-value {
    color: #999;
}

.setting-arrow {
    color: #999;
    font-size: 20px;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #FF6B9D;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* ==================== 体力不足弹窗 ==================== */
.energy-content {
    padding: 30px 20px;
    text-align: center;
}

.energy-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.energy-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.energy-recover {
    font-size: 14px;
    color: #999;
    margin-bottom: 25px;
}

.energy-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ==================== 帮助弹窗 ==================== */
.help-modal .modal-content {
    max-height: 70vh;
}

.help-content {
    padding: 20px;
    overflow-y: auto;
}

.help-content h3 {
    color: #FF6B9D;
    margin: 20px 0 10px;
    font-size: 16px;
}

.help-content h3:first-child {
    margin-top: 0;
}

.help-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 8px;
    font-size: 14px;
}

.help-content strong {
    color: #333;
}

/* ==================== 按钮样式 ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #FF6B9D, #FF8E53);
    color: white;
}

.btn-secondary {
    background: #F0F0F0;
    color: #666;
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-large {
    padding: 15px 40px;
    font-size: 16px;
    width: 100%;
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ==================== 动画 ==================== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}
