/*
Theme Name: Changxin Refractory Theme
Theme URI: https://example.com/changxin-refractory-theme
Author: OpenAI Codex
Author URI: https://openai.com/
Description: 将现有静态演示站改造为可后台编辑的 WordPress 企业官网主题。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: changxin-refractory-theme
*/

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

:root {
    --primary-color: #1a3a5c;
    --primary-dark: #0f2840;
    --primary-light: #2c5282;
    --accent-color: #d4a017;
    --accent-hover: #b88a0f;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --bg-light: #f7f9fc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease-in-out;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Source Han Sans CN", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

.header.fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    flex-shrink: 0;
    border-radius: 4px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.menu-btn {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    width: 28px;
    height: 20px;
    position: relative;
    z-index: 1001;
}

.menu-btn span {
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    margin: 4px 0;
    transition: var(--transition);
}

.menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    z-index: 999;
    padding-top: 80px;
}

.nav.active {
    left: 0;
}

.nav-list {
    list-style: none;
}

.nav-link {
    display: block;
    padding: 16px 24px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--bg-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.hero {
    position: relative;
    min-height: min(820px, calc(100svh - 80px));
    display: flex;
    align-items: flex-start;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    padding-top: 80px;
    overflow: hidden;
    isolation: isolate;
}

.hero-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--bg-white);
    width: 100%;
    padding-top: 92px;
    padding-bottom: 72px;
}

.hero-text {
    max-width: 640px;
    margin-left: 0;
    text-align: left;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 14px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 14px;
    opacity: 0.95;
}

.hero-description {
    font-size: 18px;
    margin-bottom: 26px;
    opacity: 0.9;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
    transform: translateY(-2px);
}

.hero .btn-secondary {
    color: var(--bg-white);
    border-color: var(--bg-white);
}

.hero .btn-secondary:hover {
    background-color: var(--bg-white);
    color: var(--primary-color);
}

.btn-block {
    width: 100%;
}

.section {
    padding: 80px 0;
}

.section-light {
    background-color: var(--bg-light);
}

.section-dark {
    background-color: var(--bg-white);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.about-card {
    background-color: var(--bg-white);
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.about-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.card-icon {
    width: 64px;
    height: 64px;
    background-color: rgba(26, 58, 92, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.card-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.about-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.about-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.about-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
    text-align: center;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 8px;
}

.detail-label {
    font-size: 15px;
    color: var(--text-secondary);
}

.product-grid,
.case-grid,
.news-grid,
.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.product-card,
.case-card,
.post-list-card {
    background-color: var(--bg-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.product-card:hover,
.case-card:hover,
.post-list-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.product-image,
.case-image {
    position: relative;
    width: 100%;
    height: 240px;
    background-color: var(--border-color);
    overflow: hidden;
}

.cx-media-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.cx-media-slider-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.cx-media-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease-in-out;
}

.cx-media-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.cx-media-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.product-image img,
.case-image img,
.post-detail-image img,
.post-detail-slider-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img,
.case-card:hover .case-image img {
    transform: scale(1.05);
}

.cx-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 40, 64, 0.76);
    color: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, background 0.25s ease;
    z-index: 3;
}

.cx-slider-nav span {
    font-size: 26px;
    line-height: 1;
}

.cx-slider-prev {
    left: 12px;
}

.cx-slider-next {
    right: 12px;
}

.cx-media-slider.has-multiple:hover .cx-slider-nav,
.cx-detail-slider.has-multiple .cx-slider-nav {
    opacity: 1;
    pointer-events: auto;
}

.cx-slider-nav:hover {
    background: rgba(15, 40, 64, 0.95);
}

.card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #d9e5f2 0%, #eff4fa 100%);
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
}

.product-overlay {
    position: absolute;
    top: 16px;
    right: 16px;
}

.product-tag {
    background-color: var(--accent-color);
    color: var(--bg-white);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.product-content,
.case-content {
    padding: 28px;
    background-color: var(--bg-white);
}

.product-content h3,
.case-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.product-content p,
.case-content p,
.post-list-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.product-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.product-link:hover {
    color: var(--accent-color);
}

.case-meta {
    display: flex;
    gap: 8px;
}

.case-tag {
    background-color: rgba(26, 58, 92, 0.1);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.news-card {
    background-color: var(--bg-light);
    border-radius: 12px;
    padding: 30px;
    display: flex;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.news-date {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background-color: var(--primary-color);
    border-radius: 8px;
    color: var(--bg-white);
    padding: 6px 4px;
}

.date-day {
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.date-meta {
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    opacity: 0.9;
    text-align: center;
}

.news-content {
    flex: 1;
}

.news-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    line-height: 1.4;
}

.news-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.news-link,
.post-list-card a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.news-link:hover,
.post-list-card a:hover {
    color: var(--accent-hover);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.contact-showcase {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.4fr);
    gap: 28px;
    align-items: stretch;
}

.contact-lead-card,
.contact-info-card {
    background-color: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.contact-lead-kicker {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(26, 58, 92, 0.08);
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.contact-lead-card h3,
.contact-info-card h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 32px;
}

.contact-lead-card p {
    color: var(--text-secondary);
    line-height: 1.9;
    max-width: 34ch;
}

.contact-grid-single {
    grid-template-columns: 1fr;
    gap: 0;
}

.contact-grid-single .contact-info-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 22px;
}

.contact-item {
    display: flex;
    gap: 16px;
    margin-bottom: 0;
    padding: 22px 20px;
    border-radius: 12px;
    background: var(--bg-light);
}

.contact-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background-color: rgba(26, 58, 92, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.contact-text h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.contact-text p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.footer {
    background-color: var(--primary-dark);
    color: var(--bg-white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3,
.footer-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--bg-white);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    margin-bottom: 12px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
}

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

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--bg-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.show {
    display: flex;
}

.back-to-top:hover {
    background-color: var(--accent-color);
    transform: translateY(-4px);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

.detail-page {
    padding-top: 80px;
}

.post-detail {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.post-detail-head {
    margin-bottom: 32px;
}

.post-detail-kicker {
    color: var(--accent-color);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.post-detail-title {
    color: var(--primary-color);
    font-size: 40px;
    line-height: 1.2;
    margin-bottom: 10px;
}

.post-detail-meta {
    color: var(--text-secondary);
}

.post-detail-image {
    overflow: hidden;
    border-radius: 14px;
    margin-bottom: 28px;
    aspect-ratio: 16 / 9;
    background: var(--border-color);
}

.cx-detail-slider .cx-slider-nav {
    width: 48px;
    height: 48px;
}

.post-detail-content {
    color: var(--text-secondary);
    line-height: 1.9;
}

.post-detail-content > * + * {
    margin-top: 18px;
}

.post-detail-content h2,
.post-detail-content h3,
.post-detail-content h4 {
    color: var(--primary-color);
    line-height: 1.35;
}

.post-detail-actions {
    margin-top: 36px;
}

.empty-state {
    background: var(--bg-white);
    text-align: center;
    padding: 48px 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 20px;
    }

    .hero-description {
        font-size: 16px;
    }

    .section-title {
        font-size: 28px;
    }

    .section {
        padding: 60px 0;
    }

    .about-grid,
    .product-grid,
    .case-grid,
    .news-grid,
    .post-list {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-showcase {
        grid-template-columns: 1fr;
    }

    .contact-grid-single .contact-info-card {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-content {
        padding-top: 72px;
        padding-bottom: 56px;
    }

    .btn {
        width: 100%;
    }

    .news-card {
        flex-direction: column;
    }

    .cx-media-slider.has-multiple .cx-slider-nav {
        opacity: 1;
        pointer-events: auto;
    }

    .contact-info-card,
    .contact-lead-card,
    .post-detail {
        padding: 28px;
    }

    .post-detail-title {
        font-size: 30px;
    }
}

@media (min-width: 769px) {
    .menu-btn {
        display: none;
    }

    .nav {
        position: static;
        width: auto;
        height: auto;
        background-color: transparent;
        box-shadow: none;
        padding-top: 0;
    }

    .nav-list {
        display: flex;
        gap: 8px;
    }

    .nav-link {
        padding: 8px 16px;
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    .nav-link:hover,
    .nav-link.active {
        background-color: transparent;
        border-bottom-color: var(--primary-color);
    }
}

@media (min-width: 1200px) {
    .hero-title {
        font-size: 48px;
    }

    .section-title {
        font-size: 36px;
    }
}
