/*
Theme Name: TechShare
Theme URI: https://typecho.org/
Description: 一个专为分享免费软件工具和技术文章设计的现代Typecho主题，采用蓝色科技感设计，卡片式布局，响应式设计。
Version: 1.0.0
Author: Typecho User
Author URI: https://typecho.org/
License: GPL v2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* 基础重置和变量定义 */
:root {
    /* 蓝色系主色调 */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --accent-color: #0ea5e9;

    /* 中性色 */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;

    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    /* 间距 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* 字体 */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* 暗色模式变量 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-card: #1e293b;
        --border-color: #334155;
    }
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* 排版 */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    text-decoration: none;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

/* 卡片 */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: var(--spacing-md);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
}

.card-text {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: var(--spacing-sm);
}

/* 工具标签 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

/* 网格系统 */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }
}

@media (max-width: 640px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

/* 导航栏样式 - 科技感美化 */
.site-header {
    background: linear-gradient(to right, #9c9aef 0%, #4055e8 50%, #5644ec 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 30px rgba(64, 85, 232, 0.3), 
                0 4px 6px -1px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 科技感背景图案 */
.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px),
        linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    pointer-events: none;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.navbar-brand {
    display: flex;
    align-items: center;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.navbar-brand:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.site-title h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    background: linear-gradient(90deg, #ffffff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.site-description {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.25rem;
    margin-bottom: 0;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    position: relative;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.nav-links a:hover,
.nav-links a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-links a.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
    border-color: rgba(255, 255, 255, 0.6);
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-links a:hover::before {
    opacity: 1;
}

.navbar-search .input-group {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.navbar-search .form-control {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    min-width: 220px;
    background: rgba(15, 23, 42, 0.7);
    color: #cbd5e1;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.navbar-search .form-control:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.8);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2), 
                0 0 15px rgba(37, 99, 235, 0.4);
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
}

.navbar-search .form-control::placeholder {
    color: #94a3b8;
}

.navbar-search .btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: 1px solid rgba(37, 99, 235, 0.5);
    color: white;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

.navbar-search .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    border-color: rgba(37, 99, 235, 0.8);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
    transform: translateY(-1px);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 4px 0;
    transition: 0.3s;
}

/* 主要内容区域 */
.site-main {
    padding: var(--spacing-lg) 0;
    min-height: 60vh;
}

.content-wrapper {
    /* 移除网格布局，因为index.php中没有侧边栏 */
    display: block;
}

/* 页脚样式 */
.site-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-xl);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.footer-info {
    flex: 1;
    min-width: 300px;
}

.footer-text {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-stats {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.beian-info {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-2px);
    background-color: var(--primary-dark);
}

/* 文章样式 */
.article-header {
    margin-bottom: var(--spacing-lg);
}

.article-title {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
}

.meta-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.separator {
    opacity: 0.5;
}

.article-footer {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.article-share {
    margin: var(--spacing-lg) 0;
}

.share-label {
    margin-right: var(--spacing-sm);
    color: var(--text-secondary);
}

.share-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.share-btn.twitter {
    background-color: #1da1f2;
    color: white;
}

.share-btn.facebook {
    background-color: #1877f2;
    color: white;
}

.share-btn.telegram {
    background-color: #0088cc;
    color: white;
}

.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.nav-previous,
.nav-next {
    flex: 1;
}

.nav-next {
    text-align: right;
}

/* 评论样式 */
.comments-area {
    margin-top: var(--spacing-xl);
}

.comments-title {
    margin-bottom: var(--spacing-lg);
}

.comment-form {
    margin-top: var(--spacing-lg);
}

.field-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.field {
    display: flex;
    flex-direction: column;
}

.field label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.field label.required::after {
    content: '*';
    color: #dc2626;
    margin-left: 0.25rem;
}

.field input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comment-content-field {
    margin-bottom: var(--spacing-md);
}

.comment-content-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 150px;
    transition: border-color 0.2s;
}

.textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comment-help {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.comment-submit {
    margin-top: var(--spacing-md);
}

/* 归档页面样式 */
.archive-header {
    margin-bottom: var(--spacing-lg);
}

.archive-title {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.archive-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-size: 1.125rem;
    line-height: 1.6;
}

.archive-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.archive-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid var(--border-color);
}

.archive-item:last-child {
    border-bottom: none;
}

.archive-item-thumbnail img {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.archive-item-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.archive-item-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
}

.archive-item-excerpt {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.archive-item-taxonomies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* 404页面样式 */
.error-404 {
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.error-icon {
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
}

.error-title {
    font-size: 6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
    line-height: 1;
}

.error-subtitle {
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.error-description {
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
    color: var(--text-secondary);
    line-height: 1.6;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.error-search {
    max-width: 500px;
    margin: 0 auto var(--spacing-xl);
}

.search-label {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.error-recommendations {
    max-width: 800px;
    margin: 0 auto;
}

.recommendations-title {
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: var(--spacing-xs);
}

.mt-2 {
    margin-top: var(--spacing-sm);
}

.mt-3 {
    margin-top: var(--spacing-md);
}

.mt-4 {
    margin-top: var(--spacing-lg);
}

.mb-1 {
    margin-bottom: var(--spacing-xs);
}

.mb-2 {
    margin-bottom: var(--spacing-sm);
}

.mb-3 {
    margin-bottom: var(--spacing-md);
}

.mb-4 {
    margin-bottom: var(--spacing-lg);
}

.p-1 {
    padding: var(--spacing-xs);
}

.p-2 {
    padding: var(--spacing-sm);
}

.p-3 {
    padding: var(--spacing-md);
}

.p-4 {
    padding: var(--spacing-lg);
}

/* 代码高亮 */
pre,
code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

pre {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    overflow-x: auto;
    margin-bottom: var(--spacing-md);
}

code {
    background-color: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--primary-color);
}

/* 文章内容样式 */
.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: var(--spacing-md);
    margin: var(--spacing-md) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-md) 0;
}

.article-content th,
.article-content td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.article-content th {
    background-color: var(--bg-secondary);
    font-weight: 600;
}

/* 下载按钮样式 */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: white;
}

.download-btn::before {
    content: "↓";
    font-weight: bold;
}

/* 软件信息卡片 */
.software-info {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.software-info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.software-info-item:last-child {
    border-bottom: none;
}

.software-info-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.software-info-value {
    color: var(--text-primary);
}