.template-detail-page {
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.1), transparent 24%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 30%),
        linear-gradient(180deg, #f6f9fd 0%, #f2f6fb 32%, #f8fbff 100%);
}

.template-detail-main {
    padding: 34px 0 72px;
}

.template-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.detail-card,
.sidebar-card {
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.96) 100%);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
    animation: detailCardIn .55s ease both;
}

.detail-card:hover,
.sidebar-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.18);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.1);
}

.detail-card {
    overflow: hidden;
    padding: 0;
}

.detail-heading {
    position: relative;
    padding: 34px 34px 24px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.92);
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.detail-heading::before {
    content: "";
    position: absolute;
    left: 34px;
    top: 0;
    width: 88px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8 0%, #2563eb 100%);
}

.detail-heading h1 {
    margin: 0;
    color: #132238;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.18;
    letter-spacing: 0;
}

.detail-block {
    position: relative;
    padding: 28px 34px 0;
}

.detail-block:last-of-type {
    padding-bottom: 0;
}

.detail-block h2 {
    margin: 0 0 14px;
    color: #14243b;
    font-size: 20px;
    line-height: 1.3;
}

.detail-block::before {
    content: "";
    position: absolute;
    left: 34px;
    top: 0;
    width: calc(100% - 68px);
    height: 1px;
    background: rgba(226, 232, 240, 0.82);
}

.detail-heading + .detail-block::before {
    display: none;
}

.detail-meta-list {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-meta-list p {
    margin: 0;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: #41516a;
    font-size: 14px;
    line-height: 1.8;
}

.detail-meta-list span {
    color: #6b7b92;
    font-size: 12px;
    font-weight: 700;
}

.detail-text {
    color: #5d6e86;
    font-size: 14px;
    line-height: 1.95;
}

.detail-text p,
.detail-text ul,
.detail-text ol,
.detail-text table,
.detail-text blockquote {
    margin: 0 0 14px;
}

.detail-text img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.detail-feature-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.detail-feature-list li {
    position: relative;
    padding: 14px 16px 14px 42px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: #4c5b71;
    font-size: 14px;
    line-height: 1.9;
}

.detail-feature-list li::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 18px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background:
        radial-gradient(circle at center, #ffffff 0 28%, transparent 34%),
        linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.detail-preview-panel {
    margin: 30px 34px 34px;
    padding: 18px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 24px;
    background:
        linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.detail-preview-panel img {
    width: 100%;
    height: auto;
    border-radius: 18px;
    transition: transform .45s ease;
}

.detail-preview-panel::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 -34%;
    width: 26%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
    transform: skewX(-18deg);
    transition: left .5s ease;
    pointer-events: none;
}

.detail-preview-panel:hover::before {
    left: 114%;
}

.detail-preview-panel:hover img {
    transform: scale(1.02);
}

.detail-preview-fallback {
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 28%),
        linear-gradient(135deg, #1258ca 0%, #1b74e8 62%, #3bb7f3 100%);
}

.detail-preview-fallback span {
    width: 112px;
    height: 112px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 34px;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.template-detail-sidebar {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card {
    padding: 22px;
}

.template-detail-sidebar .sidebar-card:nth-child(2) {
    animation-delay: .06s;
}

.template-detail-sidebar .sidebar-card:nth-child(3) {
    animation-delay: .12s;
}

.template-detail-sidebar .sidebar-card:nth-child(4) {
    animation-delay: .18s;
}

.template-detail-sidebar .sidebar-card:nth-child(5) {
    animation-delay: .24s;
}

.action-card {
    padding: 20px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.sidebar-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    overflow: hidden;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, color .22s ease, background .22s ease;
}

.sidebar-btn::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -42%;
    width: 34%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
    transform: skewX(-22deg);
    transition: left .42s ease;
}

.sidebar-btn + .sidebar-btn {
    margin-top: 12px;
}

.sidebar-btn.primary {
    border: 1px solid #175cd3;
    background: linear-gradient(135deg, #175cd3 0%, #0f4db8 100%);
    color: #fff;
    box-shadow: 0 12px 26px rgba(23, 92, 211, 0.22);
}

.sidebar-btn.secondary {
    border: 1px solid rgba(203, 213, 225, 0.96);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: #21334c;
}

.sidebar-btn:hover {
    transform: translateY(-2px);
}

.sidebar-btn:hover::before {
    left: 112%;
}

.sidebar-btn.primary:hover {
    box-shadow: 0 18px 32px rgba(23, 92, 211, 0.26);
}

.sidebar-btn.secondary:hover {
    color: #175cd3;
    border-color: rgba(59, 130, 246, 0.22);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.78);
    transition: transform .2s ease, padding-left .2s ease;
}

.info-row:last-child {
    border-bottom: 0;
}

.info-row:hover {
    transform: translateX(4px);
    padding-left: 4px;
}

.info-row span {
    color: #6b7b92;
    font-size: 13px;
    font-weight: 700;
}

.info-row strong {
    color: #23354e;
    font-size: 14px;
    font-weight: 700;
    text-align: right;
    word-break: break-word;
}

.service-card h3,
.related-card h3,
.support-card h3 {
    margin: 0 0 12px;
    color: #132238;
    font-size: 18px;
    line-height: 1.3;
}

.service-card p,
.support-card p {
    margin: 0;
    color: #61728a;
    font-size: 14px;
    line-height: 1.9;
}

.support-card p + p {
    margin-top: 8px;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.related-item {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
    border: 1px solid rgba(226, 232, 240, 0.82);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: inherit;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.related-item:hover {
    transform: translateX(4px);
    border-color: rgba(59, 130, 246, 0.18);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.related-thumb {
    width: 86px;
    height: 66px;
    border-radius: 12px;
    background: linear-gradient(135deg, #dce8ff 0%, #f7faff 100%);
    overflow: hidden;
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.related-item:hover .related-thumb img {
    transform: scale(1.06);
}

.related-thumb span {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #175cd3;
    font-size: 18px;
    font-weight: 800;
}

.related-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.related-copy strong {
    color: #15263c;
    font-size: 14px;
    line-height: 1.6;
    transition: color .22s ease;
}

.related-copy span {
    color: #175cd3;
    font-size: 13px;
    font-weight: 700;
}

.related-item:hover .related-copy strong {
    color: #175cd3;
}

@keyframes detailCardIn {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    .template-detail-sidebar {
        position: static;
    }
}

@media (max-width: 760px) {
    .template-detail-main {
        padding: 22px 0 48px;
    }

    .detail-heading,
    .detail-block {
        padding-left: 22px;
        padding-right: 22px;
    }

    .detail-heading::before,
    .detail-block::before {
        left: 22px;
        width: calc(100% - 44px);
    }

    .detail-meta-list {
        grid-template-columns: 1fr;
    }

    .detail-preview-panel {
        margin: 24px 22px 22px;
    }
}

@media (max-width: 640px) {
    .detail-heading {
        padding-top: 28px;
    }

    .detail-heading h1 {
        font-size: 26px;
    }

    .detail-preview-panel {
        padding: 12px;
    }

    .detail-preview-fallback {
        min-height: 260px;
    }

    .sidebar-card {
        padding: 18px;
    }

    .related-item {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .related-thumb {
        width: 72px;
        height: 56px;
    }
}
