/*
Theme Name: OneBlog Style
Theme URI: https://github.com/oneblog-style
Author: OneBlog Team
Author URI: https://github.com/oneblog-style
Description: 现代化博客主题，集成联盟广告系统，支持 ICP 备案展示。包含 5 种广告位（顶部横幅、侧边栏、文章内嵌、底部通栏、悬浮广告），支持 Google AdSense、百度联盟等主流广告平台。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: oneblog-style
Tags: blog, responsive, ads, customization, chinese

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned.
*/

/* ============================================
   CSS Variables & Base Styles
   ============================================ */

:root {
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #ffffff;
  --bg-secondary: #f3f4f6;
  --border-color: #e5e7eb;
  --ad-bg: #f9fafb;
  --ad-border: #d1d5db;
  --ad-label: #9ca3af;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

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

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

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

/* ============================================
   Header & Navigation
   ============================================ */

.site-header {
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo img {
  max-height: 50px;
  width: auto;
}

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

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.main-nav a {
  color: var(--text-color);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

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

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.2s;
}

.main-nav a:hover::after {
  width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
}

/* ============================================
   Header Ad Zone
   ============================================ */

.header-ad-zone {
  background: var(--bg-secondary);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.header-ad-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90px;
}

/* ============================================
   Main Content Layout
   ============================================ */

.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
}

.content-area {
  min-width: 0;
}

/* ============================================
   Post List / Index
   ============================================ */

.post-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.post-card-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.post-card-content {
  padding: 1.5rem;
}

.post-card-title {
  font-size: 1.375rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.post-card-title a {
  color: var(--text-color);
}

.post-card-title a:hover {
  color: var(--primary-color);
}

.post-card-excerpt {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.post-card-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

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

/* ============================================
   Sidebar
   ============================================ */

.site-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-widget {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
}

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

/* Search Form */
.search-form {
  display: flex;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.875rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
  padding: 0.625rem 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.search-btn:hover {
  background: var(--secondary-color);
}

/* Category List */
.category-list {
  list-style: none;
}

.category-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.category-list .post-count {
  background: var(--bg-secondary);
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Recent Posts */
.recent-posts {
  list-style: none;
}

.recent-posts li {
  margin-bottom: 0.75rem;
}

.recent-posts a {
  display: block;
  color: var(--text-color);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.recent-posts .post-date {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Tag Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-item {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: var(--bg-secondary);
  color: var(--text-color);
  border-radius: 16px;
  font-size: 0.8125rem;
  transition: background 0.2s, color 0.2s;
}

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

/* ============================================
   Single Post
   ============================================ */

.post-content {
  background: var(--bg-color);
  padding: 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

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

.post-title {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  color: var(--text-color);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.post-feature-image {
  margin: 0 -2.5rem 2rem;
}

.post-feature-image img {
  width: 100%;
  height: auto;
  border-radius: 8px 8px 0 0;
}

.post-body {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-color);
}

.post-body p {
  margin-bottom: 1.5rem;
}

.post-body h2,
.post-body h3,
.post-body h4 {
  margin: 2.5rem 0 1rem;
  color: var(--text-color);
  font-weight: 600;
  line-height: 1.4;
}

.post-body h2 {
  font-size: 1.75rem;
}

.post-body h3 {
  font-size: 1.5rem;
}

.post-body h4 {
  font-size: 1.25rem;
}

.post-body ul,
.post-body ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.post-body li {
  margin-bottom: 0.5rem;
}

.post-body blockquote {
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--primary-color);
  background: var(--bg-secondary);
  font-style: italic;
  color: var(--text-light);
}

.post-body code {
  background: var(--bg-secondary);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.875em;
}

.post-body pre {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: #1f2937;
  color: #f3f4f6;
  border-radius: 8px;
  overflow-x: auto;
}

.post-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.post-body img {
  margin: 1.5rem 0;
  border-radius: 8px;
}

.post-body figure {
  margin: 1.5rem 0;
}

.post-body figcaption {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* Post Footer */
.post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.post-tag {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: var(--bg-secondary);
  color: var(--text-color);
  border-radius: 16px;
  font-size: 0.8125rem;
}

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

/* Share Buttons */
.post-share {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.share-label {
  font-size: 0.875rem;
  color: var(--text-light);
}

.share-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  transition: opacity 0.2s;
}

.share-btn:hover {
  opacity: 0.9;
  color: white;
}

.share-btn.twitter {
  background: #1da1f2;
}

.share-btn.facebook {
  background: #4267b2;
}

.share-btn.linkedin {
  background: #0077b5;
}

.share-btn.weibo {
  background: #e6162d;
}

/* Author Box */
.author-box {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: 8px;
}

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

.author-info {
  flex: 1;
}

.author-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.author-bio {
  color: var(--text-light);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.author-website {
  display: inline-block;
  color: var(--primary-color);
  font-weight: 500;
}

/* Related Posts */
.related-posts {
  margin-top: 3rem;
}

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

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

/* ============================================
   Pagination
   ============================================ */

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

.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
}

.pagination a:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

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

/* ============================================
   Footer
   ============================================ */

.footer-ad-zone {
  background: var(--bg-secondary);
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
}

.footer-ad-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90px;
}

.site-footer {
  background: var(--text-color);
  color: var(--bg-color);
  padding: 3rem 0 1.5rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-menu {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  list-style: none;
}

.footer-menu a {
  color: var(--bg-color);
  opacity: 0.8;
}

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

.footer-info {
  text-align: center;
  margin-bottom: 1.5rem;
}

.footer-beian {
  text-align: center;
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.footer-beian a:hover {
  color: white;
}

.footer-custom-text {
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.5rem;
}

.copyright {
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.4);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   Sticky Ad
   ============================================ */

.sticky-ad {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 300px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.sticky-ad--hidden {
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
}

.sticky-ad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  border-radius: 8px 8px 0 0;
}

.sticky-ad-title {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
}

.sticky-ad-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.sticky-ad-close:hover {
  background: var(--border-color);
}

.sticky-ad-content {
  padding: 1rem;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
  .site-main {
    grid-template-columns: 1fr;
  }

  .site-sidebar {
    order: -1;
  }

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

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
  }

  .main-nav.active {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav li {
    padding: 0.5rem 1.5rem;
  }

  .site-main {
    padding: 1.5rem 1rem;
  }

  .post-content {
    padding: 1.5rem;
  }

  .post-title {
    font-size: 1.75rem;
  }

  .post-feature-image {
    margin: 0 -1.5rem 1.5rem;
  }

  .author-box {
    flex-direction: column;
    text-align: center;
  }

  .author-avatar {
    margin: 0 auto;
  }

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

  .sticky-ad {
    width: calc(100% - 40px);
    bottom: 10px;
    right: 10px;
  }

  .footer-menu {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .post-card-excerpt {
    display: none;
  }

  .post-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .post-share {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================
   Utility Classes
   ============================================ */

.screen-reader-text {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ============================================
   Category Navigation (Header)
   ============================================ */

.category-nav {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.category-nav li {
    position: relative;
}

.category-nav a {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    font-weight: 500;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.category-nav a:hover,
.category-nav .current-cat a {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   Site Description (Title + Tagline)
   ============================================ */

.site-description {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.site-tagline {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

/* ============================================
   Notice Bar (公告栏)
   ============================================ */

.notice-bar {
    background: #fef3c7;
    border-bottom: 1px solid #fcd34d;
    padding: 0.75rem 0;
}

.notice-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #92400e;
    font-size: 0.9375rem;
}

.notice-content i {
    color: #f59e0b;
    font-size: 1.125rem;
}

.notice-content a {
    color: #b45309;
    text-decoration: underline;
}

/* ============================================
   Post Type Tags (Original/Repost)
   ============================================ */

.post-type-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.tag-original {
    background: #10b981;
    color: white;
}

.tag-repost {
    background: #f59e0b;
    color: white;
}

.post-card-title .post-type-tag {
    font-size: 0.6875rem;
    padding: 0.1875rem 0.4375rem;
}

/* ============================================
   Article Notice (温馨提示 - OneBlog Style)
   ============================================ */

.ob-alert {
    background: #fffcef;
    padding: 15px;
    color: #db7c22;
    border: 1px solid #ffbb76;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.ob-alert .title {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 500;
}

.ob-alert .title i {
    margin-right: 8px;
    font-size: 18px;
}

.ob-alert .content {
    padding: 0;
    padding-left: 28px;
    line-height: 1.6;
}

.ob-alert .content strong {
    color: #db7c22;
}

.ob-alert .content a {
    color: #db7c22;
    text-decoration: underline;
}

.ob-alert .content a:hover {
    color: #c06b1b;
}

/* ============================================
   Footer ICP License
   ============================================ */

.footer-info a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-info a:hover {
    color: white;
    text-decoration: underline;
}

/* ============================================
   Footer Menu (页脚菜单)
   ============================================ */

.footer-menu {
    margin-bottom: 2rem;
}

.footer-menu ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

.footer-menu a:hover {
    color: white;
    text-decoration: underline;
}

/* ============================================
   Footer Disclaimer (页脚免责声明)
   ============================================ */

.footer-disclaimer {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    text-align: center;
}

.footer-disclaimer p {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.footer-disclaimer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
}

.footer-disclaimer a:hover {
    color: white;
}

.footer-disclaimer strong {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Responsive (响应式)
   ============================================ */

@media (max-width: 768px) {
    .footer-menu ul {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .footer-disclaimer {
        padding: 0.75rem;
    }
    
    .footer-disclaimer p {
        font-size: 0.8125rem;
    }
}

