/* =============================================
   DIY创客详情页专用样式 post-diy.css
   ============================================= */

:root {
  --cdiy: #d97706;
  --cdiy-light: #fef3c7;
  --cdiy-dark: #b45309;
}

/* 面包屑 */
.breadcrumb-bar { background:#f1f5f9; border-bottom:1px solid #e2e8f0; padding:10px 0; font-size:.85rem; color:#64748b; }
.breadcrumb-bar a { color:var(--cdiy); text-decoration:none; }
.breadcrumb-bar .sep { margin:0 6px; }

/* 页面布局 */
.page-diy { display:grid; grid-template-columns:1fr 280px; gap:24px; padding-top:24px; padding-bottom:40px; align-items:start; }
@media(max-width:900px){ .page-diy { grid-template-columns:1fr; } .sidebar { display:none; } }

/* 通用卡片 */
.card { background:#fff; border:1px solid #e2e8f0; border-radius:10px; padding:24px; margin-bottom:20px; }
.card-title { font-size:1.05rem; font-weight:700; color:#1e293b; margin:0 0 16px; display:flex; align-items:center; gap:8px; }
.icon-diy { color:var(--cdiy); }
.count-badge { background:#f1f5f9; color:#64748b; font-size:.75rem; font-weight:600; padding:2px 8px; border-radius:20px; }

/* ---- 项目封面 & 标题 ---- */
.project-header { padding:0; overflow:hidden; }
.project-cover { position:relative; }
.project-cover img { width:100%; height:280px; object-fit:cover; display:block; }
.project-cover-badges { position:absolute; bottom:14px; left:16px; display:flex; gap:6px; }
.project-title-info { padding:20px 24px 24px; }
.badge { font-size:.72rem; padding:2px 8px; border-radius:20px; font-weight:600; }
.badge-diy { background:var(--cdiy-light); color:var(--cdiy-dark); }
.badge-level-mid { background:#fef9c3; color:#854d0e; }
.badge-arduino { background:#dcfce7; color:#166534; }
.project-title { font-size:1.5rem; font-weight:800; color:#0f172a; margin:12px 0 8px; }
.project-summary { font-size:.9rem; color:#475569; line-height:1.7; margin-bottom:12px; }
.project-meta-row { display:flex; flex-wrap:wrap; align-items:center; gap:6px; font-size:.83rem; color:#64748b; margin-bottom:16px; }
.author-link { display:flex; align-items:center; gap:6px; color:var(--cdiy); text-decoration:none; font-weight:600; }
.author-link:hover { color:var(--cdiy-dark); }
.meta-divider { color:#cbd5e1; }
.avatar-xs { width:26px; height:26px; border-radius:50%; object-fit:cover; }
.project-actions-row { display:flex; flex-wrap:wrap; gap:10px; }
/* ---- 覆盖公共 btn-ghost 白色文字问题（原为深色Hero设计） ---- */
.project-actions-row .btn,
.project-actions-row .btn-ghost { background: transparent; color: var(--cdiy); border: 1px solid var(--cdiy); }
.project-actions-row .btn:hover,
.project-actions-row .btn-ghost:hover { background: var(--cdiy-light); color: var(--cdiy-dark); border-color: var(--cdiy-dark); }
/* 点赞按钮特殊颜色 */
.project-actions-row .btn-like { color: #ef4444; border-color: #ef4444; }
.project-actions-row .btn-like:hover { background: #fef2f2; color: #dc2626; border-color: #dc2626; }
.btn-like.liked { color:#fff; background:#ef4444; border-color:#ef4444; }
.btn-collect.collected { color:#fff; background:var(--cdiy); border-color:var(--cdiy); }

/* ---- 项目概览 ---- */
.project-overview-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:12px; }
.overview-item { background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px; padding:12px 14px; }
.overview-label { font-size:.75rem; color:#94a3b8; margin-bottom:5px; text-transform:uppercase; letter-spacing:.04em; }
.overview-value { font-size:.95rem; font-weight:700; color:#1e293b; }
.difficulty-stars { color:var(--cdiy); letter-spacing:2px; margin-right:4px; }
.difficulty-text { font-size:.8rem; color:#64748b; }
.cost { color:#16a34a; }

/* ---- 功能特点 ---- */
.features-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:12px; }
.feature-item { border:1px solid #e2e8f0; border-radius:8px; padding:14px; text-align:center; transition:border-color .2s,box-shadow .2s; }
.feature-item:hover { border-color:var(--cdiy); box-shadow:0 2px 10px rgba(217,119,6,.08); }
.feature-icon { font-size:1.6rem; margin-bottom:6px; }
.feature-name { font-weight:700; font-size:.88rem; color:#1e293b; margin-bottom:4px; }
.feature-desc { font-size:.78rem; color:#64748b; line-height:1.5; }

/* ---- 材料清单 ---- */
.bom-table-wrap { overflow-x:auto; }
.bom-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.bom-table th { background:#f8fafc; color:#64748b; font-size:.75rem; text-transform:uppercase; letter-spacing:.04em; padding:10px 12px; text-align:left; border-bottom:2px solid #e2e8f0; }
.bom-table td { padding:10px 12px; border-bottom:1px solid #f1f5f9; color:#334155; }
.bom-table tbody tr:hover { background:#fef9f0; }
.bom-table tfoot td { background:#f8fafc; padding:10px 12px; color:#334155; }
.bom-tip { margin-top:12px; font-size:.82rem; color:#64748b; background:#fef9c3; padding:10px 14px; border-radius:6px; border-left:3px solid var(--cdiy); }

/* ---- 制作步骤 ---- */
.steps-list { display:flex; flex-direction:column; gap:0; }
.step-item { display:flex; gap:16px; padding:20px 0; border-bottom:1px solid #f1f5f9; }
.step-item:last-child { border-bottom:none; }
.step-number { width:36px; height:36px; border-radius:50%; background:var(--cdiy); color:#fff; font-size:.85rem; font-weight:800; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:2px; }
.step-body { flex:1; }
.step-title { font-size:1rem; font-weight:700; color:#1e293b; margin:0 0 10px; }
.step-content { font-size:.88rem; color:#475569; line-height:1.8; }
.step-content p { margin:0 0 10px; }
.step-content ul { padding-left:18px; margin:0 0 10px; }
.step-content li { margin-bottom:4px; }
.step-content code { background:#f1f5f9; color:#d97706; padding:1px 6px; border-radius:4px; font-size:.85em; }
.wiring-table { overflow-x:auto; margin:10px 0; }
.wiring-table table { border-collapse:collapse; font-size:.83rem; }
.wiring-table th,.wiring-table td { border:1px solid #e2e8f0; padding:7px 12px; text-align:center; }
.wiring-table th { background:#f8fafc; color:#64748b; }
.download-code-area { display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }

/* ---- 资源下载 ---- */
.resource-list { display:flex; flex-direction:column; gap:12px; }
.resource-item { display:flex; align-items:center; gap:14px; padding:12px 14px; border:1px solid #e2e8f0; border-radius:8px; transition:border-color .2s,background .2s; }
.resource-item:hover { border-color:var(--cdiy); background:var(--cdiy-light); }
.resource-icon { width:48px; height:40px; display:flex; align-items:center; justify-content:center; border-radius:6px; font-size:.65rem; font-weight:800; letter-spacing:.03em; flex-shrink:0; }
.resource-icon.code { background:#0891b2; color:#fff; }
.resource-icon.stl { background:#7c3aed; color:#fff; }
.resource-icon.doc { background:#ef4444; color:#fff; }
.resource-info { flex:1; }
.resource-name { font-weight:600; font-size:.9rem; color:#1e293b; }
.resource-meta { font-size:.78rem; color:#94a3b8; margin-top:2px; }

/* ---- 成品展示 ---- */
.showcase-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
@media(max-width:600px){ .showcase-grid { grid-template-columns:1fr; } }
.showcase-grid img { width:100%; aspect-ratio:3/2; object-fit:cover; border-radius:8px; border:1px solid #e2e8f0; }

/* ---- 评论区 ---- */
/*.reply-form { display:flex; gap:12px; margin-bottom:24px; padding-bottom:24px; border-bottom:1px solid #f1f5f9; }*/
.avatar-sm { width:38px; height:38px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.reply-input-wrap { flex:1; }
.reply-input-wrap textarea { width:100%; border:1px solid #e2e8f0; border-radius:8px; padding:10px 12px; font-size:.88rem; resize:vertical; box-sizing:border-box; transition:border-color .2s; font-family:inherit; }
.reply-input-wrap textarea:focus { border-color:var(--cdiy); outline:none; }
.reply-form-footer { display:flex; justify-content:space-between; align-items:center; margin-top:8px; }
.comment-list { display:flex; flex-direction:column; }
.comment-item { display:flex; gap:12px; padding:16px 0; border-bottom:1px solid #f1f5f9; }
.comment-item:last-child { border-bottom:none; }
.comment-body { flex:1; }
.comment-meta { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.comment-author { font-weight:700; font-size:.88rem; color:#1e293b; text-decoration:none; }
.comment-author:hover { color:var(--cdiy); }
.author-badge { background:var(--cdiy); color:#fff; font-size:.68rem; padding:1px 6px; border-radius:4px; font-weight:700; }
.comment-time { font-size:.78rem; color:#94a3b8; }
.comment-item p { font-size:.88rem; color:#334155; margin:0 0 8px; line-height:1.7; }
.comment-showcase { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.comment-showcase img { width:120px; height:80px; object-fit:cover; border-radius:6px; border:1px solid #e2e8f0; }
.comment-actions { display:flex; gap:12px; }
.btn-text { background:none; border:none; cursor:pointer; font-size:.8rem; color:#64748b; padding:0; }
.btn-text:hover { color:var(--cdiy); }

/* ---- 分页 ---- */
.pagination { display:flex; justify-content:center; align-items:center; gap:6px; padding-top:20px; }
.page-item { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:6px; border:1px solid #e2e8f0; font-size:.85rem; text-decoration:none; color:#475569; transition:all .2s; }
.page-item.active { background:var(--cdiy); color:#fff; border-color:var(--cdiy); }
.page-item:hover:not(.active) { border-color:var(--cdiy); color:var(--cdiy); }
.page-next { padding:0 12px; border-radius:6px; height:34px; display:inline-flex; align-items:center; border:1px solid #e2e8f0; font-size:.85rem; text-decoration:none; color:#475569; transition:all .2s; }
.page-next:hover { border-color:var(--cdiy); color:var(--cdiy); }
.page-ellipsis { color:#94a3b8; padding:0 4px; }

/* ---- 侧边栏 ---- */
.sidebar-card { margin-bottom:16px; }
.author-card { text-align:center; }
.author-avatar { width:72px; height:72px; border-radius:50%; object-fit:cover; border:3px solid var(--cdiy-light); margin-bottom:8px; }
.author-name { font-weight:700; font-size:1rem; color:#1e293b; margin-bottom:10px; }
.author-stats { display:flex; justify-content:center; gap:20px; font-size:.83rem; color:#64748b; }
.author-stats strong { display:block; font-size:1.05rem; color:#0f172a; }
.sidebar-title { font-size:.92rem; font-weight:700; color:#1e293b; margin:0 0 12px; padding-bottom:10px; border-bottom:1px solid #f1f5f9; }
.info-list { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; }
.info-list li { display:flex; justify-content:space-between; font-size:.83rem; color:#475569; }
.info-list li span:first-child { color:#94a3b8; }
.related-list { display:flex; flex-direction:column; gap:12px; }
.related-item { display:flex; gap:10px; text-decoration:none; border-radius:6px; padding:4px; transition:background .2s; }
.related-item:hover { background:#f8fafc; }
.related-item img { width:68px; height:50px; object-fit:cover; border-radius:5px; flex-shrink:0; }
.related-info { flex:1; }
.related-title { font-size:.83rem; font-weight:600; color:#1e293b; line-height:1.4; margin-bottom:3px; }
.related-meta { font-size:.75rem; color:#94a3b8; }
