/* shared.css - 全局共享样式 */

/* 1. 基础重置与排版 */
html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base font size */
}
body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans SC', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
*, *::before, *::after {
    box-sizing: border-box;
}
a {
    text-decoration: none;
    color: #007bff;
    transition: color 0.3s ease;
}
a:hover {
    color: #0056b3;
}
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-weight: 700;
    color: #2c3e50;
}
h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.75em; }
h4 { font-size: 1.5em; }
p {
    margin-top: 0;
    margin-bottom: 1em;
}
ul, ol {
    margin-top: 0;
    margin-bottom: 1em;
    padding-left: 20px;
}
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* 2. 布局容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}
.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
    padding: 0 15px;
    flex: 0 0 auto;
}
.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.333%; }
.col-3 { width: 25%; }

/* 3. 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1em;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 5px;
    transition: all 0.3s ease;
}
.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}
.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}
.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}
.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}
.btn-outline-primary {
    color: #007bff;
    background-color: transparent;
    border-color: #007bff;
}
.btn-outline-primary:hover {
    color: #fff;
    background-color: #007bff;
}

/* 4. 表单元素 */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
textarea,
select {
    display: block;
    width: 100%;
    padding: 10px 15px;
    font-size: 1em;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
input:focus, textarea:focus, select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 5. 辅助类 */
.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-light { background-color: #f8f9fa !important; }
.bg-primary { background-color: #007bff !important; }
.text-white { color: #fff !important; }

/* 6. Header/Footer Specific Styles (minimal, as detailed in header/footer HTML) */
.site-header {
    width: 100%;
    position: relative;
    z-index: 1000;
}
.site-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 60px 0;
    font-size: 0.95em;
}
.site-footer a {
    color: #ecf0f1;
    text-decoration: none;
}
.site-footer a:hover {
    color: #007bff;
}
.site-footer h3 {
    color: #fff;
    font-size: 1.3em;
    margin-bottom: 20px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}
.footer-col ul {
    list-style: none;
    padding: 0;
}
.footer-col ul li {
    margin-bottom: 10px;
}
.footer-col .social-icons a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-right: 10px;
    color: #fff;
    transition: background-color 0.3s ease;
}
.footer-col .social-icons a:hover {
    background-color: #007bff;
}
.newsletter-form {
    display: flex;
    margin-top: 15px;
}
.newsletter-form input {
    flex-grow: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border: none;
    padding: 10px 15px;
}
.newsletter-form button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.newsletter-form button:hover {
    background-color: #0056b3;
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    margin-top: 30px;
    text-align: center;
    font-size: 0.85em;
}
.back-to-top-btn {
    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 30px from the right */
    z-index: 99; /* Make sure it does not overlap */
    border: none; /* Remove borders */
    outline: none; /* Remove outline */
    background-color: #007bff; /* Set a background color */
    color: white; /* Text color */
    cursor: pointer; /* Add a mouse pointer on hover */
    padding: 15px; /* Some padding */
    border-radius: 10px; /* Rounded corners */
    font-size: 18px; /* Increase font size */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.back-to-top-btn:hover {
    background-color: #0056b3; /* Add a darker background on hover */
    transform: translateY(-2px);
}

/* 7. 响应式设计 */
@media (max-width: 992px) {
    .container {
        padding: 0 20px;
    }
    .main-header .nav-menu {
        /* Styles handled by JS toggle */
    }
    .main-header .container {
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .logo {
        flex-grow: 1;
        text-align: left;
    }
    .btn-contact {
        margin-left: auto; /* Push to right */
        order: 3; /* Place it after logo and toggle */
    }
    .nav-toggle {
        order: 2; /* Place toggle next to logo */
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-col .social-icons {
        margin-top: 20px;
    }
    .footer-col .social-icons a {
        margin: 0 5px;
    }
    .newsletter-form {
        max-width: 300px;
        margin: 15px auto 0;
    }
}
@media (max-width: 768px) {
    h1 { font-size: 2em; }
    h2 { font-size: 1.75em; }
    .col-md-6 { width: 50%; }
    .col-md-12 { width: 100%; }
    .btn-contact {
        display: none; /* Hide contact button on smaller screens if nav-toggle is primary action */
    }
    .main-header .container {
        justify-content: space-between; /* Re-adjust for logo and toggle */
    }
    .logo {
        width: auto;
        text-align: left;
        margin-bottom: 0;
    }
    .nav-toggle {
        margin-left: auto;
    }
}
@media (max-width: 576px) {
    h1 { font-size: 1.8em; }
    h2 { font-size: 1.5em; }
    .btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    .header-top {
        display: none; /* Hide top bar on very small screens */
    }
    .site-footer {
        padding: 40px 0;
    }
    .footer-bottom {
        padding-top: 20px;
        margin-top: 20px;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
