/* Basic Reset & Typography */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --text-color: #333;
    --heading-color: #222;
    --background-color: #f8f9fa;
    --light-gray: #e9ecef;
    --border-color: #dee2e6;
    --font-family-sans: 'Arial', sans-serif;
    --font-family-serif: 'Georgia', serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

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

a:hover {
    color: darken(var(--primary-color), 10%); /* Placeholder for actual darken function */
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* Header Styling */
.site-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top-bar {
    background-color: #f0f0f0;
    padding: 8px 0;
    text-align: center;
    font-size: 0.9em;
    color: #555;
}

.announcement-link {
    font-weight: bold;
    margin-left: 5px;
}

.header-main-nav {
    padding: 15px 0;
}

.main-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-logo img {
    display: block;
    max-height: 40px;
    width: auto;
}

.primary-navigation {
    flex-grow: 1;
    text-align: center;
}

.nav-list {
    display: flex;
    justify-content: center;
    gap: 25px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 10px 0;
    color: var(--heading-color);
    font-weight: 500;
    font-size: 1.05em;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    min-width: 180px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.nav-item.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    padding: 10px 15px;
    display: block;
    white-space: nowrap;
    color: var(--text-color);
}

.dropdown-menu li a:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.menu-toggle {
    display: none; /* Hidden by default on larger screens */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-form {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
}

.search-form input {
    border: none;
    padding: 8px 15px;
    outline: none;
    width: 180px;
    font-size: 0.9em;
}

.search-button {
    background-color: var(--primary-color);
    border: none;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: darken(var(--primary-color), 10%); /* Placeholder */
}

.user-auth .btn {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: darken(var(--primary-color), 10%); /* Placeholder */
    border-color: darken(var(--primary-color), 10%); /* Placeholder */
}

/* Footer Styling */
.site-footer {
    background-color: #222;
    color: #f8f8f8;
    padding: 60px 0;
    font-size: 0.9em;
}

.footer-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-col h3 {
    color: #fff;
    font-size: 1.1em;
    margin-bottom: 20px;
    position: relative;
}

.footer-col h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
    margin-top: 8px;
}

.footer-col p, .footer-col address {
    margin-bottom: 15px;
    line-height: 1.8;
}

.footer-col ul {
    margin-top: 10px;
}

.footer-col ul li {
    margin-bottom: 8px;
}

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

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

.footer-logo img {
    max-height: 32px;
    margin-bottom: 20px;
}

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

.social-links a {
    color: #ccc;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 30px;
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright {
    color: #ccc;
}

.legal-links {
    display: flex;
    gap: 20px;
}

.legal-links li a {
    color: #ccc;
    transition: color 0.3s ease;
}

.legal-links li a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Screen Reader Only (SR-Only) styles */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Utility classes */
.arrow-down {
    display: inline-block;
    margin-left: 5px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--text-color);
    vertical-align: middle;
    transition: transform 0.3s ease;
}

.nav-item.has-dropdown:hover .arrow-down {
    transform: rotate(180deg);
}

/* Responsive adjustments (basic example) */
@media (max-width: 992px) {
    .primary-navigation {
        flex-basis: 100%;
        order: 3; /* Push navigation to new row */
        margin-top: 15px;
        text-align: left;
    }

    .nav-list {
        flex-direction: column;
        display: none; /* Hidden by default for mobile */
        width: 100%;
        background-color: #fff;
        border-top: 1px solid var(--border-color);
        padding-top: 10px;
    }

    .nav-list.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--light-gray);
    }

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

    .nav-link {
        padding: 12px 15px;
    }

    .menu-toggle {
        display: block;
        margin-left: auto; /* Push toggle to the right */
    }

    .header-actions {
        order: 2; /* Keep actions next to logo */
        gap: 10px;
    }

    .search-form {
        width: 100%;
        margin-top: 10px;
    }

    .user-auth {
        display: none; /* Hide for smaller screens, could be in mobile menu */
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        transform: none;
        opacity: 1;
        visibility: visible;
        background-color: var(--light-gray);
        margin-left: 20px;
        width: calc(100% - 20px);
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .legal-links {
        flex-direction: column;
        gap: 10px;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
