/* 
 * Main Styles - Bootstrap 5 Optimized
 * 其他页面通用样式 - 符合Bootstrap 5规范
 */

/* Common Card Hover Effect */
.card-hover-effect {
    transition: var(--bs-transition);
    border: 1px solid #f3f3f3;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
}

.card-hover-effect:hover {
    transform: translateY(-8px);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
    border-color: #8ab5f8;
}

/* Banner Text Animation */
.slide_in_left {
    animation: slideInLeft 1.2s ease-out forwards;
    opacity: 0;
    transform: translateX(-200px);
}

.slide_in_right {
    animation: slideInRight 1.2s ease-out 0.5s forwards;
    opacity: 0;
    transform: translateX(200px);
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-200px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(200px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* About Us Page */
.page_banner {
    height: 60vh;
    min-height: 400px;
    overflow: hidden;
}

.banner_overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.banner_title {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.banner_title.text-start {
    padding-left: 5rem;
}

.banner_title.text-end {
    padding-right: 5rem;
}

.section_divider {
    width: 4rem;
    height: 3px;
    border-radius: 2px;
}

.about_content_section {
    background-image: url('../images/about1_bg.jpg');
    background-repeat: no-repeat;
}

.about_content_section .container {
    position: relative;
    z-index: 2;
}

.content_text p {
    text-indent: 2em;
}

.about_content_section img:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.company_features_section {
    background: var(--bs-light, #f8f9fa);
}

.feature_card {
    background: var(--bs-body-bg, #ffffff);
    transition: var(--bs-transition, all 0.15s ease-in-out);
    border: 1px solid var(--bs-border-color, #dee2e6);
}

.feature_card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    border-color: var(--bs-primary, #0d6efd);
}

.feature_card:hover i {
    transform: scale(1.1);
}

.about_content_section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.breadcrumb_section {
    background: var(--bs-light, #f8f9fa);
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

.breadcrumb-item,
.breadcrumb-item a,
.breadcrumb-item.active {
    color: var(--bs-gray-600, #6c757d);
}

.breadcrumb-item a:hover {
    color: var(--bs-primary, #0d6efd);
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .page_banner {
        height: 50vh;
        min-height: 350px;
    }

    .banner_title {
        font-size: 2.5rem;
    }
}

@media (max-width: 767.98px) {
    .page_banner {
        height: 40vh;
        min-height: 300px;
    }

    .banner_title {
        font-size: 1.5rem;
    }

    .banner_title.text-start {
        padding-left: 0.125rem;
    }

    .banner_title.text-end {
        padding-right: 0.125rem;
    }

    .slide_in_left,
    .slide_in_right {
        animation-duration: 0.8s;
    }

    @keyframes slideInLeft {
        0% {
            opacity: 0;
            transform: translateX(-100px);
        }

        100% {
            opacity: 1;
            transform: translateX(0);
        }
    }

    @keyframes slideInRight {
        0% {
            opacity: 0;
            transform: translateX(100px);
        }

        100% {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

/* Dark Theme */
[data-theme="dark"] {
    .about_content_section {
        background: var(--bs-gray-900, #212529);
    }

    .content_text {
        color: var(--bs-gray-300, #adb5bd) !important;
    }

    .company_features_section {
        background: var(--bs-gray-900, #212529) !important;
    }

    .feature_card {
        background: var(--bs-gray-700, #495057) !important;
        color: var(--bs-light, #f8f9fa) !important;
        border-color: var(--bs-gray-600, #6c757d) !important;
    }

    .breadcrumb_section {
        background: var(--bs-gray-800, #343a40) !important;
        border-bottom-color: var(--bs-gray-700, #495057) !important;
    }

    .breadcrumb-item,
    .breadcrumb-item a,
    .breadcrumb-item.active {
        color: var(--bs-gray-300, #adb5bd) !important;
    }

    .breadcrumb-item a:hover {
        color: var(--bs-primary, #0d6efd) !important;
    }
}

/* Ti
meline Page Styles */
.timeline_section {
    /* background: linear-gradient(135deg, var(--bs-primary, #0d6efd) 0%, var(--bs-purple, #6f42c1) 100%); */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.timeline_section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.timeline_section .container {
    position: relative;
    z-index: 2;
}

.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 3px;
    height: 100%;
    background: var(--bs-primary, #0d6efd);
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline_item {
    position: relative;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.timeline_item.animate {
    opacity: 1;
    transform: translateY(0);
}

.timeline_content {
    position: relative;
    width: calc(50% - 30px);
    padding: 1.5rem;
    background: rgba(var(--bs-body-bg-rgb, 255, 255, 255), 0.95);
    border-radius: var(--bs-border-radius-lg, 0.5rem);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--bs-body-bg-rgb, 255, 255, 255), 0.2);
    transition: transform 0.3s ease;
}

.timeline_content:hover {
    transform: translateY(-5px);
}

.timeline_item:nth-child(odd) .timeline_content {
    margin-left: auto;
}

.timeline_content::after {
    content: '';
    position: absolute;
    top: 25px;
    width: 24px;
    height: 24px;
    background: rgba(var(--bs-body-bg-rgb, 255, 255, 255), 0.95);
    transform: rotate(45deg);
    border: 1px solid rgba(var(--bs-body-bg-rgb, 255, 255, 255), 0.2);
}

.timeline_item:nth-child(odd) .timeline_content::after {
    left: -12px;
    border-right: none;
    border-bottom: none;
}

.timeline_item:nth-child(even) .timeline_content::after {
    right: -12px;
    border-left: none;
    border-bottom: none;
}

.timeline_dot {
    position: absolute;
    top: 25px;
    left: 50%;
    width: 16px;
    height: 16px;
    background: var(--bs-primary, #0d6efd);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 2;
    border: 4px solid var(--bs-body-bg, #ffffff);
    box-shadow: 0 0 0 4px var(--bs-primary, #0d6efd);
}

.timeline_date {
    position: absolute;
    top: 15px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bs-body-bg, #ffffff);
    background: var(--bs-primary, #0d6efd);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    white-space: nowrap;
}

.timeline_item:nth-child(odd) .timeline_date {
    left: calc(50% - 125px);
}

.timeline_item:nth-child(even) .timeline_date {
    right: calc(50% - 125px);
}

.timeline_content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--bs-body-color, #212529);
}

.history-list {
    display: none;
}

/* Timeline Responsive Design */
@media (max-width: 991.98px) {
    .timeline::before {
        left: 30px;
    }

    .timeline_content {
        width: calc(100% - 60px);
        margin-left: 60px !important;
    }

    .timeline_content::after {
        left: -12px !important;
        right: auto !important;
        border-right: none !important;
        border-bottom: none !important;
    }

    .timeline_dot {
        left: 30px;
    }

    .timeline_date {
        left: 60px !important;
        right: auto !important;
    }
}

@media (max-width: 767.98px) {
    .timeline_content {
        padding: 1.25rem;
        width: calc(100% - 50px);
        margin-left: 50px !important;
    }

    .timeline_dot {
        left: 25px;
    }

    .timeline::before {
        left: 25px;
    }

    .timeline_date {
        left: 50px !important;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Timeline Dark Theme */
[data-theme="dark"] {
    .timeline_section {
        background: linear-gradient(135deg, var(--bs-primary, #0d6efd) 0%, var(--bs-purple, #6f42c1) 100%);
    }

    .timeline_section::before {
        background: rgba(0, 0, 0, 0.3);
    }

    .timeline_content {
        background: rgba(var(--bs-gray-800-rgb, 52, 58, 64), 0.9);
        border-color: rgba(var(--bs-gray-700-rgb, 73, 80, 87), 0.3);
        color: var(--bs-light, #f8f9fa);
    }

    .timeline_content::after {
        background: rgba(var(--bs-gray-800-rgb, 52, 58, 64), 0.9);
        border-color: rgba(var(--bs-gray-700-rgb, 73, 80, 87), 0.3);
    }

    .timeline_content h3 {
        color: var(--bs-light, #f8f9fa);
    }

    .timeline_dot {
        border-color: var(--bs-gray-800, #343a40);
    }
}

/* Company Culture Page Styles */
.culture-icon-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
    transition: var(--bs-transition);
}

.culture-icon-circle i {
    font-size: 2rem;
    transition: transform 0.3s ease;
}

.culture-card-hover {
    transition: var(--bs-transition);
    position: relative;
}

.culture-card-hover:hover {
    transform: translateY(-8px);
}

.culture-card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--bs-primary), var(--bs-info));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.culture-card-hover:hover::before {
    transform: scaleX(1);
}

.culture-card-hover:hover .culture-icon-circle i {
    transform: scale(1.1);
}

/* Database CSS Classes Compatibility */
.culture_title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 1rem;
}

.culture_description {
    color: var(--bs-gray-600);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 767.98px) {
    .culture-icon-circle {
        width: 60px;
        height: 60px;
    }

    .culture-icon-circle i {
        font-size: 1.5rem;
    }

    .culture_title {
        font-size: 1.25rem;
    }
}

/* Dark Theme Support */
[data-theme="dark"] {
    .culture_title {
        color: var(--bs-light);
    }

    .culture_description {
        color: var(--bs-gray-300);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    .culture-card-hover,
    .culture-icon-circle i,
    .culture-card-hover::before {
        transition: none;
    }

    .culture-card-hover:hover {
        transform: none;
    }
}

/* Simple Gallery Styles */
.gallery-item {
    position: relative;
    overflow: hidden;
    height: 100%;
    border-radius: var(--bs-border-radius);
    transition: var(--bs-transition);
    display: block;
    text-decoration: none;
    background: var(--bs-card-bg);
    color: inherit;
    box-shadow: 0 0rem 1rem rgba(0, 0, 0, 0.1);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    /* height: 300px; */
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    padding: 1.5rem;
}

/* Responsive */
/* @media (max-width: 767.98px) {
    .gallery-item img {
        height: 200px;
    }
} */

/* Product Card Styles */

.product-img {
    overflow: hidden;
    position: relative;
    border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0;
}

.product-img img {
    transition: transform 0.4s ease;
    transform-origin: center bottom;
}

.product-card:hover .product-img img {
    transform: scale(1.02);
    animation: shake 0.6s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: rotate(-2deg) scale(1.02);
    }

    20% {
        transform: rotate(1deg) scale(1.02);
    }

    40% {
        transform: rotate(-1deg) scale(1.02);
    }

    60% {
        transform: rotate(0.5deg) scale(1.02);
    }

    80% {
        transform: rotate(-0.3deg) scale(1.02);
    }

    100% {
        transform: rotate(0deg) scale(1.02);
    }
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 128, 0, 0.03);
    /* transition: background 0.3s ease; */
}

.product-card:hover .product-overlay {
    background: rgba(0, 128, 0, 0);
}

.product-content {
    display: flex;
    flex-direction: column;
}

.product-actions {
    margin-top: auto;
}

/* Product Detail Gallery Styles */
.product-gallery {
    --gallery-height: 450px;
}

.main-image-container,
.thumbnail-container {
    height: var(--gallery-height);
    background: var(--bs-gray-50);
}

.main-image,
.product-content img {
    cursor: pointer;
    transition: transform var(--bs-transition-duration, 0.15s) ease;
}

.main-image {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}

.main-image:hover,
.product-content img:hover {
    transform: scale(1.02);
}

.thumbnail-item {
    border: var(--bs-border-width, 2px) solid var(--bs-border-color);
    transition: border-color var(--bs-transition-duration, 0.15s) ease;
    cursor: pointer;
}

.thumbnail-item.active,
.thumbnail-item:hover {
    border-color: var(--bs-primary);
}

/* Table Styles */
.product-content table {
    border-collapse: collapse;
    border: 1px solid var(--bs-border-color);
}

.product-content table th,
.product-content table td {
    border: 1px solid var(--bs-border-color);
    font-family: 'Times New Roman', Times, serif;
    text-align: center;
    white-space: normal;
    word-break: break-word;
}

.product-content table th p,
.product-content table td p {
    margin-bottom: 0;
}

/* Responsive Design for Product Gallery */
@media (max-width: 991.98px) {
    .product-gallery {
        --gallery-height: 350px;
    }

    .thumbnail-container {
        height: auto;
        max-height: 80px;
    }

    .thumbnail-item {
        width: 72px;
        height: 54px;
        flex-shrink: 0;
    }
}

@media (max-width: 767.98px) {
    .product-gallery {
        --gallery-height: 280px;
    }

    .thumbnail-item {
        width: 60px;
        height: 45px;
    }
}

/* Dark Theme Support */
[data-bs-theme="dark"] .main-image-container,
[data-bs-theme="dark"] .thumbnail-container {
    background: var(--bs-gray-700);
}

[data-bs-theme="dark"] .thumbnail-item {
    border-color: var(--bs-gray-600);
}

/* Advantage Cards */
.advantage-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
    border-radius: 50%;
    flex-shrink: 0;
}

.advantage-icon img {
    width: 50px;
    height: 50px;
    filter: brightness(0) invert(1);
}

@media (max-width: 767.98px) {
    .advantage-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }

    .advantage-icon img {
        width: 35px;
        height: 35px;
    }
}

/* Partners */
.partnership-stats {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-info) 100%);
    color: white
}

.stat-item {
    text-align: center;
    padding: 2rem 1rem
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    line-height: 1;
    margin-bottom: .5rem
}

.stat-label {
    font-size: 1rem;
    opacity: .9
}

@media (max-width:767.98px) {
    .stat-number {
        font-size: 2.5rem
    }

    .stat-item {
        padding: 1.5rem .5rem
    }
}

/* Partners Section - 与home.css一致 */
.partner-card {
    height: 120px;
    transition: var(--bs-transition, all 0.15s ease-in-out);
    border: var(--bs-border-width, 1px) solid var(--bs-border-color, #dee2e6)
}

.partner-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important
}

@media (min-width:992px) {
    .partners-section .partner-item {
        flex: 0 0 20%;
        max-width: 20%
    }
}

.partner-logo {
    max-height: 6rem;
    width: auto
}

.partner-title {
    font-size: .875rem;
    margin-top: .5rem
}

/* Service Content with Map Background */
.service-content-bg {
    background-image: url('../images/map.png');
    background-repeat: no-repeat;
    background-position: top;
    background-size: contain;
    position: relative
}

.service-content-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    z-index: 1
}

.service-content-bg p {
    position: relative;
    z-index: 2
}

[data-theme="dark"] .service-content-bg::before {
    background: rgba(33, 37, 41, 0.9)
}

/* News content */
.news-image {
    height: 200px
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease
}

.card-hover-effect:hover .news-image img {
    transform: scale(1.05)
}

.news-title,
.news-summary {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.text-body:hover {
    color: var(--bs-primary) !important
}

@media (max-width:767.98px) {
    .news-image {
        height: 180px
    }
}

/* Guestbook Page */
.guestbook-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.guestbook-page .page_banner {
    z-index: 1;
}

.floating-icon {
    position: fixed;
    top: 50%;
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.3);
    /* z-index: 2; */
    animation: float 3s ease-in-out infinite;
    opacity: 0.2;
}

.icon-left {
    left: 5%;
    animation-delay: 0s;
}

.icon-right {
    right: 5%;
    animation-delay: 1.5s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* 表单样式 */
.guestbook-form .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.guestbook-form .btn-primary {
    border-radius: 50px;
    padding: 12px 60px;
    transition: all 0.3s ease;
}

.guestbook-form .btn-primary:hover {
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
}

/* 修改 invalid-feedback 样式，使其占用固定位置 */
.invalid-feedback {
    display: none;
    height: 24px;
    min-height: 24px;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    position: relative;
    left: 40px;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.2s linear;
}

.is-invalid~.invalid-feedback {
    visibility: visible;
    opacity: 1;
}

/* 表单元素样式 */
.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
}

.required-star {
    color: #dc3545;
}

.form-control {
    border-radius: 8px;
    padding: 10px 15px;
}

.form-text {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
}

.alert {
    border-radius: 8px;
    font-weight: 500;
}

.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

/* map page */
.map-container {
    position: relative;
    width: 100%;
    height: 580px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #ccc;
}

/* 全屏控制按钮样式 */
#mapFullscreenControl {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: none;
}

.map-fullscreen-btn {
    display: block;
}

.map-fullscreen .map-fullscreen-btn {
    display: none;
}

.map-fullscreen #mapFullscreenControl {
    display: block;
}

.contact-info ul {
    padding-left: 0;
    list-style: none;
    line-height: 3em;
}

.contact-info ul li i {
    width: 20px;
    height: 20px;
    text-align: center;
}

/* Footer Section */
.footer-section {
    background: var(--bs-gray-200);
    border-top: 2px solid var(--bs-gray-300);
}

.footer-link {
    color: var(--bs-gray-700);
    text-decoration: none;
    transition: var(--bs-transition);
}

.footer-link:hover {
    color: var(--bs-primary);
}

/* Dark Theme */
[data-theme="dark"] .footer-section {
    background: var(--bs-gray-800);
    border-top-color: var(--bs-gray-700);
}

[data-theme="dark"] .footer-link {
    color: var(--bs-gray-300);
}