/*
Theme Name: TechVibe
Theme URI: https://www.iyue.fun
Description: A modern tech-themed WordPress theme for technical blogs
Author: AI Assistant
Author URI: https://www.iyue.fun
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: techvibe
Tags: tech, dark, responsive, modern, blog
*/

/* Global Styles */
:root {
  --primary-color: #00d4ff;
  --secondary-color: #7928ca;
  --accent-color: #ff2d55;
  --dark-bg: #0a0a12;
  --darker-bg: #050508;
  --light-text: #e0e0e0;
  --medium-text: #a0a0a0;
  --border-color: rgba(0, 212, 255, 0.2);
  --glow-effect: 0 0 10px rgba(0, 212, 255, 0.5);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--dark-bg);
  color: var(--light-text);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(121, 40, 202, 0.1) 0%, transparent 50%);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--light-text);
  text-shadow: var(--glow-effect);
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 2rem;
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
}

p {
  margin-bottom: 1rem;
  color: var(--medium-text);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-color);
  text-shadow: var(--glow-effect);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
header {
  background-color: rgba(5, 5, 8, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo::before {
  content: "<";
  color: var(--primary-color);
  font-size: 1.8rem;
}

.logo::after {
  content: "/>";
  color: var(--primary-color);
  font-size: 1.8rem;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--primary-color);
  margin: 3px 0;
  transition: var(--transition);
  border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

.nav-menu {
  display: flex;
  align-items: center;
}

.nav-menu-items {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-menu-items li a {
  color: var(--light-text);
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
}

.nav-menu-items li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: var(--transition);
}

.nav-menu-items li a:hover::after {
  width: 100%;
}

/* Hero Section */
.hero {
  padding: 6rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
  z-index: -1;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  animation: glow 2s ease-in-out infinite alternate;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto 2rem;
  color: var(--medium-text);
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  }
  to {
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.8), 0 0 30px rgba(0, 212, 255, 0.5);
  }
}

/* Main Content */
main {
  padding: 4rem 0;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
}

/* Blog Posts */
.blog-posts {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.post-card {
  background-color: rgba(10, 10, 18, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.1);
  border-color: var(--primary-color);
}

.post-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--medium-text);
}

.post-excerpt {
  margin-bottom: 1.5rem;
}

.read-more {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 4px;
  font-weight: 600;
  transition: var(--transition);
}

.read-more:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-effect);
  color: white;
}

/* Sidebar */
.sidebar {
  background-color: rgba(10, 10, 18, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  height: fit-content;
  position: sticky;
  top: 100px;
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-section h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.search-form {
  display: flex;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  padding: 0.75rem;
  background-color: var(--darker-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--light-text);
}

.search-submit {
  padding: 0.75rem 1rem;
  background-color: var(--primary-color);
  border: none;
  border-radius: 4px;
  color: var(--darker-bg);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.search-submit:hover {
  background-color: var(--secondary-color);
  color: white;
}

.category-list {
  list-style: none;
}

.category-list li {
  margin-bottom: 0.5rem;
}

.category-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-radius: 4px;
  transition: var(--transition);
}

.category-list li a:hover {
  background-color: rgba(0, 212, 255, 0.1);
}

/* Footer */
footer {
  background-color: var(--darker-bg);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-section p,
.footer-section li {
  color: var(--medium-text);
  margin-bottom: 0.5rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li a {
  color: var(--medium-text);
  transition: var(--transition);
}

.footer-section ul li a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--medium-text);
  font-size: 0.9rem;
}

.footer-bottom p {
  margin-bottom: 0.5rem;
}

.icp-info {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.beian-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

.icp-info a {
  color: var(--medium-text);
  text-decoration: none;
  transition: var(--transition);
}

.icp-info a:hover {
  color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .header-content {
    flex-direction: row;
    gap: 1rem;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: rgba(5, 5, 8, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    z-index: 1000;
    border-left: 1px solid var(--border-color);
  }
  
  .nav-menu.active {
    right: 0;
  }
  
  .nav-menu-items {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }
  
  .nav-menu-items li a {
    font-size: 1.2rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .sidebar {
    position: static;
  }
}

/* Post Single */
.post-single {
  background-color: rgba(10, 10, 18, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3rem;
}

.post-content {
  margin-top: 2rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

/* Comments */
.comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.comment-form {
  margin-top: 2rem;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  background-color: var(--darker-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--light-text);
}

.comment-form textarea {
  resize: vertical;
  min-height: 150px;
}

.comment-form input[type="submit"] {
  width: auto;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.comment-form input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-effect);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
}

.page-numbers {
  padding: 0.5rem 1rem;
  background-color: rgba(10, 10, 18, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--light-text);
  transition: var(--transition);
}

.page-numbers:hover,
.page-numbers.current {
  background-color: var(--primary-color);
  color: var(--darker-bg);
  border-color: var(--primary-color);
}

/* 404 Page */
.error-404 {
  text-align: center;
  padding: 6rem 0;
}

.error-404 h1 {
  font-size: 6rem;
  margin-bottom: 1rem;
}

.error-404 p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 212, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--darker-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Reading Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  z-index: 1002;
  transition: width 0.1s ease;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
  box-shadow: var(--glow-effect);
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 212, 255, 0.3);
}

/* Code Highlighting */
pre {
  background-color: #1e1e1e;
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
}

code {
  font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
}

pre code {
  background-color: transparent;
  padding: 0;
}

:not(pre) > code {
  background-color: rgba(0, 212, 255, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: var(--primary-color);
}

/* Article Actions */
.article-actions {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: rgba(10, 10, 18, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.action-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.action-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-effect);
}

.like-button {
  background-color: rgba(255, 45, 85, 0.2);
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
}

.like-button:hover {
  background-color: var(--accent-color);
  color: white;
}

.like-button.liked {
  background-color: var(--accent-color);
  color: white;
}

/* Social Share */
.social-share {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.share-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: rgba(10, 10, 18, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--light-text);
  text-decoration: none;
  transition: var(--transition);
  font-size: 0.9rem;
}

.share-button:hover {
  background-color: var(--primary-color);
  color: var(--darker-bg);
  border-color: var(--primary-color);
}

/* Related Posts */
.related-posts {
  margin-top: 3rem;
  padding: 2rem;
  background-color: rgba(10, 10, 18, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.related-posts h3 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.related-post-card {
  background-color: rgba(5, 5, 8, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  transition: var(--transition);
}

.related-post-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
  box-shadow: var(--glow-effect);
}

.related-post-card h4 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.related-post-card h4 a {
  color: var(--light-text);
  text-decoration: none;
}

.related-post-card h4 a:hover {
  color: var(--primary-color);
}

.related-post-card .post-date {
  font-size: 0.85rem;
  color: var(--medium-text);
}
