:root {
    --gb-bg: #000000;
    --gb-content: #fafafa;
    --gb-surface: #ffffff;
    --gb-border: #eaeaea;
    --gb-text: #171717;
    --gb-muted: #666666;
    --gb-accent: #0070f3;
    --gb-font: 'Geist Sans', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --container: 1400px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--gb-font);
    background: var(--gb-content);
    color: var(--gb-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-inner {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #fff;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.logo-mark-sm { width: 24px; height: 24px; font-size: 11px; }

.logo-text {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    gap: 4px;
}

.nav-menu a {
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    transition: 0.15s;
}

.nav-menu a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-menu a.active { background: rgba(255,255,255,0.1); color: #fff; }

.auth-menu { display: flex; align-items: center; gap: 8px; }
.auth-menu a {
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    color: rgba(255,255,255,0.7);
}

.btn-primary-sm {
    background: #fff !important;
    color: #000 !important;
    font-weight: 500 !important;
}

.btn-primary-sm:hover { background: rgba(255,255,255,0.9) !important; }

/* Hero */
.hero {
    background: #000;
    color: #fff;
    padding: 80px 0 64px;
    position: relative;
    overflow: hidden;
}

.hero-grid {
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 64px 64px;
}

.hero-inner { position: relative; }

.hero-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.4);
    margin-bottom: 16px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    max-width: 640px;
}

.hero-desc {
    font-size: 15px;
    color: rgba(255,255,255,0.55);
    max-width: 520px;
    margin-bottom: 40px;
}

.hero-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 400px;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: rgba(255,255,255,0.3);
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 14px;
    outline: none;
}

.search-box input::placeholder { color: rgba(255,255,255,0.3); }
.search-box input:focus { border-color: rgba(255,255,255,0.3); }

.category-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.15s;
}

.chip:hover { border-color: rgba(255,255,255,0.3); color: #fff; }
.chip.active { background: #fff; color: #000; border-color: #fff; }

/* Resource grid */
.resource-section { padding: 48px 0; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--gb-border);
}

.section-title {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.section-sub { font-size: 14px; color: var(--gb-muted); margin-top: 4px; }

.resource-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.resource-card {
    background: var(--gb-surface);
    border: 1px solid var(--gb-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.resource-card:hover {
    border-color: #000;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.resource-thumb-link { text-decoration: none; }

.resource-thumb {
    aspect-ratio: 4/3;
    background: #f3f4f6;
    overflow: hidden;
}

.resource-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}

.resource-card:hover .resource-thumb img { transform: scale(1.03); }

.resource-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e0;
}

.resource-thumb-placeholder svg { width: 32px; height: 32px; }

.resource-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}

.resource-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.resource-title a { text-decoration: none; }
.resource-title a:hover { color: var(--gb-accent); }

.resource-excerpt {
    font-size: 13px;
    color: var(--gb-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag-item {
    font-size: 11px;
    padding: 2px 8px;
    border: 1px solid var(--gb-border);
    border-radius: 6px;
    color: var(--gb-muted);
}

.resource-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.resource-author {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.author-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #999;
    flex-shrink: 0;
}

.author-name {
    font-size: 12px;
    color: var(--gb-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resource-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #999;
}

.stat-item svg { width: 14px; height: 14px; }

.download-btn {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--gb-text);
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.15s;
}

.download-btn:hover { background: var(--gb-text); color: #fff; }
.download-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border: 1px dashed var(--gb-border);
    border-radius: 12px;
}

.empty-state p { font-size: 15px; font-weight: 500; }
.empty-state span { font-size: 13px; color: var(--gb-muted); }

/* Detail */
.resource-detail { padding: 32px 0 64px; }
.back-link { text-decoration: none; font-size: 14px; color: var(--gb-muted); display: inline-block; margin-bottom: 24px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.detail-media img { width: 100%; border-radius: 12px; border: 1px solid var(--gb-border); }
.detail-info h1 { font-size: 2rem; letter-spacing: -0.03em; margin-bottom: 12px; }
.detail-excerpt { color: var(--gb-muted); margin-bottom: 20px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--gb-muted); margin-bottom: 24px; }
.btn-download-lg {
    padding: 12px 28px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.detail-content { margin-top: 32px; font-size: 15px; line-height: 1.8; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--gb-border);
    background: #fff;
    padding: 40px 0;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.site-footer p { font-size: 13px; color: var(--gb-muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--gb-muted); text-decoration: none; }
.footer-links a:hover { color: #000; }

/* Auth / Error */
.auth-page, .error-page {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.auth-card {
    background: #fff;
    border: 1px solid var(--gb-border);
    border-radius: 12px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.auth-hint { font-size: 14px; color: var(--gb-muted); margin-top: 12px; }
.alert-info { background: #eef2ff; color: #3854e8; padding: 12px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }

.error-page h1 { font-size: 4rem; font-weight: 700; }
.error-page p { color: var(--gb-muted); margin: 8px 0 24px; }

@media (max-width: 1200px) { .resource-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
    .resource-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
    .nav-menu { display: none; }
}
@media (max-width: 560px) { .resource-grid { grid-template-columns: 1fr; } }
