/**
 * 签到系统样式
 */

.checkin-system {
    text-align: center;
}

.checkin-balance {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.balance-label {
    font-size: 14px;
    opacity: 0.9;
}

.balance-amount {
    font-size: 24px;
    font-weight: bold;
    display: block;
    margin-top: 5px;
}

.checkin-status {
    margin-bottom: 20px;
}

.streak-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.current-streak,
.total-checkins {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    font-size: 14px;
}

.current-streak strong,
.total-checkins strong {
    color: #007bff;
    font-size: 18px;
}

.checkin-button-container {
    margin: 20px 0;
}

.checkin-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.checkin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.checkin-btn-active:active {
    transform: translateY(0);
}

.checkin-btn-disabled {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    cursor: not-allowed;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.reward-special {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    animation: pulse 2s infinite;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
}

.seven-year-badge {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.reward-milestone {
    background: linear-gradient(135deg, #ffd93d 0%, #ff8c42 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    box-shadow: 0 4px 15px rgba(255, 217, 61, 0.3);
}

.reward-milestone p {
    margin: 0;
    font-weight: bold;
}

.checkin-calendar {
    margin-top: 25px;
    padding: 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.03);
}

.checkin-calendar h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 18px;
}

.checkin-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    max-width: 560px;
    margin: 12px auto 0;
    position: relative;
}

.checkin-card-title {
    text-align: center;
    margin: 0 0 12px 0;
    color: #333;
    font-size: 20px;
    font-weight: 700;
}

.calendar-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
}

.calendar-viewport {
    overflow: hidden;
    /* 宽度由JS按 7 天 * 单天宽度 计算设置 */
    display: block;
    /* 居中视口，确保当页面天数少时看起来居中整齐 */
    margin: 0 auto;
}

.calendar-track {
    display: flex;
    gap: 8px;
    align-items: center;
    will-change: transform;
    flex-wrap: nowrap;
}

.calendar-day {
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f0f2f5;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.18s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    padding: 6px;
    text-align: center;
}

.calendar-day.checked {
    background: linear-gradient(135deg, #2ecc71 0%, #28a745 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.28);
}

.calendar-day.unchecked {
    background: #e9ecef;
    color: #6c757d;
}

.calendar-day.today {
    /* 未签到的“今天”与未签到样式一致（保持灰色） */
    background: #e9ecef;
    color: #6c757d;
    animation: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.calendar-day .day-number {
    line-height: 1;
}

.calendar-day .day-reward {
    margin-top: 6px;
    font-size: 12px;
    color: #2f2f2f;
    font-weight: 600;
}

.calendar-day.unchecked .day-reward {
    color: #6c757d;
    font-weight: 500;
}

.checkin-login-prompt {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.checkin-card .checkin-login-prompt {
    /* 当登录提示放入卡片时，使用简洁样式 */
    background: transparent;
    border: none;
    padding: 28px 16px;
    color: #6c757d;
}

/* 翻页箭头与页脚 */
.calendar-arrow {
    background: #ffffff;
    border: 1px solid #e9ecef;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    font-weight: bold;
}
.calendar-arrow {
    /* 保证箭头垂直居中对齐格子 */
    align-self: center;
}
.calendar-arrow:hover {
    transform: translateY(-2px);
}

.calendar-footer {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 18px;
    align-items: center;
    color: #495057;
    font-weight: 600;
}
.calendar-footer .income-display,
.calendar-footer .balance-display {
    background: #fff;
    border: 1px solid #e9ecef;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    font-size: 14px;
}

.streak-boxes {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 8px;
}
.streak-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #495057;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    line-height: 1.1;
    gap: 8px;
}
.streak-card .streak-label {
    display: inline-block;
    font-size: 13px;
    color: #6c757d;
    margin: 0;
}
.streak-card strong {
    color: #1773e6;
    font-size: 16px;
    line-height: 1;
    display: inline-block;
    margin: 0 6px 0 6px;
}

.checkin-invite {
    position: relative;
    width: 100%;
    margin-top: 12px;
    background: transparent;
    display: block;
}
.checkin-invite .checkin-invite-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 6px;
}
.checkin-invite .checkin-invite-row .line-form-input {
    flex: 1 1 auto;
    min-width: 0;
}
.checkin-invite .checkin-invite-row .but {
    flex: 0 0 auto;
}

/* 奖励里程碑样式 */
.reward-milestones {
    display: flex;
    flex-direction: row;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    flex-wrap: nowrap; /* 强制单行横向展示 */
    width: 100%;
    padding-bottom: 6px;
}
.reward-chip {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #495057;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.reward-chip {
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
    padding: 8px 14px;
    min-width: 110px;
    box-sizing: border-box;
    white-space: nowrap;
}
.reward-chip strong {
    color: #333;
    font-weight: 700;
}
.reward-chip span {
    color: #1773e6;
    font-weight: 700;
}

.checkin-login-prompt p {
    margin: 0;
    font-size: 16px;
    color: #6c757d;
}

.checkin-login-prompt a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.checkin-login-prompt a:hover {
    text-decoration: underline;
}

/* 通知样式 */
.checkin-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    max-width: 300px;
}

.checkin-notification.show {
    transform: translateX(0);
}

.checkin-notification.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.checkin-notification.error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* 持久化通知样式 */
.checkin-notification.persistent {
    opacity: 1;
    transform: translateX(0);
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
}
.checkin-notification .checkin-notification-close {
    background: transparent;
    border: none;
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    position: absolute;
    top: 6px;
    right: 8px;
    cursor: pointer;
}
.checkin-notification.success .checkin-notification-close { color: white; }
.checkin-notification.error .checkin-notification-close { color: white; }

/* 模态框样式 */
.checkin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkin-modal-overlay.show {
    opacity: 1;
}

.checkin-modal {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.checkin-modal-overlay.show .checkin-modal {
    transform: scale(1);
}

.modal-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 25px;
    border-radius: 20px 20px 0 0;
    text-align: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.modal-body {
    padding: 30px;
    text-align: center;
}

.achievement-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.reward-amount {
    font-size: 20px;
    color: #28a745;
    margin: 15px 0;
}

.congratulation {
    color: #6c757d;
    font-style: italic;
    margin-top: 15px;
}

.modal-footer {
    padding: 20px 30px 30px;
    text-align: center;
    border-top: 1px solid #dee2e6;
}

.modal-close-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

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

@keyframes todayPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .streak-info {
        flex-direction: column;
        gap: 10px;
    }

    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 5px;
    }

    .calendar-day {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .checkin-btn {
        padding: 12px 25px;
        font-size: 14px;
    }
}
