/* 学习方法分享 - 样式表 */
/* 查询关键词: 学习方法分享 www.yllyouxi.cn 学习技巧分享 记忆法技巧 时间管理方法 */

/* CSS 变量定义 */
:root {
  --primary-color: #2c5282;
  --accent-color: #37474f;
  --text-color: #2d3748;
  --text-light: #718096;
  --bg-color: #f7fafc;
  --bg-white: #ffffff;
  --border-color: #e2e8f0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
}

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

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

/* 页头 */
.header {
  background-color: var(--bg-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

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

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

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

.nav a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

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

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

.search-box button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-light);
}

/* 面包屑 */
.breadcrumb {
  padding: 16px 0;
  font-size: 14px;
  color: var(--text-light);
}

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

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

.breadcrumb span {
  margin: 0 8px;
}

/* Hero 区域 */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  color: var(--bg-white);
  padding: 80px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  font-weight: 700;
}

.hero p {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* 免责声明 */
.disclaimer {
  background-color: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.disclaimer p {
  color: #92400e;
  font-size: 14px;
}

.disclaimer strong {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

/* 分类卡片 */
.categories {
  padding: 48px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-color);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.category-card {
  background-color: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.category-icon {
  width: 64px;
  height: 64px;
  background-color: var(--bg-color);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}

.category-card h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
  color: var(--text-color);
}

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

/* 文章列表 */
.articles-section {
  padding: 48px 0;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-card {
  background-color: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 20px;
  transition: box-shadow 0.2s;
}

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

.article-card .article-info {
  flex: 1;
}

.article-card h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
  color: var(--text-color);
}

.article-card p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
}

.article-meta {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-light);
}

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

.article-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--bg-white);
}

.btn-primary:hover {
  background-color: #1a365d;
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
  text-decoration: none;
}

/* 三栏文章区域 */
.three-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 48px 0;
}

.column {
  background-color: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.column h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

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

.column li a {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-color);
  font-size: 14px;
  line-height: 1.5;
}

.column li a:hover {
  color: var(--primary-color);
}

.column li a::before {
  content: "•";
  color: var(--primary-color);
  font-weight: bold;
}

/* 页脚 */
.footer {
  background-color: var(--accent-color);
  color: var(--bg-white);
  padding: 48px 0 24px;
  margin-top: 48px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 32px;
}

.footer-brand h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 14px;
  opacity: 0.8;
  line-height: 1.6;
}

.footer-links h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.footer-links a {
  color: var(--bg-white);
  opacity: 0.8;
  font-size: 14px;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 14px;
  opacity: 0.7;
}

/* 分类页特定样式 */
.category-header {
  background-color: var(--bg-white);
  padding: 48px 0;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.category-header h1 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.category-header p {
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
}

.pagination a {
  background-color: var(--bg-white);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.pagination a:hover {
  background-color: var(--bg-color);
  text-decoration: none;
}

.pagination .current {
  background-color: var(--primary-color);
  color: var(--bg-white);
}

/* 文章详情页 */
.article-header {
  background-color: var(--bg-white);
  padding: 48px 0;
  border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
  font-size: 2rem;
  margin-bottom: 16px;
  line-height: 1.3;
}

.article-header .article-meta {
  font-size: 14px;
}

.article-content {
  background-color: var(--bg-white);
  padding: 48px;
  margin: 24px 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.article-content h2 {
  font-size: 1.5rem;
  margin: 32px 0 16px;
  color: var(--text-color);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
}

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

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

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

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

.article-content ul li {
  list-style-type: disc;
}

.article-content ol li {
  list-style-type: decimal;
}

.article-content blockquote {
  background-color: var(--bg-color);
  border-left: 4px solid var(--primary-color);
  padding: 16px 20px;
  margin: 24px 0;
  font-style: italic;
}

.article-content pre {
  background-color: #1a202c;
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 20px 0;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 14px;
}

.article-content code {
  background-color: var(--bg-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 14px;
}

.article-content pre code {
  background: none;
  padding: 0;
}

/* 相关文章 */
.related-section {
  padding: 32px 0;
}

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

.related-card {
  background-color: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

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

.related-card h4 {
  font-size: 1rem;
  margin-bottom: 8px;
}

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

/* 404 页面 */
.error-page {
  min-height: calc(100vh - var(--header-height) - 300px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px;
}

.error-content h1 {
  font-size: 6rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
}

.error-content h2 {
  font-size: 1.5rem;
  margin: 16px 0;
  color: var(--text-color);
}

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

/* 两栏布局 */
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 32px 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .three-columns {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header .container {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 20px;
  }

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

  .search-box {
    display: none;
  }

  .hero {
    padding: 48px 0;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .three-columns {
    grid-template-columns: 1fr;
  }

  .article-card {
    flex-direction: column;
  }

  .article-actions {
    justify-content: flex-start;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

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

  .two-columns {
    grid-template-columns: 1fr;
  }

  .article-content {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .category-header h1,
  .article-header h1 {
    font-size: 1.5rem;
  }

  .error-content h1 {
    font-size: 4rem;
  }
}
