/* =========================================================
   VibePort — 现代开发者工具风格
   设计参考：Linear / Vercel / Raycast
   ========================================================= */

/* ---------- 1. 设计变量 ---------- */
:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-hover: #fafafa;
    --border: #ebebeb;
    --border-strong: #e0e0e0;

    --text-primary: #0a0a0a;
    --text-secondary: #525252;
    --text-tertiary: #a3a3a3;
    --text-quaternary: #d4d4d4;

    --brand: #2563eb;
    --brand-hover: #1d4ed8;
    --brand-light: #eff6ff;
    --brand-text: #1d4ed8;

    --amber: #f59e0b;
    --amber-light: #fef3c7;
    --amber-text: #b45309;

    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --radius-full: 9999px;

    --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- 2. 重置 ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-weight: inherit; font-size: inherit; }

/* ---------- 3. 布局 ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow { flex-grow: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.text-center { text-align: center; }
.hidden { display: none; }

/* ---------- 4. 颜色（保留兼容旧 HTML） ---------- */
.bg-white { background: var(--surface); }
.bg-gray-50 { background: var(--bg); }
.bg-blue-50 { background: var(--brand-light); }
.bg-blue-600 { background: var(--brand); }
.bg-amber-500 { background: var(--amber); }
.bg-amber-100 { background: var(--amber-light); }
.bg-yellow-100 { background: #fef9c3; }
.bg-green-100 { background: #dcfce7; }
.bg-rose-100 { background: #ffe4e6; }
.bg-orange-100 { background: #ffedd5; }
.bg-cyan-100 { background: #cffafe; }
.bg-gray-100 { background: #f3f4f6; }
.bg-indigo-100 { background: #e0e7ff; }
.bg-purple-100 { background: #f3e8ff; }
.bg-green-500 { background: #22c55e; }
.bg-green-400 { background: #4ade80; }

.text-white { color: #fff; }
.text-gray-400 { color: var(--text-tertiary); }
.text-gray-500 { color: var(--text-secondary); }
.text-gray-600 { color: var(--text-secondary); }
.text-gray-900 { color: var(--text-primary); }
.text-blue-600 { color: var(--brand-text); }
.text-amber-700 { color: var(--amber-text); }
.text-yellow-800 { color: #854d0e; }
.text-green-700 { color: #15803d; }
.text-rose-700 { color: #be123c; }
.text-orange-700 { color: #c2410c; }
.text-cyan-700 { color: #0e7490; }
.text-gray-700 { color: #374151; }
.text-indigo-700 { color: #4338ca; }
.text-purple-700 { color: #7e22ce; }

/* ---------- 5. 尺寸与间距 ---------- */
.w-full { width: 100%; }
.w-2 { width: 8px; }
.w-4 { width: 16px; }
.w-5 { width: 20px; }
.w-8 { width: 32px; }
.w-10 { width: 40px; }
.w-12 { width: 48px; }

.h-2 { height: 8px; }
.h-5 { height: 20px; }
.h-8 { height: 32px; }
.h-10 { height: 40px; }
.h-16 { height: 64px; }
.h-24 { height: 96px; }

.max-w-md { max-width: 28rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-5xl { max-width: 64rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mx-1 { margin-left: 4px; margin-right: 4px; }
.mx-8 { margin-left: 32px; margin-right: 32px; }
.mt-8 { margin-top: 32px; }
.mt-16 { margin-top: 64px; }
.mr-2 { margin-right: 8px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mb-12 { margin-bottom: 48px; }
.ml-2 { margin-left: 8px; }
.ml-auto { margin-left: auto; }
.mt-0-5 { margin-top: 2px; }

.p-5 { padding: 20px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.px-8 { padding-left: 32px; padding-right: 32px; }
.py-0-5 { padding-top: 2px; padding-bottom: 2px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-1-5 { padding-top: 6px; padding-bottom: 6px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.py-12 { padding-top: 48px; padding-bottom: 48px; }
.pt-0 { padding-top: 0; }
.pt-12 { padding-top: 48px; }
.pr-3 { padding-right: 12px; }
.pl-3 { padding-left: 12px; }
.pl-10 { padding-left: 40px; }

/* ---------- 6. 字体层次 ---------- */
.text-10px { font-size: 10px; line-height: 1.3; }
.text-xs { font-size: 12px; line-height: 1.4; }
.text-sm { font-size: 13.5px; line-height: 1.5; }
.text-base { font-size: 15px; line-height: 1.6; }
.text-lg { font-size: 17px; line-height: 1.5; }
.text-xl { font-size: 19px; line-height: 1.4; }
.text-2xl { font-size: 22px; line-height: 1.3; }
.text-3xl { font-size: 32px; line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; }

.font-medium { font-weight: 500; }
.font-bold { font-weight: 600; }
.font-extrabold { font-weight: 700; }

.tracking-tight { letter-spacing: -0.02em; }
.leading-relaxed { line-height: 1.625; }
.whitespace-nowrap { white-space: nowrap; }

/* ---------- 7. 边框与圆角 ---------- */
.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-gray-100 { border-color: var(--border); }
.border-gray-200 { border-color: var(--border-strong); }
.border-transparent { border-color: transparent; }

.rounded-md { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-md); }
.rounded-xl { border-radius: var(--radius-lg); }
.rounded-2xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ---------- 8. 阴影 ---------- */
.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-md); }

/* ---------- 9. 过渡与动效 ---------- */
.transition-colors {
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.transition {
    transition: all 0.15s ease;
}

/* ---------- 10. 定位 ---------- */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.z-10 { z-index: 10; }
.inset-y-0 { top: 0; bottom: 0; }
.pointer-events-none { pointer-events: none; }

/* ---------- 11. 杂项 ---------- */
.overflow-hidden { overflow: hidden; }
.min-w-0 { min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.self-center { align-self: center; }
.opacity-75 { opacity: 0.75; }

/* ---------- 12. 悬停 ---------- */
.hover\:bg-blue-100:hover { background: #dbeafe; }
.hover\:bg-blue-700:hover { background: var(--brand-hover); }
.hover\:bg-gray-50:hover { background: var(--surface-hover); }
.hover\:bg-amber-600:hover { background: #d97706; }
.hover\:text-blue-500:hover { color: var(--brand); }
.hover\:text-blue-800:hover { color: var(--brand-hover); }
.hover\:text-gray-900:hover { color: var(--text-primary); }

.focus\:outline-none:focus { outline: none; }
.focus\:bg-white:focus { background: var(--surface); }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15); }
.focus\:ring-blue-500:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

/* ---------- 13. 导航栏 ---------- */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo-mark {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.logo-text {
    font-weight: 650;
    font-size: 16px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* ---------- 14. 分类标签 ---------- */
.tag-active {
    background: var(--text-primary);
    color: #fff;
    font-weight: 500;
}
.tag-active:hover {
    background: #1f1f1f;
}
.tag-inactive {
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
}
.tag-inactive:hover {
    background: #f0f0f0;
    color: var(--text-primary);
}
.tag-featured {
    background: var(--amber);
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}
.tag-featured:hover {
    background: #d97706;
}
.tag-featured-active {
    background: #d97706;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

/* ---------- 15. 项目列表容器 ---------- */
.project-list-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

/* ---------- 16. 项目列表项 ---------- */
.vibe-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    transition: background-color 0.15s ease;
}
.vibe-item:hover {
    background: #fafafa;
}
.vibe-item:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.vibe-content {
    flex: 1;
    min-width: 0;
}

.vibe-actions {
    flex-shrink: 0;
    align-self: center;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: 8px;
}

/* ---------- 17. 图标方块（已修复对齐） ---------- */
.icon-box {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 16px;
    line-height: 1;
    margin-top: 2px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- 18. 分页 ---------- */
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.page-btn:hover {
    background: #f0f0f0;
    color: var(--text-primary);
}
.page-btn.active {
    background: var(--text-primary);
    color: #fff;
    font-weight: 600;
}
.page-btn.disabled {
    color: var(--text-quaternary);
    cursor: default;
}
.page-btn.disabled:hover {
    background: transparent;
}

/* ---------- 19. 广告位 ---------- */
.ad-slot {
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 13px;
    border-radius: var(--radius-lg);
}

/* ---------- 20. FAQ ---------- */
details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.15s ease;
}
details:hover {
    border-color: var(--border-strong);
}
details summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.15s ease;
    font-weight: 500;
    color: var(--text-primary);
}
details summary::-webkit-details-marker { display: none; }
details summary:hover { background: #fafafa; }
details[open] summary .chevron { transform: rotate(180deg); }
.chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
    color: var(--text-tertiary);
}
details .faq-content {
    padding: 0 22px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

/* ---------- 21. 搜索框 ---------- */
.search-input {
    width: 100%;
    padding: 9px 16px 9px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: #f5f5f5;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.15s ease;
}
.search-input::placeholder {
    color: var(--text-tertiary);
}
.search-input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ---------- 22. 按钮 ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: var(--brand);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-primary:hover {
    background: var(--brand-hover);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
}
.btn-ghost:hover {
    background: #f0f0f0;
    color: var(--text-primary);
}

/* ---------- 23. 徽章 ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge-pinned {
    background: #fef9c3;
    color: #854d0e;
}
.badge-featured {
    background: var(--amber-light);
    color: var(--amber-text);
}
.badge-category {
    background: var(--brand-light);
    color: var(--brand-text);
    font-weight: 500;
}
.badge-tool {
    background: #f3f4f6;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---------- 24. 状态徽章（已收录 XX 个项目） ---------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}
.status-dot {
    position: relative;
    display: inline-flex;
    width: 6px;
    height: 6px;
    margin-right: 8px;
}
.status-dot::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #22c55e;
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
    opacity: 0.6;
}
.status-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #22c55e;
}

/* ---------- 25. 动画 ---------- */
@keyframes ping {
    75%, 100% {
        transform: scale(2.5);
        opacity: 0;
    }
}
.animate-ping {
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ---------- 26. 响应式 ---------- */
@media (min-width: 640px) {
    .sm\:px-6 { padding-left: 24px; padding-right: 24px; }
    .sm\:text-3xl { font-size: 30px; line-height: 1.15; }
}

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:px-10 { padding-left: 40px; padding-right: 40px; }
    .md\:py-4 { padding-top: 16px; padding-bottom: 16px; }
    .md\:text-lg { font-size: 17px; line-height: 1.5; }
}

@media (min-width: 1024px) {
    .lg\:px-8 { padding-left: 32px; padding-right: 32px; }
}

@media (max-width: 767px) {
    .hide-mobile { display: none !important; }
}