/*!
 * Zibi Blog Theme - 仿WordPress子比主题
 * 基于Typecho博客系统
 * 
 * 功能特点：
 * 1. 响应式设计，支持移动端
 * 2. 文章卡片式布局
 * 3. 侧边栏小工具
 * 4. 评论系统
 * 5. 分类和标签导航
 * 6. 搜索功能
 * 7. 备案信息显示
 */

:root {
  --primary-color: #00b4d8;
  --primary-hover: #0096c7;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #1a1a2e;
  --white: #ffffff;
  --black: #000000;
  --gray-100: #f0f2f5;
  --gray-200: #e4e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-family-base: var(--font-family-sans-serif);
  --font-size-base: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-sm: 0.875rem;
  --font-size-xs: 0.75rem;
  --line-height-base: 1.5;
  --line-height-lg: 2;
  --line-height-sm: 1.25;
  --border-radius: 0.25rem;
  --border-radius-lg: 0.3rem;
  --border-radius-sm: 0.2rem;
  --box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  --transition: all 0.3s ease-in-out;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--gray-800);
  background-color: var(--gray-100);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.container-thin {
  max-width: 800px;
}

/* Header */
.site-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.site-branding {
  display: flex;
  align-items: center;
}

.site-logo {
  height: 40px;
  margin-right: 10px;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

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

.site-description {
  font-size: var(--font-size-sm);
  color: var(--gray-600);
  margin: 0;
}

/* Navigation */
.main-navigation {
  display: flex;
  align-items: center;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  margin-left: 1.5rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  transition: var(--transition);
  padding: 0.5rem 0;
}

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

.nav-link.active {
  color: var(--primary-color);
}

/* Search Form */
.search-form {
  display: flex;
  align-items: center;
  margin-left: 1.5rem;
}

.search-input {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 20px;
  font-size: var(--font-size-sm);
  transition: var(--transition);
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
  width: 180px;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
  outline: none;
  background-color: rgba(255, 255, 255, 0.25);
  width: 220px;
}

.search-btn {
  padding: 0.6rem 1rem;
  margin-left: -2.5rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  z-index: 1;
}

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

/* Mobile Menu Toggle */
.nav-toggler {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.85);
}

/* Main Content */
.site-content {
  padding: 2rem 0;
}

.content-area {
  display: flex;
  gap: 2rem;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* Sidebar */
.sidebar {
  width: 300px;
  flex-shrink: 0;
}

.widget {
  background-color: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.widget-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--dark-color);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
}

.widget-content {
  padding: 1.5rem;
}

/* Post Card */
.post-card {
  background-color: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--gray-200);
}

.post-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
}

.post-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-content {
  padding: 1.5rem;
}

.post-meta {
  display: flex;
  align-items: center;
  font-size: var(--font-size-sm);
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.post-meta-item {
  display: flex;
  align-items: center;
  margin-right: 1rem;
}

.post-meta-item i {
  margin-right: 0.25rem;
}

.post-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.post-title a {
  color: var(--gray-800);
  text-decoration: none;
  transition: var(--transition);
}

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

.post-excerpt {
  color: var(--gray-600);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

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

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: var(--gray-200);
  color: var(--gray-700);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
  text-decoration: none;
  transition: var(--transition);
}

.tag:hover {
  background-color: var(--primary-color);
  color: var(--white);
  text-decoration: none;
}

.read-more {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: var(--white);
  border-radius: 20px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 180, 216, 0.3);
}

.read-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.4);
  color: var(--white);
  text-decoration: none;
}

/* Single Post */
.single-post {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.single-post-header {
  padding: 2rem;
  border-bottom: 1px solid var(--gray-200);
}

.single-post-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.single-post-content {
  padding: 2rem;
  line-height: 1.8;
}

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

.single-post-content h1, .single-post-content h2, .single-post-content h3, 
.single-post-content h4, .single-post-content h5, .single-post-content h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.single-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin: 1rem 0;
}

.single-post-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background-color: var(--gray-100);
  color: var(--gray-700);
}

.single-post-content code {
  padding: 0.2rem 0.4rem;
  background-color: var(--gray-100);
  border-radius: var(--border-radius-sm);
  font-family: var(--font-family-monospace);
  font-size: 0.9em;
}

.single-post-content pre {
  padding: 1rem;
  background-color: var(--gray-800);
  color: var(--gray-100);
  border-radius: var(--border-radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}

.single-post-content pre code {
  padding: 0;
  background-color: transparent;
  color: inherit;
}

.single-post-content ul, .single-post-content ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

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

.single-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.single-post-content th, .single-post-content td {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  text-align: left;
}

.single-post-content th {
  background-color: var(--gray-100);
  font-weight: 600;
}

/* Post Navigation */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-sm);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  max-width: 48%;
}

.post-nav-link.next {
  text-align: right;
  margin-left: auto;
}

.post-nav-label {
  font-size: var(--font-size-sm);
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.post-nav-title {
  font-weight: 600;
  color: var(--dark-color);
}

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

/* Comments */
.comments-section {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.comments-title {
  font-size: 1.5rem;
  font-weight: 600;
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.comments-list {
  padding: 1.5rem;
}

.comment-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 1rem;
}

.comment-meta {
  flex: 1;
}

.comment-author {
  font-weight: 600;
  color: var(--dark-color);
}

.comment-date {
  font-size: var(--font-size-sm);
  color: var(--gray-600);
}

.comment-content {
  padding-left: 3.5rem;
  color: var(--gray-700);
  line-height: 1.6;
}

.comment-reply {
  margin-left: 3.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--gray-200);
}

/* Comment Form */
.comment-form {
  padding: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.comment-form-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark-color);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: var(--font-size-base);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(30, 144, 255, 0.25);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: var(--font-size-base);
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

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

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

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.5rem;
  margin: 0 0.25rem;
  background-color: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: var(--transition);
}

.page-numbers:hover {
  background-color: var(--gray-100);
  color: var(--primary-color);
  text-decoration: none;
}

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

.page-numbers.prev, .page-numbers.next {
  padding: 0 1rem;
}

/* Footer */
.site-footer {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: var(--gray-300);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.footer-section {
  flex: 1;
  min-width: 250px;
  margin-bottom: 1.5rem;
}

.footer-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--white);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--gray-400);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--white);
  text-decoration: none;
}

.footer-contact {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-contact li {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  color: var(--gray-400);
}

.footer-contact i {
  margin-right: 0.5rem;
  color: var(--primary-color);
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-700);
  text-align: center;
}

.footer-copyright {
  font-size: var(--font-size-sm);
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}

.footer-icp {
  font-size: var(--font-size-sm);
  color: var(--gray-500);
}

.footer-icp a {
  color: var(--gray-400);
  text-decoration: none;
}

.footer-icp a:hover {
  color: var(--white);
  text-decoration: none;
}

/* 404 Page */
.error-404 {
  text-align: center;
  padding: 4rem 2rem;
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-sm);
}

.error-404-title {
  font-size: 6rem;
  font-weight: 700;
  color: var(--gray-300);
  margin-bottom: 1rem;
}

.error-404-message {
  font-size: var(--font-size-lg);
  color: var(--gray-600);
  margin-bottom: 2rem;
}

.error-404-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: var(--transition);
}

.error-404-link:hover {
  background-color: var(--primary-hover);
  color: var(--white);
  text-decoration: none;
}

/* Search Results */
.search-results {
  margin-bottom: 2rem;
}

.search-results-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.search-keyword {
  color: var(--primary-color);
  font-weight: 600;
}

/* Page Template */
.page-template {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.page-header {
  padding: 2rem;
  border-bottom: 1px solid var(--gray-200);
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-meta {
  font-size: var(--font-size-sm);
  color: var(--gray-600);
}

.page-content {
  padding: 2rem;
  line-height: 1.8;
}

/* Utilities */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--gray-600);
}

.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; }

/* Responsive Design */
@media (max-width: 992px) {
  .content-area {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .site-navbar {
    flex-wrap: wrap;
  }
  
  .main-navigation {
    width: 100%;
    order: 3;
    display: none;
  }
  
  .main-navigation.active {
    display: block;
  }
  
  .nav-menu {
    flex-direction: column;
    width: 100%;
  }
  
  .nav-item {
    margin: 0;
    margin-bottom: 0.5rem;
  }
  
  .nav-link {
    display: block;
    padding: 0.5rem 0;
  }
  
  .search-form {
    width: 100%;
    margin-left: 0;
    margin-top: 1rem;
  }
  
  .search-input {
    flex: 1;
  }
  
  .nav-toggler {
    display: block;
  }
  
  .post-meta {
    flex-wrap: wrap;
  }
  
  .post-navigation {
    flex-direction: column;
    gap: 1rem;
  }
  
  .post-nav-link {
    max-width: 100%;
    text-align: left;
  }
  
  .post-nav-link.next {
    text-align: left;
  }
  
  .footer-content {
    flex-direction: column;
  }
  
  .footer-section {
    min-width: 100%;
  }
}

@media (max-width: 576px) {
  html {
    font-size: 14px;
  }
  
  .container {
    padding: 0 10px;
  }
  
  .post-title {
    font-size: 1.25rem;
  }
  
  .single-post-title {
    font-size: 1.5rem;
  }
  
  .error-404-title {
    font-size: 4rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-100: #2d3748;
    --gray-200: #4a5568;
    --gray-300: #718096;
    --gray-400: #a0aec0;
    --gray-500: #cbd5e0;
    --gray-600: #e2e8f0;
    --gray-700: #edf2f7;
    --gray-800: #f7fafc;
    --gray-900: #ffffff;
    --white: #1a202c;
    --black: #ffffff;
  }
  
  body {
    background-color: #1a202c;
    color: #e2e8f0;
  }
  
  .site-header, .post-card, .single-post, .comments-section, .page-template, .widget {
    background-color: #2d3748;
  }
  
  .widget-title, .comments-title {
    color: #e2e8f0;
  }
  
  .post-title a, .single-post-title, .page-title {
    color: #ffffff;
  }
  
  .post-title a:hover, .post-nav-title:hover {
    color: var(--primary-color);
  }
  
  .form-control {
    background-color: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
  }
  
  .form-control:focus {
    background-color: #4a5568;
    border-color: var(--primary-color);
  }
  
  .site-footer {
    background-color: #0d1117;
  }
}

/* Print Styles */
@media print {
  .site-header, .sidebar, .site-footer, .post-navigation, .comments-section {
    display: none;
  }
  
  .main-content {
    width: 100%;
  }
  
  .post-card, .single-post, .page-template {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}
