/* Shared CSS for AI Solutions Platform */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --text-color: #212529;
    --link-color: #007bff;
    --link-hover-color: #0056b3;
    --border-color: #dee2e6;
    --font-family-base: 'Roboto', sans-serif;
    --font-family-heading: 'Roboto', sans-serif;
    --header-height: 70px;
    --footer-height: auto;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family-base);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Global Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 500;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.3rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: var(--link-hover-color);
    border-color: var(--link-hover-color);
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

.btn-accent {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-accent:hover {
    background-color: #218838;
    border-color: #218838;
}

/* Layout & Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.main-content {
    flex: 1;
    padding-top: var(--header-height);
}

/* Header Styles */
.main-header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
}

.logo-img {
    height: 40px;
    margin-right: 10px;
}

.navbar-toggler {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.toggler-icon {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--dark-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.navbar-collapse {
    display: flex;
    align-items: center;
    flex-grow: 1;
    justify-content: flex-end;
}

.navbar-nav {
    display: flex;
    margin-right: 20px;
}

.nav-item {
    margin-left: 25px;
}

.nav-link {
    color: var(--dark-color);
    font-weight: 500;
    padding: 10px 0;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.navbar-actions .btn {
    margin-left: 10px;
}

/* Footer Styles */
.main-footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 60px 0 30px;
    font-size: 0.95rem;
    margin-top: auto;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    margin-bottom: 40px;
}

.footer-heading {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-section p {
    color: #cccccc;
    line-height: 1.8;
}

.footer-section ul {
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #cccccc;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.social-links {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.social-icon {
    color: #cccccc;
    font-size: 1.3rem;
    transition: color 0.3s ease, transform 0.2s ease;
}

.social-icon:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-section.contact p {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.footer-section.contact p i {
    margin-right: 10px;
    font-size: 1.1rem;
    margin-top: 4px;
    color: var(--primary-color);
}

.newsletter-form {
    margin-top: 20px;
    display: flex;
    border-radius: 5px;
    overflow: hidden;
}

.newsletter-form input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #555;
    border-right: none;
    border-radius: 5px 0 0 5px;
    background-color: #444;
    color: #fff;
    outline: none;
}

.newsletter-form input::placeholder {
    color: #aaa;
}

.newsletter-form .btn-subscribe {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: #fff;
    padding: 12px 20px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter-form .btn-subscribe:hover {
    background-color: var(--link-hover-color);
    border-color: var(--link-hover-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #444;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

.footer-bottom p {
    margin-bottom: 8px;
    color: #cccccc;
}

.made-with-love .heart-icon {
    color: #e74c3c;
    margin: 0 5px;
}

/* Back to Top Button */
#back-to-top {
    display: none; /* Hidden by default */
    position: fixed; /* Fixed/sticky position */
    bottom: 30px; /* Place the button at the bottom of the page */
    right: 30px; /* Place the button at the right */
    z-index: 99; /* Make sure it does not overlap */
    border: none; /* Remove borders */
    outline: none; /* Remove outline */
    background-color: var(--primary-color); /* Set a background color */
    color: white; /* Text color */
    cursor: pointer; /* Add a mouse pointer on hover */
    padding: 15px; /* Some padding */
    border-radius: 50%; /* Rounded corners */
    font-size: 18px; /* Increase font size */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background-color 0.3s, transform 0.2s;
}

#back-to-top:hover {
    background-color: var(--link-hover-color);
    transform: translateY(-3px);
}

/* Responsive Design */
@media (max-width: 992px) {
    .navbar-collapse {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: #ffffff;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        padding-bottom: 20px;
        animation: slideDown 0.3s ease-out forwards;
    }

    .navbar-collapse.show {
        display: flex;
    }

    .navbar-nav {
        flex-direction: column;
        width: 100%;
        margin-right: 0;
        padding: 20px 0;
    }

    .nav-item {
        margin: 0;
        text-align: center;
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }

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

    .nav-link {
        display: block;
        padding: 15px 20px;
        font-size: 1.1rem;
    }

    .nav-link::after {
        height: 3px;
        bottom: -5px;
        left: 50%;
        transform: translateX(-50%);
    }

    .nav-link:hover::after {
        width: 60%;
    }

    .navbar-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 20px;
        width: 100%;
    }

    .navbar-actions .btn {
        margin-left: 0;
        width: 100%;
    }

    .navbar-toggler {
        display: block;
    }

    .navbar-toggler.active .toggler-icon:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .navbar-toggler.active .toggler-icon:nth-child(2) {
        opacity: 0;
    }

    .navbar-toggler.active .toggler-icon:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-section.contact p {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.bg-dark { background-color: var(--dark-color); }
.text-white { color: #fff; }
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
