/**
 * Simple Elegant Theme for Typecho
 * @package Simple-elegant
 * @author PSRSS
 * @version 1.0.0
 * @link https://typecho.org
 */

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

:root {
    --primary-color: #5a8f5a;
    --primary-light: #7ab87a;
    --bg-color: #d0dada;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border-color: #e5e5e5;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --sidebar-bg: #ebf2ed;
    --tag-bg: #f5f5f5;
}

/* 夜间模式 */
[data-theme="dark"] {
    --primary-color: #6fa86f;
    --primary-light: #8fc98f;
    --bg-color: #1a1a1a;
    --card-bg: #242424;
    --text-color: #e0e0e0;
    --text-light: #a0a0a0;
    --text-muted: #707070;
    --border-color: #383838;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    --sidebar-bg: #1e1e1e;
    --tag-bg: #333333;
}

[data-theme="dark"] .article-tag,
[data-theme="dark"] .category-tabs a,
[data-theme="dark"] .stat-item {
    background: var(--tag-bg);
}

[data-theme="dark"] .article-card {
    background: var(--card-bg);
}

[data-theme="dark"] .sidebar-right {
    background: var(--card-bg);
}

[data-theme="dark"] .main-content {
    background: var(--card-bg);
}

[data-theme="dark"] .page-wrapper {
    background: var(--card-bg);
}

[data-theme="dark"] .hot-item {
    border-color: var(--border-color);
}

[data-theme="dark"] img {
    opacity: 0.9;
}

[data-theme="dark"] .nav-icon {
    filter: brightness(0) invert(0.85);
}

[data-theme="dark"] .nav-item:hover .nav-icon {
    filter: brightness(0) saturate(100%) invert(55%) sepia(15%) saturate(900%) hue-rotate(80deg);
}

[data-theme="dark"] .nav-item i {
    color: var(--text-color);
}

[data-theme="dark"] .top-icons {
    color: var(--text-color);
}

[data-theme="dark"] .article-card:hover {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .top-bar-wrapper {
    background-color: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .top-bar-wrapper.scrolled {
    background-color: rgba(30, 30, 30, 0.9);
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .sidebar-left {
    background-color: var(--sidebar-bg);
}

@media (max-width: 992px) {
    [data-theme="dark"] .sidebar-left {
        background: rgba(30, 30, 30, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

[data-theme="dark"] .back-to-top {
    background: rgba(50, 50, 50, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* 夜间模式 - 阅读页面 */
[data-theme="dark"] .article-tags a {
    background: var(--tag-bg);
    color: var(--text-light);
}

[data-theme="dark"] .action-btn {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-light);
}

[data-theme="dark"] .action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .action-btn.liked {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

[data-theme="dark"] .action-btn.liked:hover {
    color: white;
}

[data-theme="dark"] .article-body blockquote {
    background: var(--tag-bg);
}

[data-theme="dark"] .article-body code {
    background: var(--tag-bg);
    color: var(--text-color);
}

[data-theme="dark"] .related-item {
    background: var(--tag-bg);
}

[data-theme="dark"] .related-item:hover {
    background: var(--border-color);
}

/* 夜间模式 - 评论区 */
[data-theme="dark"] .respond {
    background: var(--tag-bg);
}

[data-theme="dark"] .comment-form input,
[data-theme="dark"] .comment-form textarea {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .comment-form input::placeholder,
[data-theme="dark"] .comment-form textarea::placeholder {
    color: var(--text-muted);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    font-size: 15px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

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

.page-wrapper {
    max-width: 1180px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.container {
    display: flex;
    min-height: calc(100vh - 40px);
}

/* 左侧边栏 */
.sidebar-left {
    width: 295px;
    flex-shrink: 0;
    padding: 25px 20px;
    background-color: var(--sidebar-bg);
    border-radius: 16px 0 0 16px;
    min-height: 100%;
}

.sidebar-left-inner {
    position: sticky;
    top: 20px;
}

.logo {
    font-size: 26px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 40px;
    letter-spacing: 2px;
}

.logo span {
    color: var(--text-color);
}

.nav-menu {
    margin-top: 20px;
    margin-bottom: 25px;
}

.nav-item {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 12px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 15px;
}

.nav-item:last-child {
    margin-bottom: 0;
}

.nav-item:hover {
    background: rgba(90, 143, 90, 0.1);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-item i {
    margin-right: 10px;
    font-size: 19px;
}

.nav-icon {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    margin-right: 10px;
    object-fit: contain;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.nav-item:hover .nav-icon {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(40%) sepia(15%) saturate(900%) hue-rotate(80deg);
}

.nav-item.active .nav-icon {
    opacity: 1;
    filter: brightness(0) invert(1);
}

.sidebar-section {
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.section-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 主内容区 */
.main-content {
    width: 590px;
    flex-shrink: 0;
    padding: 0;
    background-color: #f6faf8;
}

.main-inner {
    padding: 20px 25px;
}

/* 分类横幅文字 */
.category-banner-text {
    position: absolute;
    bottom: 20px;
    left: 37px;
    text-align: left;
    color: #fff;
    max-width: 80%;
}

.category-banner-text h1 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.category-banner-text .desc {
    font-size: 14px;
    opacity: 0.95;
    margin-bottom: 6px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.category-banner-text .count {
    font-size: 13px;
    opacity: 0.8;
}

.top-bar-wrapper {
    position: sticky;
    top: 0;
    background-color: #f6faf8;
    padding: 0 25px;
    z-index: 100;
    transition: all 0.3s ease;
}

.top-bar-wrapper.scrolled {
    background-color: rgba(246, 250, 248, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.top-icons {
    display: flex;
    gap: 15px;
    color: var(--text-light);
    font-size: 18px;
}

.top-icons i {
    cursor: pointer;
    transition: color 0.3s;
}

.top-icons i:hover {
    color: var(--primary-color);
}

/* 幻灯片 */
.slider {
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

.slider-wrapper {
    display: flex;
    transition: transform 0.5s ease;
}

.slide {
    min-width: 100%;
    position: relative;
}

.slide img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
}

.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.slider-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.category-tab {
    padding: 6px 14px;
    border-radius: 4px;
    background: var(--tag-bg);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-tab:hover,
.category-tab.active {
    background: var(--primary-color);
    color: white;
}

/* 文章列表 */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-card {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    transition: all 0.3s ease;
}

.article-card:hover {
    background: rgba(255,255,255,0.5);
}

.article-thumb {
    width: 150px;
    height: 180px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px;
    margin: 12px;
    margin-right: 0;
}

.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

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

.article-content {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.5;
    color: var(--text-color);
    transition: color 0.3s;
}

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

.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.article-meta .author {
    color: var(--primary-color);
    font-weight: 500;
}

.article-meta .divider {
    color: #ddd;
}

.article-excerpt {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 12px;
}

.article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.article-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.article-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-stats i {
    font-size: 15px;
}

.article-tag {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* 右侧边栏 */
.sidebar-right {
    width: 295px;
    flex-shrink: 0;
    padding: 25px 20px;
    background-color: #ebf2ed;
    border-radius: 0 16px 16px 0;
    min-height: 100%;
}

.sidebar-right-inner {
    position: sticky;
    top: 20px;
}

.right-section {
    margin-bottom: 25px;
}

.right-section:last-child {
    margin-bottom: 0;
}

.right-section-title {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.hot-list {
    list-style: none;
}

.hot-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
}

.hot-item:first-child {
    padding-top: 0;
}

.hot-item:last-child {
    padding-bottom: 0;
}

.hot-thumb {
    width: 55px;
    height: 40px;
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
}

.hot-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hot-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.hot-info h4 {
    font-size: 13px;
    font-weight: normal;
    margin-bottom: 3px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-info span {
    font-size: 11px;
    color: var(--text-muted);
}

.comment-list {
    list-style: none;
}

.comment-list > .comment-item {
    padding: 28px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-children .comment-item {
    padding: 15px 0;
}

.comment-item:first-child {
    padding-top: 0;
}

.comment-list > .comment-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.comment-info {
    flex: 1;
    min-width: 0;
}

.comment-info .name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.comment-info .text {
    font-size: 12px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.stat-item {
    text-align: center;
    padding: 10px 6px;
    background: #f8f9f8;
    border-radius: 6px;
}

.stat-item .label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.stat-item .value {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-item.highlight {
    grid-column: span 2;
    background: var(--primary-color);
    color: white;
}

.stat-item.highlight .label,
.stat-item.highlight .value {
    color: white;
}

/* 遮罩层 */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    z-index: 997;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(90, 143, 90, 0.4);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    padding: 20px 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 6px;
    background: var(--tag-bg);
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.3s;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
}

.pagination .current {
    background: var(--primary-color);
    color: white;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .sidebar-right {
        width: 250px;
    }

    .main-content {
        width: auto;
        flex: 1;
    }
}

@media (max-width: 1024px) {
    .sidebar-right {
        display: none;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .page-wrapper {
        border-radius: 0;
    }

    .sidebar-left {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 260px;
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 999;
        padding: 20px;
        overflow-y: auto;
        transition: left 0.3s;
        border-right: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 0;
    }

    .sidebar-left.active {
        left: 0;
    }

    .overlay.active {
        display: block;
    }

    .main-content {
        width: 100%;
    }

    .article-thumb {
        width: 120px;
        height: 140px;
        margin: 10px;
        margin-right: 0;
    }

    .article-content {
        padding: 10px 12px;
    }

    .article-title {
        font-size: 15px;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .article-excerpt {
        -webkit-line-clamp: 2;
    }

    .article-tag {
        display: none;
    }

    .main-inner {
        padding: 15px;
    }

    .category-banner-text {
        left: 25px;
        bottom: 15px;
    }

    .category-banner-text h1 {
        font-size: 20px;
    }

    .category-banner-text .desc {
        font-size: 13px;
    }

    .category-banner-text .count {
        font-size: 12px;
    }

    .top-bar-wrapper {
        padding: 0 15px;
    }

    .category-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .category-tabs::-webkit-scrollbar {
        display: none;
    }

    .category-tab {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .article-content {
        padding: 10px 12px;
    }

    .article-title {
        font-size: 14px;
    }
}
