:root {
    --page-bg: #f3f6fb;
    --surface: rgba(255, 255, 255, 0.94);
    --surface-strong: #ffffff;
    --ink: #12213f;
    --muted: #70809d;
    --line: #dfe6f1;
    --primary: #2563eb;
    --primary-dark: #153d91;
    --teal: #0f9f92;
    --shadow-soft: 0 18px 45px rgba(24, 49, 91, 0.09);
    --shadow-lifted: 0 24px 55px rgba(24, 49, 91, 0.14);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 4%, rgba(37, 99, 235, 0.12), transparent 27rem),
        radial-gradient(circle at 92% 18%, rgba(15, 159, 146, 0.1), transparent 24rem),
        var(--page-bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

body::before {
    position: fixed;
    inset: 0 0 auto;
    z-index: 20;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--teal));
    content: "";
}

#content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    width: min(1180px, 100%);
    max-width: none;
    margin: 0 auto;
    padding: 42px 28px 84px;
    counter-reset: blog-section;
}

.title {
    position: relative;
    isolation: isolate;
    display: flex;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 232px;
    margin: 0;
    padding: 46px 52px;
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(circle at 86% 24%, rgba(53, 211, 195, 0.33), transparent 18rem),
        radial-gradient(circle at 68% 130%, rgba(67, 116, 245, 0.52), transparent 25rem),
        linear-gradient(135deg, #0b1738 0%, #153d91 58%, #0b6e79 120%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    box-shadow: 0 28px 65px rgba(15, 42, 89, 0.23);
    font-family: inherit;
    font-size: clamp(2.45rem, 5vw, 4.4rem);
    font-weight: 760;
    line-height: 1.08;
    letter-spacing: -0.045em;
    text-align: left;
}

.title::before {
    display: block;
    margin-bottom: 20px;
    padding: 5px 11px;
    color: #9ff3e7;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    content: "PERSONAL KNOWLEDGE BASE";
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.16em;
}

.title::after {
    display: block;
    max-width: 32rem;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.76);
    content: "用简单的文字，记录生活与技术";
    font-size: clamp(0.98rem, 1.8vw, 1.16rem);
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.02em;
}

#table-of-contents {
    position: sticky;
    top: 16px;
    z-index: 10;
    grid-column: 1 / -1;
    margin: 0;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(211, 221, 236, 0.9);
    border-radius: 18px;
    box-shadow: 0 12px 34px rgba(33, 55, 94, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

#table-of-contents > h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

#text-table-of-contents > ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#text-table-of-contents > ul > li {
    margin: 0;
}

#table-of-contents a,
#table-of-contents a:link,
#table-of-contents a:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    color: #42516d;
    background: transparent;
    border-radius: 11px;
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1.3;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

#table-of-contents a::before {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    background: var(--teal);
    border-radius: 50%;
    content: "";
}

#table-of-contents a:hover {
    color: var(--primary-dark);
    background: #edf3ff;
    text-decoration: none;
    transform: translateY(-1px);
}

.outline-2 {
    --card-accent: var(--primary);
    position: relative;
    min-width: 0;
    padding: 28px 30px 24px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(218, 226, 239, 0.92);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
    counter-increment: blog-section;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.outline-2:nth-of-type(3n) {
    --card-accent: var(--teal);
}

.outline-2:nth-of-type(3n + 1) {
    --card-accent: #7c5ce5;
}

.outline-2::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--card-accent);
    content: "";
}

.outline-2:hover {
    border-color: #cad7ea;
    box-shadow: var(--shadow-lifted);
    transform: translateY(-3px);
}

.outline-2 > h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 17px;
    color: var(--ink);
    font-family: inherit;
    font-size: 1.32rem;
    font-weight: 730;
    line-height: 1.3;
    letter-spacing: -0.018em;
}

.outline-2 > h2::before {
    display: inline-grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    color: #ffffff;
    background: var(--card-accent);
    border-radius: 10px;
    content: counter(blog-section, decimal-leading-zero);
    font-size: 0.7rem;
    font-weight: 760;
    letter-spacing: 0.04em;
}

.outline-text-2 > .org-ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.outline-text-2 > .org-ul > li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
    align-items: baseline;
    margin: 0;
    padding: 12px 2px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 0.76rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
}

.outline-text-2 > .org-ul > li:first-child {
    border-top: 0;
}

.outline-text-2 a,
.outline-text-2 a:visited {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    gap: 9px;
    min-width: 0;
    color: #243858;
    font-size: 0.96rem;
    font-weight: 590;
    line-height: 1.5;
    text-decoration: none;
    transition: color 150ms ease, transform 150ms ease;
}

.outline-text-2 a::before {
    color: var(--card-accent);
    content: "›";
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1;
    transition: transform 150ms ease;
}

.outline-text-2 a:hover {
    color: var(--primary);
    text-decoration: none;
    transform: translateX(2px);
}

.outline-text-2 a:hover::before {
    transform: translateX(2px);
}

.outline-2:last-child {
    grid-column: 1 / -1;
}

.outline-2:last-child .org-ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 30px;
}

.outline-2:last-child .org-ul > li:nth-child(2) {
    border-top: 0;
}

a:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.34);
    outline-offset: 3px;
}

@media (max-width: 900px) {
    #content {
        grid-template-columns: minmax(0, 1fr);
        padding: 28px 22px 64px;
    }

    .title,
    #table-of-contents,
    .outline-2,
    .outline-2:last-child {
        grid-column: 1;
    }

    .title {
        min-height: 210px;
        padding: 40px;
    }
}

@media (max-width: 680px) {
    body {
        background:
            radial-gradient(circle at 0 0, rgba(37, 99, 235, 0.1), transparent 20rem),
            var(--page-bg);
    }

    #content {
        gap: 16px;
        padding: 20px 14px 48px;
    }

    .title {
        min-height: 204px;
        padding: 32px 24px;
        border-radius: 22px;
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .title::before {
        margin-bottom: 16px;
        font-size: 0.62rem;
    }

    .title::after {
        margin-top: 16px;
        font-size: 0.92rem;
    }

    #table-of-contents {
        position: static;
        padding: 10px;
        border-radius: 15px;
    }

    #text-table-of-contents > ul {
        gap: 6px;
    }

    #table-of-contents a,
    #table-of-contents a:link,
    #table-of-contents a:visited {
        padding: 7px 9px;
        font-size: 0.78rem;
    }

    .outline-2 {
        padding: 24px 19px 18px;
        border-radius: 18px;
    }

    .outline-2 > h2 {
        font-size: 1.18rem;
    }

    .outline-text-2 > .org-ul > li {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
        padding: 11px 1px;
    }

    .outline-2:last-child .org-ul {
        grid-template-columns: minmax(0, 1fr);
    }

    .outline-2:last-child .org-ul > li:nth-child(2) {
        border-top: 1px solid var(--line);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media print {
    body {
        color: #000000;
        background: #ffffff;
    }

    body::before,
    #table-of-contents {
        display: none;
    }

    #content {
        display: block;
        width: auto;
        padding: 0;
    }

    .title {
        min-height: 0;
        margin-bottom: 18pt;
        padding: 0 0 12pt;
        color: #000000;
        background: none;
        border: 0;
        border-bottom: 2pt solid #000000;
        border-radius: 0;
        box-shadow: none;
    }

    .title::before,
    .title::after {
        color: #333333;
        background: none;
        border: 0;
    }

    .outline-2,
    .outline-2:hover {
        margin-bottom: 12pt;
        padding: 12pt;
        break-inside: avoid;
        border: 1pt solid #cccccc;
        box-shadow: none;
        transform: none;
    }
}
