/* ============================================================
   XRSoft CMS - 主样式
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    background: #fff;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #2563eb; text-decoration: none; transition: color .2s; }
a:hover { color: #1d4ed8; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

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

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
    transition: box-shadow .3s;
}
.site-header.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,.06); }
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}
.logo { font-size: 1.4rem; font-weight: 800; color: #1e40af; text-decoration: none; }
.logo img { height: 40px; width: auto; }
.logo-text { letter-spacing: -0.5px; }

/* Nav */
.main-nav ul { display: flex; gap: 8px; }
.main-nav a {
    display: block;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 500;
    color: #374151;
    transition: all .2s;
}
.main-nav a:hover { background: #eff6ff; color: #2563eb; }
.main-nav li.active a { background: #2563eb; color: #fff; }

/* Mobile menu */
.mobile-menu-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.mobile-menu-toggle span { display: block; width: 24px; height: 2px; background: #374151; border-radius: 2px; transition: .3s; }

/* ---------- Hero Banner ---------- */
.hero-banner { position: relative; overflow: hidden; }
.banner-slider { position: relative; }
.banner-slide {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.banner-slide img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
}
.banner-slide::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(30,64,175,.7), rgba(37,99,235,.5));
    z-index: 1;
}
.banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 60px 20px;
}
.banner-title {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 800;
    text-shadow: 0 2px 20px rgba(0,0,0,.3);
    margin-bottom: 12px;
}
.banner-subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    opacity: .95;
    text-shadow: 0 1px 10px rgba(0,0,0,.3);
}

/* ---------- Sections ---------- */
.section { padding: 70px 0; }
.section:nth-child(even) { background: #f8fafc; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 12px;
}
.section-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-icon { font-size: 1.2em; }
.section-more {
    font-size: .9rem;
    color: #2563eb;
    font-weight: 500;
    white-space: nowrap;
}

/* ---------- Cards ---------- */
.card-grid {
    display: grid;
    gap: 24px;
}
.card-grid-1 { grid-template-columns: 1fr; max-width: 600px; margin: 0 auto; }
.card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    transition: transform .3s, box-shadow .3s;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,.12);
}
.card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f1f5f9;
}
.card-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .5s;
}
.card:hover .card-image img { transform: scale(1.05); }
.card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}
.card-subtitle {
    font-size: .9rem;
    color: #2563eb;
    font-weight: 600;
    margin-bottom: 10px;
}
.card-desc {
    font-size: .9rem;
    color: #64748b;
    line-height: 1.6;
    flex: 1;
}
.card-link {
    margin-top: 14px;
    font-size: .88rem;
    font-weight: 600;
    color: #2563eb;
    display: inline-block;
}

/* ---------- Page Header ---------- */
.page-header { text-align: center; margin-bottom: 50px; }
.page-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 10px;
}
.page-desc { font-size: 1.05rem; color: #64748b; }

/* ---------- Detail ---------- */
.breadcrumb {
    font-size: .88rem;
    color: #94a3b8;
    margin-bottom: 24px;
}
.breadcrumb a { color: #2563eb; }
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}
.detail-header { margin-bottom: 28px; }
.detail-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
}
.detail-subtitle { font-size: 1.1rem; color: #2563eb; font-weight: 600; }
.detail-image { border-radius: 16px; overflow: hidden; margin-bottom: 28px; }
.detail-summary {
    font-size: 1.1rem;
    color: #334155;
    background: #eff6ff;
    padding: 24px;
    border-radius: 12px;
    border-left: 4px solid #2563eb;
    margin-bottom: 28px;
    line-height: 1.8;
}
.detail-content { font-size: 1rem; color: #475569; line-height: 1.9; }
.detail-content p { margin-bottom: 16px; }
.detail-link { margin-top: 32px; }

/* Sidebar */
.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}
.related-list { display: flex; flex-direction: column; gap: 14px; }
.related-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.related-item img {
    width: 64px; height: 64px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.related-item h4 { font-size: .9rem; color: #1e293b; margin-bottom: 4px; }
.related-item p { font-size: .8rem; color: #94a3b8; }

/* ---------- Download ---------- */
.download-list { display: flex; flex-direction: column; gap: 12px; }
.download-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    transition: all .2s;
}
.download-item:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateX(4px); }
.download-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px; height: 48px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 10px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.download-info { flex: 1; }
.download-title { display: block; font-weight: 600; color: #1e293b; }
.download-desc { display: block; font-size: .82rem; color: #94a3b8; margin-top: 2px; }
.download-btn {
    padding: 8px 18px;
    background: #2563eb;
    color: #fff !important;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Search ---------- */
.search-form { display: flex; gap: 10px; max-width: 500px; margin: 20px auto 0; }
.search-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: .95rem;
    outline: none;
    transition: border-color .2s;
}
.search-input:focus { border-color: #2563eb; }
.search-btn {
    padding: 12px 28px;
    background: #2563eb;
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
}
.search-count { margin: 24px 0; color: #64748b; }
.search-result-item {
    padding: 22px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    margin-bottom: 14px;
}
.result-type {
    display: inline-block;
    padding: 2px 10px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.result-title { font-size: 1.1rem; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.result-subtitle { font-size: .9rem; color: #2563eb; margin-bottom: 6px; }
.result-desc { font-size: .88rem; color: #64748b; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: .92rem;
    transition: all .2s;
    cursor: pointer;
    border: none;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; color: #fff; }
.btn-outline {
    background: transparent;
    border: 2px solid #2563eb;
    color: #2563eb;
}
.btn-outline:hover { background: #2563eb; color: #fff; }

/* ---------- Footer ---------- */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 56px 0 24px;
    margin-top: 40px;
}
.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 36px;
}
.footer-section h4 {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 14px;
}
.footer-section p { font-size: .88rem; margin-bottom: 6px; }
.footer-section ul li { margin-bottom: 8px; }
.footer-section ul a { color: #94a3b8; font-size: .88rem; }
.footer-section ul a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 20px;
    text-align: center;
    font-size: .82rem;
}
.footer-bottom .icp { margin-top: 6px; }

/* ---------- Flash Messages ---------- */
.flash-message {
    padding: 14px 20px;
    margin: 16px auto;
    max-width: 1160px;
    border-radius: 10px;
    font-size: .9rem;
    animation: slideDown .3s ease;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

/* ---------- Error ---------- */
.error-content { text-align: center; padding: 80px 20px; }
.error-code { font-size: 6rem; font-weight: 900; color: #2563eb; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .section { padding: 48px 0; }
    .main-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.1); }
    .main-nav.active { display: block; }
    .main-nav ul { flex-direction: column; padding: 10px; gap: 4px; }
    .main-nav a { padding: 12px 16px; }
    .mobile-menu-toggle { display: flex; }
    .card-grid-3, .card-grid-4, .card-grid-2 { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; gap: 24px; }
    .banner-slide { min-height: 280px; }
}
