/*
 * 虫虫开发者社区 - 资料与内容详情页统一样式表 (全宽工程档案头卡 + 左文右下载工作台布局)
 * 覆盖: dl_detail, vip_detail, soft_detail, article_detail, news_detail, special-1
 * 严格遵循 FRONTEND_STANDARDS.md <= 300 行
 */
.detail-page, .detail-page-wrapper { max-width: var(--ee-width); margin: 0 auto; padding: 0 0 36px; }

.breadcrumb-nav, .detail-breadcrumb, .breadcrumb {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 9px 16px; margin-bottom: 14px;
    background: #ffffff; border: 1px solid var(--ee-color-line); border-radius: var(--ee-radius); font-size: 13px; color: var(--ee-color-muted);
}
.breadcrumb-nav a, .detail-breadcrumb a, .breadcrumb a { color: var(--ee-color-text); text-decoration: none; }
.breadcrumb-nav a:hover, .detail-breadcrumb a:hover, .breadcrumb a:hover { color: var(--ee-color-brand); }
.breadcrumb-sep, .detail-breadcrumb .sep { color: var(--ee-color-subtle); }
.breadcrumb-current, .current-page, .detail-breadcrumb .current { color: var(--ee-color-ink); font-weight: 500; }

/* 第一层：全宽工程档案头卡 + 6宫格核心技术参数条 */
.title-card, .detail-card, .description-card, .download-section,
.sidebar-widget, .detail-widget, .sidebar-card, .article-main, .special-header, .resource-section {
    background: #ffffff; border: 1px solid var(--ee-color-line); border-radius: var(--ee-radius); box-shadow: var(--ee-shadow-xs); margin-bottom: 16px;
}

.title-card { padding: 22px 26px 0; overflow: hidden; }
.title-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 18px; }
.title-card__main { flex: 1; min-width: 0; }
.title-card__badges, .subtitle-info, .article-meta, .detail-meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; font-size: 12.5px; color: var(--ee-color-muted);
}
.article-meta-item, .detail-meta-item, .file-info, .time-info, .download-info { display: inline-flex; align-items: center; gap: 5px; }
.title-card__type, .category-badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 4px;
    background: var(--ee-color-brand-soft); color: var(--ee-color-brand); font-weight: 600;
}
.title-card__type.v2-res-item__icon--pdf { background: #ffece8; color: #f53f3f; }
.title-card__type.v2-res-item__icon--zip { background: #fff7e8; color: #ff7d00; }
.title-card__type.v2-res-item__icon--code { background: #e8ffea; color: #009a29; }
.title-card__type.v2-res-item__icon--ebook { background: #eef2ff; color: #4f46e5; }
.title-card__cat { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 4px; background: #f2f3f5; color: var(--ee-color-text) !important; font-weight: 500; }
.title-card__cat:hover { background: var(--ee-color-brand-soft); color: var(--ee-color-brand) !important; }
.title-card__verified { display: inline-flex; align-items: center; gap: 4px; color: #009a29; font-size: 12.5px; font-weight: 500; }
.title-icon { color: #f59e0b; margin-right: 4px; }

.resource-title, .article-title, .detail-title, .special-title {
    margin: 0 0 12px; color: var(--ee-color-ink); font-size: 22px; font-weight: 700; line-height: 1.42;
}

.spec-strip {
    margin: 0 -26px; padding: 14px 26px; background: #f7f8fa; border-top: 1px solid var(--ee-color-line);
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px;
}
.spec-strip__item { display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--ee-color-line); padding-right: 10px; }
.spec-strip__item:last-child { border-right: 0; padding-right: 0; }
.spec-strip__label { font-size: 12px; color: var(--ee-color-muted); }
.spec-strip__val { font-size: 14px; font-weight: 600; color: var(--ee-color-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spec-strip__val a { color: var(--ee-color-brand) !important; }

/* 第二层：双栏主体 (左 1fr · 右 320px，严控溢出与宽度) */
.detail-layout, .article-grid { display: grid !important; grid-template-columns: minmax(0, 1fr) 320px !important; gap: 18px !important; align-items: start !important; }
.detail-main, .detail-sidebar, .sidebar, .article-main, .article-sidebar, .detail-card, .description-card,
.sidebar-widget, .detail-widget, .sidebar-card, .download-section {
    min-width: 0 !important; max-width: 100% !important; box-sizing: border-box;
}
.sidebar, .detail-sidebar, .article-sidebar { width: 320px; max-width: 100%; overflow: hidden; }
.sidebar-widget, .detail-widget, .sidebar-card, .download-section { overflow: hidden; }

.article-main, .detail-page-wrapper .detail-main, .special-info, .resource-section {
    background: #ffffff; border: 1px solid var(--ee-color-line); border-radius: var(--ee-radius);
    padding: 24px 28px; box-shadow: var(--ee-shadow-xs);
}
.detail-header { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--ee-color-line); }
.detail-card, .description-card { padding: 20px 24px; }
.sidebar-widget, .detail-widget, .sidebar-card { padding: 16px 18px !important; }

.section-title, .widget-title, .detail-widget-title, .sidebar-title, .related-title, .related-box-title, .download-title {
    margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--ee-color-line);
    color: var(--ee-color-ink); font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.section-title { font-size: 16px; margin-bottom: 14px; }
.section-title i, .widget-title i, .detail-widget-title i, .sidebar-title i, .related-box-title i { color: var(--ee-color-brand); }

.description-content, .article-content, .detail-body, .code-section-content {
    color: var(--ee-color-ink); font-size: 14.5px; line-height: 1.78; overflow-wrap: anywhere;
}
.description-content img, .article-content img, .detail-body img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--ee-color-line); }
.description-content pre, .article-content pre, .detail-body pre { overflow-x: auto; padding: 14px; border-radius: 8px; background: #0f172a; color: #f2f3f5; font-size: 13px; }

/* 压缩包源码与工程文件清单 (2列紧凑网格 + 类型徽章) */
.code-section-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 9px 14px; margin-bottom: 12px; border-radius: 6px; background: #f7f8fa; border: 1px solid var(--ee-color-line); font-size: 12.5px; }
.code-count { font-weight: 600; color: var(--ee-color-ink); display: inline-flex; align-items: center; gap: 5px; }
.code-count i { color: #009a29; }
.code-hint { color: var(--ee-color-muted); }
.code-file-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.code-file-item { border: 1px solid var(--ee-color-line); border-radius: 7px; background: #ffffff; transition: all 0.14s ease; min-width: 0; }
.code-file-item:hover { border-color: var(--ee-color-brand-border); background: #f8fbff; }
.code-file-row { display: flex; align-items: center; gap: 8px; padding: 8px 11px; min-width: 0; }
.code-file-number, .rank-number, .related-resource-number, .hot-item-number {
    flex: 0 0 22px; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 4px; background: #f2f3f5; color: var(--ee-color-muted); font-size: 11.5px; font-weight: 600;
}
.rank-number.top-3, .related-resource-number.top-3, .hot-item-number.top3 { background: var(--ee-color-brand); color: #ffffff; }
.code-ext-badge {
    flex-shrink: 0; padding: 1px 6px; border-radius: 4px; font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.02em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.code-ext-badge--code { background: #e8ffea; color: #009a29; border: 1px solid #b7eb8f; }
.code-ext-badge--bin { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.code-ext-badge--media { background: #fff7e8; color: #d97706; border: 1px solid #fde68a; }
.code-file-info { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.code-file-link { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ee-color-ink) !important; font-size: 13px; font-weight: 500; }
.code-file-link:hover { color: var(--ee-color-brand) !important; }
.code-file-link--static { color: var(--ee-color-text) !important; cursor: default; }
.code-file-link--static:hover { color: var(--ee-color-text) !important; }
.code-file-size { font-size: 11.5px; color: var(--ee-color-muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.code-view-btn { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 5px; background: var(--ee-color-brand-soft); color: var(--ee-color-brand) !important; font-size: 11.5px; font-weight: 600; flex-shrink: 0; }
.code-view-btn:hover { background: var(--ee-color-brand); color: #ffffff !important; }
.code-bin-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 5px; background: #f8fafc; border: 1px solid #e2e8f0; color: #64748b; font-size: 11px; flex-shrink: 0; }
.view-all-container { margin-top: 10px; text-align: center; }
.view-all-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 6px; border: 1px dashed var(--ee-color-line); background: #f8fafc; font-size: 12.5px; color: var(--ee-color-muted) !important; }

/* 右侧首屏下载操作工作台 */
.download-section { padding: 20px; background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 100%); border: 1px solid var(--ee-color-brand-border); }
.download-section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 13px; color: var(--ee-color-text); }
.download-section__price strong { font-size: 18px; color: var(--ee-color-brand); font-weight: 700; }
.download-section__free { padding: 2px 8px; border-radius: 4px; background: #e8ffea; color: #009a29; font-size: 12px; font-weight: 500; }
.download-buttons, .download-buttons-container { display: flex; flex-direction: column; gap: 10px; }
.btn-single-download, .btn-free-download {
    width: 100%; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 8px; background: var(--ee-color-brand); color: #ffffff !important;
    font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px rgba(30, 128, 255, 0.25); transition: background 0.15s ease;
}
.btn-single-download:hover { background: var(--ee-color-brand-dark); }
.btn-free-download { background: #0f172a; box-shadow: none; }
.btn-free-download:hover { background: #1e293b; }
.download-text { color: inherit; }
.btn-preview-code {
    width: 100%; height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid var(--ee-color-brand-border); border-radius: 7px; background: #ffffff; color: var(--ee-color-brand) !important; font-size: 13.5px; font-weight: 500;
}
.btn-preview-code:hover { background: var(--ee-color-brand-soft); }
.download-tip { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--ee-color-line); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 12.5px; color: var(--ee-color-muted); }
.download-tip a { color: var(--ee-color-text) !important; }
.download-tip a:hover { color: var(--ee-color-brand) !important; }

/* 文章点赞、分享与专题详情组件 */
.share-section, .like-section, .detail-interact-box, .related-articles, .related-box {
    margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--ee-color-line);
}
.like-section, .detail-interact-box { text-align: center; }
.like-btn, .digg-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px;
    padding: 9px 24px; border-radius: 999px; border: 1px solid var(--ee-color-brand-border);
    background: var(--ee-color-brand-soft); color: var(--ee-color-brand); font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.15s ease;
}
.like-btn:hover, .digg-btn:hover { background: var(--ee-color-brand); color: #ffffff; }
.like-count { color: var(--ee-color-brand); }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.share-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 6px;
    border: 1px solid var(--ee-color-line); background: #f8fafc; color: var(--ee-color-text); font-size: 13px; font-weight: 500; cursor: pointer;
}
.share-btn:hover { border-color: var(--ee-color-brand-border); background: var(--ee-color-brand-soft); color: var(--ee-color-brand); }
.qrcode-section { display: none; margin-top: 10px; padding: 14px; border: 1px solid var(--ee-color-line); border-radius: 8px; background: #f8fafc; text-align: center; }
.qrcode-title { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.qrcode-container { display: inline-block; padding: 6px; background: #fff; border-radius: 6px; }
.qrcode-desc { font-size: 12px; color: var(--ee-color-muted); margin-top: 6px; }

.special-banner-wrapper { max-height: 220px; overflow: hidden; border-bottom: 1px solid var(--ee-color-line); background: #0f172a; }
.special-banner { width: 100%; height: 220px; object-fit: cover; display: block; }
.special-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.stat-item { padding: 8px 16px; border-radius: 8px; background: #f8fafc; border: 1px solid var(--ee-color-line); display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; }
.credit-value { font-size: 18px; font-weight: 800; color: var(--ee-color-brand); }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-more { font-size: 13px; color: var(--ee-color-muted); }
.section-more a { color: var(--ee-color-brand); font-weight: 600; }

.software-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.software-info-section { padding: 14px; background: #f7f8fa; border: 1px solid var(--ee-color-line); border-radius: 7px; }
.software-info-section h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--ee-color-ink); }
.software-info-list { margin: 0; padding-left: 16px; font-size: 13px; color: var(--ee-color-text); line-height: 1.7; }

.tags-container, .detail-tags, .special-tags, .resource-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-link, .detail-tag-badge, .tag, .resource-tag {
    display: inline-flex; align-items: center; padding: 3px 10px; background: #f2f3f5;
    border-radius: 4px; color: var(--ee-color-text); font-size: 12.5px; text-decoration: none;
}
.tag-link:hover, .detail-tag-badge:hover, .tag:hover, .resource-tag:hover { background: var(--ee-color-brand-soft); color: var(--ee-color-brand); }

/* 相关工程资料推荐卡片列表 */
.related-resource-container { display: grid; grid-template-columns: 1fr; gap: 10px; }
.related-resource-item {
    container-type: inline-size; padding: 13px 16px; border: 1px solid var(--ee-color-line);
    border-radius: 8px; background: #fbfcfe; transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.related-resource-item:hover { border-color: var(--ee-color-brand-border); background: #ffffff; box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05); }
.related-resource-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; min-width: 0; }
.related-resource-ext {
    flex-shrink: 0; padding: 1px 6px; border-radius: 4px; background: #fff7e8; color: #d97706;
    border: 1px solid #fde68a; font-size: 11px; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.related-resource-title { margin: 0; font-size: 14.5px; font-weight: 600; flex: 1; min-width: 0; line-height: 1.4; }
.related-resource-link, .hover-primary {
    color: var(--ee-color-ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.related-resource-link:hover, .hover-primary:hover { color: var(--ee-color-brand); }
.related-resource-size {
    flex-shrink: 0; padding: 2px 8px; border-radius: 999px; background: #f1f5f9;
    color: var(--ee-color-text); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.related-resource-desc {
    margin: 0 0 8px; padding-left: 30px; font-size: 13px; color: var(--ee-color-text); line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.related-resource-meta {
    padding-left: 30px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    font-size: 12px; color: var(--ee-color-muted);
}
.related-resource-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.related-resource-stats span { display: inline-flex; align-items: center; gap: 4px; }
.related-resource-tags { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.related-tag-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 4px; background: var(--ee-color-brand-soft); color: var(--ee-color-brand) !important; font-size: 11.5px; font-weight: 500; text-decoration: none; }
.related-tag-chip:hover { background: var(--ee-color-brand); color: #ffffff !important; }
.related-resource-more { color: var(--ee-color-brand) !important; font-size: 12px; font-weight: 500; flex-shrink: 0; }
.keyword-highlight { color: var(--ee-color-brand); font-style: normal; font-weight: 600; }

.related-grid, .resource-grid, .special-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.related-link-card, .resource-card, .special-card {
    padding: 12px 14px; border: 1px solid var(--ee-color-line); border-radius: 8px; background: #f8fafc;
    color: var(--ee-color-ink); font-size: 13.5px; font-weight: 500; transition: all 0.15s ease; display: block;
}
.related-link-card:hover, .resource-card:hover, .special-card:hover { border-color: var(--ee-color-brand-border); background: #ffffff; color: var(--ee-color-brand); }
.related-item-arrow { font-size: 12px; color: var(--ee-color-brand); flex-shrink: 0; }

.hot-tab-switch { display: flex; gap: 4px; margin-bottom: 10px; padding: 3px; background: #f2f3f5; border-radius: 6px; }
.hot-tab-btn, .hot-tab-inactive { flex: 1; padding: 5px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--ee-color-text); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.hot-tab-active { background: #ffffff; color: var(--ee-color-brand); font-weight: 600; box-shadow: var(--ee-shadow-xs); }
.hidden { display: none !important; }

.rank-list, .detail-widget-list, .hot-list, .related-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 2px; width: 100%; min-width: 0;
}
.rank-item, .detail-widget-item, .hot-item, .related-item {
    display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; max-width: 100%;
    padding: 7px 0 !important; border-bottom: 1px solid #f2f3f5 !important;
    font-size: 13px; color: var(--ee-color-text); overflow: hidden; box-sizing: border-box;
}
.rank-item:last-child, .detail-widget-item:last-child, .hot-item:last-child, .related-item:last-child { border-bottom: 0 !important; }
.rank-title, .detail-widget-link, .hot-item-title, .related-item-title {
    flex: 1 1 0%; min-width: 0; max-width: 100%; display: block;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--ee-color-text) !important; font-size: 13px !important; line-height: 1.45 !important;
}
.rank-title:hover, .detail-widget-link:hover { color: var(--ee-color-brand) !important; }
.resource-meta { font-size: 11.5px; color: var(--ee-color-muted); flex-shrink: 0; white-space: nowrap; margin-top: 0; font-variant-numeric: tabular-nums; }

@media (max-width: 960px) {
    .spec-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .detail-layout, .article-grid, .software-info-grid, .related-grid, .resource-grid, .special-grid, .code-file-list { grid-template-columns: 1fr !important; }
    .sidebar, .detail-sidebar, .article-sidebar { width: 100%; }
}
@media (max-width: 640px) {
    .spec-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.share-btn.wechat i { color: #16a34a; } .share-btn.weibo i { color: #e11d48; } .share-btn.qq i { color: #0284c7; } .share-btn.qzone i { color: #d97706; } .share-btn.copy i { color: var(--ee-color-brand); }
