/* 日系排版：思源黑体（Google Fonts CDN，轻量字重） + 系统字体回退 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500&display=swap');

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

:root {
    --color-bg: #f9f8f5;
    --color-bg-sidebar: #f4f2ed;
    --color-text: #4a4a4a;
    --color-text-light: #9a9a9a;
    --color-accent: #b8a088;
    --color-accent-hover: #a08870;
    --color-border: #eae6de;
    --color-link: #8a7560;
    --color-code-bg: #f5f3ef;
    --font-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
    --font-sans: "Noto Sans SC", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-mono: "SF Mono", "Cascadia Code", "Consolas", "Monaco", monospace;
    --sidebar-width: 200px;
    --content-max-width: 720px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.9;
    font-size: 15.5px;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "palt" 1;
}

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

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

/* ===== Layout ===== */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-bg-sidebar);
    border-right: 1px solid var(--color-border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 48px 24px;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    margin-bottom: 48px;
}

.site-title {
    font-family: var(--font-sans);
    font-size: 19px;
    font-weight: 400;
    color: var(--color-text);
    letter-spacing: 0.12em;
    margin-bottom: 12px;
}

.site-subtitle {
    font-size: 11px;
    color: var(--color-text-light);
    font-family: var(--font-sans);
    letter-spacing: 0.08em;
    font-weight: 300;
    opacity: 0.7;
}

.nav {
    flex: 1;
}

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

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: block;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-light);
    font-family: var(--font-sans);
    letter-spacing: 0.05em;
    border-radius: 4px;
    transition: color 0.25s ease, background-color 0.25s ease;
    position: relative;
}

.nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 0;
    background-color: var(--color-accent);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    background-color: transparent;
    color: var(--color-text);
}

.nav-link:hover::before {
    height: 14px;
}

.nav-link.active {
    color: var(--color-text);
    font-weight: 400;
}

.nav-link.active::before {
    height: 18px;
    background-color: var(--color-accent);
}

.sidebar-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.copyright {
    font-size: 12px;
    color: var(--color-text-light);
    font-family: var(--font-sans);
    line-height: 1.6;
}

/* ===== Mobile Menu Toggle ===== */
.menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 42px;
    height: 42px;
    background-color: var(--color-bg-sidebar);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--color-text);
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Main Content ===== */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 80px 80px;
    max-width: calc(var(--sidebar-width) + var(--content-max-width) + 160px);
}

.content-wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* ===== Page Header ===== */
.page-header {
    margin-bottom: 56px;
    padding-bottom: 0;
}

.page-title {
    font-size: 26px;
    font-weight: 400;
    color: var(--color-text);
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.page-desc {
    font-size: 14px;
    color: var(--color-text-light);
    font-family: var(--font-sans);
}

/* ===== Post List ===== */
.post-list {
    list-style: none;
}

.post-item {
    padding: 28px 0;
    border-bottom: 1px solid var(--color-border);
    transition: opacity 0.2s ease;
}

.post-item:last-child {
    border-bottom: none;
}

.post-item:hover {
    opacity: 0.85;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--color-text-light);
}

.post-category {
    padding: 2px 10px;
    background-color: rgba(184, 160, 136, 0.12);
    color: var(--color-accent);
    border-radius: 12px;
    font-size: 12px;
}

.post-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 10px;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

.post-excerpt {
    font-size: 14px;
    color: var(--color-text-light);
    line-height: 1.8;
    font-family: var(--font-sans);
}

/* ===== Article ===== */
.article {
    font-size: 16px;
    line-height: 2;
}

.article-header {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--color-border);
}

.article-title {
    font-size: 30px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 16px;
    letter-spacing: 0.03em;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--color-text-light);
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
    font-weight: 600;
    margin: 40px 0 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--color-text);
}

.article-body h1 { font-size: 26px; }
.article-body h2 {
    font-size: 21px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}
.article-body h3 { font-size: 18px; }
.article-body h4 { font-size: 16px; }

.article-body p {
    margin: 18px 0;
    line-height: 1.9;
}

.article-body ul,
.article-body ol {
    margin: 20px 0;
    padding-left: 28px;
}

.article-body li {
    margin: 8px 0;
}

.article-body blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    background-color: rgba(184, 160, 136, 0.06);
    color: var(--color-text-light);
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.8;
}
.article-body blockquote p {
    margin: 8px 0;
}

.article-body code {
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 2px 6px;
    background-color: var(--color-code-bg);
    border-radius: 3px;
    color: #5a4a3a;
}

.article-body pre {
    margin: 28px 0;
    padding: 20px;
    background-color: var(--color-code-bg);
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid var(--color-border);
}

.article-body pre code {
    padding: 0;
    background: none;
    font-size: 13px;
    line-height: 1.6;
}

.article-body hr {
    margin: 40px 0;
    border: none;
    border-top: 1px solid var(--color-border);
}

.article-body a {
    color: var(--color-link);
    text-decoration: none;
    border-bottom: 1px solid rgba(138, 117, 96, 0.3);
    padding-bottom: 1px;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.article-body a:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 20px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.article-body table {
    width: 100%;
    margin: 28px 0;
    border-collapse: collapse;
    font-family: var(--font-sans);
    font-size: 14px;
}

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

.article-body th {
    background-color: var(--color-bg-sidebar);
    font-weight: 600;
}

/* ===== About / Profile Page ===== */
.profile-section {
    text-align: center;
    padding: 40px 0;
}

.profile-section .profile-avatar {
    margin: 0 auto 36px;
}

.profile-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin-bottom: 32px;
    display: block;
    object-fit: cover;
}

.profile-name {
    font-size: 25px;
    font-weight: 400;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.profile-bio {
    font-size: 15px;
    color: var(--color-text-light);
    font-family: var(--font-sans);
    margin-bottom: 32px;
    line-height: 1.8;
}

.profile-section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.profile-content {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 2;
    color: var(--color-text);
}

.profile-content p {
    margin: 12px 0;
}

/* ===== Projects ===== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.project-card {
    padding: 28px;
    background-color: var(--color-bg-sidebar);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-accent);
    box-shadow: 0 4px 20px rgba(184, 160, 136, 0.1);
}

.project-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--color-text);
}

.project-desc {
    font-size: 14px;
    color: var(--color-text-light);
    font-family: var(--font-sans);
    line-height: 1.7;
    margin-bottom: 16px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-tag {
    padding: 3px 10px;
    font-size: 12px;
    background-color: rgba(184, 160, 136, 0.1);
    color: var(--color-accent);
    border-radius: 12px;
    font-family: var(--font-sans);
}

/* ===== Daily Cards ===== */
.daily-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.daily-card {
    background: rgba(244, 242, 237, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 24px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.daily-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 2px 16px rgba(184, 160, 136, 0.08);
}

.daily-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.daily-date {
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-light);
    letter-spacing: 0.05em;
    font-family: var(--font-mono);
}

.daily-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.daily-tag {
    font-size: 11px;
    color: var(--color-accent);
    background: rgba(184, 160, 136, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-sans);
    letter-spacing: 0.03em;
}

.daily-card-body {
    font-size: 15px;
    line-height: 1.85;
    color: var(--color-text);
}

.daily-card-body p {
    margin: 12px 0;
}

.daily-card-body p:first-child {
    margin-top: 0;
}

.daily-card-body p:last-child {
    margin-bottom: 0;
}

.daily-card-body blockquote {
    margin: 14px 0;
    padding: 12px 16px;
    background: rgba(184, 160, 136, 0.06);
    border-radius: 6px;
    font-size: 14px;
    color: var(--color-text-light);
    line-height: 1.7;
}

/* ===== Friends ===== */
.friend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.friend-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background-color: var(--color-bg-sidebar);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.friend-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-accent);
    box-shadow: 0 4px 20px rgba(184, 160, 136, 0.1);
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 500;
    color: var(--color-accent);
    background: rgba(184, 160, 136, 0.12);
    font-family: var(--font-sans);
}

.friend-avatar.loaded {
    background-size: cover;
    background-position: center;
    font-size: 0;
    color: transparent;
}

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

.friend-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--color-text);
}

.friend-desc {
    font-size: 13px;
    color: var(--color-text-light);
    font-family: var(--font-sans);
    line-height: 1.6;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 48px 0 24px;
    font-family: var(--font-sans);
}

.pagination-item {
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 14px;
    color: var(--color-text);
    transition: all 0.2s ease;
}

.pagination-item:hover,
.pagination-item.active {
    background-color: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--color-text-light);
    font-family: var(--font-sans);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 15px;
}

/* ===== Responsive: Tablet ===== */
@media (max-width: 1024px) {
    .main {
        padding: 48px 40px;
    }
}

/* ===== Responsive: Mobile ===== */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
    }

    .menu-toggle {
        display: flex;
    }

    .overlay {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
        pointer-events: none;
    }

    .sidebar.active {
        transform: translateX(0);
        pointer-events: auto;
    }

    .overlay {
        pointer-events: none;
    }

    .overlay.active {
        pointer-events: auto;
    }

    .main {
        margin-left: 0;
        padding: 72px 24px 40px;
    }

    .page-header {
        margin-bottom: 36px;
    }

    .page-title {
        font-size: 24px;
    }

    .post-item {
        padding: 20px 0;
    }

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

    .article-header {
        margin-bottom: 28px;
        padding-bottom: 20px;
    }

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

    .article {
        font-size: 15px;
        line-height: 1.9;
    }

    .article-body h1 { font-size: 22px; }
    .article-body h2 { font-size: 19px; }
    .article-body h3 { font-size: 17px; }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .daily-grid {
        grid-template-columns: 1fr;
    }

    .profile-avatar {
        width: 120px;
        height: 120px;
    }
}

/* ===== Small Mobile ===== */
@media (max-width: 480px) {
    .main {
        padding: 68px 16px 32px;
    }

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

    .page-title {
        font-size: 21px;
    }

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

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