* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Noto Sans SC', 'Hiragino Sans GB', sans-serif; background: #f5f6fa; color: #2c3e50; }
a { color: #5b6abf; text-decoration: none; }
a:hover { color: #3d4db3; }

/* Nav */
.nav { background: #fff; border-bottom: 1px solid #eef0f5; position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; height: 60px; padding: 0 24px; }
.nav-logo { font-size: 20px; font-weight: 700; color: #5b6abf; display: flex; align-items: center; gap: 8px; }
.nav-logo:hover { color: #3d4db3; }
.nav-links { margin-left: 40px; display: flex; gap: 24px; }
.nav-links a { color: #6b7c93; font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: #5b6abf; }

/* Page hero (for subpages) */
.page-hero { background: linear-gradient(135deg, #5b6abf 0%, #764ba2 100%); padding: 40px 24px; text-align: center; color: #fff; }
.page-hero h1 { font-size: 28px; margin-bottom: 8px; }
.page-hero .page-info { font-size: 14px; opacity: 0.7; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 24px 40px; }

/* Search bar */
.search-bar { margin-bottom: 24px; }

/* Section */
.section-header { display: flex; justify-content: space-between; align-items: center; margin: 32px 0 20px; }
.section-title { font-size: 20px; font-weight: 600; }
.section-more { font-size: 14px; color: #5b6abf; font-weight: 500; }

/* Category grid */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 40px; }
.cat-card { background: #fff; border-radius: 12px; padding: 16px; text-decoration: none; box-shadow: 0 1px 4px rgba(0,0,0,0.04); transition: all 0.2s; display: flex; align-items: center; gap: 12px; }
.cat-card:hover { box-shadow: 0 4px 16px rgba(91,106,191,0.12); transform: translateY(-2px); }
.cat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.cat-name { font-size: 14px; font-weight: 600; color: #2c3e50; }
.cat-count { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* Skill card */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.skill-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); transition: all 0.2s; border: 1px solid transparent; }
.skill-card:hover { box-shadow: 0 4px 20px rgba(91,106,191,0.10); border-color: #e8ebf5; transform: translateY(-2px); }
.skill-card .card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.skill-card .card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-cat { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #eef0ff; color: #5b6abf; }
.badge-key { font-size: 11px; padding: 2px 6px; border-radius: 20px; background: #fef3e7; color: #e67e22; }
.badge-zh { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #e8f8e8; color: #27ae60; }
.badge-verified { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #e8f8e8; color: #27ae60; }
.skill-card h3 { font-size: 16px; margin-bottom: 6px; }
.skill-card h3 a { color: #2c3e50; }
.skill-card h3 a:hover { color: #5b6abf; }
.skill-card .owner { font-size: 12px; color: #94a3b8; margin-bottom: 8px; }
.skill-card .desc { font-size: 13px; color: #64748b; line-height: 1.6; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skill-card .stats { display: flex; gap: 16px; font-size: 13px; color: #94a3b8; }
.skill-card .stats span { display: flex; align-items: center; gap: 4px; }
.star { color: #f39c12; }
.dl { color: #5b6abf; }
.inst { color: #27ae60; }

/* Info bar (under author row) */
.info-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.info-bar .info-item { font-size: 12px; color: #64748b; background: #f8f9fc; padding: 4px 10px; border-radius: 6px; }
.info-bar .info-item a { color: #5b6abf; }

/* Detail page */
.detail-page { max-width: 960px; margin: 0 auto; padding: 24px; }
.back-link { color: #5b6abf; font-size: 14px; margin-bottom: 16px; display: inline-block; }
.back-link:hover { text-decoration: underline; }

.detail-hero { background: #fff; border-radius: 16px; padding: 32px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); margin-bottom: 24px; }
.detail-hero .meta-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.detail-hero h1 { font-size: 28px; margin-bottom: 12px; }
.detail-hero .summary { font-size: 15px; color: #64748b; line-height: 1.7; }
.detail-hero .summary-zh { font-size: 14px; color: #94a3b8; line-height: 1.6; margin-top: 8px; }
.detail-hero .author-row { margin-top: 12px; font-size: 14px; color: #94a3b8; }
.detail-hero .author-row img { width: 22px; height: 22px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.detail-hero .author-row a { color: #5b6abf; }

.stats-bar { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 20px; padding-top: 20px; border-top: 1px solid #eef0f5; }
.stat-item { text-align: center; }
.stat-item .num { font-size: 22px; font-weight: 700; display: block; }
.stat-item .label { font-size: 12px; color: #94a3b8; margin-top: 4px; }

.detail-tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 2px solid #eef0f5; }
.detail-tab { padding: 12px 20px; border: none; background: none; cursor: pointer; font-size: 14px; color: #94a3b8; border-bottom: 2px solid transparent; margin-bottom: -2px; font-weight: 500; transition: 0.2s; }
.detail-tab:hover { color: #5b6abf; }
.detail-tab.active { color: #5b6abf; border-bottom-color: #5b6abf; }

.detail-content { display: none; }
.detail-content.active { display: block; }

.detail-section { background: #fff; border-radius: 12px; padding: 28px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); margin-bottom: 20px; }
.detail-section h2 { font-size: 18px; font-weight: 600; margin-bottom: 16px; color: #2c3e50; }
.detail-section .desc-text { font-size: 14px; line-height: 1.8; color: #475569; }

.info-grid { display: grid; grid-template-columns: 140px 1fr; gap: 12px 16px; font-size: 14px; }
.info-grid .il { color: #94a3b8; }
.info-grid .iv { color: #475569; }
.info-grid a { color: #5b6abf; word-break: break-all; }

.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 12px 0; }
.sec-card { padding: 14px 18px; border-radius: 10px; background: #f8f9fc; }
.sec-card h4 { font-size: 13px; color: #94a3b8; margin-bottom: 6px; }
.sec-card .sec-status { font-size: 14px; font-weight: 600; }
.sec-card .sec-link { font-size: 12px; color: #5b6abf; display: inline-block; margin-top: 6px; }
.sec-safe { color: #27ae60; }
.sec-queued { color: #f39c12; }

/* Markdown preview */
.md-content { line-height: 1.8; font-size: 14px; color: #475569; }
.md-content pre { background: #f8f9fc; padding: 16px; border-radius: 8px; overflow-x: auto; margin: 12px 0; font-size: 13px; }
.md-content code { background: #f0f1f5; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.md-content h2 { font-size: 18px; margin: 24px 0 12px; color: #2c3e50; }
.md-content h3 { font-size: 16px; margin: 20px 0 10px; color: #334155; }
.md-content table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.md-content th, .md-content td { border: 1px solid #e2e8f0; padding: 8px 12px; text-align: left; font-size: 13px; }
.md-content th { background: #f8f9fc; font-weight: 600; }
.md-content ul, .md-content ol { padding-left: 20px; margin: 8px 0; }
.md-content p { margin: 8px 0; }
.md-content hr { border: none; border-top: 1px solid #eef0f5; margin: 20px 0; }
.md-content blockquote { border-left: 3px solid #5b6abf; padding-left: 14px; color: #64748b; margin: 12px 0; font-size: 13px; }

.version-list { list-style: none; }
.version-list li { padding: 10px 0; border-bottom: 1px solid #f0f2f5; display: flex; justify-content: space-between; align-items: center; }
.version-list li:last-child { border-bottom: none; }
.version-tag { padding: 2px 10px; border-radius: 20px; font-size: 13px; background: #eef0ff; color: #5b6abf; font-weight: 600; }
.version-date { font-size: 12px; color: #94a3b8; }

/* Tags */
.tags-wrap { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.tag { padding: 3px 10px; border-radius: 20px; background: #f0f2f5; color: #64748b; font-size: 12px; }

/* Footer */
.footer { text-align: center; padding: 32px; color: #94a3b8; font-size: 13px; border-top: 1px solid #eef0f5; }

@media (max-width: 768px) {
    .skill-grid { grid-template-columns: 1fr; }
    .cat-grid { grid-template-columns: repeat(2,1fr); }
    .detail-hero h1 { font-size: 22px; }
    .stats-bar { gap: 16px; }
    .info-grid { grid-template-columns: 100px 1fr; }
}