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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #e0e0e0;
    --text-secondary: #a0b4c8;
    --accent: #00d2ff;
    --accent-hover: #00b8e6;
    --border: rgba(0, 210, 255, 0.1);
    --gradient: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    min-height: 100vh;
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover { color: var(--accent-hover); }

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

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4em;
    font-weight: 700;
    color: #fff;
}

.logo-icon { font-size: 1.2em; }

.logo-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav {
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
}

.main-nav a:hover { color: var(--accent); }

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.main-nav a:hover::after { width: 100%; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5em;
    cursor: pointer;
}

/* Hero */
.hero {
    padding: 80px 0;
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.05) 0%, rgba(58, 123, 213, 0.05) 100%);
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-size: 3em;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.hero-subtitle {
    font-size: 1.2em;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.hero-tags {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.hero-tag {
    padding: 6px 16px;
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.9em;
    color: var(--accent);
    transition: all 0.3s ease;
}

.hero-tag:hover {
    background: rgba(0, 210, 255, 0.2);
    border-color: var(--accent);
}

/* Section Title */
.section-title {
    font-size: 1.6em;
    font-weight: 700;
    margin: 50px 0 30px;
    padding-left: 15px;
    border-left: 4px solid var(--accent);
    color: #fff;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.post-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 28px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 210, 255, 0.3);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.post-category {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 210, 255, 0.1);
    color: var(--accent);
    border-radius: 12px;
    font-size: 0.8em;
    margin-bottom: 12px;
}

.post-card h3 {
    font-size: 1.15em;
    margin-bottom: 10px;
    line-height: 1.5;
}

.post-card h3 a { color: #fff; }
.post-card h3 a:hover { color: var(--accent); }

.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.95em;
    margin-bottom: 15px;
}

.post-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #6b8a9e;
    flex-wrap: wrap;
    align-items: center;
}

/* Topics */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.topic-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.topic-card:hover {
    border-color: rgba(0, 210, 255, 0.3);
    transform: translateY(-3px);
}

.topic-icon { font-size: 2.5em; margin-bottom: 15px; }

.topic-card h3 {
    color: #fff;
    margin-bottom: 10px;
}

.topic-card p {
    color: var(--text-secondary);
    font-size: 0.95em;
}

/* Popular Tags Cloud */
.popular-tags {
    margin-bottom: 60px;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: baseline;
}

.tag-item {
    padding: 6px 14px;
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--accent);
    transition: all 0.3s ease;
}

.tag-item:hover {
    background: rgba(0, 210, 255, 0.2);
    border-color: var(--accent);
}

.tag-count {
    font-size: 0.75em;
    color: #6b8a9e;
}

/* Single Post */
.post-single {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.9em;
    color: #6b8a9e;
    margin-bottom: 25px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

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

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb span {
    color: var(--accent);
}

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

.post-header h1 {
    font-size: 2.2em;
    line-height: 1.4;
    margin: 15px 0;
    color: #fff;
}

/* Table of Contents */
.toc-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 30px;
}

.toc-title {
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    font-size: 1em;
    list-style: none;
}

.toc-title::-webkit-details-marker {
    display: none;
}

.toc-title::before {
    content: '▼ ';
    font-size: 0.8em;
}

details[open] .toc-title::before {
    content: '▲ ';
}

.toc {
    margin-top: 12px;
    padding-left: 0;
}

.toc ul {
    list-style: none;
    padding-left: 16px;
}

.toc > ul {
    padding-left: 0;
}

.toc li {
    margin: 6px 0;
    font-size: 0.9em;
}

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

.toc a:hover {
    color: var(--accent);
}

.post-content {
    font-size: 1.05em;
    line-height: 2;
}

.post-content h2 {
    font-size: 1.5em;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: #fff;
}

.post-content h3 {
    font-size: 1.2em;
    margin: 30px 0 15px;
    color: var(--accent);
}

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

.post-content code {
    background: rgba(0, 210, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-content pre {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid var(--border);
}

.post-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    margin: 20px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.post-content th,
.post-content td {
    padding: 12px 16px;
    border: 1px solid var(--border);
    text-align: left;
}

.post-content th {
    background: var(--bg-secondary);
    color: var(--accent);
}

.post-content ul, .post-content ol {
    margin: 15px 0;
    padding-left: 24px;
}

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

/* Post Tags Section */
.post-tags-section {
    margin: 40px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.post-tags-section h3 {
    font-size: 1em;
    color: #fff;
    margin-bottom: 12px;
}

.post-tags-section .post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.post-tags-section .tag {
    padding: 4px 12px;
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.post-tags-section .tag:hover {
    background: rgba(0, 210, 255, 0.2);
    border-color: var(--accent);
}

/* Related Posts */
.related-posts {
    margin: 40px 0;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.related-posts h3 {
    font-size: 1.2em;
    color: #fff;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.related-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    transition: all 0.3s ease;
}

.related-card:hover {
    border-color: rgba(0, 210, 255, 0.3);
    transform: translateY(-2px);
}

.related-card .post-category {
    font-size: 0.75em;
    margin-bottom: 8px;
}

.related-card h4 {
    font-size: 0.95em;
    margin-bottom: 8px;
    line-height: 1.4;
}

.related-card h4 a { color: #fff; }
.related-card h4 a:hover { color: var(--accent); }

.related-card p {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.related-card .post-date {
    font-size: 0.8em;
    color: #6b8a9e;
}

/* Post Footer / Navigation */
.post-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.post-nav a {
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.9em;
    max-width: 45%;
    transition: all 0.3s ease;
}

.post-nav a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* List Page */
.list-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 0;
}

.list-header {
    margin-bottom: 40px;
}

.list-header h1 {
    font-size: 2em;
    color: #fff;
    margin-bottom: 10px;
}

.list-description {
    color: var(--text-secondary);
}

.list-count {
    color: #6b8a9e;
    font-size: 0.9em;
    margin-top: 8px;
}

.list-item {
    padding: 25px 0;
    border-bottom: 1px solid var(--border);
}

.list-item h2 {
    font-size: 1.3em;
    margin-bottom: 10px;
}

.list-item h2 a { color: #fff; }
.list-item h2 a:hover { color: var(--accent); }

.list-excerpt {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.list-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #6b8a9e;
    flex-wrap: wrap;
    align-items: center;
}

.tag {
    color: var(--accent);
    font-size: 0.9em;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
    padding: 20px 0;
}

.pagination a {
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--accent);
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: rgba(0, 210, 255, 0.1);
    border-color: var(--accent);
}

.page-info {
    color: #6b8a9e;
    font-size: 0.9em;
}

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 50px 0 30px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-brand h3 {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.footer-links h4,
.footer-subscribe h4 {
    color: #fff;
    margin-bottom: 15px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li { margin-bottom: 8px; }

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

.footer-subscribe p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.rss-btn {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--accent);
    font-size: 0.9em;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: #6b8a9e;
    font-size: 0.85em;
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: block; }
    .hero h1 { font-size: 2em; }
    .posts-grid { grid-template-columns: 1fr; }
    .post-header h1 { font-size: 1.6em; }
    .related-grid { grid-template-columns: 1fr; }
    .post-nav { flex-direction: column; }
    .post-nav a { max-width: 100%; }
    .breadcrumb { font-size: 0.8em; }
}
