/* 导入 Tailwind CSS 编译后的样式 */
@import url('./tailwind.css');

/* 主题特定的自定义样式 */
/* 这里可以添加一些 Tailwind 无法覆盖的特殊样式 */

/* 代码高亮样式 */
.hljs {
  @apply bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto;
}

.hljs-keyword {
  @apply text-blue-400;
}

.hljs-string {
  @apply text-green-400;
}

.hljs-comment {
  @apply text-gray-500 italic;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  @apply bg-gray-100;
}

::-webkit-scrollbar-thumb {
  @apply bg-gray-400 rounded-full;
}

::-webkit-scrollbar-thumb:hover {
  @apply bg-gray-500;
}

/* 打印样式 */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    @apply text-black bg-white;
  }
}

/* 兼容原有样式的备用方案 */
/* 如果 Tailwind 编译失败，这些样式作为后备 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e1e5e9;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 32px;
    height: 32px;
}

.site-title {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: #333;
}

.site-title:hover {
    color: #007bff;
}

/* 搜索框 */
.search-container {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.search-btn {
    padding: 8px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.search-btn:hover {
    background: #0056b3;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.nav-link.active {
    color: #007bff;
    background-color: #e3f2fd;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* 移动端菜单 */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e1e5e9;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 99;
}

.mobile-menu.show {
    display: block;
}

.mobile-menu .nav-link {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu .nav-link:last-child {
    border-bottom: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .search-container {
        max-width: 200px;
        margin: 0 10px;
    }
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: #666;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: #007bff;
    background: #f8f9fa;
}

/* 移动端菜单 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e1e5e9;
}

/* 主要内容 */
.site-header {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 1px solid #e1e5e9;
    margin-bottom: 2rem;
}

.site-description {
    font-size: 1.1rem;
    color: #666;
}

.main-content {
    min-height: 60vh;
    padding: 2rem 0;
}

/* 页面标题 */
.page-header {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 1px solid #e1e5e9;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.page-header p {
    font-size: 1.1rem;
    color: #666;
}

/* 文章列表 */
.post-list {
    display: grid;
    gap: 2rem;
}

.post-item {
    padding: 1.5rem;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.2s;
}

.post-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-title a {
    text-decoration: none;
    color: #333;
}

.post-title a:hover {
    color: #007bff;
}

.post-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-meta span {
    margin-right: 1rem;
}

.post-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* 标签和分类 */
.tags, .categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tag, .category {
    background: #f8f9fa;
    color: #666;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.tag:hover, .category:hover {
    background: #007bff;
    color: white;
}

/* 面包屑导航 */
.breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 快速导航 */
.quick-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.nav-item {
    padding: 2rem;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    text-align: center;
    background: #fff;
    transition: box-shadow 0.2s;
}

.nav-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-item h3 {
    margin-bottom: 1rem;
    color: #333;
}

.nav-item p {
    color: #666;
    margin-bottom: 1.5rem;
}

.nav-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: #0056b3;
}

/* 分类页面 */
.categories-section, .tags-section {
    margin-bottom: 3rem;
}

.category-tree {
    margin: 2rem 0;
}

.category-item {
    margin-bottom: 1.5rem;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.category-main {
    padding: 1rem;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-main a {
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.category-main a:hover {
    color: #007bff;
}

.category-count {
    background: #007bff;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.subcategories {
    padding: 0.5rem;
}

.subcategory-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subcategory-item a {
    color: #666;
    text-decoration: none;
}

.subcategory-item a:hover {
    color: #007bff;
}

.sub-subcategories {
    margin-top: 0.5rem;
    padding-left: 1rem;
}

.sub-subcategory-item {
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    background: #f8f9fa;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sub-subcategory-item a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

.sub-subcategory-item a:hover {
    color: #007bff;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0;
}

.tag-item {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    color: #666;
    text-decoration: none;
    border-radius: 20px;
    border: 1px solid #e1e5e9;
    transition: all 0.2s;
}

.tag-item:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* 归档页面 */
.archives-list {
    margin: 2rem 0;
}

.year-section {
    margin-bottom: 3rem;
}

.year-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
}

.archive-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    background: #fff;
    transition: box-shadow 0.2s;
}

.archive-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.archive-date {
    width: 80px;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

.archive-content {
    flex: 1;
    margin-left: 1rem;
}

.archive-content h3 {
    margin-bottom: 0.5rem;
}

.archive-content h3 a {
    color: #333;
    text-decoration: none;
}

.archive-content h3 a:hover {
    color: #007bff;
}

/* 文章内容页面 */
.post-content {
    max-width: 800px;
    margin: 0 auto;
}

.back-link {
    margin-bottom: 1rem;
}

.back-link a {
    color: #007bff;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.post-body {
    line-height: 1.8;
    color: #333;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
    margin: 2rem 0 1rem 0;
    color: #333;
}

.post-body h1 { font-size: 2rem; }
.post-body h2 { font-size: 1.75rem; }
.post-body h3 { font-size: 1.5rem; }
.post-body h4 { font-size: 1.25rem; }

.post-body p {
    margin: 1rem 0;
}

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

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

.post-body blockquote {
    border-left: 4px solid #007bff;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #666;
    font-style: italic;
}

.post-body code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.post-body pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
    position: relative;
}

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

.copy-code-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: #666;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 0.8rem;
    cursor: pointer;
}

.copy-code-btn:hover {
    background: #333;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.post-body th,
.post-body td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
}

.post-body th {
    background: #f8f9fa;
    font-weight: bold;
}

/* 分享功能 */
.post-share {
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.post-share h4 {
    margin-bottom: 1rem;
    color: #333;
}

.share-buttons {
    display: flex;
    gap: 1rem;
}

.share-buttons button {
    padding: 0.5rem 1rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.share-buttons button:hover {
    background: #0056b3;
}

/* 返回顶部 */
.back-to-top {
    text-align: center;
    margin: 2rem 0;
}

.back-to-top button {
    padding: 0.75rem 1.5rem;
    background: #666;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.back-to-top button:hover {
    background: #333;
}

/* 无内容状态 */
.no-posts, .no-categories, .no-tags {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-posts h3, .no-categories h3, .no-tags h3 {
    margin-bottom: 1rem;
    color: #333;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #666;
}

.pagination a:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination .current {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* 页脚 */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
    padding: 2rem 0;
    text-align: center;
    color: #666;
    margin-top: 3rem;
}

.footer a {
    color: #007bff;
    text-decoration: none;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .mobile-menu.show {
        display: flex;
    }
    
    .search-container {
        margin: 0 10px;
        max-width: 200px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .post-item {
        padding: 1rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .post-header h1 {
        font-size: 2rem;
    }
    
    .quick-nav {
        grid-template-columns: 1fr;
    }
    
    .archive-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .archive-date {
        width: auto;
        margin-bottom: 0.5rem;
    }
    
    .archive-content {
        margin-left: 0;
    }
}

/* 搜索结果样式 */
.search-results {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
}

.search-result-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.search-result-item:hover {
    background: #f8f9fa;
}

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

.search-result-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.search-result-excerpt {
    color: #666;
    font-size: 0.9rem;
}

/* 侧边栏布局修复 - 手动添加space-y-6样式 */
.space-y-6 > * + * {
    margin-top: 1.5rem;
}

/* 侧边栏卡片样式 */
.card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.card-body {
    padding: 1.5rem;
}

.card-body.p-0 {
    padding: 0;
}

/* 侧边栏广告位样式 */
.sidebar-ad {
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}