/* 28周计划打卡网站 - 自定义样式 */

/* 基础样式 */
:root {
    --primary-blue: #3b82f6;
    --primary-purple: #8b5cf6;
    --primary-green: #10b981;
    --primary-yellow: #f59e0b;
    --primary-red: #ef4444;
}

body {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

/* 卡片悬停效果 */
.hover-card {
    transition: all 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 进度条动画 */
@keyframes progressFill {
    from { width: 0%; }
    to { width: var(--target-width); }
}

.progress-bar-animated {
    animation: progressFill 1.5s ease-out forwards;
}

/* 徽章发光效果 */
.badge-glow {
    position: relative;
}

.badge-glow::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    background-size: 400%;
    border-radius: inherit;
    z-index: -1;
    animation: badgeGlow 20s linear infinite;
    opacity: 0.7;
    filter: blur(2px);
}

@keyframes badgeGlow {
    0% { background-position: 0 0; }
    50% { background-position: 400% 0; }
    100% { background-position: 0 0; }
}

/* 倒计时数字样式 */
.countdown-number {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 打卡按钮动画 */
@keyframes pulseCheckin {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pulse-checkin {
    animation: pulseCheckin 2s infinite;
}

/* 模态框背景 */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* 计划项样式 */
.plan-item {
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.plan-item.current-week {
    border-left-color: var(--primary-blue);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.plan-item.completed-week {
    border-left-color: var(--primary-green);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.plan-item:hover {
    border-left-color: var(--primary-purple);
}

/* 日历样式 */
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.calendar-day.checked {
    background-color: var(--primary-green);
    color: white;
    font-weight: bold;
}

.calendar-day.today {
    border: 2px solid var(--primary-blue);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .countdown-number {
        font-size: 1.75rem;
    }
    
    .plan-item {
        padding: 1rem;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    .plan-item {
        break-inside: avoid;
        border: 1px solid #ddd;
    }
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 渐变文字 */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 工具提示 */
.tooltip {
    position: relative;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 动画类 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); }
}

/* 按钮样式增强 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--primary-green), #34d399);
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

/* 卡片阴影层级 */
.shadow-layer-1 {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.shadow-layer-2 {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.shadow-layer-3 {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* 响应式文字大小 */
.text-responsive {
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.text-responsive-lg {
    font-size: clamp(1.25rem, 3vw, 2rem);
}

/* 自定义滚动条 */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-blue) #f1f1f1;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-purple);
}

/* 骨架屏加载效果 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 徽章动画 */
.badge-pulse {
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 进度条渐变 */
.progress-gradient {
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-purple), var(--primary-green));
    background-size: 300% 100%;
    animation: progressGradient 3s ease infinite;
}

@keyframes progressGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 页面过渡效果 */
.page-transition {
    animation: pageTransition 0.3s ease;
}

@keyframes pageTransition {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 励志语全屏覆盖层 */
.motivation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease;
}

.motivation-overlay.show {
    opacity: 1;
    visibility: visible;
}

.motivation-overlay.hide {
    opacity: 0;
    visibility: hidden;
}

/* 励志语文字 */
.motivation-text {
    color: #ffffff;
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 500;
    text-align: center;
    padding: 2rem;
    max-width: 80%;
    line-height: 1.6;
    white-space: pre-line;
    /* 先淡入，然后呼吸效果 */
    animation: motivationFadeIn 1.5s ease forwards, breathe 2s ease-in-out infinite 1.5s;
}

@keyframes breathe {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

/* 淡入动画 */
.motivation-fade-in {
    animation: motivationFadeIn 1.5s ease forwards;
}

@keyframes motivationFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 0.7;
        transform: scale(1);
    }
}

/* ============================================
   移动端响应式优化
   ============================================ */

/* 全局移动端优化 */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        line-height: 1.5;
    }
    
    /* 增大触控区域 */
    button,
    .btn-primary,
    .btn-success,
    a[role="button"] {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
    }
    
    /* 输入框优化 */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    textarea,
    select {
        font-size: 16px; /* 防止iOS自动缩放 */
        padding: 12px;
    }
    
    /* 卡片间距优化 */
    .grid.gap-8 {
        gap: 1.5rem;
    }
    
    .grid.gap-6 {
        gap: 1rem;
    }
    
    /* 模态框移动端适配 */
    .modal-content {
        max-width: 95vw;
        margin: 10px;
        border-radius: 16px;
    }
    
    /* 隐藏非必要文字，只显示图标 */
    .hide-text-mobile span:not(.icon-only) {
        display: none;
    }
    
    .show-icon-mobile i {
        font-size: 1.5rem;
    }
}

/* 小屏手机优化 (max-width: 480px) */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }
    
    h1 {
        font-size: 1.25rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
    
    h3 {
        font-size: 1.125rem !important;
    }
    
    /* 用户选择卡片优化 */
    .user-select-card {
        padding: 1.5rem !important;
    }
    
    .user-select-card .w-24 {
        width: 4rem;
        height: 4rem;
    }
    
    /* 底部功能卡片网格调整为单列 */
    .mobile-grid-1 {
        grid-template-columns: 1fr !important;
    }
    
    /* 进度条高度增大 */
    .progress-bar {
        height: 12px !important;
    }
    
    /* 导航栏按钮优化 */
    header.bg-white button i {
        font-size: 1.25rem !important;
    }

    /* 导航栏内边距优化 */
    header.bg-white {
        padding: 1rem !important;
    }

    /* 用户徽章优化 */
    #currentUserBadge {
        font-size: 0.875rem !important;
        padding: 0.25rem 0.75rem !important;
    }

    /* 统计数字增大 */
    .stat-number {
        font-size: 1.5rem;
    }
}

/* 平板横屏优化 (min-width: 769px) and (max-width: 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid-cols-2-md {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-3-md {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 移动端实用类 */
.mobile-p-4 {
    padding: 1rem;
}

.mobile-p-6 {
    padding: 1.5rem;
}

.mobile-mb-4 {
    margin-bottom: 1rem;
}

.mobile-text-center {
    text-align: center;
}

.mobile-full-width {
    width: 100%;
}

/* 防止移动端横向滚动 */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* 移动端优化滚动 */
.mobile-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 表格移动端适配 */
.mobile-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 按钮移动端样式 */
.btn-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.2s;
}

.btn-mobile:active {
    transform: scale(0.98);
}

/* 输入框组移动端优化 */
.input-group-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-group-mobile label {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

/* 导航栏移动端优化 */
.nav-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* 模态框全屏移动端 */
.modal-mobile-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 9999;
    overflow-y: auto;
}