/* ============================================
   副业网 - 主样式表
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #e85d04;
  --primary-dark: #d64a00;
  --primary-light: #fff3e0;
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #222222;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #e0e0e0;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --max-width: 1200px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

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

/* --- Header --- */
.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.logo { font-size: 22px; font-weight: 700; flex-shrink: 0; }
.logo a { color: var(--primary); text-decoration: none; }
.logo span { color: var(--text); }

/* Navigation */
.nav { display: flex; gap: 20px; align-items: center; }
.nav a { font-size: 14px; color: var(--text-light); font-weight: 500; transition: color 0.2s; white-space: nowrap; }
.nav a:hover { color: var(--primary); text-decoration: none; }
.nav a.active { color: var(--primary); }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  padding: 8px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

/* Search box */
.search-box { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.search-box input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  width: 180px;
  outline: none;
}
.search-box input:focus { border-color: var(--primary); }
.search-box button {
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  transition: background 0.2s;
}
.search-box button:hover { background: var(--primary-dark); }

/* --- Main Content Area --- */
.main {
  max-width: var(--max-width);
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

.content { min-width: 0; }

/* --- Sidebar --- */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 80px; }

.widget {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.widget-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  color: var(--text);
}
.widget ul li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.5;
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--text); display: block; }
.widget ul li a:hover { color: var(--primary); }

/* --- Categories Pills --- */
.categories { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.pill {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  background: var(--card);
  color: var(--text-light);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.pill:hover, .pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  text-decoration: none;
}

/* --- Section Title --- */
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  color: var(--text);
}

/* --- Article Grid (used in index) --- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

/* --- Article Card --- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
  text-decoration: none;
  color: inherit;
}

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 14px;
}
.card-body { padding: 16px; }
.card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.card-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  margin-top: 4px;
}

/* --- Single Article Page --- */
.article-full {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
  max-width: 800px;
  margin: 0 auto;
}
.article-header { margin-bottom: 30px; }
.article-full .article-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 16px;
  color: var(--text);
}
.article-full .article-meta {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.article-body {
  font-size: 17px;
  line-height: 1.9;
  color: #333;
}
.article-body h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 36px 0 16px;
  padding-left: 14px;
  border-left: 4px solid var(--primary);
  line-height: 1.4;
}
.article-body h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--text);
}
.article-body p { margin-bottom: 18px; }
.article-body ul,
.article-body ol {
  margin: 0 0 18px 0;
  padding-left: 24px;
  list-style: revert;
}
.article-body ul li,
.article-body ol li { margin-bottom: 8px; }
.article-body strong { color: var(--primary); font-weight: 600; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-light);
  font-style: italic;
}
.article-body img {
  margin: 20px auto;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* FAQ Section */
.faq-section {
  background: #f9f9f9;
  border-radius: var(--radius);
  padding: 24px;
  margin: 36px 0;
  border: 1px solid var(--border);
}
.faq-section h2 { margin-top: 0; font-size: 20px; }
.faq-item { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.faq-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.faq-q { font-weight: 700; font-size: 16px; color: var(--primary); margin-bottom: 8px; }
.faq-a { font-size: 15px; color: var(--text-light); line-height: 1.7; }

/* Table of Contents */
.toc {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
  border: 1px solid #ffe0b2;
}
.toc-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--primary); }
.toc ul { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 6px; font-size: 14px; list-style: disc; }
.toc a { color: var(--text-light); }
.toc a:hover { color: var(--primary); }

/* Article tags footer */
.article-tags {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s;
}
.tag:hover { background: var(--primary); color: white; text-decoration: none; }

/* --- Category Header --- */
.category-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px 20px;
  text-align: center;
  margin-bottom: 30px;
  border-radius: var(--radius);
}
.category-header h1 { font-size: 32px; margin-bottom: 10px; font-weight: 800; }
.category-header p { font-size: 16px; opacity: 0.9; max-width: 600px; margin: 0 auto; }

.category-online { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.category-offline { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.category-stories { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.category-tools { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }

/* --- Load More --- */
.load-more { text-align: center; margin: 30px 0; }
.load-more-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 36px;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(232,93,4,0.3);
  cursor: pointer;
}
.load-more-btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(232,93,4,0.4); }

/* --- About Page --- */
.about-page {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
}
.about-page h1 { font-size: 32px; margin-bottom: 30px; text-align: center; color: var(--text); }
.about-section { margin-bottom: 30px; }
.about-section h2 { font-size: 22px; margin-bottom: 16px; color: var(--primary); }
.about-section p { font-size: 16px; line-height: 1.8; margin-bottom: 12px; color: var(--text-light); }
.about-section ul { padding-left: 24px; list-style: disc; }
.about-section li { font-size: 16px; line-height: 1.8; margin-bottom: 8px; color: var(--text-light); }

/* --- Footer --- */
.footer {
  background: var(--text);
  color: #ccc;
  padding: 50px 0 20px;
  margin-top: 60px;
  font-size: 14px;
}
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}
.footer-grid h4 { color: white; font-size: 16px; margin-bottom: 14px; }
.footer-grid a { color: #aaa; font-size: 14px; display: block; margin-bottom: 8px; }
.footer-grid a:hover { color: white; text-decoration: none; }
.footer-bottom { text-align: center; color: #888; font-size: 13px; padding-top: 20px; border-top: 1px solid #444; }
.footer-bottom a { color: #aaa; }

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .main { grid-template-columns: 1fr 260px; gap: 20px; }
}

@media (max-width: 768px) {
  .main {
    grid-template-columns: 1fr;
    padding: 0 12px;
    gap: 20px;
  }

  .sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .widget { padding: 16px; }
  .widget-title { font-size: 15px; margin-bottom: 10px; }

  .header-inner { padding: 0 12px; height: 56px; }

  .menu-toggle { display: flex; }
  .nav {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--card);
    flex-direction: column;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 99;
    gap: 0;
    border-top: 1px solid var(--border);
  }
  .nav.open { display: flex; }
  .nav a {
    padding: 14px 12px;
    font-size: 16px;
    border-bottom: 1px solid var(--border);
    display: block;
    width: 100%;
  }
  .nav a:last-child { border-bottom: none; }
  .nav a.active { background: var(--primary-light); border-radius: 8px; border-bottom: none; margin-bottom: 4px; }

  .search-box input { width: 140px; font-size: 14px; padding: 8px 12px; }
  .search-box button { padding: 8px 14px; font-size: 14px; }

  .logo { font-size: 20px; }

  .category-header { padding: 30px 16px; border-radius: 0; }
  .category-header h1 { font-size: 26px; }
  .category-header p { font-size: 14px; }

  .article-grid { grid-template-columns: 1fr; gap: 16px; }

  .article-full { padding: 20px 16px; border-radius: 0; }
  .article-full .article-title { font-size: 22px; line-height: 1.4; }
  .article-full .article-meta { font-size: 13px; gap: 8px; }
  .article-body { font-size: 16px; line-height: 1.85; }
  .article-body h2 { font-size: 19px; margin: 28px 0 12px; padding-left: 12px; }
  .article-body h3 { font-size: 17px; margin: 22px 0 10px; }

  .about-page { padding: 24px 16px; }
  .about-page h1 { font-size: 26px; }
  .about-section h2 { font-size: 20px; }

  .footer { padding: 30px 0 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .header-inner { height: 52px; padding: 0 10px; }
  .logo { font-size: 18px; }
  .sidebar { grid-template-columns: 1fr; }
  .search-box input { width: 110px; font-size: 13px; }
  .search-box button { padding: 7px 12px; font-size: 13px; }
  .card-img { height: 160px; }
  .card-body { padding: 14px; }
  .card-title { font-size: 15px; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media print {
  .header, .sidebar, .footer, .load-more, .article-tags { display: none; }
  .article-full { box-shadow: none; padding: 0; }
  .article-body { font-size: 12pt; line-height: 1.6; }
}
