/* ===== CSS Variables ===== */
:root {
  --accent-color: #ff5722;
  --primary-color: #2c3e50;
  --secondary-color: #546e7a;
  --bg-color: #f5f7fa;
  --card-bg: #ffffff;
  --text-color: #333333;
  --text-light: #666666;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --max-width: 1200px;
  --gap: 24px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

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

/* ===== Header ===== */
.header {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-color);
}

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

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

.nav a {
  color: var(--text-light);
  font-weight: 500;
  transition: color 0.3s;
}

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

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-color);
  border-radius: 20px;
  padding: 8px 16px;
  gap: 8px;
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  width: 180px;
  font-size: 14px;
}

.search-box button {
  border: none;
  background: var(--accent-color);
  color: white;
  padding: 6px 16px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 14px;
  transition: opacity 0.3s;
}

.search-box button:hover {
  opacity: 0.9;
}

/* ===== Hero Section ===== */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero h1 {
  font-size: 36px;
  color: var(--primary-color);
  margin-bottom: 12px;
}

.hero p {
  color: var(--text-light);
  font-size: 18px;
}

/* ===== Section Title ===== */
.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 4px solid var(--accent-color);
}

/* ===== Collections Grid ===== */
.collections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-bottom: 40px;
}

.collection-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  cursor: pointer;
}

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

.collection-card .icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent-color), #ff8a65);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: white;
  font-size: 24px;
}

.collection-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.collection-card p {
  color: var(--text-light);
  font-size: 14px;
}

/* ===== Bookmark Cards ===== */
.bookmark-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.bookmark-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s;
}

.bookmark-card:hover {
  box-shadow: var(--shadow-hover);
}

.bookmark-card .favicon {
  width: 40px;
  height: 40px;
  background: var(--bg-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.bookmark-card .content {
  flex: 1;
}

.bookmark-card h4 {
  font-size: 16px;
  margin-bottom: 4px;
  color: var(--primary-color);
}

.bookmark-card .meta {
  font-size: 13px;
  color: var(--text-light);
}

.bookmark-card .tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: var(--bg-color);
  color: var(--secondary-color);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
}

.tag:hover {
  background: var(--accent-color);
  color: white;
}

/* ===== Article Grid ===== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-bottom: 40px;
}

.article-column h4 {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.article-column ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-column li a {
  display: block;
  padding: 10px 12px;
  background: var(--card-bg);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-color);
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.article-column li a:hover {
  border-left-color: var(--accent-color);
  background: white;
  box-shadow: var(--shadow);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  padding: 20px 0;
  font-size: 14px;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--text-light);
}

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

.breadcrumb span {
  margin: 0 8px;
}

/* ===== Category Header ===== */
.category-header {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.category-header h1 {
  font-size: 28px;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.category-header p {
  color: var(--text-light);
}

/* ===== Filter Tabs ===== */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-tabs a {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text-light);
  transition: all 0.3s;
}

.filter-tabs a.active,
.filter-tabs a:hover {
  background: var(--accent-color);
  color: white;
}

/* ===== Tag Cloud ===== */
.tag-cloud {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
  box-shadow: var(--shadow);
}

.tag-cloud h4 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.tag-cloud .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-cloud .tag {
  font-size: 13px;
}

.tag-count {
  color: var(--text-light);
  margin-left: 4px;
}

/* ===== Article Page ===== */
.article-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}

.article-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
  font-size: 32px;
  color: var(--primary-color);
  margin-bottom: 16px;
  line-height: 1.3;
}

.article-meta {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: var(--text-light);
}

.article-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-color);
}

.article-content h2 {
  font-size: 24px;
  color: var(--primary-color);
  margin: 32px 0 16px;
}

.article-content h3 {
  font-size: 20px;
  color: var(--primary-color);
  margin: 24px 0 12px;
}

.article-content p {
  margin-bottom: 16px;
}

.article-content ul,
.article-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content a {
  color: var(--accent-color);
  text-decoration: underline;
}

/* ===== Related Section ===== */
.related-section {
  margin-top: 40px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.related-card {
  background: var(--bg-color);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.3s;
}

.related-card:hover {
  background: white;
  box-shadow: var(--shadow);
}

.related-card h5 {
  font-size: 15px;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.related-card p {
  font-size: 13px;
  color: var(--text-light);
}

/* ===== 404 Page ===== */
.error-page {
  text-align: center;
  padding: 80px 0;
}

.error-code {
  font-size: 120px;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
  margin-bottom: 16px;
}

.error-page h1 {
  font-size: 28px;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.error-page p {
  color: var(--text-light);
  margin-bottom: 32px;
}

.btn-primary {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  padding: 12px 32px;
  border-radius: 24px;
  font-weight: 500;
  transition: opacity 0.3s;
}

.btn-primary:hover {
  opacity: 0.9;
}

/* ===== Footer ===== */
.footer {
  background: var(--primary-color);
  color: white;
  padding: 40px 0;
  margin-top: 60px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer p {
  font-size: 14px;
  opacity: 0.8;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 14px;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.footer-links a:hover {
  opacity: 1;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .collections,
  .article-grid,
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 16px;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 20px;
  }

  .search-box {
    flex: 1;
  }

  .search-box input {
    width: 100%;
  }

  .hero h1 {
    font-size: 28px;
  }

  .collections,
  .article-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .bookmark-card {
    flex-wrap: wrap;
  }

  .bookmark-card .tags {
    width: 100%;
    margin-top: 8px;
  }

  .article-container {
    padding: 24px;
  }

  .article-header h1 {
    font-size: 24px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --gap: 16px;
  }

  .hero {
    padding: 40px 0 24px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .hero p {
    font-size: 16px;
  }

  .collection-card {
    padding: 20px;
  }

  .category-header {
    padding: 24px;
  }

  .filter-tabs {
    flex-wrap: wrap;
  }
}
