/**
 * Yikai CMS - 前台公共样式
 */

/* ============================================================
   Tailwind v4 Preflight 表单修复
   ============================================================ */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="color"]),
textarea,
select {
    background-color: #fff;
}

/* ============================================================
   版块标题装饰线
   ============================================================ */
.section-title-bar {
    display: block;
    width: 50px;
    height: 4px;
    background: var(--color-primary, #3B82F6);
    border-radius: 9999px;
    margin: 0.75rem auto 0;
}
.section-title-bar-light {
    background: rgba(255,255,255,0.5);
}

/* ============================================================
   文本截断
   ============================================================ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   导航下拉菜单
   ============================================================ */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 160px;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    margin-top: 0;
}
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
}
.nav-dropdown-menu a {
    display: block;
    padding: 0.5rem 1.25rem;
    color: #4b5563;
    white-space: nowrap;
    transition: all 0.2s;
}
.nav-dropdown-menu a:hover {
    background: #f3f4f6;
    color: var(--color-primary, #3B82F6);
}

/* ============================================================
   汉堡菜单动画
   ============================================================ */
.hamburger {
    width: 24px;
    height: 20px;
    position: relative;
    cursor: pointer;
}
.hamburger span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 2px;
    left: 0;
    transition: all 0.3s ease;
}
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 9px; }
.hamburger span:nth-child(3) { top: 18px; }
.hamburger.active span:nth-child(1) { top: 9px; transform: rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: translateX(-10px); }
.hamburger.active span:nth-child(3) { top: 9px; transform: rotate(-45deg); }

/* ============================================================
   富文本内容样式（.prose / .content-body）
   ============================================================ */
.prose img,
.content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}
.prose p,
.content-body p {
    margin: 1em 0;
    line-height: 1.8;
}
.prose h2,
.content-body h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 1.5em 0 0.5em;
}
.prose h3,
.content-body h3 {
    font-size: 1.25rem;
    font-weight: bold;
    margin: 1em 0 0.5em;
}
.prose h4,
.content-body h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 1em 0 0.5em;
}
.prose ul, .prose ol,
.content-body ul, .content-body ol {
    padding-left: 1.5em;
    margin: 1em 0;
}
.prose li,
.content-body li {
    margin: 0.5em 0;
}
.prose table,
.content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}
.prose th, .prose td,
.content-body th, .content-body td {
    border: 1px solid #e5e7eb;
    padding: 0.5em 1em;
}
.prose th,
.content-body th {
    background: #f9fafb;
}
.prose blockquote,
.content-body blockquote {
    border-left: 4px solid var(--color-primary, #3B82F6);
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6b7280;
    font-style: italic;
}

/* ============================================================
   图片灯箱
   ============================================================ */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.lightbox-overlay.active { display: flex; }
.lightbox-content { max-width: 90vw; max-height: 90vh; position: relative; }
.lightbox-content img { max-width: 100%; max-height: 90vh; object-fit: contain; }
.lightbox-close { position: absolute; top: -40px; right: 0; color: white; font-size: 2rem; cursor: pointer; }
.lightbox-title { position: absolute; bottom: -40px; left: 0; right: 0; text-align: center; color: white; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); color: white; font-size: 3rem; cursor: pointer; padding: 1rem; }
.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }

/* ============================================================
   时间线（发展历程）
   ============================================================ */
.timeline-container { position: relative; }

@media (max-width: 767px) {
    .timeline-item::before {
        content: '';
        position: absolute;
        left: 20px; top: 0; bottom: 0;
        width: 2px;
        background: linear-gradient(to bottom, #e5e7eb, #d1d5db);
    }
    .timeline-item::after {
        content: '';
        position: absolute;
        left: 14px; top: 50%;
        transform: translateY(-50%);
        width: 14px; height: 14px;
        background: var(--color-primary);
        border-radius: 50%;
        border: 3px solid white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    .timeline-item > div:last-child {
        margin-left: 50px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}
.timeline-item .group:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}
.animate-float { animation: float 3s ease-in-out infinite; }

/* ============================================================
   Banner 轮播图（静态部分，动态高度在页面内联）
   ============================================================ */
.banner-swiper .swiper-slide { position: relative; }
.banner-swiper .swiper-slide > a { display: block; width: 100%; height: 100%; }
.banner-swiper .swiper-button-prev,
.banner-swiper .swiper-button-next { color: #fff; opacity: 0; transition: opacity 0.3s; }
.banner-swiper:hover .swiper-button-prev,
.banner-swiper:hover .swiper-button-next { opacity: 1; }
.banner-swiper .swiper-pagination-bullet { background: #fff; opacity: 0.5; width: 12px; height: 12px; }
.product-item { transition: opacity 0.3s ease; }
