:root {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --bg-subtle: #f1f5f9;
    --border-color: #e2e8f0;
    --border-subtle: #edf2f7;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --primary: #4f46e5;
    --primary-light: #eef2ff;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.15);
    --code-bg: #f8fafc;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-body: #0b0f19;
    --bg-card: #131b2e;
    --bg-card-hover: #18223a;
    --bg-subtle: #1e293b;
    --border-color: #243048;
    --border-subtle: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --primary: #6366f1;
    --primary-light: rgba(99, 102, 241, 0.15);
    --primary-hover: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.25);
    --code-bg: #0d1322;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    --card-shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.5);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

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

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

.layout-wrapper {
    display: flex;
    gap: 32px;
    margin-top: 32px;
    margin-bottom: 48px;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar-content {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (max-width: 900px) {
    .layout-wrapper {
        flex-direction: column;
        gap: 28px;
    }
    .sidebar-content {
        width: 100%;
    }
}

/* Header & Nav */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .site-header {
    background: rgba(19, 27, 46, 0.85);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-text span.brand-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 8px;
}

.nav-item a {
    display: inline-block;
    padding: 8px 14px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
}

.nav-item a:hover,
.nav-item a.current {
    color: var(--primary);
    background-color: var(--primary-light);
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

.mobile-menu-btn {
    display: none;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--card-shadow);
    }
    .nav-links.show {
        display: flex;
    }
    .mobile-menu-btn {
        display: flex;
    }
}

/* Post Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(99, 102, 241, 0.3);
}

.post-card {
    margin-bottom: 24px;
    padding: 28px 32px;
}

.post-card-header {
    margin-bottom: 14px;
}

.post-card-title {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
}

.post-card-title a {
    color: var(--text-main);
}

.post-card-title a:hover {
    color: var(--primary);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

.post-meta-item svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    opacity: 0.8;
}

.post-excerpt {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.7;
    margin-bottom: 20px;
    word-break: break-word;
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--primary);
}

.read-more-btn:hover {
    gap: 10px;
}

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

.tag-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.8rem;
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.tag-badge:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-light);
}

/* Single Post & Page */
.article-detail {
    padding: 36px 40px;
    margin-bottom: 32px;
}

@media (max-width: 640px) {
    .article-detail {
        padding: 24px 20px;
    }
    .post-card {
        padding: 20px 20px;
    }
}

.article-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.article-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

/* Typography in article content */
.article-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-main);
    word-break: break-word;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: var(--text-main);
    font-weight: 700;
    margin-top: 1.8em;
    margin-bottom: 0.8em;
    line-height: 1.4;
}

.article-content h2 {
    font-size: 1.6rem;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.article-content h3 {
    font-size: 1.3rem;
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.8em;
}

.article-content li {
    margin-bottom: 0.4em;
}

.article-content blockquote {
    margin: 1.8em 0;
    padding: 16px 20px;
    background: var(--bg-subtle);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    font-style: italic;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 2px 6px;
    background: var(--bg-subtle);
    color: var(--primary);
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.article-content pre {
    margin: 1.8em 0;
    padding: 18px 22px;
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.article-content pre code {
    padding: 0;
    background: none;
    border: none;
    color: inherit;
    font-size: 0.92rem;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.8em 0;
}

.article-content th,
.article-content td {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
}

.article-content th {
    background: var(--bg-subtle);
    font-weight: 600;
}

/* Post Navigation (Prev/Next) */
.post-pagination-near {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

@media (max-width: 600px) {
    .post-pagination-near {
        grid-template-columns: 1fr;
    }
}

.near-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    transition: var(--transition);
}

.near-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.near-card .near-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.near-card .near-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-main);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Archive Title Banner */
.archive-banner {
    padding: 24px 30px;
    margin-bottom: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}

.archive-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.archive-banner-title {
    font-size: 1.35rem;
    font-weight: 700;
}

/* Pagination */
.pagination-wrapper {
    margin: 32px 0;
    display: flex;
    justify-content: center;
}

.pagination-wrapper .page-navigator {
    list-style: none;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    background: var(--bg-card);
    padding: 6px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.pagination-wrapper .page-navigator li a,
.pagination-wrapper .page-navigator li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
}

.pagination-wrapper .page-navigator li.current a,
.pagination-wrapper .page-navigator li.current span {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
}

.pagination-wrapper .page-navigator li a:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* Sidebar Widgets */
.widget-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 24px;
}

.widget-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title span.bar {
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
    display: inline-block;
}

/* Profile Widget */
.profile-card {
    text-align: center;
}

.profile-avatar {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    margin: 0 auto 14px;
    object-fit: cover;
    border: 3px solid var(--border-subtle);
    box-shadow: 0 4px 10px var(--primary-glow);
}

.profile-avatar-fallback {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.profile-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.profile-bio {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Widget Lists */
.widget-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.widget-list li {
    font-size: 0.92rem;
    line-height: 1.5;
}

.widget-list li a {
    color: var(--text-muted);
    display: block;
    word-break: break-word;
}

.widget-list li a:hover {
    color: var(--primary);
    transform: translateX(4px);
}

.recent-comment-author {
    font-weight: 600;
    color: var(--text-main);
}

/* Search Form in Sidebar / Top */
.search-widget-form {
    display: flex;
    gap: 8px;
}

.search-widget-input {
    flex: 1;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.9rem;
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.search-widget-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-widget-btn {
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.search-widget-btn:hover {
    background: var(--primary-hover);
}

/* Comments Section */
.comments-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 32px;
    margin-top: 32px;
}

.comments-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.comment-list {
    list-style: none;
    margin-bottom: 32px;
}

.comment-list .comment-body {
    padding: 18px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.comment-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.comment-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.comment-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.comment-content {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.6;
    margin-left: 52px;
}

.comment-reply {
    margin-left: 52px;
    margin-top: 8px;
    font-size: 0.85rem;
}

.comment-children {
    list-style: none;
    margin-left: 36px;
    border-left: 2px solid var(--border-subtle);
    padding-left: 16px;
}

/* Comment Form */
.respond-box {
    margin-top: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.92rem;
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
    resize: vertical;
    min-height: 110px;
}

.btn-submit {
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Footer */
.site-footer {
    margin-top: auto;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 32px 0 24px;
    font-size: 0.88rem;
    color: var(--text-muted);
    text-align: center;
    transition: var(--transition);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

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

.footer-links a:hover {
    color: var(--primary);
}

/* 404 Error Page */
.error-page-wrapper {
    padding: 60px 20px;
    text-align: center;
}

.error-code {
    font-size: 6rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.error-desc {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* APlayer 音乐播放器色彩适配（自动契合 Aurora 主题双模式） */
.aplayer {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--card-shadow) !important;
    font-family: var(--font-sans) !important;
}

/* 歌曲标题与歌手名字颜色 */
.aplayer .aplayer-title {
    color: var(--text-main) !important;
}
.aplayer .aplayer-author {
    color: var(--text-muted) !important;
}

/* 展开的歌曲列表背景与文字 */
.aplayer .aplayer-list ol li {
    border-top: 1px solid var(--border-subtle) !important;
    color: var(--text-main) !important;
}
.aplayer .aplayer-list ol li:hover {
    background: var(--bg-subtle) !important;
}
.aplayer .aplayer-list ol li.aplayer-list-light {
    background: var(--primary-light) !important;
}
.aplayer .aplayer-list ol li .aplayer-list-author {
    color: var(--text-muted) !important;
}

/* 播放控制器图标与音量条底色 */
.aplayer .aplayer-controller .aplayer-time {
    color: var(--text-muted) !important;
}
.aplayer .aplayer-controller .aplayer-time .aplayer-icon path {
    fill: var(--text-muted) !important;
}
.aplayer .aplayer-controller .aplayer-time .aplayer-icon:hover path {
    fill: var(--primary) !important;
}
.aplayer .aplayer-miniswitcher {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}
.aplayer .aplayer-miniswitcher .aplayer-icon path {
    fill: var(--text-muted) !important;
}

/* 彻底解决 APlayer fixed 吸底模式展开后的纯白底色 */
.aplayer.aplayer-fixed .aplayer-body,
.aplayer .aplayer-body,
.aplayer .aplayer-info,
.aplayer .aplayer-lrc:before,
.aplayer .aplayer-lrc:after {
    background: var(--bg-card) !important;
}

/* 渐变遮罩透明化，避免白边 */
.aplayer .aplayer-lrc:before {
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(255, 255, 255, 0)) !important;
}
.aplayer .aplayer-lrc:after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--bg-card)) !important;
}

/* 歌曲列表外层容器背景 */
.aplayer.aplayer-fixed .aplayer-list {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}
