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

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-soft: #fbfbf9;
    --text: #000000;
    --text-soft: #2f2f2f;
    --text-muted: #4a4a4a;
    --border: #e6e6e6;
    --border-soft: #d6d6cf;
    --chip-bg: #efefe9;
    --chip-hover: #eaeae4;
    --toggle-hover: #eeeeee;
}

html[data-theme='dark'] {
    --bg: #000000;
    --surface: #1a1d21;
    --surface-soft: #20252a;
    --text: #f4f6f8;
    --text-soft: #d5dae0;
    --text-muted: #b2bac4;
    --border: #35404b;
    --border-soft: #3a4755;
    --chip-bg: #26303a;
    --chip-hover: #2e3a47;
    --toggle-hover: #2a2a2a;
}

body {
    font-family: 'Geist', sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 1.1rem 1.1rem 2rem;
    line-height: 1.5;
    transition: background-color 200ms ease, color 200ms ease;
}

.page-wrap {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    text-decoration: none;
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    transition: color 180ms ease, transform 180ms ease;
}

.back-home-arrow {
    display: inline-block;
    transition: transform 180ms ease;
}

.back-home-arrow svg {
    width: 0.98rem;
    height: 0.98rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.back-home:hover {
    color: var(--text);
    transform: translateX(-2px);
}

.back-home:hover .back-home-arrow {
    transform: translateX(-3px);
}

.blog-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}

.blog-subtitle {
    margin-top: 0.28rem;
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.blog-article-meta {
    margin-top: 0.18rem;
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.welcome-content {
    margin-top: 1rem;
    font-family: 'Charter', 'Bitstream Charter', 'Times New Roman', serif;
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.7;
}

.welcome-content p {
    margin: 0 0 1rem;
}

.welcome-content ul {
    margin: 0 0 1rem 1.1rem;
    padding: 0;
}

.welcome-content li {
    margin: 0 0 0.45rem;
}

.blog-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.blog-card {
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    border-radius: 0;
    padding: 0.9rem 0.08rem;
}

.blog-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.blog-card:last-child {
    border-bottom: 0;
}

.blog-meta {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    line-height: 1.3;
}

.blog-card h2 {
    margin: 0.18rem 0 0;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
}

.blog-excerpt {
    margin: 0.34rem 0 0.56rem;
    font-size: 0.84rem;
    color: var(--text-soft);
    line-height: 1.55;
}

.blog-read {
    display: inline;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.4;
    padding: 0;
    transition: color 180ms ease;
}

.blog-read:hover {
    color: #60a5fa;
}

.blog-card-link:hover .blog-read {
    color: #60a5fa;
}

.blog-read-line {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-read-time {
    font-size: 0.76rem;
    font-weight: 400;
    color: var(--text-muted);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--surface);
    color: var(--text);
    border-radius: 50%;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.5s ease, transform 0.5s ease;
}

.theme-toggle:hover {
    background: var(--toggle-hover);
    transform: translateY(-1px);
}

.theme-toggle-icon {
    width: 1rem;
    height: 1rem;
    display: inline-block;
    position: relative;
}

.theme-toggle-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.theme-icon-sun {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-icon-moon {
    opacity: 0;
    transform: rotate(-90deg);
}

html[data-theme='dark'] .theme-icon-sun {
    opacity: 0;
    transform: rotate(90deg);
}

html[data-theme='dark'] .theme-icon-moon {
    opacity: 1;
    transform: rotate(0deg);
}

.site-footer {
    width: 100%;
    max-width: 820px;
    margin: 1.1rem auto 0;
    padding: 0.75rem 0 0.9rem;
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.welcome-page .blog-title {
    font-size: 1.75rem;
}

.welcome-page .blog-subtitle {
    margin-top: 0.42rem;
    font-size: 1rem;
    line-height: 1.75;
}

.welcome-page .blog-article-meta {
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
    line-height: 1.55;
}

.welcome-page .welcome-content {
    margin-top: 1.3rem;
    font-size: 1.1rem;
    line-height: 1.9;
}

.welcome-page .welcome-content p {
    margin: 0 0 1.25rem;
}

.welcome-page .welcome-content ul {
    margin: 0 0 1.25rem 1.35rem;
}

.welcome-page .welcome-content li {
    margin: 0 0 0.7rem;
}

.article-actions {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.article-back-link {
    margin-top: 0;
    margin-bottom: 0;
}

.copy-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    border: none;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background-color 180ms ease, transform 180ms ease;
}

.copy-link-btn:hover {
    background: var(--toggle-hover);
    transform: translateY(-1px);
}

.copy-link-btn svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.blog-index-page .page-wrap {
    max-width: 860px;
}

.blog-index-page .page-head {
    margin-bottom: 1.25rem;
}

.blog-index-page .back-home {
    margin-bottom: 0;
}

.blog-index-page .blog-title {
    font-size: 2rem;
    line-height: 1.2;
}

.blog-index-page .blog-subtitle {
    margin-top: 0.5rem;
    font-size: 1rem;
    line-height: 1.8;
    max-width: 62ch;
}

.blog-index-page .blog-list {
    margin-top: 1.6rem;
    border-top: 0;
}

.blog-index-page .blog-card {
    padding: 1.35rem 0.12rem 1.25rem;
}

.blog-index-page .blog-meta {
    font-size: 0.8rem;
}

.blog-index-page .blog-card h2 {
    margin-top: 0.3rem;
    font-size: 1.14rem;
    line-height: 1.45;
}

.blog-index-page .blog-excerpt {
    margin: 0.52rem 0 0.9rem;
    font-size: 0.95rem;
    line-height: 1.75;
    max-width: 68ch;
}

.blog-index-page .blog-read-line {
    gap: 0.65rem;
}

@media (max-width: 700px) {
    .blog-index-page .blog-title {
        font-size: 1.7rem;
    }

    .blog-index-page .blog-subtitle {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .blog-index-page .blog-card {
        padding: 1.05rem 0.08rem 1rem;
    }
}

@media (max-width: 820px) {
    body {
        padding: 1rem 0.95rem 1.4rem;
    }

    .page-wrap,
    .site-footer {
        max-width: 100%;
    }

    .page-head {
        gap: 0.6rem;
    }

    .blog-title {
        font-size: 1.45rem;
    }

    .blog-subtitle {
        font-size: 0.92rem;
        line-height: 1.7;
    }

    .welcome-content {
        font-size: 1rem;
        line-height: 1.75;
    }
}

@media (max-width: 700px) {
    .page-head {
        align-items: center;
    }

    .back-home {
        font-size: 0.83rem;
    }

    .theme-toggle,
    .copy-link-btn {
        width: 2rem;
        height: 2rem;
    }

    .blog-index-page .blog-card h2 {
        font-size: 1.02rem;
        line-height: 1.5;
    }

    .blog-index-page .blog-excerpt {
        font-size: 0.9rem;
        line-height: 1.65;
    }

    .article-actions {
        padding-top: 0.75rem;
        margin-top: 0.75rem;
    }
}

@media (max-width: 520px) {
    body {
        padding: 0.9rem 0.78rem 1.2rem;
    }

    .blog-title {
        font-size: 1.28rem;
    }

    .blog-subtitle {
        margin-top: 0.4rem;
        font-size: 0.88rem;
        line-height: 1.6;
    }

    .blog-article-meta {
        font-size: 0.8rem;
    }

    .welcome-content {
        font-size: 0.96rem;
        line-height: 1.7;
    }

    .welcome-content ul {
        margin-left: 1rem;
    }
}
