/* 教程卡片样式 */
.resources-section {
    padding: 80px 0 100px;
    background: var(--secondary-color);
}

.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
    margin-top: 30px;
}

.tutorial-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: all var(--transition-normal);
    border: 1px solid rgba(212, 175, 55, 0.10);
    position: relative;
    box-shadow: 0 2px 16px rgba(26, 59, 93, 0.07);
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(26, 59, 93, 0.15);
    border-color: rgba(212, 175, 55, 0.30);
}


.tutorial-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 22px;
    box-shadow: 0 4px 14px rgba(26, 59, 93, 0.30);
}

.tutorial-content {
    flex: 1;
}

.tutorial-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: break-word;
}

.tutorial-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: break-word;
}

.tutorial-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    letter-spacing: 0.03em;
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.30);
}

.tutorial-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(212, 175, 55, 0.40);
}

/* 标签切换内容 */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    margin-bottom: 20px;
    color: var(--accent-color);
    opacity: 0.8;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.empty-state p {
    font-size: 16px;
    max-width: 400px;
    margin: 0 auto;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tutorials-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tutorial-card {
        flex-direction: column;
        padding: 20px;
    }
    
    .tutorial-icon {
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .tutorial-content h3 {
        font-size: 16px;
    }
    
    .resource-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 0 auto;
        min-width: calc(50% - 10px);
        margin-bottom: 10px;
    }
}

/* 教程卡片动画 */
.tutorial-card {
    animation: cardIn 0.6s ease both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 为每个教程卡片添加延迟动画 */
.tutorial-card:nth-child(1) { animation-delay: 0.1s; }
.tutorial-card:nth-child(2) { animation-delay: 0.2s; }
.tutorial-card:nth-child(3) { animation-delay: 0.3s; }
.tutorial-card:nth-child(4) { animation-delay: 0.4s; }
.tutorial-card:nth-child(5) { animation-delay: 0.5s; }
.tutorial-card:nth-child(6) { animation-delay: 0.6s; }
.tutorial-card:nth-child(7) { animation-delay: 0.7s; }
.tutorial-card:nth-child(8) { animation-delay: 0.8s; }
.tutorial-card:nth-child(9) { animation-delay: 0.9s; }
.tutorial-card:nth-child(10) { animation-delay: 1.0s; }
.tutorial-card:nth-child(11) { animation-delay: 1.1s; }
.tutorial-card:nth-child(12) { animation-delay: 1.2s; }
.tutorial-card:nth-child(13) { animation-delay: 1.3s; }
.tutorial-card:nth-child(14) { animation-delay: 1.4s; }
.tutorial-card:nth-child(15) { animation-delay: 1.5s; }
.tutorial-card:nth-child(16) { animation-delay: 1.6s; }

/* ── Tab 切换栏 ─────────────────────────────────────────────── */
.cases-tabs-bar {
    background: var(--card-bg);
    border-bottom: 1px solid rgba(212,175,55,0.12);
    position: sticky;
    top: 56px;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.cases-tabs-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0;
    padding-bottom: 0;
}
.cases-tabs {
    display: flex;
    gap: 0;
}
.cases-tab {
    padding: 16px 28px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
    letter-spacing: 0.02em;
}
.cases-tab:hover { color: var(--accent-color); }
.cases-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}
.write-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 16px;
    background: var(--accent-color);
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
    letter-spacing: 0.03em;
    border: none;
    box-shadow: none;
    cursor: pointer;
    font-family: inherit;
}
.write-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212,175,55,0.45); }

/* Tab 内容容器 */
.cases-tab-content { display: none; }
.cases-tab-content.active { display: block; }

/* ── 社区文章列表 ─────────────────────────────────────────────── */
.community-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.community-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card-bg);
    border: 1.5px solid rgba(212,175,55,0.15);
    border-radius: 100px;
    padding: 9px 18px;
    flex: 1;
    max-width: 400px;
    transition: border-color 0.2s;
}
.community-search:focus-within { border-color: var(--accent-color); }
.community-search i { color: var(--text-light); font-size: 14px; }
.community-search input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-primary);
    width: 100%;
    font-family: inherit;
}
.community-search input::placeholder { color: var(--text-light); }
.community-write-btn { white-space: nowrap; }

.community-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.community-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* 文章卡片 */
.article-item {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    display: flex;
    align-items: flex-start;
    gap: 24px;
    border: 1.5px solid rgba(212,175,55,0.08);
    box-shadow: 0 2px 14px rgba(26,59,93,0.07);
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}
.article-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent-color);
    opacity: 0;
    transition: opacity 0.2s;
}
.article-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(26,59,93,0.14);
    border-color: rgba(212,175,55,0.28);
}
.article-item:hover::before { opacity: 1; }

.article-item-body { flex: 1; min-width: 0; }
.article-item-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.article-item-tag {
    padding: 2px 11px;
    background: rgba(212,175,55,0.10);
    color: var(--accent-color);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.article-item-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.article-item:hover .article-item-title { color: var(--accent-color); }
.article-item-summary {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-item-meta {
    display: flex;
    gap: 18px;
    font-size: 12px;
    color: var(--text-light);
}
.article-item-meta span { display: flex; align-items: center; gap: 5px; }
.article-item-meta i { font-size: 11px; }

.article-item-arrow {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(212,175,55,0.08);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    align-self: center;
}
.article-item:hover .article-item-arrow {
    background: var(--accent-color);
    color: white;
    transform: translateX(3px);
}

.community-empty {
    text-align: center;
    padding: 70px 20px;
    color: var(--text-secondary);
}
.community-empty i { font-size: 52px; color: var(--accent-color); opacity: 0.45; margin-bottom: 18px; display: block; }
.community-empty h3 { font-size: 20px; color: var(--primary-color); margin-bottom: 10px; }
.community-empty p { margin-bottom: 24px; }
.tabs-bar-actions { display: flex; align-items: center; gap: 10px; }
.write-btn-login {
    background: rgba(212,175,55,0.10);
    color: var(--text-secondary);
    border: 1.5px solid rgba(212,175,55,0.2);
    font-size: 12px;
}
.write-btn-login:hover { background: rgba(212,175,55,0.2); color: var(--accent-color); }

/* 社区视图切换 */
.community-view-tabs {
    display: flex;
    gap: 4px;
}
.cv-tab {
    padding: 6px 16px;
    border-radius: 100px;
    border: 1.5px solid rgba(212,175,55,0.2);
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.cv-tab:hover { border-color: var(--accent-color); color: var(--accent-color); }
.cv-tab.active {
    background: rgba(212,175,55,0.12);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.draft-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 100px;
    background: rgba(100,130,200,0.12);
    color: #6482c8;
    border: 1px solid rgba(100,130,200,0.25);
    flex-shrink: 0;
}

.hidden { display: none !important; }

/* ── 社区文章收录按钮 ── */
.article-item-wrap {
    display: flex;
    flex-direction: column;
}
.article-item-actions {
    display: flex;
    justify-content: flex-end;
    padding: 6px 12px 4px;
}
.official-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid rgba(212,175,55,0.35);
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-family: inherit;
}
.official-toggle-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(212,175,55,0.08);
}
.official-toggle-btn.is-official {
    border-color: var(--accent-color);
    background: rgba(212,175,55,0.12);
    color: var(--accent-color);
}

.article-item-actions {
    gap: 6px;
}

.article-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    border: 1.5px solid rgba(229,57,53,0.25);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #e53935;
    transition: all 0.2s;
    font-family: inherit;
}
.article-delete-btn:hover {
    background: #e53935;
    border-color: #e53935;
    color: white;
}

.article-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    border: 1.5px solid rgba(212,175,55,0.3);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--accent-color);
    transition: all 0.2s;
    font-family: inherit;
}
.article-edit-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #1a1a1a;
}

.unfeat-btn:hover {
    border-color: #e55 !important;
    color: #e55 !important;
    background: rgba(229,85,85,0.07) !important;
}

@media (max-width: 768px) {
    .article-item { padding: 20px 18px; gap: 14px; }
    .article-item-title { font-size: 16px; }
    .article-item-arrow { display: none; }
    .cases-tab { padding: 12px 16px; font-size: 14px; }
}
