@import url(https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Noto+Serif+SC:wght@400;600&display=fallback);


:root {
    --ink: #010000;
    --parchment: #BBBBBC;
    --shadow: rgba(43, 42, 40, 0.3);
    --time: 0.1s;
}

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

html {
    overflow-y: scroll;
}

body {
    font-family: "Crimson Text", "Noto Serif SC", serif;
    background-color: var(--ink);
    color: var(--parchment);
    line-height: 1.7;
    font-size: 1rem;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
    filter: contrast(1.5);
}

header {
    margin-bottom: 3rem;
    border-bottom: 1px solid #333;
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--parchment);
    text-decoration: none;
    transition: color var(--time) ease;
}

nav a:hover {
    color: #fff;
}

h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

h2 {
    font-size: 1.7rem;
    margin-bottom: 1rem;
}

article {
    margin-bottom: 3rem;
}

article header {
    margin-bottom: 2rem;
    border: none;
}

time {
    font-size: 1rem;
    opacity: 0.7;
    font-style: italic;
}

.title-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.title-row h1 {
    margin-bottom: 0;
}

.meta-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
} .tags-inline {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: baseline;
}

.date {
    font-size: 0.9rem;
    color: rgba(187, 187, 188, 0.7);
    font-style: normal;
}

.tags-inline {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.8rem;
    color: rgba(187, 187, 188, 0.6);
    text-decoration: none;
    border: none !important;
    transition: color 0.2s ease;
}

.tag:hover {
    color: rgba(187, 187, 188, 0.9);
}

.tag::before {
    content: "#";
    opacity: 0.5;
}

.content {
    margin-bottom: 2rem;
}

.content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.content h1, .content h2, .content h3 {
    margin: 2rem 0 1rem 0;
    font-weight: 600;
}

.heti {
    font-family: "Crimson Text", "Noto Serif SC", serif!important;
}

.heti p {
    font-family: "Crimson Text", "Noto Serif SC", serif!important;
    margin: 0 0 1em 0;
    text-indent: 0;
}

.heti h1, .heti h2, .heti h3, .heti h4, .heti h5, .heti h6 {
    font-family: "Crimson Text", "Noto Serif SC", serif!important;

    font-weight: 600;
    line-height: 1.4;
    margin: 1em 0 0.8em 0;
}

.heti code, .heti pre {
    font-family: "Courier New", "Noto Sans Mono CJK SC", monospace;
}

.heti blockquote {
    font-style: italic;
    border-left: 3px solid #333;
    padding-left: 1rem;
    margin: 1.5rem 0;
}

/* 图片CLS优化 */
.heti img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 防止图片加载时的布局偏移 */
img[width][height] {
    height: auto;
}

/* 图片容器样式 */
.image-container {
    position: relative;
    overflow: hidden;
    margin: 1.5rem 0;
}

/* 响应式图片 */
.responsive-img {
    width: 100%;
    height: auto;
    display: block;
}

/* 图片占位符防止CLS */
.img-placeholder {
    background: #111;
    position: relative;
    overflow: hidden;
}

/* 首页头像特殊样式 */
#emblem {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto 2rem;
    display: block;
    object-fit: cover;
}

@media (max-width: 600px) {
    #emblem {
        width: 150px;
        height: 150px;
    }
}

.content code {
    background-color: #111;
    padding: 0.2em 0.4em;
    font-family: "Courier New", monospace;
    font-size: 0.9em;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    display: inline-block;
}

.content pre {
    background-color: #111;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.content blockquote {
    border-left: 3px solid #333;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
}

.content ul, .content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.content li {
    margin-bottom: 0.5rem;
}

.content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem 0;
}

.content p img {
    display: inline-block;
    margin: 0 0.5rem;
    vertical-align: middle;
}

a {
    color: var(--parchment);
    text-decoration: none;
    border-bottom: 1px solid #333;
    transition: color var(--time) ease, border-color var(--time) ease;
}

a:hover {
    color: #fff;
    border-bottom-color: #fff;
}

footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
    text-align: center;
    font-size: 1rem;
    opacity: 0.7;
}

.links-page {
    max-width: 600px;
}

.links-section {
    margin: 2rem 0;
}

.links-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 1px solid #333;
}

.taxonomy-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.taxonomy-item {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    transition: all 0.2s ease;
}

.taxonomy-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.taxonomy-item a {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--parchment);
    text-decoration: none;
    border: none !important;
    display: block;
    margin-bottom: 0.5rem;
}

.taxonomy-item a:hover {
    color: #fff;
    border: none !important;
    text-decoration: none !important;
}

.taxonomy-item span {
    font-size: 0.9rem;
    color: rgba(187, 187, 188, 0.7);
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.6rem;
}

@media (max-width: 600px) {
    .taxonomy-list {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .taxonomy-item {
        padding: 0.8rem;
    }
    
    .taxonomy-item a {
        font-size: 1rem;
    }
}


.links-section ul {
    list-style: none;
    padding: 0;
}

.links-section li {
    margin: 1rem 0;
}

.links-section a {
    display: block;
    padding: 1rem;
    border: 1px solid #333;
    text-decoration: none;
    transition: all var(--time) ease;
    background-color: rgba(255, 255, 255, 0.02);
}

.links-section a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #555;
    color: #fff;
    transform: translateY(-1px);
}

.links-page ul {
    list-style: none;
    padding: 0;
}

.links-page li {
    margin: 1rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid #222;
}

.links-page a {
    color: var(--parchment);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.links-page a:hover {
    color: #fff;
    border-bottom-color: #555;
}



.katex {
    font-size: 1.1em;
}

.katex-display {
    margin: 1.5rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.06);
    -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.08);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    -webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 600px) {
    body {
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* PJAX加载动画 */
body.pjax-loading main {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

body.pjax-loading::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--parchment), transparent);
    animation: pjax-loading 1.5s infinite;
    z-index: 9999;
}

@keyframes pjax-loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}


input, textarea, [contenteditable="true"] {
    cursor: text;
}

* {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

body {
    caret-color: transparent;
}

input, textarea, [contenteditable="true"] {
    caret-color: auto;
}