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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f4f2ef;
    color: #1d1d1d;
}

a {
    color: inherit;
}

.container {
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
}

.header {
    background: #fff;
    border-bottom: 1px solid #ececec;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    min-height: 74px;
}

.logo {
    width: 128px;
}

.logo img {
    display: block;
    width: 100%;
    height: auto;
}

.nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 22px;
}

.nav a {
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    color: #2d2d2d;
}

.nav a:hover,
.nav a.active,
.nav-dropdown:hover .nav-dropdown-trigger {
    color: #e60000;
}

.nav-dropdown {
    position: relative;
}

.mega-menu {
    position: fixed;
    top: 74px;
    left: 0;
    width: 100vw;
    padding: 30px 0;
    background: #fff;
    border-top: 1px solid #ececec;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.22s ease;
}

.nav-dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-inner {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.mega-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mega-img {
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    overflow: hidden;
    background: #f5f5f5;
}

.mega-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mega-cat-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.mega-divider {
    width: 52px;
    height: 2px;
    background: #e60000;
}

.mega-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mega-links a {
    font-size: 13px;
    color: #666;
}

.article-hero {
    padding: 42px 0 28px;
}

.article-hero-inner {
    max-width: 980px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #dedede;
    background: #fff;
    color: #454545;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.article-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.article-hero-meta span {
    font-size: 12px;
    color: #8f8f8f;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.article-hero h1 {
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.04;
    font-weight: 700;
    margin-bottom: 16px;
}

.article-summary {
    max-width: 760px;
    color: #5f5f5f;
    font-size: 16px;
    line-height: 1.9;
    margin-bottom: 28px;
}

.article-cover {
    background: #e9e9e9;
    overflow: hidden;
}

.article-cover img {
    display: block;
    width: 100%;
    height: auto;
}

.article-shell {
    padding: 0 0 70px;
}

.article-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    justify-content: center;
}

.article-left-sidebar {
    position: sticky;
    top: 94px;
}

.side-card {
    background: #fff;
    border: 1px solid #e9e5df;
    padding: 18px;
}

.outline-card {
    background: #faf8f3;
}

.side-card + .side-card {
    margin-top: 14px;
}

.side-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.side-card-title span {
    width: 18px;
    height: 2px;
    background: #e60000;
}

.side-card-title h3 {
    font-size: 18px;
}

/* Recommended Links Style Instead of TOC */
.recommended-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recommended-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: #656565;
    font-size: 14px;
    line-height: 1.55;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e9e5df;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.recommended-list a svg {
    width: 18px;
    height: 18px;
    color: #a8a8a8;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.recommended-list a:hover {
    color: #e60000;
    border-color: #e60000;
    box-shadow: 0 4px 12px rgba(230, 0, 0, 0.08);
}

.recommended-list a:hover svg {
    color: #e60000;
    transform: translateX(4px);
}

.empty-list {
    color: #8a8a8a;
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

.article-main {
    min-width: 0;
}

.article-detail-card {
    background: #fff;
    border: 1px solid #ece7e0;
}

.article-detail-body {
    max-width: 100%;
    margin: 0 auto;
    padding: 40px 48px;
    color: #2d2d2d;
    font-size: 16px;
    line-height: 1.95;
}

.article-detail-body h1,
.article-detail-body h2,
.article-detail-body h3,
.article-detail-body h4,
.article-detail-body h5,
.article-detail-body h6 {
    color: #171717;
    line-height: 1.25;
    margin-top: 30px;
    margin-bottom: 14px;
    scroll-margin-top: 110px;
}

.article-detail-body h2 {
    font-size: 30px;
}

.article-detail-body h3 {
    font-size: 24px;
}

.article-detail-body h4 {
    font-size: 20px;
}

.article-detail-body p {
    margin-bottom: 16px;
}

.article-detail-body ul,
.article-detail-body ol {
    margin: 12px 0 18px 20px;
}

.article-detail-body li {
    margin-bottom: 8px;
}

.article-detail-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 24px auto;
}

.article-detail-body blockquote {
    margin: 22px 0;
    padding: 18px 20px;
    border-left: 3px solid #e60000;
    background: #faf6f2;
    color: #4d4d4d;
    font-size: 17px;
}

.article-detail-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.article-detail-body table th,
.article-detail-body table td {
    border: 1px solid #e7e2db;
    padding: 10px 12px;
    text-align: left;
}

.article-detail-body a {
    color: #e60000;
}

.article-nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.article-nav-card {
    text-decoration: none;
    background: #fff;
    border: 1px solid #ece7e0;
    padding: 18px;
}

.article-nav-card .label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8a8a8a;
    margin-bottom: 8px;
}

.article-nav-card .title {
    font-size: 15px;
    line-height: 1.7;
}

.article-nav-card:hover {
    border-color: #d8b7b8;
}

.category-stat-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-stat-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid #ece7e0;
    text-decoration: none;
    color: #3f3f3f;
    font-size: 14px;
}

.category-stat-list a.active,
.category-stat-list a:hover {
    color: #e60000;
}

.category-stat-list strong {
    font-size: 12px;
    color: #8e8e8e;
}

.side-article-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.side-article-item {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    text-decoration: none;
    color: #242424;
}

.side-article-item img {
    width: 86px;
    height: 68px;
    object-fit: cover;
    display: block;
}

.side-article-item h4 {
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 4px;
}

.side-article-item p {
    font-size: 12px;
    line-height: 1.6;
    color: #7f7f7f;
}

.side-empty {
    color: #8f8f8f;
    font-size: 13px;
}

.footer {
    background: #09182b;
    color: #fff;
    padding-top: 56px;
}

.footer .container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
}

.footer-section h3 {
    font-size: 16px;
    margin-bottom: 18px;
}

.footer-section p,
.footer-section li,
.footer-section .contact-item {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    text-decoration: none;
}

.contact-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.icon-wrapper {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
}

.icon-wrapper svg {
    width: 14px;
    height: 14px;
    fill: #fff;
}

.footer-bottom {
    margin-top: 34px;
    padding: 18px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.52);
    font-size: 13px;
}

.sidebar-actions {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 120;
    width: 56px;
    padding: 16px 0;
    background: rgba(125, 125, 125, 0.92);
    border-radius: 12px 0 0 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.side-item-wrapper {
    position: relative;
}

.side-item {
    width: 56px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.side-item svg {
    width: 26px;
    height: 26px;
    fill: #fff;
}

.hover-panel {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    background: #1f5fb5;
    padding: 12px 62px 12px 18px;
    border-radius: 18px;
}

.hover-panel-text {
    color: #fff;
    font-size: 18px;
}

.hover-panel-image {
    padding: 14px 62px 14px 14px;
}

.hover-panel-image img {
    width: 170px;
    height: 170px;
    object-fit: contain;
    display: block;
}

.side-item-wrapper:hover .hover-panel {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-left-sidebar {
        position: static;
        margin-bottom: 20px;
    }

    .article-hero-inner {
        max-width: none;
    }
}

@media (max-width: 820px) {
    .header .container {
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        padding: 14px 0;
    }

    .nav {
        margin-left: 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    .article-detail-body {
        padding: 24px 20px 34px;
    }

    .article-nav-links,
    .article-sidebar {
        grid-template-columns: 1fr;
    }

    .footer .container {
        grid-template-columns: 1fr;
    }

    .sidebar-actions {
        display: none;
    }
}

@media (max-width: 640px) {
    .container {
        width: calc(100% - 24px);
    }

    .article-hero {
        padding-top: 28px;
    }

    .article-hero h1 {
        font-size: 34px;
    }

    .article-summary {
        font-size: 15px;
    }
}
