/* ========== 前台 CSS ========== */
:root { --primary: #4f46e5; --text: #1e293b; --text-muted: #64748b; --bg: #f8fafc; --radius: 8px; }

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 16px 0; position: sticky; top: 0; z-index: 100; }
.header .container { display: flex; justify-content: space-between; align-items: center; }
.logo a { font-size: 24px; font-weight: 700; color: var(--text); }
.logo a:hover { text-decoration: none; }
.nav { display: flex; gap: 24px; }
.nav a { color: var(--text-muted); font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--primary); text-decoration: none; }

/* Filter */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; padding: 20px 0; }
.filter-btn { padding: 6px 16px; border: 1px solid #e2e8f0; border-radius: 20px; color: var(--text-muted); font-size: 13px; background: #fff; transition: all 0.15s; }
.filter-btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Project Grid */
.project-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding-bottom: 40px; }
.project-card { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius); overflow: hidden; transition: all 0.2s; display: block; }
.project-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); transform: translateY(-2px); text-decoration: none; }
.project-thumb { padding: 1.5rem 1.5rem 0 1.5rem; overflow: hidden; background: #fff; aspect-ratio: 1/1; display: flex; align-items: center; }
.project-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 4px; }
.project-info { padding: 16px; text-align: center; }
.project-info h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
.project-category { display: inline-block; padding: 2px 8px; background: #ede9fe; color: var(--primary); border-radius: 12px; font-size: 12px; margin-bottom: 8px; }
.project-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.tag { display: inline-block; padding: 2px 8px; background: #f1f5f9; color: var(--text-muted); border-radius: 4px; font-size: 11px; }

/* Video Grid */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding-bottom: 40px; }
.video-card { display: block; color: inherit; text-decoration: none; background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius); overflow: hidden; transition: all 0.2s; }
.video-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.video-thumb { width: 100%; height: 180px; overflow: hidden; background: #1e293b; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-info { padding: 16px; }
.video-info h3 { font-size: 16px; margin-bottom: 8px; }
.view-count { font-size: 13px; color: var(--text-muted); margin-left: 8px; }

/* Project Detail */
.project-detail { padding: 40px 20px; max-width: 900px; }
.detail-thumb { width: 100%; border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; }
.detail-thumb img { max-width: 100%; max-height: 400px; display: block; object-fit: contain; }
.detail-title { font-size: 28px; margin-bottom: 20px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; padding: 16px; background: #fff; border-radius: var(--radius); border: 1px solid #e2e8f0; }
.meta-item { font-size: 14px; }
.meta-label { color: var(--text-muted); font-weight: 500; }
.detail-tags { display: flex; gap: 6px; margin-bottom: 24px; }
.detail-content { background: #fff; padding: 24px; border-radius: var(--radius); border: 1px solid #e2e8f0; line-height: 1.8; }
.detail-content img { max-width: 100%; height: auto; border-radius: 4px; }
.back-link { display: inline-block; margin-bottom: 20px; font-size: 15px; }

/* Doc Table */
.doc-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid #e2e8f0; margin-bottom: 40px; }
.doc-table th { background: #f8fafc; padding: 12px 16px; text-align: left; font-weight: 600; }
.doc-table td { padding: 12px 16px; border-top: 1px solid #e2e8f0; }
.doc-table tbody tr:hover { background: #f1f5f9; }

/* Footer */
.footer { text-align: center; padding: 32px 0; color: var(--text-muted); font-size: 14px; border-top: 1px solid #e2e8f0; margin-top: 40px; }

/* Empty */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); font-size: 18px; }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; padding-bottom: 40px; }
.pagination .page-btn { padding: 6px 14px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; color: var(--text); font-size: 14px; }
.pagination .page-btn:hover { background: #f1f5f9; text-decoration: none; }
.pagination .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-ellipsis { padding: 6px 4px; color: #94a3b8; font-size: 14px; }

/* Breadcrumbs */
.breadcrumbs { padding: 12px 0; font-size: 13px; color: var(--text-muted); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 2px; padding: 0; }
.breadcrumbs a { color: var(--primary); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 4px; color: #cbd5e1; }
.breadcrumbs [aria-current="page"] { color: var(--text); }

@media (max-width: 1024px) {
    .project-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .project-grid, .video-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-meta { flex-direction: column; gap: 8px; }
    .nav { gap: 12px; }
}

@media (max-width: 480px) {
    .project-grid, .video-grid { grid-template-columns: 1fr; }
}
