/* 小葱技能站 - 全站样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #fffbf5; --surface: #ffffff; --text: #1f1f1f; --text-muted: #737373;
  --border: #f5f0e8; --accent: #ff6b35; --accent-dark: #e55a2a; --accent-soft: #fff3ed;
  --green: #10b981; --amber: #f59e0b; --blue: #3b82f6;
  --radius: 16px; --shadow: 0 4px 20px rgba(255,107,53,.12); --shadow-lg: 0 16px 40px rgba(255,107,53,.2);
}
body { font-family: 'DM Sans', -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif; background: var(--bg); color: var(--text); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Nav ===== */
nav { position: sticky; top: 0; z-index: 50; background: rgba(255,251,245,.95); backdrop-filter: blur(12px); border-bottom: 2px solid var(--border); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 20px; }
.logo img { width: 36px; height: 36px; border-radius: 10px; }
.nav-search { flex: 1; max-width: 420px; position: relative; margin: 0 12px; }
.nav-search input { width: 100%; height: 42px; padding: 0 16px 0 42px; border: 2px solid var(--border); border-radius: 10px; background: #fff; font-size: 14.5px; font-family: inherit; }
.nav-search input:focus { outline: none; border-color: var(--accent); }
.nav-search .icon { position: absolute; left: 14px; top: 11px; color: var(--text-muted); }
.nav-search .search-btn { position: absolute; right: 4px; top: 4px; height: 34px; padding: 0 14px; border: none; border-radius: 8px; background: var(--accent); color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit; transition: .15s; }
.nav-search .search-btn:hover { background: var(--accent-dark); }
.nav-search input { padding-right: 64px; }
.nav-links { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.nav-links a { padding: 9px 16px; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: var(--text-muted); transition: .15s; }
.nav-links a:hover { background: var(--accent-soft); color: var(--accent); }

/* 语言切换下拉菜单 */
.lang-switcher { position: relative; display: inline-block; }
.lang-btn { padding: 9px 16px; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: var(--text-muted); background: none; border: none; cursor: pointer; transition: .15s; font-family: inherit; }
.lang-btn:hover { background: var(--accent-soft); color: var(--accent); }
.lang-dropdown { display: none; position: absolute; top: 100%; left: 0; min-width: 140px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 100; padding: 6px 0; margin-top: 4px; }
.lang-switcher:hover .lang-dropdown,
.lang-switcher:focus-within .lang-dropdown { display: block; }
.lang-dropdown a { display: block; padding: 9px 16px; font-size: 14px; color: var(--text-muted); text-decoration: none; white-space: nowrap; transition: .1s; }
.lang-dropdown a:hover { background: var(--accent-soft); color: var(--accent); }
.lang-dropdown a.active { color: var(--accent); font-weight: 700; }
.btn-primary { background: var(--accent) !important; color: #fff !important; }
.btn-primary:hover { background: var(--accent-dark) !important; transform: translateY(-1px); }

/* ===== Breadcrumb ===== */
.breadcrumb { padding: 20px 0 0; font-size: 14px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: #ccc; }

/* ===== Skill Card (list) ===== */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.skill-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; gap: 14px; transition: .2s; }
.skill-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.sc-icon { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; font-size: 26px; color: #fff; flex-shrink: 0; overflow: hidden; }
.sc-icon img { width: 100%; height: 100%; object-fit: cover; }
.sc-body { flex: 1; min-width: 0; }
.sc-title { font-weight: 800; font-size: 16px; margin-bottom: 2px; }
.sc-author { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }
.sc-desc { font-size: 13.5px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 12px; min-height: 38px; }
.sc-foot { display: flex; align-items: center; justify-content: space-between; }
.sc-stats { font-size: 12.5px; color: var(--text-muted); display: flex; gap: 12px; }
.sc-stats .r { color: var(--amber); font-weight: 700; }
.bc-tag { font-size: 11px; padding: 3px 10px; border-radius: 8px; font-weight: 700; background: #d1fae5; color: #065f46; }
.bc-tag.paid { background: #fef3c7; color: #92400e; }

/* ===== Page Header ===== */
.page-head { padding: 32px 0 24px; }
.page-head h1 { font-size: 34px; font-weight: 900; letter-spacing: -.02em; display: flex; align-items: center; gap: 14px; }
.page-head .ph-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 30px; }
.page-head .ph-count { font-size: 15px; color: var(--text-muted); margin-top: 8px; font-weight: 600; }

/* ===== Toolbar (筛选/排序) ===== */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.toolbar .result-count { font-size: 14.5px; color: var(--text-muted); font-weight: 600; }
.sort-tabs { display: flex; gap: 6px; background: #fff; border: 2px solid var(--border); border-radius: 12px; padding: 4px; }
.sort-tabs a { padding: 7px 16px; border-radius: 9px; font-size: 13.5px; font-weight: 700; color: var(--text-muted); transition: .15s; }
.sort-tabs a.active { background: var(--accent); color: #fff; }
.sort-tabs a:hover:not(.active) { background: var(--accent-soft); color: var(--accent); }

/* ===== Filter sidebar ===== */
.search-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.filter-panel { background: #fff; border: 2px solid var(--border); border-radius: var(--radius); padding: 22px; position: sticky; top: 88px; }
.filter-group { margin-bottom: 24px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group h4 { font-size: 14px; font-weight: 800; margin-bottom: 12px; }
.filter-option { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 14px; color: var(--text-muted); cursor: pointer; }
.filter-option:hover { color: var(--accent); }
.filter-option input { accent-color: var(--accent); width: 16px; height: 16px; }
.filter-cat { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: 9px; font-size: 14px; color: var(--text-muted); transition: .15s; }
.filter-cat:hover, .filter-cat.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.filter-cat .n { font-size: 12px; opacity: .7; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 40px 0; }
.pagination a, .pagination span { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 2px solid var(--border); background: #fff; font-weight: 700; font-size: 14px; color: var(--text-muted); transition: .15s; padding: 0 12px; }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state .emoji { font-size: 64px; margin-bottom: 16px; }
.empty-state h3 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 24px; }
.empty-state .btn-primary { display: inline-block; padding: 12px 28px; border-radius: 12px; font-weight: 700; }

/* ===== Skill Detail ===== */
.detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; padding: 8px 0 60px; }
.detail-header { display: flex; gap: 20px; margin-bottom: 28px; }
.detail-icon { width: 88px; height: 88px; border-radius: 20px; display: grid; place-items: center; font-size: 44px; color: #fff; flex-shrink: 0; overflow: hidden; }
.detail-icon img { width: 100%; height: 100%; object-fit: cover; }
.detail-title h1 { font-size: 32px; font-weight: 900; letter-spacing: -.02em; margin-bottom: 6px; }
.detail-meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; color: var(--text-muted); font-size: 14px; }
.detail-meta .verified { color: var(--green); font-weight: 700; }
.detail-badges { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.badge { font-size: 12px; padding: 4px 12px; border-radius: 8px; font-weight: 700; }
.badge.free { background: #d1fae5; color: #065f46; }
.badge.paid { background: #fef3c7; color: #92400e; }
.badge.api { background: #dbeafe; color: #1e40af; }
.badge.cat { background: var(--accent-soft); color: var(--accent-dark); }

.detail-section { background: #fff; border: 2px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 24px; }
.detail-section h2 { font-size: 20px; font-weight: 800; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.detail-desc { font-size: 15px; line-height: 1.8; color: #333; }
.detail-desc h1,.detail-desc h2,.detail-desc h3 { margin: 16px 0 8px; }
.detail-desc p { margin-bottom: 12px; }
.detail-desc code { background: #f5f0e8; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.detail-desc pre { background: #1f1f1f; color: #eee; padding: 16px; border-radius: 10px; overflow-x: auto; margin: 12px 0; }
.detail-desc pre code { background: transparent; padding: 0; }
.detail-desc ul,.detail-desc ol { margin: 0 0 12px 24px; }

/* Radar */
.radar-wrap { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.radar-scores { flex: 1; min-width: 200px; }
.radar-score-item { margin-bottom: 14px; }
.rs-label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.rs-label .val { color: var(--accent); font-weight: 800; }
.rs-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.rs-fill { height: 100%; background: linear-gradient(90deg, #ff6b35, #ff9a76); border-radius: 4px; }

/* File list */
.file-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.file-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; transition: .1s; }
.file-item:hover { background: var(--accent-soft); }
.file-item .fname { font-family: 'SF Mono', Consolas, monospace; color: #333; display: flex; align-items: center; gap: 8px; }
.file-item .fsize { color: var(--text-muted); font-size: 12.5px; }

/* Download sidebar */
.download-box { background: #fff; border: 2px solid var(--border); border-radius: var(--radius); padding: 24px; position: sticky; top: 88px; }
.dl-price { font-size: 28px; font-weight: 900; color: var(--green); margin-bottom: 4px; }
.dl-price.paid { color: var(--accent); }
.dl-price-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.btn-install { width: 100%; height: 52px; background: var(--accent); color: #fff; border: none; border-radius: 13px; font-weight: 800; font-size: 16px; cursor: pointer; font-family: inherit; transition: .15s; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; }
.btn-install:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-download { width: 100%; height: 46px; background: #fff; color: var(--text); border: 2px solid var(--border); border-radius: 13px; font-weight: 700; font-size: 14.5px; cursor: pointer; font-family: inherit; transition: .15s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-download:hover { border-color: var(--accent); color: var(--accent); }
.dl-stats { border-top: 2px solid var(--border); margin-top: 20px; padding-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.dl-stat { display: flex; justify-content: space-between; font-size: 14px; }
.dl-stat .k { color: var(--text-muted); }
.dl-stat .v { font-weight: 700; }

/* Related */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* ===== Footer ===== */
footer { border-top: 2px solid var(--border); padding: 44px 0; background: #fff; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 26px; font-size: 14.5px; color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }
.footer-note { font-size: 13px; color: var(--text-muted); max-width: 500px; }
.footer-lang { width: 100%; font-size: 13px; color: var(--text-muted); text-align: center; margin-top: -8px; }
.footer-lang a { color: var(--accent); text-decoration: none; }
.footer-lang a:hover { text-decoration: underline; }
.footer-lang-divider { margin: 0 6px; opacity: .5; }

@media (max-width: 900px) {
  .search-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  .detail-layout { grid-template-columns: 1fr; }
  .download-box { position: static; }
  .nav-search { display: none; }
}
