/*
Theme Name: Dragon Tech
Theme URI: https://wp.nebyae.top
Author: 小龙 🐉
Description: 科技风卡片式 WordPress 主题 — 深色磨砂玻璃质感，适合技术博客
Version: 1.0
License: MIT
Text Domain: dragon-tech
*/

/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-glass-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #e8e8f0;
    --text-secondary: #9494b8;
    --text-muted: #6b6b8d;
    --accent-1: #00d4ff;
    --accent-2: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #00d4ff, #7c3aed);
    --tag-bg: rgba(0, 212, 255, 0.1);
    --tag-color: #00d4ff;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 40px rgba(0, 212, 255, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--accent-1); text-decoration: none; transition: color .25s; }
a:hover { color: #66e5ff; }

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

/* ===== Background Grid ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-title {
    font-size: 22px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.site-title a { background: none; -webkit-text-fill-color: transparent; }

/* ===== Tag Navigation ===== */
.tag-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    justify-content: center;
}

.tag-nav::-webkit-scrollbar { display: none; }

.tag-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    white-space: nowrap;
    transition: all .3s;
}

.tag-nav a:hover,
.tag-nav a.current-tag {
    color: var(--accent-1);
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.2);
}

.header-search {
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all .3s;
    flex-shrink: 0;
}

.header-search:hover {
    color: var(--accent-1);
    background: rgba(0, 212, 255, 0.1);
}

/* ===== Main Content ===== */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 140px);
}

/* ===== Section Header ===== */
.section-header {
    margin-bottom: 36px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ===== Card Grid ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* ===== Article Card ===== */
.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all .4s cubic-bezier(.25,.46,.45,.94);
    cursor: pointer;
}

.article-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glass-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--bg-secondary);
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}

.article-card:hover .card-thumb img {
    transform: scale(1.05);
}

.card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    opacity: 0.6;
    font-size: 48px;
}

.card-body {
    padding: 20px;
}

.card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.card-category {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--tag-bg);
    color: var(--tag-color);
    border: 1px solid rgba(0, 212, 255, 0.15);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.card-meta .date {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== Single Post ===== */
.post-article {
    max-width: 760px;
    margin: 0 auto;
}

.post-header {
    margin-bottom: 40px;
    text-align: center;
}

.post-header .post-categories {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.post-header .post-categories a {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--tag-bg);
    color: var(--tag-color);
    border: 1px solid rgba(0, 212, 255, 0.15);
    transition: all .3s;
}

.post-header .post-categories a:hover {
    background: rgba(0, 212, 255, 0.2);
}

.post-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.post-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-featured-image {
    margin: 0 -40px 40px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    display: block;
}

/* ===== Post Content ===== */
.post-content {
    font-size: 16px;
    line-height: 1.85;
    color: var(--text-primary);
}

.post-content h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 48px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-glass);
}

.post-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 36px 0 12px;
}

.post-content p {
    margin-bottom: 20px;
}

.post-content a {
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

.post-content a:hover {
    border-bottom-color: var(--accent-1);
}

.post-content blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    border-left: 3px solid var(--accent-1);
    background: rgba(0, 212, 255, 0.05);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-secondary);
}

.post-content ul, .post-content ol {
    margin: 0 0 20px 24px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content img {
    border-radius: var(--radius-sm);
    margin: 24px 0;
    display: block;
}

.post-content pre {
    margin: 24px 0;
    padding: 20px;
    background: #0d0d1f;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
}

.post-content code {
    font-family: var(--font-mono);
    font-size: 14px;
    background: rgba(0, 212, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
}

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

.post-content hr {
    border: none;
    border-top: 1px solid var(--border-glass);
    margin: 40px 0;
}

/* ===== Tags at bottom ===== */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-glass);
}

.post-tags a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
    transition: all .3s;
}

.post-tags a:hover {
    color: var(--accent-1);
    border-color: rgba(0, 212, 255, 0.2);
    background: rgba(0, 212, 255, 0.08);
}

/* ===== Tag line accent ===== */
.post-tags::before {
    content: '🏷';
    margin-right: 4px;
    font-size: 14px;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    transition: all .3s;
}

.pagination a:hover {
    color: var(--accent-1);
    border-color: rgba(0, 212, 255, 0.2);
}

.pagination .current {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
}

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid var(--border-glass);
    padding: 32px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    position: relative;
    z-index: 1;
}

.site-footer a {
    color: var(--text-secondary);
}

.site-footer a:hover {
    color: var(--accent-1);
}

/* ===== 404 Page ===== */
.page-404 {
    text-align: center;
    padding: 80px 20px;
}

.page-404 h1 {
    font-size: 80px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.page-404 p {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 24px;
}

.btn-home {
    display: inline-flex;
    padding: 12px 32px;
    border-radius: 999px;
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    transition: all .3s;
    border: none;
    cursor: pointer;
}

.btn-home:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    color: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-inner {
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .tag-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }

    .site-title { font-size: 18px; }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .post-title {
        font-size: 26px;
    }

    .post-featured-image {
        margin: 0 0 24px;
    }

    .site-main {
        padding: 24px 16px;
    }

    .post-content {
        font-size: 15px;
    }

    .post-content h2 { font-size: 22px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
