/* ========================================
   KLA Instruments - 全局样式表
   ======================================== */

/* CSS 变量 */
:root {
    --primary: #003087;
    --primary-light: #0055cc;
    --primary-dark: #001a52;
    --secondary: #00a8e8;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --text-dark: #1a1a2e;
    --text-gray: #666666;
    --text-light: #999999;
    --border: #e0e0e0;
    --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 32px rgba(0,0,0,0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.media-frame {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #eef4fb 0%, #dfeaf7 48%, #f7f9fc 100%);
}

.media-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 22% 20%, rgba(255,255,255,0.8), transparent 28%),
        linear-gradient(100deg, transparent 0%, rgba(255,255,255,0.34) 45%, transparent 72%);
    opacity: 0.9;
    transform: translateX(-28%);
    animation: media-placeholder-drift 2.2s ease-in-out infinite alternate;
    pointer-events: none;
    transition: opacity 0.45s ease;
    z-index: 0;
}

.media-frame.is-loaded::before {
    opacity: 0;
    animation: none;
}

.media-frame > .media-fade-in,
.media-frame > img.media-fade-in[src] {
    opacity: 0;
    transform: scale(1.018);
    transition:
        opacity 0.55s ease,
        transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.media-frame > .media-fade-in.is-loaded,
.media-frame > img.media-fade-in.is-loaded[src] {
    opacity: 1;
    transform: scale(1);
}

@keyframes media-placeholder-drift {
    from { transform: translateX(-28%); }
    to { transform: translateX(18%); }
}

@media (prefers-reduced-motion: reduce) {
    .media-frame::before {
        animation: none;
    }

    .media-frame > .media-fade-in,
    .media-frame > img.media-fade-in[src] {
        transition: opacity 0.2s ease;
        transform: none;
    }
}

/* ========================================
   导航栏
   ======================================== */
.navbar {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.navbar-logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
}

.navbar-logo img {
    height: 40px;
    width: auto;
}

.navbar-menu {
    display: flex;
    gap: 40px;
}

.navbar-menu a {
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: var(--primary);
}

.navbar-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.navbar-menu a:hover::after,
.navbar-menu a.active::after {
    width: 100%;
}

/* ========================================
   首页 Hero 区域
   ======================================== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--secondary) 100%);
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/company-bg.jpg') center/cover;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    padding: 40px;
}

.hero-logo {
    width: 200px;
    height: 200px;
    margin: 0 auto 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.hero-logo img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 20px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ========================================
   公司简介区域
   ======================================== */
.about {
    padding: 100px 20px;
    background: var(--bg-white);
}

.about-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.about h2 {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

.about h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.about p {
    font-size: 18px;
    color: var(--text-gray);
    line-height: 2;
    margin-top: 40px;
}

/* ========================================
   页面标题
   ======================================== */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.page-header h1 {
    font-size: 42px;
    margin-bottom: 15px;
}

.page-header p {
    font-size: 18px;
    opacity: 0.9;
}

/* ========================================
   内容容器
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* ========================================
   卡片组件
   ======================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0,48,135,0.18);
}

.card-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    flex-shrink: 0;
}

/* 真实设备图 */
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

.card:hover .card-image img {
    transform: scale(1.07);
}

/* 无图片时的 emoji 占位 */
.card-image-emoji {
    font-size: 80px;
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

.card:hover .card-image-emoji {
    transform: scale(1.1);
}

/* 图片底部渐变遮罩 */
.card-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: linear-gradient(transparent, rgba(0, 20, 60, 0.65));
    pointer-events: none;
}

/* 图片上的分类标签 */
.card-image-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,0.92);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.card-content {
    padding: 22px 24px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.card-desc {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.7;
    margin-bottom: 20px;
    flex: 1;
}

/* 技术优势卡片（无按钮，更紧凑） */
.card-feature .card-image {
    height: 260px;
}

.card-feature .card-content {
    padding: 18px 22px 22px;
}

.card-feature .card-title {
    font-size: 18px;
}

/* 全屏图片叠加文字卡片（有图时不显示 card-content） */
.card-cover {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.card-cover .card-image {
    height: 280px;
}

.card-cover.card-feature .card-image {
    height: 260px;
}

/* 叠加文字层（卡片内通用） */
.card-text-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 18px 20px;
    background: linear-gradient(to top, rgba(0,8,40,0.92) 0%, rgba(0,8,40,0.45) 60%, transparent 100%);
    z-index: 2;
    transition: background 0.3s ease;
}

.card:hover .card-text-overlay {
    background: linear-gradient(to top, rgba(0,8,40,0.97) 0%, rgba(0,8,40,0.6) 60%, transparent 100%);
}

.card-text-overlay h3 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 5px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
    line-height: 1.3;
}

.card-text-overlay p {
    font-size: 12.5px;
    color: rgba(255,255,255,0.84);
    line-height: 1.55;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-text-overlay .btn {
    padding: 7px 16px;
    font-size: 13px;
    display: inline-block;
}

/* ========================================
   按钮组件
   ======================================== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,48,135,0.3);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

/* ========================================
   产品详情页样式
   ======================================== */
.product-hero {
    padding: 0;
    overflow: hidden;
    position: relative;
    /* 灰白渐变背景 */
    background: linear-gradient(180deg, #f5f7fa 0%, #e8ecf3 100%);
    /* 滚动显隐动画 - use transform for smooth animation without layout shift */
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease;
    transform-origin: top center;
    transform: scaleY(1);
    opacity: 1;
}

/* 向下滚动时折叠隐藏 */
.product-hero.hero-hidden {
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
}

.product-hero-image {
    width: 100%;
    height: 540px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(180deg, #f5f7fa 0%, #e8ecf3 100%);
}

/* 模糊背景层（充满两侧空白，灰白风格） */
.product-hero-blur-bg {
    position: absolute;
    inset: -8%;
    background-size: cover;
    background-position: center;
    filter: blur(32px) brightness(0.88) saturate(0.22);
    opacity: 0.55;
    z-index: 0;
    transition: opacity 0.4s ease;
}

/* 产品图：展示完整图像，不裁剪 */
.product-hero-image img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: calc(100% - 110px);
    object-fit: contain;
    object-position: center top;
    z-index: 1;
    padding: 28px 60px 0;
    box-sizing: border-box;
    display: block;
    filter: drop-shadow(0 4px 24px rgba(0,0,0,0.18));
    transition: transform 0.6s ease;
}

.product-hero-image img:hover {
    transform: scale(1.02);
}

/* 大图底部标题覆盖层 */
.product-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 20px 30px;
    background: linear-gradient(to top, rgba(10,20,55,0.82) 0%, rgba(10,20,55,0.38) 55%, transparent 100%);
    z-index: 2;
}

.product-section {
    padding: 60px 20px;
    scroll-margin-top: 80px;
}

.product-section:nth-child(even) {
    background: var(--bg-light);
}

.product-section-title {
    font-size: 26px;
    color: var(--primary);
    margin-bottom: 30px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
}

.product-intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

/* Feature grid cards */
.feature-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* PDF Download Card */
.pdf-download-card {
    display: flex;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,48,135,0.08);
    max-height: 280px;
}

.pdf-cover-side {
    flex: 0 0 200px;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pdf-cover-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pdf-info-side {
    flex: 1;
    padding: 32px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pdf-info-badge {
    display: inline-block;
    background: linear-gradient(135deg, #003087 0%, #0050c8 100%);
    color: white;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 5px 14px;
    border-radius: 4px;
    width: fit-content;
    margin-bottom: 16px;
}

.pdf-info-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 8px;
}

.pdf-info-desc {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-gray);
    margin: 0 0 20px;
}

.pdf-info-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.feature-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 2px 12px rgba(0, 48, 135, 0.06);
    border: 1px solid rgba(0, 48, 135, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 48, 135, 0.12);
}

.feature-card-bar {
    width: 5px;
    min-height: 32px;
    border-radius: 3px;
    flex-shrink: 0;
    align-self: stretch;
}

.feature-card-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dark);
    font-weight: 500;
}

.product-intro-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-gray);
}

.product-intro-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    max-height: 380px;
}

.product-intro-image img {
    width: 100%;
    height: 100%;
    max-height: 380px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.product-intro-image img:hover {
    transform: scale(1.04);
}

/* ========================================
   表格样式
   ======================================== */
.specs-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.specs-table th,
.specs-table td {
    padding: 16px 20px;
    text-align: left;
}

.specs-table th {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.specs-table tr:nth-child(even) {
    background: var(--bg-light);
}

.specs-table tr:hover {
    background: #e8f0fe;
}

.specs-table td:first-child {
    font-weight: 500;
    color: var(--primary);
    width: 30%;
}

/* ========================================
   图片画廊
   ======================================== */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* ========================================
   表单样式
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,48,135,0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    .navbar-menu {
        gap: 20px;
    }
    
    .navbar-menu a {
        font-size: 14px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-logo {
        width: 150px;
        height: 150px;
    }
    
    .product-intro {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .pdf-download-card {
        flex-direction: column;
        max-height: none;
        margin: 0 -10px;
    }
    
    .pdf-cover-side {
        flex: none;
        min-height: 140px;
        max-height: 180px;
    }
    
    .pdf-info-side {
        padding: 24px 20px;
    }
    
    .pdf-info-badge {
        font-size: 11px;
        padding: 4px 12px;
        margin-bottom: 12px;
    }
    
    .pdf-info-title {
        font-size: 17px;
        margin-bottom: 10px;
    }
    
    .pdf-info-desc {
        font-size: 13px;
        line-height: 1.6;
        margin-bottom: 20px;
    }
    
    .pdf-info-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .pdf-info-actions .btn,
    .pdf-download-btn,
    .pdf-consult-btn {
        width: 100%;
        text-align: center;
        padding: 16px 20px !important;
        font-size: 16px !important;
        font-weight: 600;
        display: block;
        border-radius: 10px;
    }
    
    .pdf-download-btn {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
        color: white !important;
        box-shadow: 0 4px 12px rgba(0,48,135,0.25);
    }
    
    .pdf-consult-btn {
        background: white !important;
        color: var(--primary) !important;
        border: 2px solid var(--primary) !important;
    }
    
    .page-header h1 {
        font-size: 28px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   联系我们页面样式
   ======================================== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-form-container {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.contact-form-container h2 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 30px;
}

.contact-info-container h2 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 30px;
}

.contact-info-container h3 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.contact-info-container p {
    color: var(--text-gray);
    line-height: 1.8;
}

/* 懒加载占位符样式 */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-placeholder 1.5s infinite;
}

@keyframes loading-placeholder {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

img[loading="lazy"][src] {
    animation: none;
    background: none;
}

/* ========================================
   动画效果
   ======================================== */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
