/*
Theme Name: Nexus
Theme URI: https://yourdomain.com
Description: 科技感主题，支持颜色预设、自动缩略图、简化编辑器。
Version: 2.0
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* 默认深空青配色（变量由 customizer 动态输出，此处仅作为后备） */
:root {
    --bg-body: #0a0f1a;
    --bg-surface: #111827;
    --border-color: #2d3a5e;
    --accent: #2dd4bf;
    --accent-glow: rgba(45,212,191,0.3);
    --text-primary: #eef2ff;
    --text-secondary: #9ca3af;
    --card-bg: rgba(17,24,39,0.85);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 头部 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(var(--bg-body), 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    flex-wrap: wrap;
    gap: 16px;
}
.logo a {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
}
.nav-links ul {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
}
.nav-links a:hover {
    color: var(--accent);
}
.user-btns {
    display: flex;
    gap: 12px;
}
.btn {
    padding: 6px 18px;
    border-radius: 40px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a0c12;
}
.btn-primary:hover {
    background: #14b8a6;
    transform: translateY(-2px);
}

/* 英雄区 */
.hero {
    text-align: center;
    padding: 80px 20px 60px;
}
.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 16px;
}
.hero p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* 搜索框 */
.search-wrapper {
    max-width: 560px;
    margin: 32px auto 0;
}
.search-box {
    display: flex;
    background: var(--bg-surface);
    border-radius: 60px;
    padding: 4px;
    border: 1px solid var(--border-color);
    position: relative;
}
.search-box form {
    display: flex;
    width: 100%;
}
.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px 24px;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    border-radius: 60px 0 0 60px;
}
.search-box button {
    background: linear-gradient(135deg, var(--accent), #3b82f6);
    border: none;
    border-radius: 60px;
    padding: 0 32px;
    font-weight: 600;
    cursor: pointer;
    color: #0a0c12;
    white-space: nowrap;
}
.search-box::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(90deg, var(--accent), #3b82f6, var(--accent));
    border-radius: 62px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s;
}
.search-box:focus-within::before {
    opacity: 1;
    animation: borderFlow 2s linear infinite;
}
@keyframes borderFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
.search-box input::placeholder {
    color: var(--text-secondary);
    transition: 0.2s;
}
.search-box input:focus::placeholder {
    color: var(--accent);
    text-shadow: 0 0 3px var(--accent);
}

/* 分类标签 */
.cat-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin: 48px 0 40px;
}
.cat-item {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(4px);
    padding: 8px 24px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
}
.cat-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), #3b82f6);
    transform: scaleX(0);
    transition: transform 0.25s;
}
.cat-item:hover::after, .cat-item.active::after {
    transform: scaleX(1);
}
.cat-item:hover, .cat-item.active {
    background: rgba(45,212,191,0.15);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* 文章网格 */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
    margin: 40px 0 60px;
}
.post-card {
    background: transparent;
    border-radius: 28px;
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.post-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 20px 30px -12px var(--accent-glow);
}
.card-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    background: #2a3a5e;
}
.card-content {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    padding: 24px;
}
.post-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.post-title a {
    color: var(--text-primary);
    text-decoration: none;
}
.post-title a:hover {
    color: var(--accent);
}
.post-excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}
.post-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 12px;
}

/* 文章详情页 */
.article-container {
    max-width: 860px;
    margin: 60px auto;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: 32px;
    padding: 48px 56px;
    border: 1px solid var(--border-color);
}
.article-header {
    margin-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 24px;
}
.article-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.article-meta {
    display: flex;
    gap: 24px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.article-content {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-primary);
}
.article-content a {
    color: var(--accent);
    text-decoration: none !important;
}
.article-content a:hover {
    text-decoration: none !important;
    color: #fff;
}
.article-content p {
    margin-bottom: 1.2em;
}
.article-content h2 {
    font-size: 1.6rem;
    margin: 1.5em 0 0.8em;
    color: var(--text-primary);
}
.article-content h3 {
    font-size: 1.3rem;
    margin: 1.2em 0 0.6em;
    color: var(--text-primary);
}
.article-content code {
    background: rgba(0,0,0,0.4);
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-family: monospace;
}
.article-content pre {
    background: #0a0c12;
    padding: 16px;
    border-radius: 16px;
    overflow-x: auto;
}
/* 下载按钮 - 强制清除浮动和增加上边距 */
.download-box {
    clear: both;
    background: rgba(0,0,0,0.3);
    border-radius: 24px;
    padding: 24px;
    margin: 60px 0 40px !important;
    text-align: center;
    border: 1px solid var(--border-color);
}
.like-btn {
    background: transparent;
    border: 1px solid var(--accent);
    margin-left: 16px;
    padding: 8px 20px;
    border-radius: 40px;
    cursor: pointer;
    color: var(--accent);
}
.like-btn:hover {
    background: rgba(45,212,191,0.2);
}

/* 列表页 */
.archive-header {
    text-align: center;
    padding: 48px 0 24px;
}
.archive-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* 响应式 */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .article-container { padding: 24px; margin: 30px 20px; }
    .post-grid { grid-template-columns: 1fr; }
    .nav-links ul { gap: 16px; flex-wrap: wrap; justify-content: center; }
    .header-inner { flex-direction: column; text-align: center; }
}