/* SGSkill 设计系统 — 深色技术感 + 青绿强调 */
/* 避免模板化的奶油/纯白,选 distinctive 的深色方向 */

:root {
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --bg-hover: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #7d8590;
  --accent: #3fb950;
  --accent-hover: #2da44e;
  --accent-dim: rgba(63, 185, 80, 0.12);
  --danger: #f85149;
  --warning: #d29922;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --max-width: 1200px;
  --font-body: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ===== 导航栏 ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  height: 56px;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-brand .dot { color: var(--accent); }
.nav-links { display: flex; gap: 20px; flex: 1; }
.nav-links a {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.nav-user .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

/* ===== 布局容器 ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 32px; }

/* ===== Hero 搜索区(signature)===== */
.hero {
  padding: 64px 32px 40px;
  text-align: center;
  max-width: var(--max-width);
  margin: 0 auto;
}
.hero h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { color: var(--text-dim); font-size: 17px; margin-bottom: 32px; }
.search-bar {
  display: flex;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
}
.search-bar input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color 0.15s;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-bar input::placeholder { color: var(--text-dim); }
.search-bar button {
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font-body);
}
.search-bar button:hover { background: var(--accent-hover); }

/* ===== 热门区(横向滚动轨)===== */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}
.section-title .badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hot-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.hot-track::-webkit-scrollbar { height: 6px; }
.hot-track::-webkit-scrollbar-track { background: transparent; }
.hot-track::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.hot-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hot-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.hot-card .rank {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}
.hot-card .rank .num { color: var(--accent); font-weight: 700; }
.hot-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}
.hot-card .desc {
  font-size: 13px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hot-card .stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: auto;
}
.hot-card .stats .star { color: var(--warning); }

/* ===== 筛选栏 ===== */
.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 24px 0 16px;
}
.filters select {
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
}
.filters select:focus { outline: none; border-color: var(--accent); }

/* ===== skill 网格 ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-bottom: 48px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.card h3 { font-size: 16px; font-weight: 600; }
.card .desc {
  font-size: 13px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.card .cat-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
  font-weight: 500;
  width: fit-content;
}

/* ===== 分页 ===== */
.pager {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 0 0 48px;
}
.pager a {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== 表单(登录/注册/上传)===== */
.form-card {
  max-width: 440px;
  margin: 48px auto;
  padding: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.form-card.wide { max-width: 600px; }
.form-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
}
.form-card label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  margin-top: 16px;
}
.form-card label:first-of-type { margin-top: 0; }
.form-card input,
.form-card textarea,
.form-card select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
}
.form-card textarea { resize: vertical; min-height: 80px; }
.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-card button {
  width: 100%;
  margin-top: 24px;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s;
}
.form-card button:hover { background: var(--accent-hover); }
.form-card button:disabled { background: var(--border); cursor: not-allowed; }
.form-card .hint { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-dim); }
.form-card .hint a { font-size: 13px; }

/* ===== 详情页 ===== */
.detail {
  max-width: 800px;
  margin: 32px auto;
  padding: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.detail h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.detail .meta-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.detail .meta-row .stat { font-family: var(--font-mono); }
.detail .meta-row .star { color: var(--warning); }
.detail .readme {
  line-height: 1.7;
  font-size: 15px;
}
.detail .readme h1, .detail .readme h2, .detail .readme h3 {
  margin-top: 24px; margin-bottom: 12px; font-weight: 700;
}
.detail .readme code {
  font-family: var(--font-mono);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}
.detail .readme pre {
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid var(--border);
}
.detail .readme pre code { background: none; padding: 0; }
.detail .readme a { color: var(--accent); }
.detail .readme ul, .detail .readme ol { padding-left: 24px; margin: 12px 0; }
.detail .readme blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  color: var(--text-dim);
  margin: 12px 0;
}
.detail .actions { margin: 24px 0; display: flex; gap: 12px; align-items: center; }
.detail .actions .btn-download {
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  text-decoration: none;
  display: inline-block;
}
.detail .actions .btn-download:hover { background: var(--accent-hover); text-decoration: none; }

/* 评分区 */
.rating-box { margin: 24px 0; padding: 20px; background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.rating-box .label { font-size: 14px; color: var(--text-dim); margin-bottom: 8px; }
.stars { display: flex; gap: 4px; }
.stars span { cursor: pointer; font-size: 24px; color: var(--border); transition: color 0.1s; }
.stars span.on { color: var(--warning); }
.stars span:hover { color: var(--warning); }
.rating-box textarea {
  width: 100%; margin-top: 12px; padding: 10px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: var(--font-body);
}
.rating-box button {
  margin-top: 12px; padding: 8px 20px;
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-family: var(--font-body);
}

/* 评论列表 */
.reviews { max-width: 800px; margin: 0 auto 48px; padding: 0 32px; }
.reviews h2 { font-size: 18px; margin-bottom: 16px; }
.review-item { padding: 16px 0; border-top: 1px solid var(--border); }
.review-item .head { display: flex; gap: 12px; align-items: center; font-size: 14px; margin-bottom: 6px; }
.review-item .head .who { font-weight: 600; }
.review-item .head .when { color: var(--text-dim); font-size: 12px; font-family: var(--font-mono); }
.review-item p { color: var(--text-dim); font-size: 14px; }

/* ===== 列表页(我的/管理)===== */
.list-page { max-width: 800px; margin: 32px auto; padding: 0 32px; }
.list-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.list-item h3 { font-size: 16px; margin-bottom: 4px; }
.list-item h3 small { color: var(--text-dim); font-weight: 400; font-family: var(--font-mono); font-size: 13px; }
.list-item p { color: var(--text-dim); font-size: 14px; margin: 8px 0; }
.status {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.status.approved { background: var(--accent-dim); color: var(--accent); }
.status.pending { background: rgba(210, 153, 34, 0.15); color: var(--warning); }
.status.rejected { background: rgba(248, 81, 73, 0.15); color: var(--danger); }
.status.unlisted { background: rgba(125, 133, 144, 0.15); color: var(--text-dim); }

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-body);
  text-decoration: none;
  display: inline-block;
  margin-right: 8px;
}
.btn-sm:hover { border-color: var(--accent); text-decoration: none; }
.btn-sm.danger { color: var(--danger); border-color: var(--danger); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 1000;
  font-size: 14px;
  animation: slideIn 0.2s ease;
}
.toast-error { border-color: var(--danger); color: var(--danger); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== 空状态 ===== */
.empty { padding: 48px; text-align: center; color: var(--text-dim); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .nav { padding: 0 16px; gap: 12px; }
  .nav-links { gap: 12px; }
  .hero { padding: 40px 16px 24px; }
  .hero h1 { font-size: 28px; }
  .container { padding: 0 16px; }
  .grid { grid-template-columns: 1fr; }
  .detail, .reviews, .list-page { padding: 0 16px; }
  .hot-card { flex: 0 0 240px; }
}

/* 减少动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
