/* shared_css: Reset and base styles for the entire website */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #333;
    --bg-color: #ffffff;
    --border-color: #dee2e6;
    --font-family-base: 'Noto Sans SC', sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;
    --container-max-width: 1200px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 48px;
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 100%; /* Base for rem units */
}

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

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

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

p {
    margin-bottom: var(--spacing-md);
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    line-height: 1.2;
    color: var(--dark-color);
}

h1 { font-size: 2.5rem; margin-bottom: var(--spacing-lg); }
h2 { font-size: 2rem; margin-bottom: var(--spacing-md); }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

ul, ol {
    list-style-position: inside;
    margin-bottom: var(--spacing-md);
    padding-left: 20px;
}

ul ul, ol ol {
    margin-left: var(--spacing-md);
    margin-bottom: 0;
}

button, input[type="submit"], input[type="button"] {
    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.5rem 1rem;
    font-size: var(--font-size-base);
    line-height: 1.5;
    border-radius: var(--border-radius-sm);
    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;
}

button:hover, input[type="submit"]:hover, input[type="button"]:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

button:focus, input:focus, textarea:focus, select:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Accessibility: Visually hidden but accessible */
.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;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.skip-link {
    position: absolute;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 9999;
}

.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    padding: var(--spacing-sm);
    background-color: var(--primary-color);
    color: var(--light-color);
    text-decoration: none;
    text-align: center;
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
    border-radius: var(--border-radius-sm);
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.py-1 { padding-top: var(--spacing-xs); padding-bottom: var(--spacing-xs); }
.py-2 { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-3 { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    .container {
        padding: 0 var(--spacing-sm);
    }
    button, input[type="submit"], input[type="button"] {
        padding: 0.4rem 0.8rem;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    .container {
        padding: 0 var(--spacing-xs);
    }
}

/* Footer specific styles integrated into shared_css for consistency */
.footer-main {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: var(--spacing-xl) 0;
    margin-top: auto; /* Pushes footer to the bottom */
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-main a {
    color: #a0d9ff;
    text-decoration: none;
}

.footer-main a:hover {
    color: #d0eaff;
    text-decoration: underline;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.footer-section h3 {
    color: var(--light-color);
    margin-bottom: var(--spacing-md);
    font-size: 1.2rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: var(--spacing-sm);
}

.social-media a {
    display: inline-flex;
    align-items: center;
    margin-right: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    color: var(--light-color);
    font-size: 1rem;
}

.social-media a img {
    margin-right: var(--spacing-xs);
    filter: invert(1);
}

.newsletter-form {
    display: flex;
    margin-top: var(--spacing-sm);
}

.newsletter-form input[type="email"] {
    flex-grow: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border: 1px solid #555;
    background-color: #444;
    color: white;
}

.newsletter-form input[type="email"]::placeholder {
    color: #bbb;
}

.newsletter-form button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    white-space: nowrap;
}

.newsletter-disclaimer {
    font-size: 0.8rem;
    color: #ccc;
    margin-top: var(--spacing-sm);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    border-top: 1px solid #444;
    color: #ccc;
}

.footer-bottom p {
    margin-bottom: var(--spacing-sm);
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-section ul {
        padding: 0;
    }
    .social-media {
        justify-content: center;
        display: flex;
        flex-wrap: wrap;
    }
    .newsletter-form {
        flex-direction: column;
        align-items: stretch;
    }
    .newsletter-form input[type="email"], .newsletter-form button {
        border-radius: var(--border-radius-sm);
        margin-bottom: var(--spacing-sm);
    }
    .newsletter-form button {
        margin-left: 0;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
