/* ==========================================
   宁波星熠未来智能装备 - 官方网站样式表
   ========================================== */

/* 基础变量 */
:root {
    --primary: #0d47a1;
    --primary-dark: #0a3578;
    --primary-light: #42a5f5;
    --accent: #ff6f00;
    --accent-light: #ff9800;
    --dark: #1a1a2e;
    --gray-dark: #2d3436;
    --gray: #636e72;
    --gray-light: #b2bec3;
    --gray-lighter: #dfe6e9;
    --light: #f5f6fa;
    --white: #ffffff;
    --success: #00b894;
    --danger: #d63031;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
    --radius: 8px;
    --radius-lg: 16px;
    --max-width: 1280px;
}

/* 重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-dark);
    background: var(--white);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul { list-style: none; }
img {
    max-width: 100%;
    display: block;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* 图片容器：固定宽高比，防止加载时布局抖动 */
.card-img,
.product-item-img,
.solution-detail .solution-img,
.news-detail-image {
    padding-bottom: 56.25%;
    background: var(--light);
    position: relative;
    overflow: hidden;
}

/* 加载占位骨架屏 */
.card-img::before,
.product-item-img::before,
.solution-detail .solution-img::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--light) 25%, #e8e8e8 50%, var(--light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    z-index: 0;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 图片加载完成后隐藏骨架屏 */
.card-img img,
.product-item-img img,
.solution-detail .solution-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* 新闻列表卡片图片 */
.news-list-item .card-img,
.news-card .card-img {
    padding-bottom: 56.25%;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================
   导航栏
   ========================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-lighter);
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

/* 语言切换按钮 */
.lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    margin-right: 12px;
    transition: var(--transition);
}

.lang-switch:hover {
    background: var(--primary);
    color: var(--white);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 800;
    font-size: 1.1rem;
}

.logo img {
    height: 40px;
    width: auto;
    display: block;
    border-radius: var(--radius);
}

.footer-brand .logo img {
    height: 36px;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-dark);
    position: relative;
    padding: 4px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-dark);
}

/* ==========================================
   按钮
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(13,71,161,0.3);
}

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

.btn-accent:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,111,0,0.3);
}

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

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

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

.btn-outline-white:hover {
    background: var(--white);
    color: var(--primary);
}

.btn-lg {
    padding: 14px 36px;
    font-size: 1rem;
}

/* ==========================================
   页面横幅
   ========================================== */
.page-banner {
    position: relative;
    height: 380px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    margin-top: 72px;
    overflow: hidden;
}

.page-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 400"><defs><linearGradient id="g" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:%230d47a1;stop-opacity:1" /><stop offset="100%25" style="stop-color:%230a3578;stop-opacity:1" /></linearGradient></defs><rect fill="url(%23g)" width="1200" height="400"/><circle cx="200" cy="100" r="150" fill="%231a5fb4" opacity="0.3"/><circle cx="1000" cy="300" r="200" fill="%230d47a1" opacity="0.2"/></svg>');
    background-size: cover;
    opacity: 0.9;
}

.banner-content {
    position: relative;
    z-index: 1;
}

.banner-content h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.banner-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.breadcrumb a:hover { opacity: 1; text-decoration: underline; }

/* ==========================================
   章节标题
   ========================================== */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 12px auto 0;
    border-radius: 2px;
}

.section-header p {
    color: var(--gray);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================
   卡片
   ========================================== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--gray-lighter);
}

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

.card-body {
    padding: 24px;
}

.card-body h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.card-body p {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ==========================================
   页脚
   ========================================== */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 80px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-brand .logo {
    color: var(--white);
    margin-bottom: 20px;
}

.footer-brand .logo-icon {
    background: var(--accent);
}

.footer-brand p {
    color: var(--gray-light);
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--white);
}

.footer-links ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}

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

.footer-links a {
    color: var(--gray-light);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent-light);
    padding-left: 4px;
}

.footer-contact p {
    color: var(--gray-light);
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.footer-contact .icon {
    color: var(--accent-light);
    font-size: 1.1rem;
    margin-top: 2px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--gray);
    font-size: 0.85rem;
}

/* ==========================================
   响应式
   ========================================== */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px 24px;
        gap: 16px;
        box-shadow: var(--shadow);
        border-top: 1px solid var(--gray-lighter);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .page-banner {
        height: 280px;
    }
    
    .banner-content h1 {
        font-size: 1.8rem;
    }
    
    .section-header h2 {
        font-size: 1.6rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* ==========================================
   动画
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* ==========================================
   工具类
   ========================================== */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 40px; }

/* 视频播放错误提示 */
.video-error-overlay {
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    color: #666;
    margin: 12px 0;
}
.video-error-overlay .video-error-icon {
    font-size: 48px;
    color: #e74c3c;
    margin-bottom: 12px;
}
.video-error-overlay .video-error-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}
.video-error-overlay .video-error-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 12px;
}
.video-error-overlay .video-error-tip {
    font-size: 13px;
    color: #999;
    background: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
}

/* 富文本编辑器并排图片样式 */
.editor-img-row {
    display: flex;
    gap: 12px;
    margin: 12px 0;
}
.editor-img-col {
    flex: 1;
    min-width: 0;
}
.editor-img-col img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
@media (max-width: 768px) {
    .editor-img-row {
        flex-direction: column;
    }
}
