/* ============================================
   在那指南 — 全局样式
   ============================================ */

:root {
  --primary: #0f0f23;
  --primary-light: #1a1a3e;
  --accent: #F5A623;
  --accent-light: #FFF3E0;
  --accent-gradient: linear-gradient(135deg, #F5A623, #FF8C00);
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== Header ========== */
.header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.logo span { color: var(--accent); }

.nav { display: flex; gap: 4px; }

.nav a {
  color: rgba(255,255,255,0.7);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: all 0.2s;
}

.nav a:hover, .nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.nav a.active { color: var(--accent); }

/* ========== Hero ========== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 80px 0 60px;
  text-align: center;
  color: #fff;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 16px;
}

.hero h1 span { color: var(--accent); }

.hero p {
  font-size: 18px;
  color: rgba(255,255,255,0.7);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
}

.hero-stat { text-align: center; }

.hero-stat .num {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
}

.hero-stat .label {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}

/* ========== Section ========== */
.section { padding: 48px 0; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
}

.section-title .accent { color: var(--accent); }

.view-all {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.view-all:hover { color: var(--accent); }

/* ========== Card Grid ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .card-grid.cols-3, .card-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
  .card-grid.cols-3, .card-grid.cols-4 { grid-template-columns: 1fr; }
}

/* ========== Cover Card ========== */
.cover-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.cover-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.cover-card .cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.cover-card .cover .img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.cover-card .tag, .ws-card .tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(0,0,0,0.6);
  color: #fff;
}

.cover-card .tag.ai { background: linear-gradient(135deg, #667eea, #764ba2); }
.cover-card .tag.zimeiti { background: linear-gradient(135deg, #f093fb, #f5576c); }
.cover-card .tag.dianshang { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.cover-card .tag.jineng { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.cover-card .tag.xinxi { background: linear-gradient(135deg, #fa709a, #fee140); }
.cover-card .tag.haowai { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }

.cover-card .body {
  padding: 16px;
  flex: 1;
}

.cover-card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cover-card .meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

.cover-card .body h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cover-card .body p {
  font-size: 13px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cover-card .footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== Cover Gradients ========== */
.cover-gradient-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.cover-gradient-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.cover-gradient-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.cover-gradient-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.cover-gradient-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.cover-gradient-6 { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }
.cover-gradient-7 { background: linear-gradient(135deg, #fccb90 0%, #d57eeb 100%); }
.cover-gradient-8 { background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); }
.cover-gradient-9 { background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); }

.cover-card .cover .img.emoji {
  font-size: 48px;
  color: #fff;
}

/* ========== Info Card (连接) ========== */
.info-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.info-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.info-card .card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.info-card .card-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.info-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.info-card .icon.purple { background: var(--accent-light); }
.info-card .icon.blue { background: #e0f2fe; }

.info-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.info-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.info-card .info-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.info-card .status {
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 12px;
}

.info-card .status.active {
  background: #dcfce7;
  color: #166534;
}

.info-card .status.full {
  background: #f3f4f6;
  color: #6b7280;
}

.info-card .contact {
  color: var(--accent);
  font-weight: 500;
}

/* ========== Practice Card (实战) ========== */
.practice-card .income {
  font-size: 20px;
  font-weight: 700;
  color: #059669;
}

.practice-card .income.neg { color: #dc2626; }

.practice-card .rating {
  color: var(--accent);
  font-size: 14px;
}

.practice-card .stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ========== Breadcrumb ========== */
.breadcrumb {
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 6px; }

/* ========== Module Banner ========== */
.module-banner {
  padding: 24px 0 16px;
  margin: 0 0 24px;
}

.module-banner .info h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text);
}

.module-banner .info p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========== Page Header (fallback) ========== */
.page-header {
  padding: 40px 0 24px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ========== Filter Bar ========== */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group .label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
}

.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.filter-divider {
  width: 1px;
  background: var(--border);
  margin: 0 4px;
}

/* ========== Detail Page ========== */
.detail-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  padding: 0 0 48px;
}

@media (max-width: 900px) {
  .detail-wrap { grid-template-columns: 1fr; }
}

.detail-main {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.detail-main .cover-large {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.detail-main .cover-large .img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}

.detail-main h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.3;
}

.detail-main .detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.detail-main .detail-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.detail-main .content {
  font-size: 15px;
  line-height: 1.8;
  color: #374151;
}

.detail-main .content h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.detail-main .content h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 8px;
}

.detail-main .content p { margin-bottom: 16px; }
.detail-main .content ul, .detail-main .content ol { padding-left: 20px; margin-bottom: 16px; }
.detail-main .content li { margin-bottom: 8px; }
.detail-main .content blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0;
  color: #666;
}

/* Detail Sidebar */
.detail-sidebar { position: sticky; top: 80px; align-self: start; }

.sidebar-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.sidebar-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.sidebar-card .related-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.sidebar-card .related-item:last-child { border-bottom: none; }

.sidebar-card .related-item .tiny-cover {
  width: 60px;
  height: 40px;
  border-radius: 4px;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-card .related-item .tiny-cover .img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sidebar-card .related-item .info { flex: 1; }
.sidebar-card .related-item .info .rel-title {
  font-size: 13px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.sidebar-card .related-item .info .rel-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Practice detail table */
.practice-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }

.practice-table td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  font-size: 14px;
}

.practice-table td:first-child {
  font-weight: 600;
  background: #f9fafb;
  width: 100px;
}

.practice-table .highlight { color: #059669; font-weight: 700; font-size: 16px; }

/* ========== Tabs ========== */
.tabs {
  display: flex;
  gap: 4px;
  /* margin-bottom: 24px; */
  border-bottom: 2px solid var(--border);
}

.tab {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

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

/* ========== Resource List ========== */
.resource-list { list-style: none; }

.resource-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.resource-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateX(4px);
}

.resource-item .left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.resource-item .left .icon { font-size: 20px; }

.resource-item .left .info .res-title {
  font-size: 14px;
  font-weight: 600;
}

.resource-item .left .info .res-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.resource-item .action {
  padding: 6px 16px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.resource-item .action:hover { opacity: 0.9; }

/* ========== Footer ========== */
.footer {
  background: var(--primary);
  color: rgba(255,255,255,0.6);
  padding: 32px 0;
  text-align: center;
  font-size: 13px;
}

.footer .beian { margin-top: 8px; }
.footer .beian a { color: rgba(255,255,255,0.5); }

/* ========== 404 ========== */
.page-404-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

.page-404-wrap .page-404 {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.page-404 .code {
  font-size: 120px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.page-404 p {
  font-size: 18px;
  color: var(--text-secondary);
  margin: 16px 0 32px;
}

/* ========== Workshop card (武器库) ========== */
.ws-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.ws-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.ws-card .cover {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  position: relative;
}

.ws-card .cover .type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(0,0,0,0.5);
  color: #fff;
}

.ws-card .body {
  padding: 16px;
}

.ws-card .body h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.ws-card .body .difficulty {
  display: flex;
  gap: 3px;
  font-size: 13px;
}

.ws-card .body .difficulty .star { color: var(--accent); }
.ws-card .body .difficulty .star.empty { color: #ddd; }

.ws-card .body .chapters {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ========== Responsive Nav ========== */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 768px) {
  .nav { display: none; position: absolute; top: var(--header-height); left: 0; right: 0; background: var(--primary); flex-direction: column; padding: 12px 20px; gap: 0; }

  .nav.open { display: flex; }

  .nav a { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.1); border-radius: 0; }

  .mobile-toggle { display: block; }

  .hero h1 { font-size: 32px; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .hero-stat .num { font-size: 24px; }

  .section-title { font-size: 20px; }

  .detail-main { padding: 20px; }
  .detail-main h1 { font-size: 22px; }

  .filter-group .label { display: none; }
}

@media (max-width: 480px) {
  .hero { padding: 48px 0 36px; }
  .hero h1 { font-size: 26px; }

  .section { padding: 32px 0; }
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 48px 0;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination .active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  cursor: default;
}

.pagination .ellipsis {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: default;
  min-width: 20px;
}

.pagination .prev, .pagination .next {
  font-weight: 500;
}

.pagination .prev.disabled, .pagination .next.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .prev.disabled:hover, .pagination .next.disabled:hover {
  border-color: var(--border);
  color: var(--text-secondary);
}

/* ========== Utility ========== */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-24 { margin-top: 24px; }
