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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    font-size: 18px;
    display: flex;
    flex-direction: column;
}

main {
    width: 100%;
    padding: 2rem 0;
    flex: 1;
}

.site-footer {
    width: 100%;
    padding: 0.5rem 0;
    border-top: 1px solid var(--accent);
    margin-top: 1rem;
}

.site-footer p {
    margin: 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 1.5rem;
    letter-spacing: -0.02em;
    color: var(--accent);
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--accent);
}

time {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

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

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

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

ul {
    list-style: none;
    padding: 0;
}

section>ul {
    margin-top: 1rem;
}


li:last-child {
    border-bottom: none;
}

article {
    margin-top: 0.5rem;
}

.article-header {
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--accent);
}

.article-header h1 {
    margin-bottom: 0.25rem;
    margin-top: 0;
}

.article-header time {
    display: block;
    color: var(--text-secondary);
}

.article-content {
    margin-bottom: 1rem;
}

.article-content h2 {
    margin-top: 5px;
    margin-bottom: 5px;
}

.article-content h3 {
    margin-top: 5px;
    margin-bottom: 5px;
}

.article-content p {
    margin: 0.5rem 0;
}

.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem 0;
    border-radius: 4px;
}

/* Custom content blocks */
.warning-block,
.info-block,
.tip-block,
.danger-block {
    margin: 1rem 0;
    padding: 0.4rem 0.5rem;
    border-left: 4px solid;
    border-radius: 4px;
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
    hyphens: auto;
}

.warning-block {
    border-color: #f59e0b;
    background: #fffbeb;
}

.info-block {
    border-color: #10b981;
    background: #f0fdf4;
}

.tip-block {
    border-color: #3b82f6;
    background: #eff6ff;
}

.danger-block {
    border-color: #ef4444;
    background: #fef2f2;
}

.warning-title,
.info-title,
.tip-title,
.danger-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.warning-title {
    color: #d97706;
}

.info-title {
    color: #059669;
}

.tip-title {
    color: #2563eb;
}

.danger-title {
    color: #dc2626;
}

.warning-content,
.info-content,
.tip-content,
.danger-content {
    font-size: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
}

.warning-content p,
.info-content p,
.tip-content p,
.danger-content p {
    margin: 0.25rem 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.warning-content p:last-child,
.info-content p:last-child,
.tip-content p:last-child,
.danger-content p:last-child {
    margin-bottom: 0;
}

.toc {
    background: transparent;
    border: 1px solid var(--accent);
    padding: 0.4rem 10rem 0.4rem 1rem;
    margin: 0.5rem 0;
    display: inline-block;
    font-size: 0.85rem;
    line-height: 1.4;
}

.toc h2 {
    font-size: 0.9rem;
    margin: 0 0 0.1rem 0;
    color: var(--text);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.toc h2::after {
    content: " [hide]";
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.toc.collapsed h2::after {
    content: " [show]";
}

.toc.collapsed ul {
    display: none;
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}

.toc>ul>li {
    counter-increment: toc-counter;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    border: none;
}

.toc>ul>li::before {
    content: counter(toc-counter) " ";
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 0.25rem;
}

.toc>ul>li>ul {
    counter-reset: toc-sub-counter;
    margin: 0;
    padding: 0;
}

.toc>ul>li>ul>li {
    counter-increment: toc-sub-counter;
    margin: 0;
    padding: 0 0 0 2rem;
    font-size: 0.9em;
    line-height: 1.5;
    border: none;
}

.toc>ul>li>ul>li::before {
    content: counter(toc-counter) "." counter(toc-sub-counter) " ";
    color: var(--text-secondary);
    font-weight: 400;
    margin-right: 0.25rem;
}

.toc a {
    color: var(--text);
    text-decoration: none;
    border-bottom: none;
}

.toc a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--accent);
}

.comments-section {
    min-height: 100px;
}

p {
    margin: 0.5rem 0;
}

code {
    font-family: "SF Mono", Monaco, "Cascadia Code", "Courier New", monospace;
    font-size: 0.9em;
    background: transparent;
    padding: 0.15em 0.4em;
}

pre:not(:has(.warning-block)):not(:has(.info-block)):not(:has(.tip-block)):not(:has(.danger-block)) {
    background: white;
    padding: 3px;
    overflow-x: auto;
    border-left: 3px solid var(--accent);
}

pre:has(.warning-block),
pre:has(.info-block),
pre:has(.tip-block),
pre:has(.danger-block) {
    background: transparent;
    padding: 0;
    border: none;
    max-width: 100%;
    overflow: visible;
    white-space: normal;
}

pre code {
    background: none;
    padding: 0;
}

/* Syntax highlighting - minimal stone-age theme */
.hljs {
    display: block;
    overflow-x: auto;
    color: #2E2E2B;
}

.hljs-comment,
.hljs-quote {
    color: #7A7A77;
    font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
    color: #B87333;
    font-weight: bold;
}

.hljs-number,
.hljs-literal {
    color: #CD853F;
}

.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
    color: #6B6A67;
}

.hljs-string,
.hljs-doctag {
    color: #8B7355;
}

.hljs-title,
.hljs-section,
.hljs-selector-id {
    color: #A0826D;
    font-weight: bold;
}

.hljs-type,
.hljs-class .hljs-title {
    color: #9C6644;
    font-weight: 600;
}

.hljs-tag,
.hljs-name,
.hljs-attribute {
    color: #B87333;
}

.hljs-regexp,
.hljs-link {
    color: #BC8F8F;
}

.hljs-symbol,
.hljs-bullet {
    color: #8B7D6B;
}

.hljs-built_in,
.hljs-builtin-name {
    color: #9C6644;
}

.hljs-meta {
    color: #8B8680;
}

.hljs-deletion {
    background: #fdd;
}

.hljs-addition {
    background: #dfd;
}

.hljs-emphasis {
    font-style: italic;
}

.hljs-strong {
    font-weight: bold;
}

/* Home page styles */
.home {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.profile-image {
    width: 210px;
    height: 300px;
    border-radius: 14px;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 2px solid var(--accent);
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.profile-title {
    font-size: 1rem;
    font-weight: 400;
    margin: 0.5rem 0 0 0;
    color: var(--text-secondary);
}

.sections {
    margin: 1rem 0;
}

.sections ul {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sections li {
    padding: 4px;
    border: 1px solid var(--accent);
    border-radius: 4px;
    transition: border-color 0.15s ease;
}

.sections li:hover {
    border-color: var(--text);
    font-weight: 600;
}

.sections a {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
}

.social-links {
    padding-top: 2rem;
    border-top: 1px solid var(--accent);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.social-links a {
    color: var(--text-secondary);
}

.social-links a:hover {
    color: var(--accent);
    font-weight: 600;
}

/* Table styles */
table {
    border-collapse: collapse;
    font-size: 0.95rem;
    border: 1px solid var(--accent);
}

thead {
    background: transparent;
    border-bottom: 1px solid var(--accent);
}

th {
    padding: 0.1rem 0.2rem;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border: 1px solid var(--accent);
}

td {
    padding: 0.1rem 0.2rem;
    border: 1px solid var(--accent);
}

tbody tr:hover {
    background: transparent;
}

tbody tr:last-child td {
    border-bottom: 1px solid var(--accent);
}

/* Breadcrumb navigation */
.breadcrumb {
    margin-bottom: 0.5rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
}

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

/* Article enhancements */
.article-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.separator {
    color: var(--text-secondary);
}

.reading-time {
    color: var(--text-secondary);
}

.article-nav {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e8e8e8;
}

.back-link {
    color: #666;
    font-size: 0.9rem;
}

.back-link:hover {
    color: #0066cc;
}

/* Listing enhancements */
.listing {
    max-width: 900px;
    margin: 0rem auto 0 auto;
}

.listing-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e0e0e0;
}

.listing-header h1 {
    margin-bottom: 0.25rem;
}

.listing-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.post-list {
    list-style: none;
    padding: 0;
}

.post-list li {

    border-bottom: 1px solid #e8e8e8;
    display: flex;
    gap: 1rem;
    align-items: baseline;
    transition: background 0.15s ease;
}

.post-list li:hover {
    background: #fafafa;
    margin: 0 -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.post-list time {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    min-width: 90px;
}

.post-list a {
    font-weight: 500;
    font-size: 1.05rem;
    flex: 1;
}

.list-reading-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-left: auto;
}

.list-modified {
    color: var(--text-secondary);
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-left: 1rem;
}

.post-time,
.list-time {
    color: var(--text-secondary);
    font-size: 0.85em;
    font-weight: normal;
}

.modified-tag {
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.new-tag {
    background: var(--accent);
    color: var(--bg);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    white-space: nowrap;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.modified-date {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
}

.sponsor-block {
    width: 100%;
    height: 90px;
    border: 1px solid #000;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 4px;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
}

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

.back-to-top:hover {
    background: var(--text);
}