/* 全局样式 */
body, html {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Helvetica Neue', Helvetica, Arial, 'Microsoft Yahei', '微软雅黑', sans-serif;
    
    /* --- 修改点：采用移动优先策略，默认加载手机端壁纸 --- */
    background-image: url('https://t.alcy.cc/mp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    color: #333;
    
    /* --- 使用 Flexbox 让主内容居中 --- */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- 修改点：新增桌面端媒体查询 --- */
/* 当屏幕宽度大于768px时，应用电脑端壁纸和固定效果 */
@media (min-width: 769px) {
    body, html {
        background-image: url('https://t.alcy.cc/ycy');
        background-attachment: fixed;
    }
}

/* 标题样式 - 固定在左上角并美化 (电脑端样式) */
.title {
    position: fixed;
    top: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 2.5rem;
    font-family: 'STKaiti', 'KaiTi', '楷体', 'SimSun', '宋体', serif;
    font-weight: 400;
    letter-spacing: 2px;
    transition: all 0.4s ease-in-out;
    text-shadow: none;
    cursor: pointer;
    z-index: 10;
    overflow: hidden;
}

/* --- 扫光效果伪元素 (电脑端为白色) --- */
.title::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    animation: sweep 3s infinite linear;
}

/* --- 扫光动画的关键帧 --- */
@keyframes sweep {
    from { left: -100%; }
    to { left: 100%; }
}

/* --- 标题悬停效果 --- */
.title:hover {
    background-color: rgba(0, 0, 0, 0.7);
    color: #add8e6;
    transform: scale(1.05);
}

/* 主容器 */
.container {
    width: 90%;
    max-width: 600px;
    padding: 20px;
}

/* 内容框 - 毛玻璃效果 */
.content-box {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 2rem 2.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* --- 句子容器 --- */
.quote-wrapper {
    margin-bottom: 2rem;
}

/* --- 毒鸡汤文本 (恢复为原来的淡入淡出效果) --- */
#quote {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.5rem;
    line-height: 1.8;
    color: #f0f8ff; /* 使用一个淡蓝色作为文字基础色 */
    letter-spacing: 1px;

    /* --- 发光文字特效 --- */
    text-shadow: 
        0 0 5px #4682b4,
        0 0 10px #4682b4,
        0 0 15px #4682b4,
        0 0 20px #4682b4;
    
    /* --- 呼吸动画 --- */
    animation: glow 3s ease-in-out infinite alternate;
    
    /* --- 恢复：使用 opacity 过渡 --- */
    transition: opacity 0.5s ease-in-out;
}

/* --- 发光动画的关键帧 --- */
@keyframes glow {
    from {
        text-shadow: 
            0 0 5px #4682b4,
            0 0 10px #4682b4,
            0 0 15px #4682b4,
            0 0 20px #4682b4;
    }
    to {
        text-shadow: 
            0 0 10px #4682b4,
            0 0 15px #4682b4,
            0 0 20px #4682b4,
            0 0 25px #4682b4;
    }
}

/* --- 底部操作按钮容器 (固定在屏幕底部) --- */
.action-buttons {
    position: fixed;
    bottom: 50px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 11;
}

/* --- 美化后的底部操作按钮样式 --- */
.action-buttons button {
    /* --- 修改点：使用渐变背景，增加质感 --- */
    background: linear-gradient(145deg, rgba(30, 30, 40, 0.8), rgba(60, 60, 80, 0.8));
    color: #ffffff; /* 默认颜色，会被下面的ID选择器覆盖 */
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    
    /* --- 添加内阴影和外部阴影，增加立体感 --- */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* --- 美化后的悬停效果 --- */
.action-buttons button:hover {
    /* --- 悬停时背景变亮，并轻微放大 --- */
    background: linear-gradient(145deg, rgba(40, 40, 50, 0.9), rgba(70, 70, 90, 0.9));
    transform: translateY(-3px) scale(1.02);
    
    /* --- 增强阴影效果 --- */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* --- 新增：为单个按钮设置不同颜色 --- */
#nav-new-quote-btn {
    color: #ff4757; /* 一个漂亮的红色 */
}

#nav-copy-btn {
    color: #ff6b81; /* 一个漂亮的粉色 */
}

/* --- 新增：为分享按钮设置颜色 --- */
#nav-share-btn {
    color: #2ed573; /* 一个清新的绿色 */
}

/* --- 新增：为单个按钮设置悬停颜色 --- */
#nav-new-quote-btn:hover {
    color: #ff3838; /* 悬停时更亮的红色 */
}

#nav-copy-btn:hover {
    color: #ee5a6f; /* 悬停时更亮的粉色 */
}

#nav-share-btn:hover {
    color: #26de81; /* 悬停时更亮的绿色 */
}

/* 页脚样式 (固定在屏幕底部) */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7);
    padding: 10px 0;
    z-index: 10;
}

footer a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    text-decoration: underline;
}

/* --- 自定义通知样式 (模态弹窗) --- */
#custom-notification {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

#custom-notification.show {
    display: flex;
}

.notification-content {
    background-color: #ffffff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    min-width: 300px;
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.notification-content h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #333;
}

.notification-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

/* --- 修改后的分享图片模态框样式 --- */
#share-image-modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 1001; /* 确保在最顶层 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative; /* 为内部的绝对定位按钮提供参照 */
}

#share-image-modal.show {
    display: flex;
}

.share-image-modal-content {
    text-align: center;
    color: white;
    max-width: 90%;
    max-height: 90%;
}

#share-image-modal p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

#shareable-image {
    max-width: 100%;
    max-height: 80vh;
    border: 2px solid #555;
    border-radius: 8px;
    background-color: #fff;
}

/* --- 修改点：隐藏右上角的关闭按钮 --- */
#close-share-modal {
    display: none; /* 在所有设备上都隐藏 */
}


/* ========== 响应式调整 ========== */

/* --- 平板设备 (宽度小于等于 768px) --- */
@media (max-width: 768px) {
    .content-box {
        padding: 1.8rem 2rem;
    }

    #quote {
        font-size: 1.4rem;
    }

    .action-buttons {
        gap: 12px; /* 修改点：减小间距以容纳三个按钮 */
        bottom: 45px;
    }

    .action-buttons button {
        font-size: 0.95rem;
        padding: 10px 20px;
    }

    /* --- 修改点：在平板端应用半透明炫彩扫光 --- */
    .title::before {
        background: linear-gradient(
            to right,
            rgba(255, 0, 0, 0.5),    /* 透明红 */
            rgba(255, 127, 0, 0.5),  /* 透明橙 */
            rgba(255, 255, 0, 0.5),  /* 透明黄 */
            rgba(0, 255, 0, 0.5),    /* 透明绿 */
            rgba(0, 0, 255, 0.5),    /* 透明蓝 */
            rgba(75, 0, 130, 0.5),   /* 透明靛 */
            rgba(148, 0, 211, 0.5)   /* 透明紫 */
        );
    }
}

/* --- 手机设备 (宽度小于等于 600px) --- */
@media (max-width: 600px) {
    .container {
        width: 95%;
        padding: 15px 10px;
    }

    /* --- 手机端标题的友好样式 --- */
    .title {
        font-size: 1.4rem;
        font-family: 'Microsoft Yahei', '微软雅黑', sans-serif;
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        letter-spacing: normal;
        border-radius: 15px;
    }

    /* --- 在手机端禁用扫光动画 --- */
    .title::before {
        animation: none;
    }

    .content-box {
        padding: 1.5rem 1.2rem;
    }

    .quote-wrapper {
        margin-bottom: 1.5rem;
    }

    #quote {
        font-size: 1.2rem;
        letter-spacing: 0.5px;
    }
    
    /* --- 手机端操作按钮样式 --- */
    .action-buttons {
        gap: 10px;
        bottom: 40px;
    }
    
    .action-buttons button {
        font-size: 0.85rem;
        padding: 8px 15px;
        border-radius: 20px;
    }

    footer {
        font-size: 0.7rem;
    }

    .notification-content {
        min-width: 80%;
        margin: 0 20px;
    }
}