/* Agent Skill Hub — 自定义样式 */
:root {
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --primary-light: #EEF2FF;
  --accent: #F59E0B;
  --dark: #1F2937;
  --gray: #6B7280;
  --light-gray: #F3F4F6;
  --border: #E5E7EB;
  --success: #10B981;
  --danger: #EF4444;
  --radius: 8px;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #F9FAFB;
  color: var(--dark);
}

/* 导航栏 */
.navbar-brand {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary) !important;
}
.navbar-brand .brand-icon {
  background: var(--primary);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-right: 8px;
}
.search-box {
  max-width: 500px;
  width: 100%;
}
.search-box input {
  border-radius: 20px 0 0 20px;
  border: 2px solid var(--border);
  padding-left: 18px;
}
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: none;
}
.search-box button {
  border-radius: 0 20px 20px 0;
  background: var(--primary);
  border: none;
  padding: 0 20px;
}

/* Hero区域 */
.hero {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  color: #fff;
  padding: 60px 0 50px;
  text-align: center;
}
.hero h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 10px; }
.hero p { font-size: 1.1rem; opacity: .85; margin-bottom: 25px; }
.hero-search {
  max-width: 600px;
  margin: 0 auto;
}
.hero-search input {
  width: 100%;
  border-radius: 25px;
  padding: 14px 24px;
  font-size: 1.05rem;
  border: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.hero-search .btn {
  width: 100%;
  height: 53px;
  border-radius: 25px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 4px;
  margin-top: 14px;
  border: none;
  background: linear-gradient(135deg, #4338CA, #6D28D9);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,.2);
  transition: all .2s ease;
}
.hero-search .btn:hover {
  background: linear-gradient(135deg, #3730A3, #5B21B6);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}

/* 统计栏 */
.stats-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
}
.stats-bar .stat-item {
  text-align: center;
}
.stats-bar .stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}
.stats-bar .stat-label {
  font-size: .85rem;
  color: var(--gray);
}

/* 分类导航 */
.cat-nav {
  background: #fff;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
}
.cat-nav a {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: .9rem;
  color: var(--gray);
  text-decoration: none;
  margin-right: 6px;
  transition: all .2s;
}
.cat-nav a:hover, .cat-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* Section标题 */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 35px 0 20px;
}
.section-title h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}
.section-title .more-link {
  font-size: .9rem;
  color: var(--primary);
  text-decoration: none;
}

/* 技能卡片 */
.skill-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all .25s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.skill-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(79,70,229,.1);
  transform: translateY(-2px);
}
.skill-card .skill-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.skill-card .skill-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
}
.skill-card .skill-name:hover { color: var(--primary); }
.skill-card .skill-summary {
  font-size: .88rem;
  color: var(--gray);
  line-height: 1.5;
  flex-grow: 1;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.skill-card .skill-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: .8rem;
}
.skill-card .badge-platform {
  background: var(--primary-light);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: .75rem;
}
.skill-card .badge-source-official {
  background: #FEF3C7;
  color: #92400E;
}
.skill-card .badge-source-community {
  background: #D1FAE5;
  color: #065F46;
}
.skill-card .skill-stats {
  display: flex;
  gap: 15px;
  font-size: .8rem;
  color: var(--gray);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.skill-card .quality-star {
  color: var(--accent);
}

/* 排行榜 */
.ranking-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.ranking-item:hover { color: var(--primary); }
.ranking-num {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  margin-right: 12px;
  flex-shrink: 0;
}
.ranking-num.top1 { background: #FEF3C7; color: #D97706; }
.ranking-num.top2 { background: #E5E7EB; color: #6B7280; }
.ranking-num.top3 { background: #FED7AA; color: #C2410C; }
.ranking-num.other { background: var(--light-gray); color: var(--gray); }
.ranking-info { flex-grow: 1; min-width: 0; }
.ranking-name { font-weight: 600; font-size: .95rem; }
.ranking-desc { font-size: .8rem; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-count { font-size: .8rem; color: var(--gray); margin-left: 10px; white-space: nowrap; }

/* 详情页 */
.detail-header {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 20px;
}
.detail-header h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.detail-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .9rem;
  color: var(--gray);
  margin-right: 20px;
}
.install-box {
  background: #1E293B;
  color: #E2E8F0;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 15px 0;
}
.install-box .copy-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: .85rem;
  cursor: pointer;
  white-space: nowrap;
}
.install-box .copy-btn:hover { background: var(--primary-dark); }
.tag-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  background: var(--light-gray);
  color: var(--gray);
  font-size: .82rem;
  margin: 3px;
  text-decoration: none;
}
.tag-pill:hover { background: var(--primary-light); color: var(--primary); }

/* 筛选栏 */
.filter-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.filter-bar .sort-link {
  padding: 5px 14px;
  border-radius: 16px;
  font-size: .88rem;
  color: var(--gray);
  text-decoration: none;
}
.filter-bar .sort-link.active {
  background: var(--primary);
  color: #fff;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 15px; }

/* Footer */
.footer {
  background: #1F2937;
  color: #9CA3AF;
  padding: 30px 0;
  margin-top: 50px;
  text-align: center;
  font-size: .9rem;
}
.footer a { color: #D1D5DB; text-decoration: none; margin: 0 10px; }

/* 响应式 */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: 1rem; }
  .hero-search .btn { width: 100%; }
  .detail-header { padding: 20px; }
  .detail-header h1 { font-size: 1.4rem; }
  .search-box { display: none; }
}

/* 分页 */
.pagination .page-link { color: var(--primary); border-radius: 6px; margin: 0 2px; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* 平台图标徽章 */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: .78rem;
  font-weight: 500;
}
.platform-claude { background: #E0E7FF; color: #4338CA; }
.platform-teleagent { background: #DCFCE7; color: #15803D; }
.platform-doubao { background: #FCE7F3; color: #BE185D; }
.platform-universal { background: #E5E7EB; color: #4B5563; }

/* ===== 详情页优化 ===== */
.detail-hero {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}
.detail-hero-top {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
}
.detail-hero-top h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.detail-hero-top .lead {
  font-size: 1.05rem;
  color: var(--gray);
  margin-bottom: 0;
}
.detail-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: .85rem;
  color: var(--gray);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.detail-meta-row .meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* 安装步骤区 */
.install-section {
  padding: 24px 32px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
}
.install-section h5 {
  font-weight: 600;
  margin-bottom: 16px;
}
.install-step {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
}
.install-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.install-step-body {
  flex-grow: 1;
}
.install-step-body h6 {
  font-weight: 600;
  margin-bottom: 4px;
}
.install-step-body p {
  font-size: .88rem;
  color: var(--gray);
  margin-bottom: 8px;
}
.cmd-block {
  background: #1E293B;
  color: #E2E8F0;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cmd-block .cmd-text {
  overflow-x: auto;
  white-space: nowrap;
}
.cmd-block .copy-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: .82rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.cmd-block .copy-btn:hover { background: var(--primary-dark); }

/* SKILL.md预览 */
.skill-md-preview {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 24px;
}
.skill-md-preview h5 {
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}
.skill-md-content {
  line-height: 1.7;
  font-size: .92rem;
}
.skill-md-content h1, .skill-md-content h2, .skill-md-content h3 {
  font-weight: 600;
  margin: 16px 0 8px;
}
.skill-md-content code {
  background: var(--light-gray);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .85rem;
}
.skill-md-content pre {
  background: #1E293B;
  color: #E2E8F0;
  padding: 12px 16px;
  border-radius: 8px;
  overflow-x: auto;
}
.skill-md-content ul, .skill-md-content ol {
  padding-left: 20px;
}

/* 元信息表 */
.meta-info-table {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}
.meta-info-table table {
  width: 100%;
  font-size: .88rem;
}
.meta-info-table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.meta-info-table td:first-child {
  color: var(--gray);
  width: 100px;
}
.meta-info-table td:last-child {
  font-weight: 500;
}

/* 评分分布 */
.rating-distribution {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.rating-score-big {
  text-align: center;
}
.rating-score-big .score {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--dark);
}
.rating-score-big .stars {
  color: var(--accent);
  font-size: 1.1rem;
}
.rating-score-big .count {
  font-size: .82rem;
  color: var(--gray);
}
.rating-bars {
  flex-grow: 1;
}
.rating-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.rating-bar-row .label {
  font-size: .8rem;
  color: var(--gray);
  width: 30px;
}
.rating-bar-row .bar {
  flex-grow: 1;
  height: 8px;
  background: var(--light-gray);
  border-radius: 4px;
  overflow: hidden;
}
.rating-bar-row .bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}

/* 评价卡片 */
.review-card {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.review-card .review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.review-card .review-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.review-card .review-user {
  font-weight: 600;
  font-size: .9rem;
}
.review-card .review-date {
  font-size: .8rem;
  color: var(--gray);
}
.review-card .review-stars {
  color: var(--accent);
  font-size: .85rem;
}
.review-card .review-content {
  font-size: .9rem;
  color: #374151;
  line-height: 1.6;
}

/* 评价表单 */
.review-form {
  background: var(--light-gray);
  border-radius: 8px;
  padding: 20px;
}
.star-input {
  font-size: 1.5rem;
  cursor: pointer;
  color: #D1D5DB;
}
.star-input.active { color: var(--accent); }

/* ===== 登录/注册页 ===== */
.auth-card {
  max-width: 420px;
  margin: 40px auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}
.auth-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.auth-card .auth-subtitle {
  color: var(--gray);
  font-size: .92rem;
  margin-bottom: 24px;
}
.auth-card .form-control {
  border-radius: 8px;
  padding: 10px 14px;
}
.auth-card .btn-primary {
  background: var(--primary);
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-weight: 600;
}
.auth-card .btn-primary:hover { background: var(--primary-dark); }
.auth-divider {
  text-align: center;
  position: relative;
  margin: 20px 0;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  background: #fff;
  padding: 0 12px;
  position: relative;
  color: var(--gray);
  font-size: .85rem;
}

/* ===== 提交技能页 ===== */
.submit-card {
  max-width: 720px;
  margin: 30px auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}
.submit-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.submit-card .form-label {
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 5px;
}
.submit-card .form-control {
  border-radius: 8px;
}
.submit-card .help-text {
  font-size: .82rem;
  color: var(--gray);
  margin-top: 4px;
}
.platform-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.platform-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.platform-checkbox input { margin: 0; }
.platform-checkbox.checked {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Toast消息 */
.toast-msg {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  background: #1E293B;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: .9rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  animation: slideIn .3s ease;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
