/* ============================================
   XX科技有限公司 - 企业官网 样式表
   蓝白色调 | 响应式布局 | 简洁商务
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:    #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --white:      #ffffff;
    --bg:         #f5f7fa;
    --text:       #333333;
    --text-light: #666666;
    --border:     #e0e0e0;
    --radius:     8px;
    --shadow:     0 2px 12px rgba(0,0,0,0.08);
    --max-width:  1200px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 16px;
}

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

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; vertical-align: middle; }
ul, ol { list-style: none; }

/* ---------- Top Bar ---------- */
.top-bar {
    background: #1a1a2e;
    color: #ccc;
    font-size: 13px;
    padding: 6px 0;
}
.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar-left {
    display: flex;
    gap: 20px;
}
.top-bar-right {
    display: flex;
    align-items: center;
}

/* 语言切换器 */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lang-btn {
    color: #ccc;
    font-size: 13px;
    padding: 2px 8px;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.2s;
}
.lang-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}
.lang-btn.active {
    color: #1a1a2e;
    background: #fff;
    font-weight: 500;
}
.lang-divider {
    color: #666;
    font-size: 12px;
}

/* ---------- Header / Nav ---------- */
.header {
    background: var(--white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}
.logo h1 {
    font-size: 22px;
    color: var(--primary);
    font-weight: 700;
}
.nav { display: flex; gap: 4px; }
.nav a {
    display: block;
    padding: 8px 18px;
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 500;
    font-size: 15px;
}
.nav a:hover,
.nav a.active { background: var(--primary); color: var(--white); }

/* 移动端菜单按钮 */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    font-size: 24px;
    color: var(--text);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1;
}

/* ---------- Footer ---------- */
.footer {
    background: #1a1a2e;
    color: #bbb;
    margin-top: 60px;
}
.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 40px;
    padding: 48px 20px;
}
.footer-col h3 { color: var(--white); margin-bottom: 12px; font-size: 20px; }
.footer-col h4 { color: var(--white); margin-bottom: 12px; font-size: 16px; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul li a { color: #bbb; font-size: 14px; }
.footer-col ul li a:hover { color: var(--white); }
.footer-col p { font-size: 14px; margin-bottom: 4px; line-height: 1.8; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 16px 20px;
    text-align: center;
    font-size: 13px;
    color: #888;
}

/* ---------- Page Banner ---------- */
.page-banner {
    background: linear-gradient(135deg, var(--primary) 0%, #0d47a1 100%);
    color: var(--white);
    text-align: center;
    padding: 60px 20px;
}
.page-banner h2 { font-size: 32px; margin-bottom: 8px; }
.page-banner p  { font-size: 16px; opacity: 0.85; }

/* ---------- Section Titles ---------- */
.section-title {
    text-align: center;
    margin-bottom: 40px;
}
.section-title h2 {
    font-size: 28px;
    color: var(--text);
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}
.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}
.section-title p { color: var(--text-light); margin-top: 8px; }

/* ---------- Home Banner ---------- */
.home-banner {
    background: linear-gradient(135deg, #0d47a1 0%, var(--primary) 50%, #42a5f5 100%);
    color: var(--white);
    text-align: center;
    padding: 100px 20px;
}
.home-banner h2 { font-size: 42px; margin-bottom: 16px; font-weight: 700; }
.home-banner p  { font-size: 20px; opacity: 0.9; max-width: 700px; margin: 0 auto; }

/* ---------- 首页幻灯片（轮播） ---------- */
.home-slider {
    position: relative;
    width: 100%;
    height: 520px;        /* 提高高度，从400px改为520px */
    overflow: hidden;
    background: #0d47a1;
}
.slides { position: relative; width: 100%; height: 100%; }
.slide-item {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
}
.slide-item.active { opacity: 1; }
.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.slide-placeholder {
    width: 100%;
    height: 100%;
}
.slide-overlay {
    position: absolute;
    inset: 0;
    background: none;
    display: flex;
    align-items: center;
}
.slide-overlay .container { color: #fff; }
.slide-overlay h2 {
    font-size: 44px;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
    line-height: 1.2;
}
.slide-overlay p {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 20px;
    max-width: 600px;
}
.slide-btn {
    display: inline-block;
    padding: 10px 28px;
    background: var(--primary);
    color: #fff !important;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    transition: background 0.2s;
}
.slide-btn:hover { background: var(--primary-dark); }

/* 文字位置样式（文字层叠在图片上） */
.text-pos-center-bottom { align-items: flex-end; padding-bottom: 60px; }
.text-pos-center-middle { align-items: center; }
.text-pos-center-top   { align-items: flex-start; padding-top: 60px; }
.text-pos-left-bottom  { align-items: flex-end; justify-content: flex-start; padding: 0 0 60px 10%; }
.text-pos-left-middle  { align-items: center; justify-content: flex-start; padding: 0 0 0 10%; }
.text-pos-right-bottom { align-items: flex-end; justify-content: flex-end; padding: 0 10% 60px 0; }
.text-pos-right-middle { align-items: center; justify-content: flex-end; padding: 0 10% 0 0; }
.text-pos-center-bottom .container,
.text-pos-center-top   .container,
.text-pos-left-bottom  .container,
.text-pos-right-bottom .container { text-align: center; }
.text-pos-left-bottom  .container,
.text-pos-left-middle  .container { text-align: left; }
.text-pos-right-bottom .container,
.text-pos-right-middle .container { text-align: right; }

/* 箭头 */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.slider-arrow:hover { background: rgba(0,0,0,0.7); }
.slider-arrow.prev { left: 20px; }
.slider-arrow.next { right: 20px; }

/* 指示点 */
.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}
.dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* 响应式 */
@media (max-width: 768px) {
    .home-slider { height: 320px; }
    .slide-overlay h2 { font-size: 28px; }
    .slide-overlay p { font-size: 16px; }
    .slider-arrow { width: 36px; height: 36px; font-size: 16px; }
}

/* ---------- Cards (News / Products) ---------- */
.section { padding: 60px 0; }
.section-bg { background: var(--white); }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.news-card, .product-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}
.news-card:hover, .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}
.news-card .card-img {
    height: 200px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 48px;
    overflow: hidden;
}
.news-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.news-card .card-body, .product-card .card-body {
    padding: 20px;
}
.news-card .card-body h3 { font-size: 18px; margin-bottom: 8px; }
.news-card .card-body h3 a { color: var(--text); }
.news-card .card-body h3 a:hover { color: var(--primary); }
.news-card .card-body .date {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}
.news-card .card-body .summary {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

.product-card .card-img {
    height: 220px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-card .card-body h3 { font-size: 18px; margin-bottom: 6px; }
.product-card .card-body .category {
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-light);
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
}
.product-card .card-body .summary {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

/* ---------- News List Page ---------- */
.news-list { padding: 40px 0; }
.news-list-item {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    transition: box-shadow 0.3s;
}
.news-list-item:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.news-list-item .news-thumb {
    width: 200px;
    height: 140px;
    flex-shrink: 0;
    border-radius: var(--radius);
    background: var(--primary-light);
    overflow: hidden;
}
.news-list-item .news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.news-list-info h3 { font-size: 20px; margin-bottom: 8px; }
.news-list-info h3 a { color: var(--text); }
.news-list-info h3 a:hover { color: var(--primary); }
.news-list-info .meta { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.news-list-info .summary { font-size: 14px; color: var(--text-light); line-height: 1.6; }

/* ---------- Product Grid Page ---------- */
.product-grid-page { padding: 40px 0; }

/* ---------- Detail Pages ---------- */
.detail-page { padding: 40px 0; }
.detail-page .detail-header { margin-bottom: 30px; }
.detail-page .detail-header h2 { font-size: 28px; margin-bottom: 12px; }
.detail-page .detail-header .meta {
    font-size: 14px;
    color: var(--text-light);
}
.detail-page .detail-cover {
    text-align: center;
    margin-bottom: 30px;
}
.detail-page .detail-cover img {
    max-width: 100%;
    border-radius: var(--radius);
    max-height: 400px;
    object-fit: cover;
}
.detail-page .detail-body {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    line-height: 2;
    font-size: 16px;
}
.detail-page .detail-body h4 { margin: 20px 0 10px; font-size: 18px; }
.detail-page .detail-body ul { list-style: disc; padding-left: 20px; margin: 10px 0; }
.detail-page .detail-body ul li { margin-bottom: 4px; }

/* ---------- About Page ---------- */
.about-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    line-height: 2;
    font-size: 16px;
}
.about-content p { margin-bottom: 16px; }
.about-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}
.about-info-card {
    text-align: center;
    padding: 30px 20px;
    border-radius: var(--radius);
    background: var(--primary-light);
}
.about-info-card .icon { font-size: 40px; margin-bottom: 10px; }
.about-info-card h4 { font-size: 20px; color: var(--primary); margin-bottom: 4px; }
.about-info-card p { font-size: 14px; color: var(--text-light); }

/* ---------- Contact Page ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px 0;
}
.contact-info { padding: 40px; background: var(--white); border-radius: var(--radius); }
.contact-info h3 { margin-bottom: 20px; font-size: 22px; }
.contact-info .info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 15px;
    color: var(--text-light);
}
.contact-info .info-item strong { color: var(--text); display: block; margin-bottom: 2px; }

.contact-form {
    padding: 40px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.contact-form h3 { margin-bottom: 20px; font-size: 22px; }

/* ---------- Form Elements ---------- */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--white);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}
.form-group textarea { resize: vertical; min-height: 120px; }

.btn {
    display: inline-block;
    padding: 12px 32px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-align: center;
}
.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}
.btn-block { width: 100%; }

/* alert */
.alert {
    padding: 12px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-error   { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--white);
}
.pagination a:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.pagination span.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        padding: 12px 0;
    }
    .nav.open { display: flex; }
    .nav a { border-radius: 0; padding: 12px 20px; }

    .home-banner { padding: 60px 20px; }
    .home-banner h2 { font-size: 28px; }
    .home-banner p  { font-size: 16px; }

    .footer-inner { grid-template-columns: 1fr; gap: 24px; }

    .news-list-item { flex-direction: column; }
    .news-list-item .news-thumb { width: 100%; height: 180px; }

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

    .detail-page .detail-body { padding: 20px; }

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