:root {
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --bg-color: #000000;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-blur: 30px;
    --glass-saturate: 180%;
    --blob-1: #4f46e5;
    --blob-2: #c026d3;
    --blob-3: #0ea5e9;
}

[data-theme="light"] {
    --bg-color: #F5F5F7;
    --text-primary: #1d1d1f;
    --text-secondary: rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(0, 0, 0, 0.08);
    --blob-1: #A7F3D0;
    --blob-2: #BAE6FD;
    --blob-3: #DDD6FE;
}

* { margin: 0; padding: 0; box-sizing: border-box; transition: background 0.4s, color 0.4s, transform 0.2s; }
body { background: var(--bg-color); color: var(--text-primary); font-family: var(--font-stack); overflow-x: hidden; line-height: 1.5; }

/* 背景动画 */
.ambient-background { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; animation: float 15s infinite alternate ease-in-out; }
.blob-1 { top: -10%; left: -5%; width: 40vw; height: 40vw; background: var(--blob-1); }
.blob-2 { bottom: -10%; right: -5%; width: 50vw; height: 50vw; background: var(--blob-2); animation-delay: -2s; }
.blob-3 { top: 30%; left: 30%; width: 30vw; height: 30vw; background: var(--blob-3); opacity: 0.3; }
@keyframes float { 100% { transform: translate(40px, 60px) scale(1.1); } }

/* 玻璃质感 */
.glass, .glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border);
}

/* 导航 */
.nav-bar { position: sticky; top: 15px; margin: 0 auto; width: 92%; max-width: 1100px; border-radius: 20px; padding: 0.8rem 1.8rem; display: flex; justify-content: space-between; align-items: center; z-index: 100; }
.logo { font-weight: 700; font-size: 1.2rem; }
.nav-actions { display: flex; gap: 1.2rem; align-items: center; }
.nav-link, #theme-toggle { color: var(--text-primary); cursor: pointer; background: none; border: none; font-size: 1.1rem; opacity: 0.7; }
.nav-link:hover, #theme-toggle:hover { opacity: 1; transform: translateY(-1px); }

/* 容器 */
.container { max-width: 1100px; margin: 3rem auto; padding: 0 1.5rem; }

/* Hero 卡片 */
.hero { border-radius: 30px; padding: 4rem 2rem; text-align: center; margin-bottom: 3rem; }
.avatar-wrapper { width: 110px; height: 110px; margin: 0 auto 1.5rem; border-radius: 50%; border: 4px solid var(--glass-border); overflow: hidden; }
#avatar { width: 100%; height: 100%; object-fit: cover; }
h1 { font-size: 2.5rem; letter-spacing: -1px; margin-bottom: 0.5rem; }
.bio { color: var(--text-secondary); max-width: 600px; margin: 0 auto 2rem; }
.stats-row { display: flex; justify-content: center; gap: 3rem; }
.stat-num { display: block; font-size: 1.6rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; }

/* 项目网格 */
.section-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 1.5rem; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; margin-bottom: 4rem; }
.card { border-radius: 24px; padding: 1.8rem; text-decoration: none; color: inherit; display: flex; flex-direction: column; min-height: 200px; }
.card:hover { transform: translateY(-5px); background: rgba(255,255,255,0.08); }
.repo-name { font-weight: 700; margin-bottom: 0.8rem; display: flex; align-items: center; gap: 0.5rem; }
.repo-desc { color: var(--text-secondary); font-size: 0.9rem; flex: 1; margin-bottom: 1.5rem; }
.repo-meta { display: flex; justify-content: space-between; font-size: 0.8rem; opacity: 0.8; }

/* Home Show 头部：搜索与按钮对齐的关键点 */
.home-show-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.home-show-controls {
    display: flex;
    align-items: center;
    gap: 10px; /* 搜索框和按钮的间距 */
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: var(--text-primary);
    width: 220px;
    font-size: 0.9rem;
    transition: width 0.3s ease;
}

.search-input:focus {
    width: 280px;
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

.search-icon {
    position: absolute;
    left: 0.9rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    pointer-events: none;
}

.generate-btn {
    background: var(--text-primary);
    color: var(--bg-color);
    border: none;
    border-radius: 12px;
    padding: 0.6rem 1.2rem; /* 与输入框高度匹配 */
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.generate-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* 文件卡片网格 */
.home-show-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.file-card { border-radius: 18px; padding: 1.2rem; cursor: pointer; display: flex; flex-direction: column; min-height: 170px; position: relative; }
.file-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.08); }
.file-card-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; font-size: 1.1rem; }
.file-card-icon.code { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.file-card-icon.binary { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.file-card-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-card-path { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 0.8rem; overflow: hidden; text-overflow: ellipsis; }
.file-card-content { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: auto; }
.file-card-size { position: absolute; top: 1.2rem; right: 1.2rem; font-size: 0.7rem; opacity: 0.5; }

/* 骨架屏 */
.skeleton { background: linear-gradient(90deg, var(--glass-border) 25%, rgba(255,255,255,0.05) 50%, var(--glass-border) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border: none; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* 页脚 */
.glass-footer { text-align: center; padding: 3rem; margin-top: 5rem; color: var(--text-secondary); font-size: 0.9rem; border-top: 1px solid var(--glass-border); }

/* 响应式调整 */
@media (max-width: 768px) {
    .home-show-header { flex-direction: column; align-items: flex-start; }
    .home-show-controls { width: 100%; }
    .search-container { flex: 1; }
    .search-input { width: 100% !important; }
    h1 { font-size: 2rem; }
    .stats-row { gap: 1.5rem; }
}