/**
 * HBSBT·ERP 官网样式 (Tabler + Custom)
 * 对应 index.html
 */

/* ==================== Variables ==================== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-accent: #eff6ff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition-normal: 0.3s ease;
}

/* 暗色主题变量 */
[data-bs-theme="dark"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --bg-white: #0f172a;
    --bg-light: #1e293b;
    --bg-accent: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* ==================== Base ==================== */

a {
    text-decoration: none;
    color: inherit;
}
a:hover {
    text-decoration: none;
    color: inherit;
}

/* ==================== Loading Screen ==================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition:
        opacity 0.5s ease,
        visibility 0.5s ease;
}
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-accent);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.site-navbar {
    transition: all var(--transition-normal);
    /* 保持对 Tabler 核心样式的尊重，尽量只做补充而不覆盖布局与配色 */
}
.site-navbar.scrolled {
    /* 只做轻量视觉增强，避免与 Tabler 的默认行为冲突 */
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}
.site-nav-link {
    /* 不要覆盖 Tabler 的配色和间距，仅添加轻量装饰与强调 */
    position: relative;
    font-weight: 600;
}
.site-nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}
.site-nav-link:hover::after,
.site-nav-link.active::after {
    transform: scaleX(1);
}

/* ==================== Hero Section ==================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    padding-bottom: 60px;
    background: radial-gradient(circle at top right, var(--bg-accent) 0%, var(--bg-white) 100%);
    position: relative;
    overflow: hidden;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--bg-accent);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2rem;
}
.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.hero-title {
    font-size: clamp(2rem, 5vw, 4rem); /* Adjusted clamp for better fit */
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #60a5fa 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}
.hero-highlight {
    color: var(--primary);
    font-weight: 600;
}

/* Highlight Tags */
.highlight-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    background: var(--bg-white);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    margin: 0 6px 12px;
    white-space: nowrap;
}
.highlight-tag:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--primary);
}

/* Network Map Container */
.network-map-container {
    height: 888px;
}

[data-bs-theme="dark"] .network-map-container {
    background: var(--bg-light);
}

/* ==================== Section Common ==================== */
.section {
    padding: 5rem 0;
}
.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}
.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--bg-accent);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}
.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.3;
}
.section-desc {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* ==================== Feature Cards ==================== */
.feature-card {
    position: relative;
    padding: 1.25rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all var(--transition-normal);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.feature-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}
.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}
.feature-card:hover::before {
    transform: scaleX(1);
}
.feature-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.feature-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-accent);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 0 !important;
    color: var(--primary);
    flex-shrink: 0;
}
.feature-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0 !important;
    color: var(--text-primary);
}
.feature-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-grow: 1;
    margin-bottom: 1rem;
    line-height: 1.5;
}
.feature-tag {
    display: inline-block;
    padding: 2px 10px;
    background: var(--bg-accent);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    align-self: flex-start;
}

/* Pricing descriptions: keep equal height for visual balance */
.pricing-desc {
    min-height: 3.6em; /* roughly 2 lines of text at default line-height */
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ==================== Compliance ==================== */
.compliance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.compliance-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    height: 100%;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.compliance-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.compliance-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.compliance-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-accent);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary);
}

.compliance-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.compliance-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.compliance-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.compliance-item:last-child {
    border-bottom: none;
}

.compliance-check {
    color: #10b981;
    font-weight: bold;
    flex-shrink: 0;
}

.compliance-item span:not(.compliance-check) {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 992px) {
    .compliance-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ==================== Pricing/Consult ==================== */
.consult-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    height: 100%;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.consult-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}
.consult-step {
    margin-top: auto;
    padding: 8px 16px;
    background: var(--bg-accent);
    color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    display: inline-block;
}

/* ==================== Showcase Section (Swiper) ==================== */
.showcase-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
}
.showcase-swiper {
    width: 100%;
    padding: 40px 0 60px;
}
.showcase-swiper .swiper-slide {
    width: 70%;
    max-width: 800px;
    aspect-ratio: 16 / 10;
    opacity: 0.4;
    transition: opacity 0.3s;
}
.showcase-swiper .swiper-slide-active {
    opacity: 1;
}
.showcase-card {
    background: none;
    padding: 0;
    text-align: center;
    height: 100%;
    display: block;
    border-radius: 16px;
    overflow: hidden;
    border: 8px solid var(--bg-white);
    box-shadow: var(--shadow-lg);
    position: relative;
}
.showcase-image-wrapper {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: var(--bg-white);
}
.showcase-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Swiper Navigation Customization */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-white);
    border: none;
    color: var(--primary);
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.carousel-prev::after,
.carousel-next::after {
    font-size: 20px;
    font-weight: bold;
}
.carousel-prev {
    left: 10px;
}
.carousel-next {
    right: 10px;
}
.carousel-prev:hover,
.carousel-next:hover {
    background: var(--primary);
    color: var(--bg-white);
}

.swiper-pagination-bullet-active {
    background: var(--primary);
}
.carousel-prev {
    left: -70px;
}
.carousel-next {
    right: -70px;
}
.carousel-prev:hover,
.carousel-next:hover {
    color: var(--primary-dark);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.carousel-prev::after,
.carousel-next::after {
    content: "";
    width: 12px;
    height: 12px;
    border-top: 3px solid currentColor;
    border-left: 3px solid currentColor;
    display: block;
}
.carousel-prev::after {
    transform: rotate(-45deg);
    margin-left: 4px;
}
.carousel-next::after {
    transform: rotate(135deg);
    margin-right: 4px;
}

/* ==================== Pricing Cards (Bottom) ==================== */
.pricing-section {
    padding: 100px 0 150px; /* 增加底部间距 */
    background: var(--bg-light);
}
.pricing-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    text-align: left;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.pricing-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}
.pricing-card.featured {
    border-color: var(--primary);
    background: var(--bg-white);
    transform: scale(1.05);
    z-index: 2;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}
.pricing-card.featured::after {
    content: "推荐方案";
    position: absolute;
    top: 12px;
    right: -35px;
    background: var(--primary);
    color: white;
    padding: 4px 40px;
    font-size: 12px;
    font-weight: 700;
    transform: rotate(45deg);
}
.pricing-header {
    margin-bottom: 30px;
    text-align: center;
}

.pricing-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.pricing-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
}
.pricing-features {
    list-style: none;
    margin-bottom: 40px;
    flex-grow: 1;
    padding: 0;
}
.pricing-feature-group {
    font-weight: 700;
    color: var(--text-primary);
    margin: 1rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.pricing-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}
.pricing-feature::before {
    content: "✓";
    color: var(--primary);
    font-weight: bold;
}
.pricing-feature-x::before {
    content: "✗";
    color: #ef4444; /* 红色表示负面特性 */
}

@media (max-width: 992px) {
    .pricing-card {
        width: 100%;
        max-width: 400px;
        margin: 0 !important;
        transform: none !important;
        box-shadow: var(--shadow-md) !important;
        padding: 24px 20px; /* reduce padding on smaller screens to avoid overflow */
    }
    .pricing-card.featured {
        transform: none !important; /* disable scaling on medium/small screens */
        z-index: 5;
    }
}

/* Further small-screen fixes: hide rotated badge and ensure featured card doesn't overflow */
@media (max-width: 576px) {
    .pricing-card.featured::after {
        display: none !important;
    }
    .pricing-card {
        padding: 18px !important;
        border-radius: 16px;
    }
}

@media (max-width: 1360px) {
    .carousel-prev {
        left: 10px;
    }
    .carousel-next {
        right: 10px;
    }
}

@media (max-width: 768px) {
    .showcase-card {
        padding: 30px 20px;
    }
    .showcase-slides-wrapper {
        border-width: 8px;
        border-radius: 20px;
    }
    .carousel-prev,
    .carousel-next {
        display: none;
    }
    .network-map-container {
        height: 300px;
    }
}

/* ==================== Dark Theme Overrides ==================== */
[data-bs-theme="dark"] {
    /* 基础背景适配 */
    body {
        background-color: var(--bg-white);
        color: var(--text-primary);
    }

    .bg-light {
        background-color: var(--bg-light) !important;
    }

    /* 渐变背景适配 */
    .gradient-text {
        background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    /* 卡片与折叠面板适配 */
    .feature-card,
    .consult-card,
    .pricing-card,
    .accordion-item {
        background: var(--bg-light);
        border-color: var(--border);
    }

    .accordion-button {
        background-color: var(--bg-light);
        color: var(--text-primary);
    }

    .accordion-button:not(.collapsed) {
        background-color: var(--bg-accent);
        color: var(--primary);
    }

    /* 导航栏适配 */
    .site-navbar {
        /* 仅在 site-navbar 上做暗色主题补充，避免全面覆盖 Tabler 的暗色规则 */
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border);
    }

    .site-navbar.scrolled {
        background: rgba(15, 23, 42, 0.98);
    }

    /* 页脚适配 */
    .footer {
        background: var(--bg-white);
        border-top: 1px solid var(--border);
    }
}

/* ==================== Animations ==================== */
[x-cloak] {
    display: none !important;
}
.animate-up {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.6s ease-out,
        transform 0.6s ease-out;
}
.animate-up.visible {
    opacity: 1;
    transform: translateY(0);
}
