/* ============================================================
   fixes.css — 2026-11 统一修复层（最后加载，覆盖旧样式）
   1. 彩虹流动标题  2. 图标栏不换行、按屏幕等比缩放
   3. 网址块小人：去色边 + 呼吸漂浮动效  4. 手机端看板娘不遮挡
   5. 二维码弹窗  6. AI 回复思考进度/流式输出
   ============================================================ */

/* 原 Pacifico 字体文件是裁剪过的子集，缺 I / J / a 等字母（导致 "I'm Jay" 变成别的字体），这里加载完整版，失败再回退本地 */
@font-face {
    font-family: "JayTitle";
    src: url("https://registry.npmmirror.com/@fontsource/pacifico/5.0.13/files/files/pacifico-latin-400-normal.woff2") format("woff2"),
         url("https://cdn.jsdelivr.net/npm/@fontsource/pacifico@5.0.13/files/pacifico-latin-400-normal.woff2") format("woff2"),
         url("../fonts/Pacifico-Regular.ttf") format("truetype");
    font-display: swap;
}

/* ---------- 1. 标题：不断变换颜色的流光渐变 ---------- */
.welcome .gradientText,
.gradientText {
    font-family: "JayTitle", "title", cursive !important;
    background: linear-gradient(90deg,
        #ff4d8d, #ff9a3c, #ffe14d, #4dff9a, #3cc8ff, #8a6bff, #ff4dd8, #ff4d8d) !important;
    background-size: 300% 100% !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    animation: jayHue 6s linear infinite !important;
    filter: drop-shadow(0 2px 12px rgba(140, 107, 255, 0.35));
    letter-spacing: 0 !important;
    word-spacing: 0.06em;
    white-space: nowrap;
    overflow-wrap: normal !important;
    line-height: 1.5 !important;
    padding: 0.05em 0.25em 0.32em !important; /* 给 y/g 的花体下行笔画留足空间，避免被裁切 */
    overflow: visible !important;
    display: inline-block !important;
    width: auto !important;
}
@keyframes jayHue {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* ---------- 2. 顶部图标栏 ---------- */
.iconContainer {
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: clamp(6px, 2.4vw, 12px) !important;
    height: auto !important;
    padding: 0 !important;
    max-width: 100%;
}
.iconContainer .iconItem {
    margin: 0 !important;
}
.switch {
    margin-left: 0 !important;
}

@media (max-width: 800px) {
    .welcome {
        font-size: clamp(30px, 10vw, 48px) !important;
        margin: 6px 0 4px !important;
    }
    .index-logo {
        width: clamp(110px, 36vw, 160px) !important;
        max-width: none !important;
        margin-top: 6px !important;
    }
    .iconContainer {
        margin-top: 8px !important;
    }
    .iconContainer .iconItem,
    .iconContainer .switch {
        width: clamp(38px, 11.5vw, 48px) !important;
        min-width: 0 !important;
        height: clamp(38px, 11.5vw, 48px) !important;
        min-height: 0 !important;
        border-radius: 12px !important;
        flex: 0 0 auto;
    }
    .iconContainer .switch {
        width: clamp(46px, 13.5vw, 56px) !important;
    }
    .iconContainer .iconItem img,
    .iconContainer .iconItem svg {
        width: 52% !important;
        height: 52% !important;
        margin: 0 !important;
    }
    /* 手机上没有 hover，悬停展开会把图标挤乱 */
    .iconItem:hover { width: clamp(38px, 11.5vw, 48px) !important; transform: none !important; }
    .iconItem:hover .iconTip { display: none !important; }
    .onoffswitch { transform: scale(0.82); transform-origin: center; }
}

/* ---------- 3. 网址块（banner 资源板块） ---------- */
.projectList {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)) !important;
    gap: 12px !important;
}
.projectItem {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}
.projectItemLeft {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.projectItemLeft h2 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.projectItemLeft p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block !important;
}
.projectItem:hover h2 { font-size: inherit !important; }
.projectItemRight {
    flex: 0 0 auto !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
}
.projectItemRight img {
    width: 46px !important;
    height: 58px !important;
    object-fit: contain;
    filter: none !important;
    image-rendering: auto;
    animation: jayBob 3.2s ease-in-out infinite !important;
    transform-origin: 50% 90%;
    will-change: transform;
}
/* 每个小人节奏错开，看起来更自然 */
.projectItem:nth-child(2n) .projectItemRight img { animation-delay: -0.8s !important; animation-duration: 3.6s !important; }
.projectItem:nth-child(3n) .projectItemRight img { animation-delay: -1.7s !important; animation-duration: 2.9s !important; }
.projectItem:nth-child(5n) .projectItemRight img { animation-delay: -2.3s !important; }

.projectItem:hover .projectItemRight img {
    animation: jayHop 0.7s cubic-bezier(.3,1.6,.5,1) both !important;
    filter: none !important;
    transform: none;
}
@keyframes jayBob {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25%      { transform: translateY(-3px) rotate(-3deg); }
    50%      { transform: translateY(-5px) rotate(0deg); }
    75%      { transform: translateY(-3px) rotate(3deg); }
}
@keyframes jayHop {
    0%   { transform: translateY(0) scale(1, 1); }
    25%  { transform: translateY(2px) scale(1.08, 0.9); }
    55%  { transform: translateY(-10px) scale(0.95, 1.06) rotate(-6deg); }
    80%  { transform: translateY(0) scale(1.04, 0.96); }
    100% { transform: translateY(0) scale(1, 1); }
}
.more-icon { width: 34px; height: 34px; }

@media (max-width: 800px) {
    .projectList {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        padding: 0 2px;
    }
    .projectItem {
        padding: 12px 10px 12px 14px !important;
        min-height: 76px !important;
        height: auto !important;
        border-radius: 16px !important;
    }
    .projectItemLeft h2 { font-size: clamp(14px, 4.1vw, 16px) !important; }
    .projectItemLeft p  { font-size: clamp(11px, 3.3vw, 12px) !important; margin-top: 5px !important; }
    .projectItemRight img { width: 38px !important; height: 48px !important; }
}
@media (max-width: 340px) {
    .projectList { grid-template-columns: 1fr !important; }
}

/* ---------- 4. 看板娘位置保持原样（底部居中），只给内容留出底部空间 ---------- */
@media (max-width: 768px) {
    .jay-right { padding-bottom: 150px !important; }
}

/* ---------- 5. 二维码弹窗 ---------- */
.tc-main {
    background: #fff !important;
    padding: 10px;
    min-height: 0 !important;
    width: min(82vw, 320px) !important;
    max-width: 320px !important;
}
.tc-img {
    display: block;
    width: 100% !important;
    height: auto !important;
    border-radius: 10px;
}

/* ---------- 6. AI 思考进度 + 流式输出 ---------- */
.ai-thinking-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    background: linear-gradient(90deg, rgba(255,255,255,.55) 0%, #fff 50%, rgba(255,255,255,.55) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: aiShimmer 1.6s linear infinite;
}
.ai-step-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #6fe3ff;
    box-shadow: 0 0 0 0 rgba(111, 227, 255, .6);
    animation: aiPulse 1.1s ease-out infinite;
    flex: 0 0 auto;
    -webkit-text-fill-color: initial;
}
.ai-step-count {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(111, 227, 255, .18);
    -webkit-text-fill-color: #9eeaff;
}
.ai-caret {
    display: inline-block;
    width: 7px; height: 1em;
    margin-left: 2px;
    vertical-align: -2px;
    background: #6fe3ff;
    animation: aiBlink 0.9s steps(2) infinite;
}
.ai-message-bubble { white-space: pre-wrap; word-break: break-word; }
@keyframes aiShimmer { to { background-position: -200% 0; } }
@keyframes aiPulse {
    0% { box-shadow: 0 0 0 0 rgba(111, 227, 255, .6); }
    100% { box-shadow: 0 0 0 9px rgba(111, 227, 255, 0); }
}
@keyframes aiBlink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .gradientText, .projectItemRight img { animation: none !important; }
}

.welcome { overflow: visible !important; text-align: center; }

/* ---------- 7. AI 回复头像放在气泡顶部，不再沉到最下面 ---------- */
.ai-message-row { align-items: flex-start !important; }
.ai-message-avatar { margin-top: 2px; }

/* ---------- 8. 通知弹窗（banner）重构：长幅头图 + 标题独占一行 ---------- */
#moodModal .mood-modal-content {
    position: relative;
    width: min(92vw, 460px) !important;
    max-width: 460px !important;
    max-height: 86vh !important;
    padding: 0 !important;
    overflow: hidden auto !important;
    border-radius: 24px !important;
    background: linear-gradient(180deg, rgba(26, 28, 36, 0.96), rgba(13, 14, 19, 0.97)) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55) !important;
}
#moodModal .mood-modal-image {
    width: 100% !important;
    aspect-ratio: 21 / 9;
    height: auto !important;
    max-height: 190px !important;
    object-fit: cover;
    margin: 0 !important;
    border-radius: 0 !important;
    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
            mask-image: linear-gradient(180deg, #000 70%, transparent);
}
#moodModal .mood-modal-header {
    display: block !important;
    padding: 18px 22px 0 !important;
    margin: 0 !important;
    border: 0 !important;
}
#moodModal .mood-modal-header h2 {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding-right: 40px !important;
    font-size: clamp(18px, 5vw, 22px) !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
    letter-spacing: 0.01em;
    text-wrap: balance;
    color: #fff !important;
}
#moodModal .mood-modal-close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 36px !important; height: 36px !important;
    min-width: 36px !important; min-height: 36px !important;
    border-radius: 50% !important;
    display: grid !important; place-items: center;
    font-size: 20px !important; line-height: 1 !important;
    color: #fff !important;
    background: rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    z-index: 3;
}
#moodModal .mood-modal-body {
    padding: 12px 22px 4px !important;
    margin: 0 !important;
    border: 0 !important;
}
#moodModal .mood-modal-body p {
    font-size: 14.5px !important;
    line-height: 1.85 !important;
    color: rgba(255, 255, 255, 0.78) !important;
    letter-spacing: 0.02em;
    text-align: left !important;
    word-break: break-word;
}
#moodModal .mood-modal-body a { color: #6fe3ff !important; word-break: break-all; }
#moodModal .mood-modal-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px;
    padding: 14px 22px 18px !important;
    margin: 8px 0 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
}
#moodModal .mood-modal-footer #moodDate {
    font-size: 12px; color: rgba(255, 255, 255, 0.45);
    padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06);
}
#moodModal .mood-nav { display: flex !important; gap: 8px !important; }
#moodModal .mood-nav-btn {
    width: 36px !important; height: 36px !important;
    min-width: 36px !important; min-height: 36px !important;
    border-radius: 50% !important;
    font-size: 18px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
}
