/* Variant Minimal Mistakes: The Flexible Standard */

:root {
    --font-serif: "PT Serif", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", Arial, sans-serif;
    --global-bg: #fff;
    --global-text: #333;
    --brand-color: #333;
    --link-color: #3b80d0;
    --sidebar-bg: #fff;
    --sidebar-width: 300px;
    --masthead-height: 60px;
    --border-color: #eee;
    --btn-bg: #24292e;
    --btn-text: #fff;
    --btn-outline-border: #ccc;
    --btn-outline-text: #555;
    --nav-link-color: #555;
    --meta-color: #666;
    --badge-bg: rgba(51, 51, 51, 0.08);
    --brand-hover: #e64a19;
    /* Darker Orange */
}

[data-theme="dark"] {
    --global-bg: #111;
    --global-text: #ddd;
    --brand-color: #fff;
    --link-color: #5ba2f4;
    --sidebar-bg: #111;
    --border-color: #333;
    --btn-bg: #333;
    --btn-text: #fff;
    --btn-outline-border: #444;
    --btn-outline-text: #bbb;
    --nav-link-color: #bbb;
    --meta-color: #999;
    --badge-bg: rgba(255, 255, 255, 0.1);
    --brand-hover: #f4511e;
    /* Slightly darker orange for dark mode */
}

html {
    font-size: 15px;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--global-text);
    background: var(--global-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

p {
    margin-top: 0;
    margin-bottom: 0.8rem;
}

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

a:active {
    color: var(--brand-hover);
    transition: color 0.5s;
}

@media (hover: hover) {
    a:hover {
        color: var(--brand-hover);
        text-decoration: none;
    }
}

/* Hero Section Layout */
.page-wrapper {
    max-width: 800px;
    margin: 2.5rem auto;
    /* More compact top spacing */
    padding: 0 2rem;
    position: relative;
}

/* New Header Layout */
.profile-photo-float {
    float: right;
    width: 210px;
    /* Slightly larger */
    margin-left: 30px;
    margin-bottom: 15px;
}

.author-avatar {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.header-content {
    margin-bottom: 1.5rem;
}

.header-links {
    font-size: 0.9rem;
    color: var(--meta-color);
    margin-top: 0;
}

.header-location {
    font-size: 0.9rem;
    color: var(--meta-color);
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-location i {
    font-size: 0.8rem;
    color: var(--meta-color);
}

.header-links a {
    color: var(--link-color);
    text-decoration: none;
}

@media (hover: hover) {
    .header-links a:hover {
        color: var(--brand-hover);
        text-decoration: none;
    }
}

.theme-toggle-corner {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-color);
    color: var(--meta-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 9999;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .theme-toggle-corner {
    background: rgba(30, 30, 30, 0.8);
}

.theme-toggle-corner:active {
    background: rgba(230, 74, 25, 0.2);
    color: var(--brand-hover);
    transform: scale(0.95);
    transition: all 0.05s;
}

@media (hover: hover) {
    .theme-toggle-corner:hover {
        color: var(--brand-hover);
        transform: scale(1.1);
    }
}

.header-divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
    /* More compact */
}

.bio-content {
    line-height: 1.6;
}

/* Main Content */
.main-content {
    width: 100%;
    padding-bottom: 4rem;
}

h1,
h2,
h3 {
    font-family: var(--font-sans);
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 0.2rem;
    color: var(--brand-color);
}

.chinese-name {
    font-family: "Ma Shan Zheng", "Kaiti SC", "STKaiti", cursive, serif;
    font-weight: 400 !important;
    font-size: 1.1em;
    color: #333;
    margin-left: 15px;
    vertical-align: baseline;
}

[data-theme="dark"] h1,
[data-theme="dark"] .chinese-name {
    color: #fff;
}

h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.archive-item {
    margin-bottom: 1.2rem;
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 15px;
    align-items: start;
}

.archive-item-title {
    font-size: 1.05rem;
    font-weight: 400;
    color: #333;
    margin-bottom: 2px;
    line-height: 1.3;
}

[data-theme="dark"] .archive-item-title {
    color: #fff;
}

/* Removed title link hover since user wants links removed from titles */

.archive-meta {
    font-size: 0.75rem;
    color: #333;
    background: transparent;
    width: 100%;
    /* Fill the grid column */
    height: 1.365rem;
    /* Matches title line-height */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-weight: 500;
}

[data-theme="dark"] .archive-meta {
    color: #fff;
}

.archive-excerpt {
    font-size: 0.95rem;
}

.archive-excerpt p {
    margin: 1px 0 4px 0;
    color: var(--meta-color);
    line-height: 1.4;
}

.archive-excerpt p strong {
    font-weight: normal;
    color: #333;
}

[data-theme="dark"] .archive-excerpt p strong {
    color: #fff;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f1f1f1;
    color: #444 !important;
    height: 1.35rem;
    /* Shrink to be more compact */
    padding: 0 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-top: 4px;
    margin-right: 4px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border: none;
    box-sizing: border-box;
    vertical-align: middle;
}

.btn i,
.btn img {
    display: block;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    object-fit: contain;
}

.btn img {
    filter: grayscale(100%) contrast(1.5) brightness(0.7);
    opacity: 0.9;
}

[data-theme="dark"] .btn img {
    filter: invert(1) grayscale(100%) brightness(1.2);
    opacity: 0.9;
}

.btn i {
    font-size: 0.8rem;
    line-height: 12px;
    text-align: center;
}

/* Removed btn inner icon redundacy */

[data-theme="dark"] .btn {
    background: #2a2a2a;
    color: #ccc !important;
}

.btn:active {
    background: rgba(230, 74, 25, 0.2);
    color: var(--brand-hover) !important;
    transition: all 0.05s;
}

[data-theme="dark"] .btn:active {
    background: rgba(244, 81, 30, 0.3);
}

@media (hover: hover) {
    .btn:hover {
        background: rgba(230, 74, 25, 0.1);
        /* Soft orange tint */
        color: var(--brand-hover) !important;
    }
}

@media (hover: hover) {
    [data-theme="dark"] .btn:hover {
        background: rgba(244, 81, 30, 0.2);
        /* Slightly punchier tint for dark mode */
    }
}

@media (hover: hover) {
    .btn:hover img {
        filter: grayscale(100%) contrast(1.5) sepia(100%) hue-rotate(-15deg) saturate(5);
    }

    [data-theme="dark"] .btn:hover img {
        filter: invert(1) grayscale(100%) contrast(1.5) sepia(100%) hue-rotate(-15deg) saturate(5);
    }
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
}

@media (hover: hover) {
    .btn-outline:hover {
        background: rgba(230, 74, 25, 0.05);
        border-color: var(--brand-hover);
        color: var(--brand-hover) !important;
    }
}

[data-theme="dark"] .btn-outline:hover {
    background: rgba(244, 81, 30, 0.1);
}

/* Mobile */
@media (max-width: 800px) {
    .page-wrapper {
        margin: 1.5rem auto;
        padding: 0 1rem;
    }

    .theme-toggle-corner {
        top: 15px;
        right: 15px;
    }

    .profile-photo-float {
        float: none;
        width: 100%;
        margin-left: 0;
        margin-bottom: 1.5rem;
        display: flex;
        justify-content: center;
    }

    .author-avatar {
        width: 140px;
        height: 140px;
    }

    .header-content {
        text-align: center;
    }

    .header-location {
        justify-content: center;
        margin-bottom: 0.4rem;
    }

    .header-links {
        font-size: 0.85rem;
    }

    .header-divider {
        margin: 1rem 0;
    }

    .archive-item {
        grid-template-columns: 1fr;
        gap: 0px;
        margin-bottom: 1.5rem;
    }

    .archive-meta {
        width: fit-content;
        height: auto;
        padding: 0;
        font-size: 0.75rem;
        margin-bottom: 2px;
        justify-content: flex-start;
        font-style: italic;
    }

    .btn {
        padding: 5px 14px;
        font-size: 0.85rem;
    }
}