/* shared_css: Global Styles, Reset, Variables, and Base Typography */

/* CSS Reset / Normalize */
html {
    box-sizing: border-box;
    font-size: 16px; /* Base font size */
}
*, *:before, *:after {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Noto Sans 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;
}

/* Global Variables */
:root {
    --primary-color: #007bff; /* Blue */
    --secondary-color: #6c757d; /* Gray */
    --accent-color: #28a745; /* Green */
    --danger-color: #dc3545; /* Red */
    --warning-color: #ffc107; /* Yellow */
    --info-color: #17a2b8; /* Cyan */
    --light-color: #f8f9fa; /* Light Gray */
    --dark-color: #343a40; /* Dark Gray */
    --text-color: #333;
    --heading-color: #222;
    --border-color: #dee2e6;
    --box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05);
    --border-radius: 0.25rem;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --container-width: 1200px;
    --header-height: 70px;
    --footer-height: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Noto Sans SC', sans-serif;
    color: var(--heading-color);
    margin-bottom: var(--spacing-md);
    font-weight: 700;
    line-height: 1.2;
}
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: var(--spacing-md);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: #0056b3;
    text-decoration: underline;
}

ul, ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-xl);
}
li {
    margin-bottom: var(--spacing-sm);
}

blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    font-style: italic;
    color: #555;
}

/* Utility Classes */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-md { margin-top: var(--spacing-md); }
.mb-md { margin-bottom: var(--spacing-md); }
.py-lg { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    color: var(--light-color);
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.625rem 1.25rem; /* 10px 20px */
    font-size: 1rem;
    line-height: 1.5;
    border-radius: var(--border-radius);
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
}
.btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: var(--light-color);
    text-decoration: none;
}
.btn-outline-primary {
    color: var(--primary-color);
    background-color: transparent;
    border-color: var(--primary-color);
}
.btn-outline-primary:hover {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    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);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.sr-only-focusable:active,
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Header Specific Styles (from header_html, but can be shared) */
.header-container {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.logo a {
    font-size: 28px;
    font-weight: 700;
    color: var(--heading-color);
    display: flex;
    align-items: center;
}
.logo img {
    height: 40px;
    margin-right: 10px;
}
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
}
.nav-menu li a {
    color: var(--text-color);
    font-weight: 500;
    font-size: 16px;
    padding: 5px 0;
    transition: color 0.3s ease;
    position: relative;
}
.nav-menu li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}
.nav-menu li a:hover::after {
    width: 100%;
}
.nav-menu li a:hover {
    color: var(--primary-color);
}
.auth-buttons {
    display: flex;
    gap: 15px;
}
.auth-buttons .btn {
    padding: 8px 18px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
}
.auth-buttons .btn-login {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}
.auth-buttons .btn-login:hover {
    background-color: var(--primary-color);
    color: #fff;
}
.auth-buttons .btn-signup {
    background-color: var(--primary-color);
    color: #fff;
    border: 1px solid var(--primary-color);
}
.auth-buttons .btn-signup:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}
.hamburger-menu {
    display: none; /* Hidden on desktop */
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
}

/* Footer Specific Styles */
.footer-container {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: var(--spacing-xl) var(--spacing-md);
    font-size: 0.9rem;
    margin-top: var(--spacing-xl);
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    max-width: var(--container-width);
    margin: 0 auto var(--spacing-xl) auto;
}
.footer-section h3 {
    color: #fff;
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
}
.footer-section p {
    color: #ccc;
    margin-bottom: var(--spacing-sm);
}
.footer-section ul {
    list-style: none;
    padding: 0;
}
.footer-section ul li a {
    color: #ccc;
    display: block;
    padding: var(--spacing-xs) 0;
}
.footer-section ul li a:hover {
    color: #fff;
    text-decoration: underline;
}
.social-links a {
    color: #fff;
    font-size: 1.5rem;
    margin-right: var(--spacing-md);
    transition: color 0.3s ease;
}
.social-links a:hover {
    color: var(--primary-color);
}
.newsletter-signup {
    margin-top: var(--spacing-md);
}
.newsletter-signup h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
}
.newsletter-signup form {
    display: flex;
}
.newsletter-signup input[type="email"] {
    flex-grow: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border: 1px solid #555;
    background-color: #444;
    color: #eee;
}
.newsletter-signup input[type="email"]::placeholder {
    color: #aaa;
}
.newsletter-signup button {
    background-color: var(--primary-color);
    color: #fff;
    border: 1px solid var(--primary-color);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.newsletter-signup button:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}
.footer-bottom {
    max-width: var(--container-width);
    margin: 0 auto;
    border-top: 1px solid #444;
    padding-top: var(--spacing-md);
    text-align: center;
    color: #aaa;
    font-size: 0.85rem;
}
.footer-bottom a {
    color: var(--primary-color);
}
.footer-bottom a:hover {
    color: #fff;
}

#back-to-top {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    transition: background-color 0.3s ease, opacity 0.3s ease;
    opacity: 0; /* Hidden by default */
    visibility: hidden;
    z-index: 999;
}
#back-to-top.show {
    opacity: 1;
    visibility: visible;
}
#back-to-top:hover {
    background-color: #0056b3;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .nav-menu, .auth-buttons {
        display: none; /* Hide on smaller screens */
    }
    .hamburger-menu {
        display: block; /* Show hamburger */
    }
    .header-container {
        justify-content: space-between;
    }
    .footer-content {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
        text-align: center;
    }
    .footer-section ul {
        text-align: center;
        padding-left: 0;
    }
    .footer-section ul li a {
        display: inline-block;
        margin: 0 var(--spacing-sm);
    }
    .social-links {
        margin-top: var(--spacing-md);
    }
    .social-links a {
        margin: 0 var(--spacing-sm);
    }
    .newsletter-signup form {
        justify-content: center;
    }
    .newsletter-signup input[type="email"] {
        max-width: 250px;
    }
    #back-to-top {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    .header-container {
        padding: var(--spacing-xs) var(--spacing-sm);
        height: 60px;
    }
    .logo a {
        font-size: 24px;
    }
    .logo img {
        height: 35px;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
