@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&family=Newsreader:opsz,wght@6..72,400;6..72,600&display=swap");

:root {
    --bg: #f5f2ec;
    --surface: #fffdf8;
    --text: #2f2d2a;
    --muted: #6f6a62;
    --line: #ddd6cb;
    --link: #2363b3;
    --accent: #d4a84f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Noto Sans TC", sans-serif;
    line-height: 1.75;
}

.container {
    max-width: 1020px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-header {
    border-bottom: 1px solid var(--line);
    background: #f0ece4;
}

.site-head-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 2.1rem 0 1.6rem;
    align-items: flex-start;
}

.site-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: "Newsreader", serif;
    font-weight: 600;
    line-height: 1.28;
}

h1 {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    margin-bottom: 0.45rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 0.7rem;
}

h3 {
    font-size: 1.18rem;
}

.lead {
    margin: 0;
    color: var(--muted);
    max-width: 62ch;
}

.site-actions {
    display: flex;
    gap: 0.55rem;
}

.site-head-tools {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.site-avatar-link {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface);
    flex: 0 0 auto;
}

.site-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.page-nav-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.page-nav-actions .btn {
    white-space: nowrap;
}

.btn {
    display: inline-block;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.38rem 0.82rem;
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
    font-size: 0.9rem;
}

.btn:hover {
    border-color: #b9ae9b;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.05rem 1.15rem;
    margin-bottom: 1rem;
}

.section p {
    margin: 0;
}

.section.compact {
    padding: 0.95rem 1rem;
}

.featured-list,
.repo-list {
    display: grid;
    gap: 0.75rem;
}

.featured-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.repo-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.78rem 0.86rem;
    background: #fffcf7;
}

.note-card {
    border-color: #c9d8ec;
    background: #f7fbff;
}

.featured-card {
    border-color: #d8c287;
    background: #fff8e9;
}

.repo-rank {
    margin: 0 0 0.2rem;
    font-size: 0.74rem;
    color: #8c6f35;
    letter-spacing: 0.05em;
}

.repo-title {
    margin: 0 0 0.32rem;
}

.repo-desc {
    margin: 0;
    color: var(--muted);
    font-size: 0.93rem;
}

.repo-meta {
    margin: 0.5rem 0 0;
    color: #7d7468;
    font-size: 0.82rem;
}

.plain-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--muted);
}

.plain-list li + li {
    margin-top: 0.25rem;
}

a {
    color: var(--link);
}

.link-list a {
    text-decoration: none;
}

.link-list a:hover {
    text-decoration: underline;
}

footer {
    color: var(--muted);
    text-align: center;
    padding: 0.8rem 1rem 1.5rem;
}

.view-counter {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: #827a6f;
}

.top-disclaimer {
    margin: 0 0 1rem;
    font-size: 0.82rem;
    color: #8a8379;
    background: rgba(255, 253, 248, 0.72);
    border: 1px dashed #d8d1c6;
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
}

.notes-actions {
    margin: 0.9rem 0 0;
}

.note-view-section {
    padding: 0.8rem;
}

.note-frame {
    width: 100%;
    min-height: 78vh;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.markdown-content {
    max-width: 900px;
    margin: 0 auto;
    color: var(--text);
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin: 1.2rem 0 0.6rem;
}

.markdown-content p,
.markdown-content ul,
.markdown-content ol,
.markdown-content blockquote {
    margin: 0.75rem 0;
}

.markdown-content pre {
    overflow-x: auto;
    background: #f6f8fa;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
}

.markdown-content code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92em;
}

.markdown-content :not(pre) > code {
    background: #f1f3f5;
    border-radius: 4px;
    padding: 0.12rem 0.35rem;
}

.markdown-content blockquote {
    border-left: 3px solid #b8c2cc;
    padding-left: 0.8rem;
    color: #59636e;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.9rem 0;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid var(--line);
    padding: 0.45rem 0.55rem;
    text-align: left;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
}

.markdown-content details {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
    padding: 0.55rem 0.75rem;
    margin: 0.85rem 0;
}

.markdown-content summary {
    cursor: pointer;
    font-weight: 600;
}

@media (max-width: 920px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .featured-list {
        grid-template-columns: 1fr;
    }

    .site-head-row {
        flex-direction: column;
        gap: 0.8rem;
        padding-top: 1.5rem;
    }

    .site-head-tools {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 540px) {
    .container {
        padding: 0 0.72rem;
    }

    .site-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .site-avatar-link {
        width: 38px;
        height: 38px;
    }

    .btn {
        text-align: center;
    }

    .site-actions .btn {
        white-space: nowrap;
    }

    .page-nav-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .page-nav-actions .btn {
        flex: initial;
    }

    .section {
        padding: 0.9rem;
        border-radius: 8px;
    }

    h2 {
        font-size: 1.35rem;
    }
}
