:root {
    --res-ink: var(--color-ink);
    --res-muted: var(--color-muted);
    --res-line: var(--color-line);
    --res-paper: var(--color-surface);
    --res-accent: var(--color-primary);
    --res-warm: var(--color-primary-tint);
    --res-shadow: var(--shadow-card);
}

.resource-page {
    min-height: calc(100vh - var(--site-header-h, 64px));
    background: var(--color-page);
    color: var(--res-ink);
    padding-bottom: 64px;
    font-family: var(--font-sans);
}

.resource-hero {
    padding: 56px 0 36px;
    text-align: center;
}

.resource-brand {
    margin: 0 0 10px;
    font-family: var(--font-sans);
    font-size: 13px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--res-accent);
}

.resource-hero-title {
    margin: 0 0 10px;
    font-family: var(--font-sans);
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 700;
}

.resource-hero-desc {
    margin: 0 auto 20px;
    max-width: 32em;
    color: var(--res-muted);
}

.resource-search {
    display: inline-flex;
    width: min(100%, 420px);
    background: #fff;
    border: 1px solid var(--res-line);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--res-shadow);
}

.resource-search input {
    flex: 1;
    border: 0;
    outline: 0;
    padding: 12px 18px;
    background: transparent;
}

.resource-search button {
    border: 0;
    background: var(--res-ink);
    color: #fff;
    padding: 0 20px;
}

.resource-hero-actions {
    margin-top: 18px;
}

.resource-btn {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--res-line);
    background: #fff;
    color: var(--res-ink);
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.resource-btn:hover,
.resource-btn:focus {
    text-decoration: none;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    transform: none;
    box-shadow: none;
}

.resource-btn-accent {
    background: var(--res-accent);
    border-color: var(--res-accent);
    color: #fff;
}

.resource-btn-accent:hover,
.resource-btn-accent:focus {
    color: #fff;
    background: #007c92;
}

.resource-btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.resource-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.resource-filters-cat {
    margin-bottom: 24px;
}

.resource-chip {
    display: inline-block;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--res-line);
    background: rgba(255, 255, 255, .7);
    color: var(--res-muted);
    font-size: 13px;
    text-decoration: none;
}

.resource-chip:hover,
.resource-chip.is-active {
    text-decoration: none;
    color: #fff;
    background: var(--res-accent);
    border-color: var(--res-accent);
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.resource-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: var(--res-paper);
    border: 1px solid var(--res-line);
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(10, 46, 54, 0.04);
    transition: transform .22s ease, box-shadow .22s ease;
}

.resource-card:hover {
    text-decoration: none;
    color: inherit;
    transform: translateY(-3px);
    box-shadow: var(--res-shadow);
}

.resource-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(195, 122, 103, 0.12);
    color: var(--res-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    overflow: hidden;
    flex-shrink: 0;
}

.resource-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-card-body {
    min-width: 0;
}

.resource-card-body h2 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resource-card-meta,
.resource-card-foot {
    margin: 0;
    font-size: 12px;
    color: var(--res-muted);
}

.resource-score {
    color: #c45c26;
}

.resource-free {
    color: var(--res-accent);
}

.resource-pager,
.resource-empty {
    text-align: center;
    padding: 28px 0;
    color: var(--res-muted);
}

.resource-detail {
    margin: 40px auto;
    max-width: 860px;
    background: #fff;
    border: 1px solid var(--res-line);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--res-shadow);
}

.resource-detail-main {
    display: flex;
    gap: 20px;
}

.resource-detail-icon {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-lg);
    background: rgba(195, 122, 103, 0.12);
    color: var(--res-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    overflow: hidden;
    flex-shrink: 0;
}

.resource-detail-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-detail-type {
    margin: 0 0 6px;
    color: var(--res-accent);
    font-size: 13px;
    letter-spacing: .08em;
}

.resource-detail-info h1 {
    margin: 0 0 10px;
    font-family: var(--font-sans);
    font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.resource-detail-desc {
    color: var(--res-muted);
    margin: 0 0 14px;
}

.resource-detail-meta {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: var(--res-muted);
    font-size: 14px;
}

.resource-detail-meta strong {
    color: var(--res-ink);
    font-weight: 600;
    margin-right: 4px;
}

.resource-tags {
    margin-top: 14px;
}

.resource-tag {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 3px 10px;
    border-radius: var(--radius-md);
    background: rgba(195, 122, 103, 0.12);
    color: var(--res-accent);
    font-size: 12px;
}

.resource-detail-actions {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.resource-detail-tip,
.resource-detail-back {
    margin-top: 16px;
    color: var(--res-muted);
    font-size: 13px;
}

/* 内容嵌入卡片 */
.resource-embed {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid rgba(10, 46, 54, 0.12);
    border-radius: 12px;
    background: linear-gradient(135deg, #f7fbfc, #eef7f9);
    color: var(--color-ink) !important;
    text-decoration: none !important;
    max-width: 520px;
    transition: transform .2s ease, box-shadow .2s ease;
}

.resource-embed:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(10, 46, 54, 0.08);
}

.resource-embed-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(195, 122, 103, 0.14);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.resource-embed-body {
    flex: 1;
    min-width: 0;
}

.resource-embed-title {
    display: block;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resource-embed-meta {
    display: block;
    font-size: 12px;
    color: rgba(10, 46, 54, 0.55);
    margin-top: 2px;
}

.resource-embed-action {
    color: var(--color-primary);
    font-size: 13px;
    flex-shrink: 0;
}

.resource-embed-missing {
    color: #999;
    font-style: italic;
}

@media (max-width: 767px) {
    .resource-detail-main {
        flex-direction: column;
    }
    .resource-hero {
        padding: 36px 0 24px;
    }
}
