/* 智创社 AI资讯 - 蓝白主题 + 立体感设计 */
/* v6 - 统一风格版本 */

/* ===== 全局变量 ===== */
:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --accent: #06b6d4;
    --bg-main: #f0f4f8;
    --bg-card: #ffffff;
    --bg-header: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #06b6d4 100%);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 2px 8px rgba(37, 99, 235, 0.08);
    --shadow-md: 0 8px 24px rgba(37, 99, 235, 0.12);
    --shadow-lg: 0 16px 48px rgba(37, 99, 235, 0.16);
    --radius: 16px;
    --radius-sm: 10px;
}

/* ===== 基础样式 ===== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== 背景装饰 ===== */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(37, 99, 235, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* ===== 头部 ===== */
.site-header {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.gradient-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0ea5e9 100%);
}

/* ===== 卡片 ===== */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15);
}

/* ===== 标签 ===== */
.tab-btn {
    color: #64748b;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.tab-btn:hover { color: #2563eb; }
.tab-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* ===== 文字截断 ===== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 滚动条 ===== */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== 工具卡片 ===== */
.tool-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s;
    border: 1px solid #e2e8f0;
}
.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(37,99,235,0.1);
    border-color: #bfdbfe;
}

/* ===== 分类导航 ===== */
.cat-btn {
    padding: 8px 20px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

/* ===== 按钮 ===== */
.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37,99,235,0.4);
}

/* ===== 文章内容 ===== */
.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #334155;
}
.article-content p { margin-bottom: 1em; }
.article-content h2 { font-size: 20px; font-weight: 700; margin: 1.5em 0 0.5em; color: #1e293b; }
.article-content h3 { font-size: 18px; font-weight: 600; margin: 1.2em 0 0.5em; color: #334155; }
.article-content img { max-width: 100%; border-radius: 12px; margin: 1em 0; }
.article-content a { color: #2563eb; text-decoration: underline; }
.article-content blockquote {
    border-left: 4px solid #2563eb;
    padding: 12px 20px;
    background: #eff6ff;
    border-radius: 0 12px 12px 0;
    margin: 1em 0;
    color: #475569;
}
.article-content ul, .article-content ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}
.article-content li { margin-bottom: 0.3em; }

/* ===== 工具推荐 ===== */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
@media(max-width: 768px) {
    .tool-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
}

/* ===== 动画 ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease-out; }

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.pulse { animation: pulse-soft 2s infinite; }

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
}

/* ===== 响应式 ===== */
@media(max-width: 640px) {
    .cat-btn { padding: 6px 14px; font-size: 13px; }
    .btn-primary { padding: 8px 18px; font-size: 14px; }
}

/* ===== Badge ===== */
.badge-hot {
    background: linear-gradient(135deg,#f97316,#ef4444);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
}
.badge-new {
    background: linear-gradient(135deg,#10b981,#059669);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.pagination button {
    min-width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
}
.pagination button:hover { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }
.pagination button.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

/* ===== Skeleton loading ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== Focus ===== */
*:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== 工具详情弹窗 ===== */
.tool-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tool-detail-modal .modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
}
.tool-detail-modal .modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

/* ===== AI技能 ===== */
.skill-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}
.skill-card:hover {
    border-color: #10b981;
    box-shadow: 0 12px 24px rgba(16,185,129,0.1);
}
.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #ecfdf5;
    color: #059669;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
}

/* ===== 热门文章列表 ===== */
.rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    transition: all 0.2s;
    cursor: pointer;
}
.rank-item:hover { background: #f8fafc; }
.rank-num {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ===== 分类图标 ===== */
.cat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* ===== AI导航页 / AI技能页 通用 ===== */
.tools-hero, .skills-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0ea5e9 100%);
}
.skills-hero {
    background: linear-gradient(135deg, #065f46 0%, #059669 50%, #06b6d4 100%);
}
.tools-hero::after, .skills-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 85% 15%, rgba(255,255,255,0.18) 0%, transparent 60%);
    pointer-events: none;
}
.tools-hero > *, .skills-hero > * { position: relative; z-index: 1; }

/* ===== 加载动画 ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: zcs-spin 0.8s linear infinite;
}
@keyframes zcs-spin { to { transform: rotate(360deg); } }

/* ===== 分类按钮 ===== */
.tools-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid transparent;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}
.tools-cat-btn:hover { background: #e2e8f0; color: #2563eb; }
.tools-cat-btn.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

/* ===== AI导航：工具目录卡片 ===== */
.tools-section { margin-bottom: 40px; }
.tools-dir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.tool-dir-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
    text-decoration: none;
    cursor: pointer;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tool-dir-card:hover,
.tool-dir-card:focus-visible {
    transform: translateY(-3px);
    border-color: #bfdbfe;
    box-shadow: 0 12px 24px rgba(37,99,235,0.12);
}
.tool-dir-more {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    margin-left: auto;
    transition: color 0.2s;
}
.tool-dir-card:hover .tool-dir-more { color: #2563eb; }
.tool-dir-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.tool-dir-name { font-size: 15px; font-weight: 700; color: #1e293b; display: flex; align-items: center; gap: 6px; }
.tool-dir-desc { font-size: 12px; color: #94a3b8; margin-top: 4px; line-height: 1.5; }
.tool-dir-price { font-size: 12px; color: #2563eb; font-weight: 600; }
.tool-hot-tag {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 9999px;
}
.tool-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}
.tool-filter-tab {
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.tool-filter-tab:hover { color: #2563eb; }
.tool-filter-tab.active { background: #2563eb; color: #fff; }

/* ===== AI技能：排行榜 ===== */
.rank-tab {
    padding: 5px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.rank-tab:hover { color: #059669; }
.rank-tab.active {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    box-shadow: 0 4px 12px rgba(5,150,105,0.3);
}
.rank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}
.rank-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    transition: all 0.3s;
}
.rank-card:hover {
    transform: translateY(-3px);
    border-color: #a7f3d0;
    box-shadow: 0 12px 24px rgba(5,150,105,0.1);
}
.rank-card-top { border-color: #fbbf24; box-shadow: 0 8px 20px rgba(251,191,36,0.15); }
.rank-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.rank-card-info { flex: 1; min-width: 0; }
.rank-card-name { font-size: 15px; font-weight: 700; color: #1e293b; }
.rank-card-desc { font-size: 12px; color: #64748b; margin-top: 4px; line-height: 1.5; }
.rank-card-downloads { font-size: 12px; color: #059669; font-weight: 600; }
.rank-card-author { font-size: 12px; color: #94a3b8; }
.skill-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #ecfdf5;
    color: #059669;
    font-weight: 600;
}
.copy-btn, .copy-btn-sm {
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #059669;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.copy-btn:hover, .copy-btn-sm:hover { background: #059669; color: #fff; }
.copy-btn-sm { padding: 4px 10px; font-size: 11px; }
.skills-section { margin-bottom: 32px; }
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}
.skills-container { display: block; }
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
@media (max-width: 768px) {
    .tools-dir-grid, .rank-grid, .skills-grid { grid-template-columns: 1fr; }
    .tools-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}
