* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #1f2937;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at 8% 12%, rgba(26, 35, 126, 0.08), transparent 42%),
        radial-gradient(circle at 88% 6%, rgba(229, 57, 53, 0.08), transparent 32%),
        #f3f5fb;
    overflow-x: hidden;
}

.detail-header {
    position: relative;
    overflow: hidden;
    padding: 34px 20px 24px;
    color: #fff;
    background: linear-gradient(120deg, #101a61 0%, #1f2d8a 52%, #e53935 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.detail-header::before {
    content: "";
    position: absolute;
    inset: auto -160px -120px auto;
    width: 400px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.detail-header::after {
    content: "";
    position: absolute;
    inset: -120px auto auto -120px;
    width: 300px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.detail-header-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0 auto;
}

.detail-subtitle {
    margin: 0 0 8px;
    opacity: 0.9;
    letter-spacing: 0.8px;
    font-size: 14px;
    text-transform: uppercase;
}

.detail-header h1 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.18;
    letter-spacing: 0.2px;
}

.detail-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    opacity: 0.95;
}

.detail-breadcrumb a {
    color: #fff;
    text-decoration: none;
}

.detail-wrapper {
    padding: 14px 10px 24px;
}

.detail-container {
    width: 100%;
    margin: 0 auto;
}

.detail-loading,
.detail-error {
    background: #fff;
    border: 1px solid #dfe5f3;
    border-radius: 14px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 10px 26px rgba(18, 32, 95, 0.08);
}

.detail-error {
    color: #b91c1c;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #1a237e;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.detail-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
}

.detail-main,
.detail-sidebar {
    background: #fff;
    border: 1px solid #dfe5f3;
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(17, 34, 109, 0.06);
    min-width: 0;
}

.detail-main {
    padding: 16px;
    overflow: hidden;
}

.detail-top {
    display: block;
}

.detail-image-wrap {
    width: 100%;
    height: 420px;
    border-radius: 18px;
    overflow: hidden;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.detail-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin: 16px 0 8px;
    color: #4b5563;
    font-size: 13px;
}

.detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f5f7ff;
    border: 1px solid #dde4f5;
    border-radius: 999px;
    padding: 6px 12px;
}

.detail-body {
    margin-top: 14px;
    padding: 18px 20px;
    border: 1px solid #e2e8f6;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
    color: #374151;
    line-height: 1.92;
    font-size: 16px;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.detail-body * {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.detail-body h2 {
    margin: 20px 0 8px;
    color: #16267c;
    font-size: 24px;
    line-height: 1.3;
}

.detail-body p {
    margin: 0 0 14px;
    word-break: break-word;
}

.detail-body ul {
    margin: 0 0 16px;
    padding-left: 20px;
}

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

.detail-body img,
.detail-body video,
.detail-body iframe,
.detail-body canvas,
.detail-body svg {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.detail-body table {
    width: 100%;
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 0 0 14px;
}

.detail-body th,
.detail-body td {
    white-space: nowrap;
    border: 1px solid #dfe5f3;
    padding: 8px 10px;
    font-size: 14px;
}

.detail-body pre {
    max-width: 100%;
    overflow-x: auto;
    border-radius: 10px;
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px;
}

.detail-body code {
    word-break: break-word;
}

.detail-body a {
    word-break: break-all;
}

.detail-sidebar {
    padding: 14px;
    align-self: start;
    position: sticky;
    top: 92px;
}

.detail-sidebar h3 {
    margin: 2px 0 12px;
    color: #1a237e;
    font-size: 20px;
}

.recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-list li a {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 10px;
    align-items: center;
    text-decoration: none;
    color: #1f2937;
    border: 1px solid #e3e8f5;
    border-radius: 10px;
    padding: 10px 11px;
    background: #f8faff;
    transition: all 0.2s ease;
}

.recent-list li a img {
    width: 74px;
    height: 58px;
    object-fit: cover;
    border-radius: 7px;
    border: 1px solid #dbe3f5;
    background: #eef2ff;
}

.recent-list li a span {
    line-height: 1.35;
    font-size: 14px;
    font-weight: 600;
}

.recent-list li a:hover {
    border-color: #c9d3f0;
    background: #edf2ff;
    color: #1a237e;
    transform: translateY(-1px);
}

@media (max-width: 1180px) {
    .detail-content {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        position: static;
    }
}

@media (max-width: 900px) {
    .detail-image-wrap {
        height: 320px;
    }
}

@media (max-width: 768px) {
    .detail-header {
        padding: 20px 12px 16px;
    }

    .detail-header::before,
    .detail-header::after {
        display: none;
    }

    .detail-header h1 {
        font-size: 25px;
        line-height: 1.3;
        margin-bottom: 8px;
    }

    .detail-subtitle {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .detail-breadcrumb {
        gap: 6px;
        font-size: 12px;
    }

    .detail-wrapper {
        padding: 10px 6px 16px;
    }

    .detail-loading,
    .detail-error {
        padding: 22px 12px;
        border-radius: 12px;
    }

    .detail-content {
        gap: 12px;
        min-width: 0;
    }

    .detail-main,
    .detail-sidebar {
        padding: 10px;
        border-radius: 12px;
    }

    .detail-image-wrap {
        height: 240px;
        border-radius: 12px;
    }

    .detail-body {
        font-size: 14px;
        line-height: 1.75;
        padding: 14px;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .detail-body h2 {
        font-size: 20px;
        line-height: 1.35;
    }

    .detail-body ul,
    .detail-body ol {
        padding-left: 16px;
        margin-bottom: 12px;
    }

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

    .detail-meta {
        gap: 8px;
        margin: 12px 0 6px;
    }

    .detail-meta span {
        padding: 5px 10px;
        font-size: 12px;
    }

    .detail-sidebar h3 {
        font-size: 18px;
    }

    .recent-list li a {
        grid-template-columns: 66px 1fr;
        gap: 8px;
        padding: 8px;
    }

    .recent-list li a img {
        width: 66px;
        height: 52px;
    }

    .recent-list li a span {
        font-size: 13px;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .detail-header h1 {
        font-size: 21px;
    }

    .detail-wrapper {
        padding: 8px 4px 14px;
    }

    .detail-main,
    .detail-sidebar {
        padding: 8px;
    }

    .detail-image-wrap {
        height: 200px;
    }

    .detail-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-meta span {
        width: 100%;
        justify-content: flex-start;
    }

    .detail-body {
        padding: 12px;
        font-size: 13px;
        line-height: 1.65;
    }

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

    .recent-list li a {
        grid-template-columns: 62px 1fr;
        gap: 8px;
        padding: 8px;
    }

    .recent-list li a img {
        width: 62px;
        height: 50px;
    }

    .recent-list li a span {
        font-size: 13px;
    }
}
