/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 浅色模式颜色 */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-tertiary: #94a3b8;
        --border-color: #334155;
        --accent-color: #818cf8;
        --accent-hover: #6366f1;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    }
    
    /* xAI 风格分类标签深色模式优化 */
    .category-tab {
        background: rgba(139, 157, 195, 0.15);
        border-color: rgba(255, 255, 255, 0.2);
        color: rgba(255, 255, 255, 0.9);
    }
    
    .category-tab:hover {
        background: rgba(139, 157, 195, 0.25);
        border-color: rgba(255, 255, 255, 0.35);
    }
    
    .category-tab.active {
        background: linear-gradient(135deg, rgba(139, 157, 195, 0.6), rgba(90, 108, 125, 0.6));
        border-color: rgba(139, 157, 195, 0.7);
        color: white;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 80px; /* 为底部导航留出空间 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
}

/* ==================== 头部样式 ==================== */
.header {
    background: #000000;
    color: white;
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 背景图片层 - 使用缩放呼吸动画 */
.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../images/wormhole-medium.jpg'); /* 默认使用中等尺寸图片 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: headerZoomBreathing 20s ease-in-out infinite;
    z-index: 0;
}

/* 渐变遮罩层 + xAI 风格背景光晕 */
.header::after {
    content: '';
    position: absolute;
    inset: 0;
    /* 组合渐变遮罩和星空灰光晕 */
    background: 
        radial-gradient(ellipse at 80% 30%, 
            rgba(139, 157, 195, 0.15) 0%,
            rgba(139, 157, 195, 0.08) 20%,
            transparent 40%),
        radial-gradient(ellipse at center, 
            transparent 0%, 
            rgba(0, 0, 0, 0.15) 70%,
            rgba(0, 0, 0, 0.35) 100%);
    z-index: 1;
    animation: glowPulse 8s ease-in-out infinite;
}

/* 光晕脉动动画 */
@keyframes glowPulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* 缩放呼吸动画 */
@keyframes headerZoomBreathing {
    0%, 100% { 
        transform: scale(1);
        filter: brightness(0.9);
    }
    50% { 
        transform: scale(1.1);
        filter: brightness(1);
    }
}

.title {
    font-size: 1.75rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
    /* xAI 风格金属质感渐变 */
    background: linear-gradient(
        180deg,
        #4a4a4a 0%,
        #7a7a7a 30%,
        #c0c0c0 50%,
        #ffffff 70%,
        #e0e0e0 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 30px rgba(197, 208, 224, 0.5))
            drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
    animation: titleShine 3s ease-in-out infinite;
    letter-spacing: -0.02em;
}

/* 标题光泽动画 */
@keyframes titleShine {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(197, 208, 224, 0.4))
                drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(197, 208, 224, 0.7))
                drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
    }
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.95;
    font-weight: 400;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9),
                 0 4px 8px rgba(0, 0, 0, 0.8),
                 0 0 15px rgba(0, 0, 0, 0.5);
}

.clear-all-btn {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    z-index: 2;
}

.clear-all-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.clear-all-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* ==================== 主内容区 ==================== */
.main-content {
    padding: 1.5rem;
}

/* ==================== 搜索框样式 ==================== */
.search-box {
    position: relative;
    margin-bottom: 0;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.25rem;
    font-size: 1rem;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    /* xAI 风格玻璃态背景 */
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.search-input:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 48px rgba(139, 157, 195, 0.15);
    transform: translateY(-2px);
}

.search-input:focus {
    outline: none;
    border-color: rgba(139, 157, 195, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 48px rgba(139, 157, 195, 0.3),
                0 0 0 4px rgba(139, 157, 195, 0.1);
    transform: translateY(-2px);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.clear-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.clear-btn.show {
    display: flex;
}

.clear-btn:hover {
    background: var(--danger-color);
    color: white;
}

.clear-btn:active {
    transform: translateY(-50%) scale(0.9);
}

/* ==================== 欢迎卡片（新手引导）==================== */
.welcome-card {
    position: relative;
    margin: 1.5rem 0 1rem 0;
    padding: 1rem 1.5rem;
    min-height: 100px;
    background: var(--bg-primary);
    border-radius: 16px;
    /* 入场动画 */
    animation: welcomeSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* 为边框动画留出空间 */
    isolation: isolate;
}

/* 欢迎卡片入场动画 */
@keyframes welcomeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 欢迎卡片退出动画 */
@keyframes welcomeSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* 动态渐变边框底层 - 360度环绕旋转 */
.welcome-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: conic-gradient(
        from var(--angle),
        #0084FF 0deg,
        #00D4FF 60deg,
        #0084FF 120deg,
        #0050FF 180deg,
        #0084FF 240deg,
        #00D4FF 300deg,
        #0084FF 360deg
    );
    border-radius: 16px;
    padding: 3px; /* 边框宽度 */
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    filter: drop-shadow(0 0 8px rgba(0, 132, 255, 0.6));
    animation: borderRotate 1.5s linear infinite;
}

/* 边框环绕旋转动画 - 让渐变角度旋转 */
@keyframes borderRotate {
    0% {
        --angle: 0deg;
    }
    100% {
        --angle: 360deg;
    }
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* 关闭按钮 */
.welcome-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1;
}

.welcome-close:hover {
    background: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

.welcome-close:active {
    transform: rotate(90deg) scale(0.9);
}

/* 标题 */
.welcome-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 步骤列表 - 横向布局 */
.welcome-steps {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.welcome-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid rgba(0, 132, 255, 0.2);
    border-radius: 12px;
    transition: all 0.3s;
    flex: 1;
    min-width: 0;
}

.welcome-step:hover {
    border-color: rgba(0, 132, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 132, 255, 0.15);
}

.step-icon {
    font-size: 1.75rem;
    line-height: 1;
    flex-shrink: 0;
}

.step-content {
    text-align: center;
}

.step-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
}

/* 深色模式优化 */
@media (prefers-color-scheme: dark) {
    .welcome-step {
        border-color: rgba(0, 132, 255, 0.3);
    }
    
    .welcome-step:hover {
        border-color: rgba(0, 132, 255, 0.6);
    }
}

/* 响应式优化 */
@media (max-width: 767px) {
    .welcome-card {
        padding: 0.875rem 1rem;
        margin: 1rem 0;
        min-height: 90px;
    }
    
    .welcome-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .welcome-steps {
        gap: 0.5rem;
    }
    
    .welcome-step {
        padding: 0.5rem;
        gap: 0.35rem;
    }
    
    .step-icon {
        font-size: 1.5rem;
    }
    
    .step-title {
        font-size: 0.75rem;
    }
}

/* ==================== 常用平台组件 ==================== */
.frequent-platforms {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    margin-bottom: 0;
}

.frequent-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.frequent-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.frequent-icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frequent-icon-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.frequent-icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: currentColor;
}

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

/* ==================== 分类标签栏样式 ==================== */
.category-container {
    margin-bottom: 0.5rem;
    position: relative;
}

.category-tabs {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 1rem 0;
    /* 渐变遮罩提示可滚动 */
    mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent);
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 16px;
    /* xAI Try Grok 按钮风格：半透明玻璃态背景 */
    background: rgba(125, 129, 135, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1.4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    white-space: nowrap;
}

.category-tab:hover {
    background: rgba(125, 129, 135, 0.35);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-tab:active {
    transform: translateY(0) scale(0.97);
}

.category-tab.active {
    /* xAI 风格星空灰渐变背景 */
    background: linear-gradient(135deg, rgba(139, 157, 195, 0.5), rgba(90, 108, 125, 0.5));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 157, 195, 0.6);
    color: white;
    /* xAI 风格发光效果 - 紧凑版，避免被遮挡 */
    box-shadow: 0 2px 8px rgba(139, 157, 195, 0.5),
                0 0 12px rgba(139, 157, 195, 0.4),
                0 0 20px rgba(139, 157, 195, 0.2);
    animation: categoryGlow 2s ease-in-out infinite;
}

/* 分类标签发光动画 - 紧凑版 */
@keyframes categoryGlow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(139, 157, 195, 0.5),
                    0 0 12px rgba(139, 157, 195, 0.4),
                    0 0 20px rgba(139, 157, 195, 0.2);
    }
    50% {
        box-shadow: 0 2px 10px rgba(139, 157, 195, 0.6),
                    0 0 16px rgba(139, 157, 195, 0.5),
                    0 0 24px rgba(139, 157, 195, 0.3);
    }
}

.category-icon {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.9;
}

.category-name {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: inherit;
}

/* ==================== 平台卡片网格 ==================== */
.platforms-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    animation: platformsFadeIn 0.3s ease-out;
}

/* 平台切换动画 */
@keyframes platformsFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.platform-card {
    /* 玻璃拟态效果 */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-height: 100px;
    position: relative;
    overflow: hidden;
}

/* xAI 风格旋转光晕效果 - 使用平台主题色 */
.platform-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        var(--brand-color-glow-center, rgba(139, 157, 195, 0.18)) 0%,
        var(--brand-color-glow-mid, rgba(184, 197, 214, 0.12)) 30%,
        transparent 50%
    );
    opacity: 0;
    z-index: 0;
    transition: opacity 0.4s;
}

/* 主题色发光边框 */
.platform-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(
        135deg,
        var(--brand-color-glow-center, rgba(139, 157, 195, 0.5)),
        var(--brand-color-glow-mid, rgba(184, 197, 214, 0.5))
    );
    border-radius: 20px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s;
    filter: blur(12px);
}

.platform-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px var(--brand-shadow, rgba(139, 157, 195, 0.35));
}

.platform-card:hover::before {
    opacity: 1;
    animation: rotateGlow 4s linear infinite;
}

.platform-card:hover::after {
    opacity: 0.4;
}

/* 旋转光晕动画 */
@keyframes rotateGlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.platform-card:active {
    transform: translateY(-4px) scale(0.98);
}

.platform-card.disabled {
    /* 移除灰色蒙版效果，保持正常显示 */
    cursor: pointer;
}

/* 禁用状态下的悬停效果与正常状态一致 */
.platform-card.disabled:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px var(--brand-shadow, rgba(139, 157, 195, 0.35));
}

.platform-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    font-size: 2rem; /* Emoji 字体大小 */
}

/* SVG 图标样式 */
.platform-icon svg {
    width: 100%;
    height: 100%;
    /* fill: currentColor; */  /* 已注释：让 SVG 保持原有颜色，避免品牌色被覆盖 */
    transition: transform 0.3s;
}

.platform-card:hover .platform-icon svg {
    transform: scale(1.1);
}

/* 各平台品牌色 */
.platform-card[data-platform="wechat"] .platform-icon {
    color: #07C160;
}

.platform-card[data-platform="xiaohongshu"] .platform-icon {
    color: #FF2442;
}

.platform-card[data-platform="weibo"] .platform-icon {
    color: #E6162D;
}

.platform-card[data-platform="douyin"] .platform-icon {
    color: #000000;
}

.platform-card[data-platform="x"] .platform-icon {
    color: #000000;
}

.platform-card[data-platform="instagram"] .platform-icon {
    color: #E4405F;
}

.platform-card[data-platform="youtube"] .platform-icon {
    color: #FF0000;
}

.platform-card[data-platform="bilibili"] .platform-icon {
    color: #00A1D6;
}

/* 深色模式下的图标颜色 */
@media (prefers-color-scheme: dark) {
    .platform-card[data-platform="douyin"] .platform-icon,
    .platform-card[data-platform="x"] .platform-icon {
        color: #ffffff;
    }
}

.platform-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    line-height: 1.2;
}


/* ==================== 历史记录样式 ==================== */
.history-content {
    padding-bottom: 2rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-item:active {
    transform: scale(0.98);
}

.history-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.history-platform-icon {
    font-size: 1.5rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.history-platform-icon svg {
    width: 28px;
    height: 28px;
    display: block;
}

.history-query {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.history-platform-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.history-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
}

.history-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    white-space: nowrap;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.history-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.history-btn.delete-btn:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.history-btn:active {
    transform: scale(0.95);
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    display: none;
}

.empty-state.show {
    display: block;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-text {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.empty-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.empty-link:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* ==================== 底部导航 ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    padding: 1.25rem 2rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -0.25rem;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.8);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-item:active {
    transform: scale(0.98);
}

.nav-item.active {
    color: rgba(255, 255, 255, 1);
}

.nav-item.active::after {
    transform: translateX(-50%) scaleX(1);
    background: rgba(255, 255, 255, 1);
}

.nav-icon {
    display: none;
}

.nav-label {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Text', sans-serif;
}

/* ==================== Toast通知 ==================== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 80%;
    text-align: center;
    backdrop-filter: blur(10px);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ==================== 搜索框动画效果 ==================== */
/* 脉冲闪烁动画 - 星空灰主题 */
@keyframes inputPulse {
    0% { 
        border-color: rgba(139, 157, 195, 0.8);
        box-shadow: 0 0 0 0 rgba(139, 157, 195, 0.8);
    }
    25% { 
        border-color: rgba(139, 157, 195, 0.8);
        box-shadow: 0 0 0 8px rgba(139, 157, 195, 0.4);
    }
    50% { 
        border-color: rgba(139, 157, 195, 0.8);
        box-shadow: 0 0 0 15px rgba(139, 157, 195, 0);
    }
    75% { 
        border-color: rgba(139, 157, 195, 0.8);
        box-shadow: 0 0 0 8px rgba(139, 157, 195, 0.4);
    }
    100% { 
        border-color: rgba(139, 157, 195, 0.8);
        box-shadow: 0 0 0 0 rgba(139, 157, 195, 0);
    }
}

.search-input.pulse-animation {
    animation: inputPulse 1.5s ease-in-out !important;
    transition: none !important;
}

/* ==================== 设置页面样式 ==================== */
.settings-section {
    margin-bottom: 2rem;
}

.settings-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 统计卡片网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 0.75rem;
    text-align: center;
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* 最常使用平台 */
.top-platforms {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-platform-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s;
}

.top-platform-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

.top-platform-rank {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
}

.top-platform-icon {
    font-size: 1.75rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-platform-icon svg {
    width: 28px;
    height: 28px;
    display: block;
}

.top-platform-info {
    flex: 1;
}

.top-platform-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.top-platform-category {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.top-platform-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-color);
}

.empty-hint {
    text-align: center;
    color: var(--text-tertiary);
    padding: 2rem;
    font-size: 0.875rem;
}

/* 设置按钮 */
.settings-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.settings-btn {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.settings-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.settings-btn:active {
    transform: translateY(0) scale(0.98);
}

.settings-btn.danger:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

/* 关于信息 */
.about-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    line-height: 1.8;
}

.about-info p {
    margin: 0.25rem 0;
}

.about-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.about-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.about-link:hover {
    opacity: 0.8;
}

/* ==================== 响应式设计 ==================== */

/* 平板 (768px - 1024px) */
@media (min-width: 768px) {
    .platforms-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
    
    .platform-card {
        padding: 1.5rem;
        min-height: 120px;
    }
    
    .platform-icon {
        width: 3rem;
        height: 3rem;
        font-size: 2.25rem;
    }
    
    .platform-name {
        font-size: 0.9rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 2rem;
    }
}

/* 桌面 (>1024px) */
@media (min-width: 1024px) {
    .platforms-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.25rem;
    }
    
    .platform-card {
        padding: 1.75rem;
        min-height: 140px;
    }
    
    .platform-icon {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 2.5rem;
    }
    
    .platform-name {
        font-size: 0.95rem;
    }
    
    .header {
        padding: 2.5rem 2rem;
    }
    
    .main-content {
        padding: 2.5rem;
    }
    
    body {
        padding-bottom: 0;
    }
    
    .bottom-nav {
        gap: 2rem;
        padding: 1rem 1.5rem;
    }
    
    .nav-label {
        font-size: 0.8rem;
        letter-spacing: 0.12em;
    }
}

/* ==================== xAI 风格粒子效果 ==================== */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: particleFloat 10s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* 平台图标悬停放大 */
.platform-card:hover .platform-icon {
    transform: scale(1.15) rotate(5deg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 超大屏幕优化 */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .platforms-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 1.5rem;
    }
    
    .platform-card {
        padding: 2rem;
        min-height: 160px;
    }
    
    .platform-icon {
        width: 4rem;
        height: 4rem;
        font-size: 3rem;
    }
    
    .platform-name {
        font-size: 1rem;
    }
}

/* ==================== 微信浏览器引导提示 ==================== */
.wechat-tip {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
    cursor: pointer;
}

.wechat-tip-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1.5rem;
    margin-top: 3rem;
    margin-right: 1rem;
}

.wechat-tip-arrow {
    animation: arrowBounce 1.5s ease-in-out infinite;
}

.wechat-tip-arrow svg {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

@keyframes arrowBounce {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(8px, -8px);
    }
}

.wechat-tip-text {
    text-align: right;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.wechat-tip-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: #ffffff;
}

.wechat-tip-desc {
    font-size: 1.125rem;
    line-height: 1.8;
    margin: 0.5rem 0;
    color: rgba(255, 255, 255, 0.95);
}

.wechat-tip-desc strong {
    color: #4CAF50;
    font-weight: 700;
    font-size: 1.25rem;
}

.wechat-tip-hint {
    font-size: 0.875rem;
    margin-top: 2rem;
    opacity: 0.7;
    color: rgba(255, 255, 255, 0.7);
}

/* 响应式优化 */
@media (max-width: 767px) {
    .wechat-tip-content {
        margin-top: 1.5rem;
        margin-right: 0.5rem;
    }
    
    .wechat-tip-arrow svg {
        width: 70px;
        height: 70px;
    }
    
    .wechat-tip-title {
        font-size: 1.25rem;
    }
    
    .wechat-tip-desc {
        font-size: 1rem;
    }
    
    .wechat-tip-desc strong {
        font-size: 1.125rem;
    }
    
    .wechat-tip-hint {
        font-size: 0.8rem;
    }
}

/* ==================== 响应式背景图片优化 ==================== */
/* 移动设备（小屏幕）- 使用小尺寸图片以提升性能和节省流量 */
@media (max-width: 767px) {
    .header::before {
        background-image: url('../images/wormhole-small.jpg'); /* 640x360 */
        background-size: cover;
    }
}

/* 平板设备 - 使用中等尺寸图片 */
@media (min-width: 768px) and (max-width: 1023px) {
    .header::before {
        background-image: url('../images/wormhole-medium.jpg'); /* 1920x1080 */
        background-size: cover;
    }
}

/* 桌面设备 - 使用高质量图片 */
@media (min-width: 1024px) {
    .header::before {
        background-image: url('../images/wormhole-medium.jpg'); /* 1920x1080 */
        background-size: cover;
    }
}

/* 高分辨率屏幕优化（Retina显示屏等） */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .header::before {
        /* 高分辨率屏幕保持清晰度 */
        background-size: cover;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 低性能设备优化 - 减少动画复杂度 */
@media (prefers-reduced-motion: reduce) {
    .header::before {
        animation: none;
    }
    
    @keyframes headerZoomBreathing {
        0%, 100% { 
            transform: scale(1);
            filter: none;
        }
    }
}

/* ==================== 历史记录响应式布局 ==================== */
@media (max-width: 767px) {
    body {
        padding-bottom: 65px; /* 调整为更小的底部留白 */
    }
    
    .history-item {
        padding: 0.75rem;
    }
    
    .history-query {
        font-size: 0.9rem;
    }
    
    .history-platform-name {
        font-size: 0.75rem;
    }
    
    .history-time {
        font-size: 0.7rem;
    }
    
    .history-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .history-header {
        margin-bottom: 0.5rem;
    }
    
    .history-meta {
        margin-bottom: 0.5rem;
    }
    
    /* 手机端底部导航栏缩短 */
    .bottom-nav {
        gap: 2rem;
        padding: 0.875rem 1.5rem;
    }
}

/* ==================== 模态框样式 ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    max-width: 90%;
    width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    border: 1px solid var(--border-color);
}

.modal-title {
    margin: 0 0 1.5rem 0;
    text-align: center;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.modal-qrcode {
    text-align: center;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.modal-qrcode img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.modal-desc {
    margin: 0;
    text-align: center;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.85;
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover {
    color: var(--text-primary);
    background-color: var(--hover-bg);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        padding: 1.5rem;
    }
    
    .modal-title {
        font-size: 1.1rem;
        margin-bottom: 1.25rem;
    }
    
    .modal-qrcode {
        padding: 0.75rem;
    }
    
    .modal-desc {
        font-size: 0.9rem;
    }
}

