
/* shared_css: 网站通用样式表 */

/* 基础重置 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    color: #333;
    background-color: #f8f8f8;
}

/* 链接样式 */
a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover, a:focus {
    color: #0056b3;
    text-decoration: underline;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* 辅助类 */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

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

.header-topbar {
    background-color: #f0f0f0;
    padding: 8px 0;
    font-size: 0.85em;
    color: #666;
}

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

.topbar-menu {
    list-style: none;
    display: flex;
}
.topbar-menu li {
    margin-left: 20px;
}
.topbar-menu a {
    color: #666;
}
.topbar-menu a:hover {
    color: #007bff;
}

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

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

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

.main-navigation {
    flex-grow: 1;
    margin: 0 20px;
}

.main-navigation .menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
}

.nav-menu {
    list-style: none;
    display: flex;
    justify-content: center;
}

.nav-menu > li {
    position: relative;
    margin: 0 15px;
}

.nav-menu a {
    display: block;
    padding: 10px 0;
    color: #333;
    font-weight: 500;
}

.nav-menu a:hover {
    color: #007bff;
}

.nav-menu .sub-menu {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    list-style: none;
    min-width: 180px;
    z-index: 10;
    padding: 10px 0;
    border-top: 2px solid #007bff;
}

.nav-menu li:hover > .sub-menu {
    display: block;
}

.nav-menu .sub-menu li {
    margin: 0;
}

.nav-menu .sub-menu a {
    padding: 8px 20px;
    white-space: nowrap;
}

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

.search-form {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 20px;
    overflow: hidden;
}

.search-form input[type="search"] {
    border: none;
    padding: 8px 15px;
    outline: none;
    font-size: 0.9em;
    width: 150px;
}

.search-form button {
    background-color: #007bff;
    border: none;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.user-menu a {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}

.login-btn {
    background-color: #f0f0f0;
    color: #333;
}

.login-btn:hover {
    background-color: #e0e0e0;
    color: #333;
    text-decoration: none;
}

.register-btn {
    background-color: #007bff;
    color: white;
}

.register-btn:hover {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
}

.language-selector select {
    border: 1px solid #ddd;
    padding: 7px 10px;
    border-radius: 20px;
    background-color: #fff;
    cursor: pointer;
    font-size: 0.9em;
    outline: none;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .main-navigation {
        flex-basis: 100%;
        margin: 15px 0 0;
    }
    .main-navigation .menu-toggle {
        display: block;
        margin-left: auto;
    }
    .nav-menu {
        flex-direction: column;
        display: none; /* Hidden by default on mobile */
        width: 100%;
        text-align: center;
    }
    .nav-menu.active {
        display: flex; /* Shown when active */
    }
    .nav-menu > li {
        margin: 0;
        border-bottom: 1px solid #eee;
    }
    .nav-menu .sub-menu {
        position: static;
        box-shadow: none;
        border-top: none;
        padding: 0;
        background-color: #f9f9f9;
        min-width: unset;
    }
    .nav-menu li:hover > .sub-menu {
        display: block;
    }
    .header-actions {
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }
}

/* 底部样式 */
.site-footer {
    background-color: #222;
    color: #ccc;
    padding: 40px 0 20px;
    font-size: 0.9em;
}

.site-footer a {
    color: #eee;
}

.site-footer a:hover {
    color: #007bff;
    text-decoration: underline;
}

.footer-widgets {
    padding-bottom: 30px;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
}

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

.footer-widget {
    flex: 1 1 200px; /* Adjust basis as needed */
    margin-bottom: 20px;
}

.footer-widget .widget-title {
    color: #fff;
    font-size: 1.2em;
    margin-bottom: 15px;
    position: relative;
}

.footer-widget .widget-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background-color: #007bff;
    margin-top: 8px;
}

.footer-widget p {
    margin-bottom: 10px;
}

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

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

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

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #444;
    transition: background-color 0.3s ease;
}

.social-links a:hover {
    background-color: #007bff;
    text-decoration: none;
}

.social-links img {
    filter: invert(1); /* Makes SVG icons white */
}

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

.footer-bottom .copyright,
.footer-bottom .disclaimer {
    margin-bottom: 10px;
}

.footer-bottom a {
    margin: 0 5px;
}

@media (max-width: 768px) {
    .footer-widgets .container {
        flex-direction: column;
        align-items: center;
    }
    .footer-widget {
        width: 100%;
        text-align: center;
    }
    .footer-widget .widget-title::after {
        margin-left: auto;
        margin-right: auto;
    }
    .social-links {
        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;
  }
}
