/* * TxtPress Corporate Theme - Corrected for index.php
 * Based on AutoVision Style
 */

:root {
  /* --- 品牌配色 --- */
  --c-primary: #e50914;       /* 标志性红色 */
  --c-primary-dark: #b0070f;  /* 悬停加深 */
  --c-secondary: #2c2c2c;     /* 金属灰 */
  --c-accent: #00a8ff;        /* 科技蓝 */
  --c-text-main: #1a1a1a;     /* 深灰文字 */
  --c-text-light: #666666;    /* 浅灰文字 */
  --c-bg-body: #f5f7fa;       /* 页面背景 */
  --c-bg-white: #ffffff;      /* 卡片背景 */
  --c-border: #e1e8ed;        /* 边框颜色 */

  /* --- 动态参数 --- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --speed-fast: 0.3s;
  --shadow-card: 0 4px 12px rgba(0,0,0,0.05);
  --shadow-hover: 0 12px 24px rgba(0,0,0,0.12);
  --container-width: 1200px;
}

/* === 基础重置 === */
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }
body {
  background-color: var(--c-bg-body);
  color: var(--c-text-main);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: color var(--speed-fast); }
ul, li { list-style: none; }
img { display: block; max-width: 100%; height: auto; object-fit: cover; }

/* === 容器系统 === */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* === 导航栏 (Header) === */
.site-header {
  background: var(--c-bg-white);
  height: 70px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-top: 3px solid var(--c-primary);
}

.header-inner {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-text-main);
  letter-spacing: -0.5px;
}
.logo-text { color: var(--c-primary); }

.desktop-nav { display: flex; gap: 25px; }
.desktop-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--c-text-main);
  position: relative;
  padding: 5px 0;
}
.desktop-nav a:hover, .desktop-nav a.active { color: var(--c-primary); }
.desktop-nav a::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
  background: var(--c-primary); transition: width var(--speed-fast);
}
.desktop-nav a:hover::after, .desktop-nav a.active::after { width: 100%; }

/* === 手机端菜单 (Mobile Menu) === */
.mobile-menu-trigger { display: none; font-size: 1.5rem; cursor: pointer; padding: 10px; }

.mobile-menu-overlay {
  display: none; /* JS toggles flex */
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: var(--c-bg-white); z-index: 9999;
  flex-direction: column; padding: 20px;
}

.mobile-menu-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 30px; border-bottom: 1px solid var(--c-border); padding-bottom: 15px;
}
.logo-mobile { font-size: 1.4rem; font-weight: bold; color: var(--c-primary); }
.close-btn { font-size: 2rem; cursor: pointer; line-height: 1; color: var(--c-text-light); }

.mobile-nav-links { display: flex; flex-direction: column; gap: 20px; }
.mobile-nav-links a { font-size: 1.1rem; font-weight: 500; border-bottom: 1px solid #f0f0f0; padding-bottom: 10px; }

/* === Hero 区域 === */
.hero-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
  color: #fff;
  padding: 100px 0;
  text-align: center;
}
.hero-content h1 { font-size: 2.8rem; margin-bottom: 20px; font-weight: 700; }
.hero-subtitle { font-size: 1.2rem; margin-bottom: 40px; opacity: 0.9; max-width: 800px; margin: 0 auto 40px; }

.hero-buttons { display: flex; gap: 15px; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 30px; font-size: 1rem; border-radius: var(--radius-sm);
  font-weight: 600; cursor: pointer; transition: all var(--speed-fast);
}
.primary-btn { background: var(--c-primary); color: #fff; border: 2px solid var(--c-primary); }
.primary-btn:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); transform: translateY(-2px); }
.secondary-btn { background: transparent; border: 2px solid rgba(255,255,255,0.3); color: #fff; }
.secondary-btn:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

/* === Info Section (Features) === */
.info-section { padding: 60px 0; background: var(--c-bg-white); }
.section-header { text-align: left; margin-bottom: 40px; border-left: 5px solid var(--c-primary); padding-left: 15px; }
.center-header { text-align: center; border-left: none; padding-left: 0; position: relative; }
.center-header::after { content: ''; display: block; width: 40px; height: 3px; background: var(--c-primary); margin: 15px auto 0; }
.section-header h2 { font-size: 1.8rem; margin-bottom: 5px; color: var(--c-text-main); }
.section-header p { color: var(--c-text-light); font-size: 0.95rem; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.info-card {
  background: #fff; padding: 30px; border-radius: var(--radius-md);
  border: 1px solid var(--c-border); transition: transform var(--speed-fast), box-shadow var(--speed-fast);
}
.info-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card); }
.info-card .icon { font-size: 2.5rem; margin-bottom: 20px; }
.info-card h3 { margin-bottom: 15px; font-size: 1.3rem; }
.info-card p { font-size: 0.95rem; color: var(--c-text-light); margin-bottom: 20px; line-height: 1.8; }
.read-more { color: var(--c-primary); font-weight: 600; font-size: 0.9rem; }
.read-more:hover { text-decoration: underline; }

/* === 主内容区与网格列表 === */
.main-content-area { padding: 50px 0; min-height: 60vh; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 30px; }

/* PHP: grid-card */
.grid-card {
  background: var(--c-bg-white); border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-card); transition: all var(--speed-fast); border: 1px solid var(--c-border);
  display: flex; flex-direction: column;
}
.grid-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }

/* 封面图容器 */
.card-cover-wrapper { display: block; height: 200px; overflow: hidden; position: relative; }
.card-img { width: 100%; height: 100%; transition: transform var(--speed-fast); }
.grid-card:hover .card-img { transform: scale(1.05); }

/* 占位图 (无封面时) */
.card-img-placeholder {
  width: 100%; height: 100%; background: #eee;
  display: flex; align-items: center; justify-content: center;
  color: #999; font-weight: bold; font-size: 1.2rem;
}

.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-meta { font-size: 0.85rem; color: #999; margin-bottom: 10px; display: flex; justify-content: space-between; }
.cat-tag { color: var(--c-primary); font-weight: 600; }
.grid-card h3 { font-size: 1.2rem; margin-bottom: 10px; line-height: 1.4; }
.grid-card h3 a:hover { color: var(--c-primary); }
.excerpt { font-size: 0.9rem; color: var(--c-text-light); margin-bottom: 15px; flex-grow: 1; }

.card-tags { margin-top: auto; display: flex; flex-wrap: wrap; gap: 5px; }
.tag-badge { font-size: 0.75rem; background: #f0f0f0; color: #666; padding: 2px 8px; border-radius: 4px; }
.tag-badge:hover { background: var(--c-primary); color: #fff; }

.no-content { text-align: center; color: var(--c-text-light); padding: 40px; width: 100%; }

/* === 分页 (Pagination) === */
.pagination { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 50px; }
.page-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--c-border); border-radius: 50%;
  color: var(--c-text-main); transition: all 0.2s;
}
.page-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.page-current { font-weight: bold; color: var(--c-text-light); }

/* === 文章详情页 (Single Post) === */
.single-post { max-width: 800px; margin: 0 auto; background: #fff; padding: 40px; border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
.single-header { margin-bottom: 30px; border-bottom: 1px solid #eee; padding-bottom: 20px; }
.single-header h1 { font-size: 2rem; margin: 15px 0; line-height: 1.3; }

.breadcrumb { font-size: 0.9rem; color: #888; margin-bottom: 10px; }
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb span { margin: 0 5px; }

.meta-line { font-size: 0.9rem; color: #888; display: flex; gap: 20px; }

/* Markdown 内容样式 */
.markdown-body { font-size: 1.05rem; line-height: 1.8; color: #333; }
.markdown-body h2 { font-size: 1.5rem; margin: 40px 0 20px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.markdown-body h3 { font-size: 1.3rem; margin: 30px 0 15px; }
.markdown-body p { margin-bottom: 20px; }
.markdown-body ul, .markdown-body ol { margin-bottom: 20px; padding-left: 20px; }
.markdown-body li { margin-bottom: 8px; list-style: disc; }
.markdown-body blockquote { border-left: 4px solid var(--c-primary); background: #f9f9f9; padding: 15px; margin-bottom: 20px; color: #555; }
.markdown-body img { border-radius: var(--radius-sm); max-width: 100%; margin: 20px auto; }

/* 标签与导航 */
.post-tags-container { margin: 30px 0; padding-top: 20px; border-top: 1px solid #eee; }
.tags-label { font-weight: bold; margin-right: 10px; font-size: 0.9rem; }
.tag-pill {
  display: inline-block; background: #f1f1f1; padding: 5px 12px; margin-right: 8px;
  border-radius: 20px; font-size: 0.85rem; color: #555;
}
.tag-pill:hover { background: var(--c-primary); color: #fff; }

.post-cta {
  background: #f8fbff; border: 1px solid #e1e8f0; padding: 30px;
  text-align: center; border-radius: var(--radius-md); margin: 40px 0;
}
.post-cta p { font-size: 1.1rem; font-weight: 600; margin-bottom: 15px; }
.small-btn { padding: 8px 20px; font-size: 0.9rem; }

.post-navigation {
  display: flex; justify-content: space-between; margin-top: 40px; padding-top: 30px; border-top: 1px dashed #ddd;
}
.nav-prev, .nav-next { max-width: 45%; }
.nav-prev small, .nav-next small { display: block; color: #999; font-size: 0.8rem; margin-bottom: 5px; }
.nav-prev span, .nav-next span { display: block; font-weight: 600; font-size: 1rem; color: var(--c-text-main); }
.nav-next { text-align: right; }
.nav-prev:hover span, .nav-next:hover span { color: var(--c-primary); }

/* === FAQ Section === */
.faq-section { background: #fff; padding: 60px 0; margin-top: 40px; border-top: 1px solid var(--c-border); }
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid #eee; }
.faq-question {
  padding: 20px 0; font-size: 1.1rem; font-weight: 600; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; color: var(--c-text-main);
}
.faq-question:hover { color: var(--c-primary); }
.faq-question .arrow { font-weight: bold; font-size: 1.5rem; transition: transform 0.3s; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; color: var(--c-text-light); }
.faq-answer p { padding-bottom: 20px; line-height: 1.7; }
/* 激活状态 */
.faq-question.active { color: var(--c-primary); }

/* === 404 页面 === */
.error-404 { text-align: center; padding: 80px 0; }
.error-404 h1 { font-size: 6rem; color: #ddd; margin-bottom: 20px; line-height: 1; }
.error-404 p { font-size: 1.2rem; margin-bottom: 30px; color: #666; }

/* === 页脚 (Footer) === */
.site-footer { background: var(--c-secondary); color: #ccc; padding: 60px 0 20px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h4 { color: #fff; margin-bottom: 20px; font-size: 1.1rem; border-bottom: 2px solid var(--c-primary); display: inline-block; padding-bottom: 5px; }
.footer-col a { display: block; margin-bottom: 10px; color: #bbb; font-size: 0.9rem; transition: all var(--speed-fast); /* 加上这一句让动画更顺滑 */}
.footer-col a:hover { color: #fff; transform: translateX(5px); /* display: inline-block;  <--- 删掉这一行！就是它惹的祸 */ }
.footer-bottom { text-align: center; font-size: 0.85rem; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); }

/* === 响应式适配 === */
@media (max-width: 768px) {
  .site-header { height: 60px; }
  .desktop-nav { display: none; }
  .mobile-menu-trigger { display: block; }
  
  .hero-content h1 { font-size: 2rem; }
  .hero-section { padding: 60px 0; }
  
  .post-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  
  .single-post { padding: 20px; }
  .single-header h1 { font-size: 1.6rem; }
  .meta-line { flex-direction: column; gap: 5px; }
  .post-navigation { flex-direction: column; gap: 20px; }
  .nav-next { text-align: left; }
}