/* shared_css: Global styles for the entire application */
: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;
    --heading-color: #222;
    --border-color: #dee2e6;
    --bg-light: #f4f7f6;
    --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --container-max-width: 1200px;
}

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

.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    font-family: var(--font-family-sans-serif);
    margin-top: 0;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    font-weight: 400;
    color: #212529;
    text-align: center;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    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;
}

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

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

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

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

.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1.25rem;
    line-height: 1.5;
    border-radius: 0.3rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea {
    display: block;
    width: 100%;
    padding: 0.375rem 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: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input:focus, textarea:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.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;
}

/* Header specific styles (example, more would be in actual header_css) */
.site-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-top-bar {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 8px 0;
    font-size: 0.9em;
}
.header-top-bar a {
    color: var(--warning-color);
}

.header-main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

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

.logo img {
    height: 40px; /* Adjust as needed */
    width: auto;
}

.primary-navigation ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}

.primary-navigation ul li {
    position: relative;
    margin-left: 25px;
}

.primary-navigation ul li a {
    display: block;
    padding: 10px 0;
    color: var(--heading-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.95em;
}

.primary-navigation ul li a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.primary-navigation .submenu {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    list-style: none;
    padding: 10px 0;
    min-width: 180px;
    z-index: 1000;
    left: 0;
    top: 100%;
    border-radius: 4px;
}

.primary-navigation .has-submenu:hover > .submenu {
    display: block;
}

.primary-navigation .submenu li a {
    padding: 8px 20px;
    color: var(--text-color);
    text-transform: none;
    font-weight: normal;
    font-size: 1em;
}

.primary-navigation .submenu li a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
}

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

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

.search-box input {
    border: none;
    padding: 5px 10px;
    outline: none;
    width: 150px;
}

.search-box button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}

.hero-section {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('/assets/images/hero-bg.jpg') no-repeat center center/cover;
    color: #fff;
    text-align: center;
    padding: 80px 0;
}

.hero-section h1 {
    color: #fff;
    font-size: 3em;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.2em;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-section .btn {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: var(--dark-color);
    font-weight: 700;
}
.hero-section .btn:hover {
    background-color: #e0a800;
    border-color: #e0a800;
}

.hero-section .small-text {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 20px;
}

/* Footer specific styles */
.site-footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 40px 0 20px;
    font-size: 0.9em;
}

.footer-widgets {
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.footer-widgets .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

.footer-widget {
    flex: 1;
    min-width: 220px;
    margin-bottom: 20px;
}

.footer-widget h3 {
    color: #fff;
    font-size: 1.2em;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
    display: inline-block;
}

.footer-widget p, .footer-widget address {
    color: rgba(255,255,255,0.7);
    margin-bottom: 10px;
}

.footer-widget a {
    color: var(--info-color);
}

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

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

.footer-widget ul li a {
    color: rgba(255,255,255,0.7);
}

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

.newsletter-form {
    display: flex;
    margin-top: 15px;
}

.newsletter-form input {
    flex-grow: 1;
    border: none;
    padding: 10px 15px;
    border-radius: 4px 0 0 4px;
    background-color: rgba(255,255,255,0.1);
    color: #fff;
}

.newsletter-form input::placeholder {
    color: rgba(255,255,255,0.5);
}

.newsletter-form button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #0056b3;
}

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

.social-media a {
    color: #fff;
    font-size: 1.5em;
    transition: color 0.3s ease;
}

.social-media a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
}

.footer-bottom p {
    margin-bottom: 10px;
    color: rgba(255,255,255,0.7);
}

.legal-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.legal-links li a {
    color: rgba(255,255,255,0.7);
    font-size: 0.85em;
}

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

/* Responsive adjustments */
@media (max-width: 992px) {
    .primary-navigation ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #fff;
        position: absolute;
        top: 100%;
        left: 0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    .primary-navigation ul.nav-menu.active {
        display: flex;
    }
    .primary-navigation ul li {
        margin-left: 0;
        border-bottom: 1px solid var(--border-color);
    }
    .primary-navigation ul li:last-child {
        border-bottom: none;
    }
    .primary-navigation ul li a {
        padding: 15px 20px;
    }
    .primary-navigation .submenu {
        position: static;
        box-shadow: none;
        border-top: 1px solid var(--border-color);
        padding-left: 20px;
    }
    .primary-navigation .has-submenu:hover > .submenu {
        display: flex;
        flex-direction: column;
    }
    .menu-toggle {
        display: block;
    }
    .header-main-nav .container {
        flex-wrap: nowrap;
    }
    .header-actions {
        order: 3; /* Move actions below logo and nav toggle */
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }
    .search-box {
        width: 100%;
    }
    .search-box input {
        width: calc(100% - 40px); /* Adjust for button width */
    }
    .footer-widgets .container {
        flex-direction: column;
        align-items: center;
    }
    .footer-widget {
        width: 100%;
        max-width: 400px;
        text-align: center;
    }
    .footer-widget h3 {
        margin: 0 auto 15px;
    }
    .footer-widget ul {
        text-align: center;
    }
    .newsletter-form {
        justify-content: center;
    }
    .social-media {
        justify-content: center;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
