/* ========================================
   街头小吃 - 资讯风格样式表
   www.meishigonglue.cn
   ======================================== */

/* CSS 变量 */
:root {
  --accent-color: #d63384;
  --accent-light: #f8d7e8;
  --accent-dark: #a61e66;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f9fa;
  --bg-dark: #e9ecef;
  --border-color: #dee2e6;
  --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;
  --max-width: 1200px;
  --header-height: 60px;
}

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

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

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

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

ul {
  list-style: none;
}

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

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

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

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

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

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

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

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

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

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

.nav a {
  font-size: 14px;
  font-weight: 500;
  padding: 5px 0;
  border-bottom: 2px solid transparent;
}

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

.search {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 6px 15px;
  width: 200px;
}

.search input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  width: 100%;
}

.search-btn {
  color: var(--text-muted);
  cursor: pointer;
}

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

.footer {
  background: var(--text-primary);
  color: #fff;
  padding: 40px 0 20px;
  margin-top: 40px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand h3 {
  font-size: 20px;
  margin-bottom: 10px;
  color: var(--accent-light);
}

.footer-brand p {
  color: #aaa;
  font-size: 13px;
  line-height: 1.8;
}

.footer-col h4 {
  font-size: 14px;
  margin-bottom: 15px;
  color: #fff;
}

.footer-col a {
  display: block;
  color: #aaa;
  font-size: 13px;
  padding: 5px 0;
}

.footer-col a:hover {
  color: var(--accent-light);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 30px auto 0;
  padding: 20px 20px 0;
  border-top: 1px solid #444;
  text-align: center;
  color: #777;
  font-size: 12px;
}

/* ========================================
   侧边栏组件
   ======================================== */

.sidebar-left,
.sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.widget {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
}

.widget-title {
  font-size: 14px;
  font-weight: 600;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
  color: var(--text-primary);
}

.widget-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-color);
}

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

.widget-list a {
  font-size: 13px;
  color: var(--text-secondary);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.widget-list .num {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  background: var(--bg-dark);
  border-radius: 3px;
  font-size: 11px;
  margin-right: 8px;
  color: var(--text-secondary);
}

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

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

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

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

/* ========================================
   内容卡片
   ======================================== */

.card {
  background: var(--bg-primary);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

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

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

.card-body {
  padding: 15px;
}

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

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 15px;
}

/* ========================================
   内容列表
   ======================================== */

.content-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.list-item {
  display: flex;
  gap: 15px;
  background: var(--bg-primary);
  padding: 15px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.list-item:hover {
  box-shadow: var(--shadow-hover);
}

.list-item-img {
  width: 160px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.list-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.list-item-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.list-item-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 15px;
  margin-top: 8px;
}

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

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

.hero h1 {
  font-size: 32px;
  margin-bottom: 15px;
}

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

/* ========================================
   特色内容网格
   ======================================== */

.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.featured-main {
  grid-row: span 2;
}

.featured-main .card-img {
  height: 340px;
}

.featured-main .card-title {
  font-size: 18px;
}

/* ========================================
   面包屑
   ======================================== */

.breadcrumb {
  background: var(--bg-primary);
  padding: 12px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px;
}

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

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

.breadcrumb span {
  color: var(--text-muted);
  margin: 0 8px;
}

.breadcrumb strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* ========================================
   分页
   ======================================== */

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 8px 14px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}

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

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

/* ========================================
   文章详情
   ======================================== */

.article {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

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

.article-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.4;
}

.article-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

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

.article-cover {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 25px;
}

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

.article-content h2 {
  font-size: 20px;
  margin: 30px 0 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.article-content h3 {
  font-size: 17px;
  margin: 25px 0 12px;
}

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

.article-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 20px 0;
}

.article-content ul,
.article-content ol {
  margin: 15px 0;
  padding-left: 25px;
}

.article-content ul li {
  list-style: disc;
  margin-bottom: 8px;
}

.article-content ol li {
  list-style: decimal;
  margin-bottom: 8px;
}

.article-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding: 15px 20px;
  background: var(--bg-secondary);
  margin: 20px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-content code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 13px;
}

.article-content pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 20px 0;
}

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

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

.error-page {
  text-align: center;
  padding: 80px 20px;
}

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

.error-title {
  font-size: 24px;
  margin-bottom: 15px;
}

.error-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.error-btn {
  display: inline-block;
  padding: 12px 30px;
  background: var(--accent-color);
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px;
  transition: background 0.2s;
}

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

/* ========================================
   作者卡片
   ======================================== */

.author-card {
  text-align: center;
  padding: 20px;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 15px;
  object-fit: cover;
}

.author-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
}

.author-bio {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========================================
   目录
   ======================================== */

.toc-list {
  font-size: 13px;
}

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

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

.toc-list a {
  color: var(--text-secondary);
  display: block;
}

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

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

@media (max-width: 1024px) {
  .layout-three {
    grid-template-columns: 160px 1fr 160px;
    gap: 15px;
    padding: 15px;
  }

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

  .featured-main {
    grid-row: span 1;
  }

  .featured-main .card-img {
    height: 200px;
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 15px;
  }

  .nav {
    order: 3;
    width: 100%;
    gap: 20px;
    margin-top: 10px;
    overflow-x: auto;
  }

  .search {
    width: 150px;
  }

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

  .sidebar-left {
    order: 2;
  }

  .main-content {
    order: 1;
  }

  .sidebar-right {
    order: 3;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .list-item {
    flex-direction: column;
  }

  .list-item-img {
    width: 100%;
    height: 160px;
  }

  .article {
    padding: 20px;
  }

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

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

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

@media (max-width: 480px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .error-code {
    font-size: 80px;
  }

  .widget {
    padding: 12px;
  }
}
