/* ========================================
   相机镜头 - 资讯风格样式表
   www.jingtoupei.cn
   ======================================== */

/* CSS 变量定义 */
:root {
  --accent-color: #d63384;
  --accent-light: #f8d7e8;
  --accent-dark: #a0205c;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f9fa;
  --bg-dark: #212529;
  --border-color: #e9ecef;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
  --radius: 8px;
  --radius-sm: 4px;
  --transition: all 0.3s ease;
  --container-max: 1200px;
  --sidebar-width: 220px;
  --gap: 20px;
}

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

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

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

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

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

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

ul, ol {
  list-style: none;
}

/* ========================================
   布局框架
   ======================================== */

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

/* 三栏布局 */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
  gap: var(--gap);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--gap);
}

/* ========================================
   Header 页头
   ======================================== */

.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

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

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

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

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}

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

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  width: 240px;
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  flex: 1;
  font-size: 0.875rem;
}

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

/* ========================================
   Hero 区域
   ======================================== */

.hero {
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent-color) 100%);
  color: #fff;
  padding: 3rem var(--gap);
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.hero p {
  opacity: 0.9;
  font-size: 1.1rem;
}

/* ========================================
   侧边栏通用样式
   ======================================== */

.sidebar {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 1rem;
  height: fit-content;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 600;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent-color);
  color: var(--text-primary);
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

.sidebar-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-list li:last-child {
  border-bottom: none;
}

.sidebar-list a {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

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

.sidebar-list .num {
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  margin-right: 0.5rem;
  color: var(--text-muted);
}

.sidebar-list .num.hot {
  background: var(--accent-color);
  color: #fff;
}

/* 标签云 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

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

/* ========================================
   主内容区
   ======================================== */

.main {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* 内容卡片 */
.content-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-color);
}

.content-card:last-child {
  border-bottom: none;
}

.content-card .thumbnail {
  width: 180px;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.content-card .thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-card .info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.content-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.content-card h3 a:hover {
  color: var(--accent-color);
}

.content-card .desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-card .meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.content-card .meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.content-card .category-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--accent-light);
  color: var(--accent-color);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

/* 特色内容卡片 */
.featured-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.featured-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.featured-card .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
}

.featured-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.featured-card .meta {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* ========================================
   分类页样式
   ======================================== */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

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

.category-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.category-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.category-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* 筛选器 */
.filter-group {
  margin-bottom: 1rem;
}

.filter-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-options a {
  padding: 0.25rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.filter-options a:hover,
.filter-options a.active {
  background: var(--accent-color);
  color: #fff;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.pagination a {
  background: var(--bg-secondary);
}

.pagination a:hover {
  background: var(--accent-color);
  color: #fff;
}

.pagination .current {
  background: var(--accent-color);
  color: #fff;
}

.pagination .disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ========================================
   文章页样式
   ======================================== */

.article-header {
  margin-bottom: 1.5rem;
}

.article-header h1 {
  font-size: 1.75rem;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.article-meta .author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-meta .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
}

.article-featured-image {
  width: 100%;
  height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--bg-secondary);
}

.article-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-content h2 {
  font-size: 1.35rem;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.article-content h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.75rem;
}

.article-content p {
  margin-bottom: 1rem;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.article-content ul li {
  list-style: disc;
  margin-bottom: 0.5rem;
}

.article-content ol li {
  list-style: decimal;
  margin-bottom: 0.5rem;
}

.article-content img {
  border-radius: var(--radius-sm);
  margin: 1rem 0;
}

.article-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-content code {
  background: var(--bg-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: "SF Mono", Monaco, monospace;
  font-size: 0.875rem;
}

.article-content pre {
  background: var(--bg-dark);
  color: #fff;
  padding: 1rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1rem 0;
}

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

/* 文章目录 */
.toc {
  position: sticky;
  top: 80px;
}

.toc ul {
  padding-left: 0;
}

.toc li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-color);
}

.toc li:last-child {
  border-bottom: none;
}

.toc a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: block;
}

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

/* 作者卡片 */
.author-card {
  text-align: center;
  padding: 1rem;
}

.author-card .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 0.75rem;
  background: var(--bg-secondary);
}

.author-card h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.author-card p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* 分享按钮 */
.share-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.share-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: var(--transition);
}

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

/* ========================================
   404 页面
   ======================================== */

.error-page {
  text-align: center;
  padding: 4rem 2rem;
}

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

.error-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.error-desc {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--accent-color);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: var(--transition);
}

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

/* ========================================
   Footer 页脚
   ======================================== */

.footer {
  background: var(--bg-dark);
  color: #fff;
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gap);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: #fff;
}

.footer p {
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
}

/* ========================================
   响应式设计
   ======================================== */

/* 平板端 */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 180px 1fr;
  }

  .sidebar-right {
    display: none;
  }
}

/* 移动端 */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar-left {
    display: none;
  }

  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem var(--gap);
  }

  .nav {
    order: 3;
    width: 100%;
    gap: 1rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .search-box {
    width: auto;
    flex: 1;
    margin-left: 1rem;
  }

  .hero {
    padding: 2rem var(--gap);
  }

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

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

  .content-card .thumbnail {
    width: 100%;
    height: 180px;
  }

  .article-header h1 {
    font-size: 1.35rem;
  }

  .error-code {
    font-size: 5rem;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 1rem;
  }
}

/* 小屏移动端 */
@media (max-width: 480px) {
  :root {
    --gap: 12px;
  }

  .main {
    padding: 1rem;
  }

  .content-card h3 {
    font-size: 1rem;
  }

  .pagination a,
  .pagination span {
    min-width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
}
