/* ============================================
   小画饼铺 - 粉丝端自定义样式
   主题：暖橙色调 · 毛玻璃 · 圆润卡片
   优化：国内加速 · 移动端性能提升
============================================ */

/* 全局变量 */
:root {
    --primary: #F4A261;           /* 柔和杏仁橙 */
    --primary-dark: #E07A5F;      /* 沉稳珊瑚橙（悬停/激活） */
    --primary-light: #FFD8A8;     /* 浅杏色 */
    --secondary: #FFE8A0;         /* 淡黄辅助 */
    --accent: #F4A261;            /* 浅橙（与主色统一） */
    --danger: #C0553F;            /* 陶土红，白色背景上更清晰 */
    --dark: #1E293B;              /* 深蓝灰，保证文字对比度 */
    --gray: #64748B;              /* 中灰色 */
    --light-bg: #FAFAF9;          /* 极浅灰白背景 */
    --white-glass: rgba(255, 255, 255, 0.92);  /* 柔和纯白卡片 */
    --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.08);
    --radius-card: 20px;
    --radius-element: 16px;
}

body {
    background-color: #FAFAFA;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', system-ui, -apple-system, sans-serif;
    transition: background 0.5s ease;
}

/* 毛玻璃导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.60) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary) !important;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s;
}
.nav-link:hover {
    color: var(--primary) !important;
}

/* 卡片通用样式 */
.card {
    border: none;
    border-radius: var(--radius-card);
    background: var(--white-glass);
    backdrop-filter: none; 
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}
    
.card:hover {
    transform: none;
    box-shadow: var(--shadow-hover);
}

.card-header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* 画饼值概览卡片 */
.stats-card {
    background: white;
    border-radius: var(--radius-element);
    padding: 1.5rem;
    height: 100%;
    transition: all 0.2s;
}
.stats-card .points-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}
.stats-card .stats-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 140, 66, 0.1);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 欢迎卡片（毛玻璃） */
.welcome-card {
    background: linear-gradient(135deg, rgba(255,255,245,0.9), rgba(255,230,200,0.7));
    backdrop-filter: none;
    border-radius: var(--radius-card);
    border: none;
    padding: 1.2rem 1.5rem;
}

/* 最近记录列表 */
.recent-list {
    max-height: 320px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.recent-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.2s;
}
.recent-item:hover {
    background: rgba(255, 140, 66, 0.05);
}
.recent-item .recent-name {
    font-weight: 600;
    color: var(--dark);
}
.recent-item .recent-time {
    font-size: 0.7rem;
    color: var(--gray);
}
.recent-item .earn-value {
    color: #10B981;
    font-weight: 700;
}
.recent-item .spend-value {
    color: var(--danger);
    font-weight: 700;
}

/* 右侧任务栏 - 紧凑且现代 */
.task-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.task-item {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}
.task-item:hover {
    background-color: rgba(255, 140, 66, 0.03);
}
.task-item details {
    padding: 8px 10px;
}
.task-item details summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    gap: 8px;
}
.task-item details summary::-webkit-details-marker {
    display: none;
}
.task-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.task-icon {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
}
.task-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.task-item details[open] .task-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
}
.badge-completed, .badge-pending {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 30px;
    white-space: nowrap;
}
.badge-completed {
    background: linear-gradient(135deg, #10B981, #34D399);
    color: white;
}
.badge-pending {
    background: #e9ecef;
    color: #6c757d;
}
.task-desc {
    margin-top: 8px;
    padding-left: 30px;
    font-size: 0.7rem;
    color: var(--gray);
    border-left: 2px solid var(--primary-light);
}

/* 按钮风格 */
.btn-primary {
    background: linear-gradient(95deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: 40px;
    padding: 8px 24px;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(255, 140, 66, 0.3);
}
.btn-outline-primary {
    border-radius: 40px;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* 模态框风格 */
.modal-content {
    border-radius: 28px;
    border: none;
    overflow: hidden;
}
.modal-header {
    border: none;
}
.modal-footer {
    border: none;
}

/* 动画 */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 滚动条美化 */
.recent-list::-webkit-scrollbar {
    width: 4px;
}
.recent-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.recent-list::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

/*新增：移动端性能专项优化 */
@media (max-width: 768px) {
    .stats-card .points-value {
        font-size: 1.8rem;
    }
    .card-body {
        padding: 1rem;
    }
    .welcome-card {
        padding: 1rem;
    }
    .navbar {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(255, 255, 255, 0.95) !important;
    }
}

/* 每日任务折叠箭头（FontAwesome 风格） */
.task-item details summary::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free', 'FontAwesome', 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 0.6rem;
    color: #adb5bd;
    transition: transform 0.2s;
    margin-left: auto;
    flex-shrink: 0;
}
.task-item details[open] summary::after {
    transform: rotate(90deg);
}

/* ========== 头像框动画 ========== */
.avatar-frame-img {
    pointer-events: none;
}
.frame-spin {
    animation: avatarFrameSpin 4s linear infinite;
}
@keyframes avatarFrameSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}
.frame-glow {
    animation: avatarFrameGlow 2s ease-in-out infinite alternate;
}
@keyframes avatarFrameGlow {
    from { filter: drop-shadow(0 0 4px gold); }
    to   { filter: drop-shadow(0 0 12px orange); }
}

/* ========== 生日弧形文字 ========== */
.birthday-chars {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10;
}

.char-wrapper {
    position: absolute;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.char-inner {
    display: inline-block;
    font-weight: bold;
    /* 多层阴影：白色光晕 + 彩色光晕 + 黑色投影 */
    text-shadow:
        0 0 4px rgba(255,255,255,0.9),
        0 0 8px currentColor,
        0 0 16px currentColor,
        0 2px 4px rgba(0,0,0,0.4),
        0 4px 8px rgba(0,0,0,0.2);
    /* 描边：半透明黑色，让边缘清晰 */
    -webkit-text-stroke: 0.6px rgba(0,0,0,0.25);
    animation: charAppear 5s infinite, breathe 1.5s ease-in-out infinite alternate;
    opacity: 0;
}

/* 每个字独立颜色（优先级高于 .char-inner） */
.char-1 .char-inner { color: #FF4500; }
.char-2 .char-inner { color: #FFD700; }
.char-3 .char-inner { color: #00BFFF; }
.char-4 .char-inner { color: #FF69B4; }

/* 导航栏尺寸 */
.navbar .char-inner {
    font-size: 7px;
}

/* 个人中心尺寸 */
.gradient-card-soft .char-inner,
.welcome-card .char-inner {
    font-size: 13px;
}

/* 商城模态框尺寸（适当增大并减轻阴影，避免模糊） */
.modal .char-inner {
    font-size: 10px;
    text-shadow:
        0 0 4px rgba(255,255,255,0.7),
        0 0 8px currentColor,
        0 0 14px currentColor,
        1px 1px 0 rgba(0,0,0,0.2),
        -1px -1px 0 rgba(0,0,0,0.2);
}

/* 逐字延迟 */
.char-1 .char-inner { animation-delay: 0s, 0s; }
.char-2 .char-inner { animation-delay: 0.35s, 0.175s; }
.char-3 .char-inner { animation-delay: 0.7s, 0.35s; }
.char-4 .char-inner { animation-delay: 1.05s, 0.525s; }

/* 关键帧 */
@keyframes charAppear {
    0%   { opacity: 0; }
    12%  { opacity: 1; }
    88%  { opacity: 1; }
    98%  { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes breathe {
    from { transform: scale(1); }
    to   { transform: scale(1.35); }
}

/* 头像框旋转 - 已禁用生日框旋转 */
.frame-birthday {
    animation: none;
}

/* ========== VIP 文字动画（修正类名匹配） ========== */
.vip-chars {
    position: absolute;
    top: -10px;                     /* 紧贴头像框上方 */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3px;
    pointer-events: none;
    z-index: 5;
    font-weight: 900;
    font-size: 22px;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(255,215,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
    white-space: nowrap;
}

.vip-char {
    display: inline-block;
    opacity: 0;
    /* 发光阴影 + 深色投影，确保在任何背景下清晰 */
    text-shadow:
        0 0 10px rgba(255,255,255,0.5),
        0 0 20px currentColor,
        0 0 30px currentColor,
        0 2px 6px rgba(0,0,0,0.5);
    /* 细描边增强轮廓 */
    -webkit-text-stroke: 0.5px rgba(0,0,0,0.15);
    animation: vipAppear 3s ease-in-out infinite,
               colorFlow 6s linear infinite;
}

.vip-char-1 {
    animation-delay: 0s, 0s;
}
.vip-char-2 {
    animation-delay: 0.4s, 0.4s;
}
.vip-char-3 {
    animation-delay: 0.8s, 0.8s;
}

/* 出现动画：逐字出现并保持可见（之后循环消失再出现） */
@keyframes vipAppear {
    0%   { opacity: 0; transform: scale(0.8); }
    15%  { opacity: 1; transform: scale(1.1); }
    25%  { opacity: 1; transform: scale(1); }
    75%  { opacity: 1; transform: scale(1); }
    85%  { opacity: 0; transform: scale(0.8); }
    100% { opacity: 0; transform: scale(0.8); }
}

/* 颜色平滑循环（7种高级色，6秒一轮） */
@keyframes colorFlow {
    0%   { color: #D4AF37; }  /* 香槟金 */
    16%  { color: #E8A87C; }  /* 珊瑚粉 */
    32%  { color: #B39DDB; }  /* 紫罗兰 */
    48%  { color: #4DD0E1; }  /* 冰蓝 */
    64%  { color: #66BB6A; }  /* 翠绿 */
    80%  { color: #FF8A65; }  /* 暖橙 */
    100% { color: #D4AF37; }  /* 回到香槟金 */
}

/* ---------- 不同场景尺寸适配 ---------- */
/* 导航栏（小尺寸） */
.navbar .vip-chars {
    font-size: 14px;
    top: -6px;
    gap: 1px;
    letter-spacing: 1px;
}
.navbar .vip-char {
    animation-duration: 2.5s, 6s;  /* 加快出现节奏 */
}
.navbar .vip-char-1 { animation-delay: 0s, 0s; }
.navbar .vip-char-2 { animation-delay: 0.3s, 0.3s; }
.navbar .vip-char-3 { animation-delay: 0.6s, 0.6s; }

/* 模态框预览（中尺寸） */
.modal .vip-chars {
    font-size: 18px;
    top: -8px;
    gap: 2px;
}

/* ===== 七彩薄雾覆盖层（头像着色强化版） ===== */
.rainbow-fog-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 6;                      /* 确保在头像框之上 */
    opacity: 0.70;                   /* 提高透明度，更明显 */
    mix-blend-mode: overlay;         /* 更鲜艳的混合模式，也可试 color-dodge */
    /* 径向七彩渐变，颜色饱和，从中心向外扩散 */
    background: radial-gradient(circle at 30% 30%, 
        #ff0040, #ff7f00, #ffdd00, #00cc44, #0088ff, #aa44ff, #ff0040
    );
    background-size: 500% 500%;
    animation: rainbowFogBg 5s ease-in-out infinite alternate;
}

@keyframes rainbowFogBg {
    0%   { background-position: 0% 30%; }
    100% { background-position: 100% 70%; }
}

/* 导航栏（小尺寸）适当降低透明度，避免太刺眼 */
.navbar .rainbow-fog-layer {
    opacity: 0.55;
}

/* 模态框预览（中尺寸） */
.modal .rainbow-fog-layer {
    opacity: 0.60;
}