/* 全局样式 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --danger-color: #dc3545;
    --success-color: #28a745;
    --background-color: #f8f9fa;
    --border-color: #dee2e6;
    --text-color: #333;
    --light-text: #6c757d;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

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

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

a:hover {
    text-decoration: underline;
}

.btn {
    display: inline-block;
    font-weight: 400;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.375rem 0.75rem;
    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;
}

.btn:hover {
    background-color: #0069d9;
    border-color: #0062cc;
    text-decoration: none;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
    margin:0 5px;
}

.btn-block {
    display: block;
    width: 100%;
}

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

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

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.form-group {
    margin-bottom: 1rem;
}

.form-control {
    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 #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

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

label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* 头部样式 */
.header {
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    margin-bottom: 0;
    position: relative;
}

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

.logo {
    margin-right: auto;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: block;
}

.main-nav {
    transition: all 0.3s ease;
}

.main-nav.active {
    left: 0;
    opacity: 1;
    visibility: visible;
}

.nav-list {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-right: 1.5rem;
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    position: relative;
    transition: color 0.2s ease;
}

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

/* 活跃导航项样式 */
.nav-link.active {
    position: relative;
    color: var(--primary-color);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.user-info-area {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.username {
    font-weight: 500;
    margin: 0;
}

/* 主要内容样式 */
.main {
    min-height: calc(100vh - 160px);
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

/* 页脚样式 */
.footer {
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--light-text);
}

/* 登录页面样式 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
}

.auth-box {
    width: 100%;
    max-width: 400px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    padding: 2rem;
}

.auth-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-links {
    text-align: center;
}

/* 首页样式 */
.hero-section {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--light-text);
}

.home-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.section-title {
    margin: 0;
}

.post-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.post-item {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
}

.post-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.post-meta {
    margin-bottom: 1rem;
    color: var(--light-text);
    font-size: 0.875rem;
}

.post-author, .post-date, .post-type {
    margin-right: 1rem;
}

.post-excerpt {
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: var(--box-shadow);
}

/* 帖子详情页样式 */
.post-container {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}


.post-content {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.comment-section {
    margin-top: 2rem;
}

.comment-form-container {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.comment-item {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: var(--light-text);
    font-size: 0.875rem;
}

.comment-content {
    margin-bottom: 0.5rem;
}

.comment-actions {
    display: flex;
    justify-content: flex-end;
}

.login-prompt {
    text-align: center;
    padding: 1rem;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.page-link {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    color: var(--primary-color);
    text-decoration: none;
}

.page-link:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

.page-link.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 媒体查询 */
@media (min-width: 768px) {
    .post-list {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* 移动菜单按钮样式 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 20px;
    cursor: pointer;
    z-index: 1000;
    padding: 0;
    background: transparent;
    border: none;
}

.mobile-menu-toggle span {
    height: 2px;
    width: 100%;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 汉堡菜单激活状态 - 转变为X形状 */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* 背景遮罩 */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 搜索框样式优化 */
.header-search {
    position: relative;
}

.search-form {
    display: flex;
    position: relative;
}

.search-input {
    width: 220px;
    padding: 8px 36px 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    width: 260px;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    outline: none;
}

.search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    transition: color 0.2s ease;
    font-size: 16px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    color: #0056b3;
}

@media (max-width: 767px) {
    /* 基础布局 */
    .header-wrapper {
        justify-content: space-between;
        flex-direction: row;
        padding: 0;
        position: relative;
    }
    
    .logo {
        flex: 0 0 auto;
        margin-right: 0;
        z-index: 2;
        max-width: 60%;
        display: flex;
        align-items: center;
    }
    
    .logo a {
        font-size: 1.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mobile-menu-toggle {
        order: 1;
        margin-left: auto;
        z-index: 1001;
        display: flex;
    }
    
    /* 搜索和用户导航 */
    .header-search {
        order: 2;
        width: 100%;
        margin: 15px 0 5px;
    }
    
    .search-form {
        width: 100%;
        position: relative;
    }
    
    .search-input, .search-input:focus {
        width: 100%;
        border-radius: 4px;
        height: 36px;
        padding-right: 40px;
    }
    
    .search-btn {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        padding: 5px;
        background: none;
        border: none;
    }
    
    .user-nav {
        order: 3;
        width: 100%;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        margin: 5px 0 0;
    }
    
    .user-nav .username {
        width: 100%;
        text-align: center;
        margin-bottom: 6px;
        font-size: 14px;
    }
    
    .user-nav .btn {
        padding: 5px 12px;
        margin: 0 4px;
        font-size: 14px;
    }
}

/* 平板设备优化 */
@media (min-width: 768px) and (max-width: 991px) {
    .header-wrapper {
        justify-content: space-between;
        padding: 5px 0;
    }
    
    .main-nav ul {
        flex-wrap: nowrap;
    }
    
    .main-nav li {
        margin: 5px 15px 5px 0;
    }
    
    .header-search {
        flex-basis: 100%;
        order: 3;
        margin-top: 10px;
    }
    
    .user-nav {
        margin-left: auto;
    }
}

/* 公告滚动条样式 */
.announcement-bar {
    background-color: #f0f7ff;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.announcement-wrapper {
    display: flex;
    align-items: center;
    height: 36px;
}

.announcement-icon {
    margin-right: 15px;
    flex-shrink: 0;
    font-size: 20px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-scroll {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    height: 36px;
}

/* 新的垂直翻转样式 */
.announcement-flip {
    position: relative;
    height: 100%;
    width: 100%;
    perspective: 1000px;
}

.flip-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.flip-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transition: transform 0.8s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.flip-item.active {
    opacity: 1;
    visibility: visible;
    transform: rotateX(0deg);
}

.flip-item.prev {
    transform: rotateX(180deg);
}

.flip-item.next {
    transform: rotateX(-180deg);
}

.flip-item a {
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    white-space: nowrap;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.flip-item a:hover {
    color: var(--primary-color);
}

.notice-title {
    font-weight: bold;
    margin-right: 10px;
    white-space: nowrap;
    color: #f44336;
}

.notice-content {
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

/* 暂无公告样式 */
.no-notices {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--light-text);
    font-style: italic;
    font-size: 16px;
} 

/* 底部样式 */
/* 页脚样式 */
.main-footer {
    background-color: #396cc0;
    color: #ffffff;
    padding: 2rem 0;
    
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr;
    gap: 2rem;
}

.footer-info {
    display: flex;
    flex-direction: column;
}

.footer-logo {
    display: inline-block;
    margin-bottom: 1rem;
}

.footer-logo img {
    height: 40px;
    width: auto;
}

.footer-heading {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}
.footer-heading a:hover{
    color: var(--primary-color);
}
.separator{
    padding: 6px 0;
}

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

.footer-nav li {
    margin-bottom: 0.75rem;
}

.separator a{
    color: #ffffff;
}

.footer-nav li a {
    color: #ffffff;
    transition: color 0.2s ease;
    text-decoration: none;
}

.footer-nav li a:hover {
    color: var(--color-primary-light);
}

.footer-contact-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact-info li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.footer-bottom {
    /* margin-top: 2rem;
    padding-top: 1.5rem; */
    /* border-top: 1px solid rgba(255, 255, 255, 0.1); */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-bottom-links {
    /* margin-top: 0.75rem; */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.footer-bottom-links a {
    color: var(--color-gray-400);
    font-size: 0.875rem;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.footer-bottom-links a:hover {
    color: var(--color-primary-light);
}

.copyright {
    color: var(--color-gray-500);
    font-size: 0.875rem;
    text-align: center;
}

/* 纯文本链接样式 */
.plain-links {
    margin-top: 1rem;
}

.plain-links a {
    color: var(--color-primary-light);
    text-decoration: none;
}

.plain-links a:hover {
    color: var(--color-white);
    text-decoration: underline;
}

.plain-links .separator {
    color: var(--color-gray-500);
    margin: 0 8px;
    display: inline;
}

/* 页脚描述颜色 */
.footer-description {
    color: var(--color-gray-400);
}

/* 联系信息颜色 */
.footer-address p, 
.footer-contact-info li {
    color: var(--color-gray-400);
}

/* 页脚链接悬停效果 */
.footer-nav li a {
    position: relative;
}

.footer-nav li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-primary-light);
    transition: width 0.3s ease;
}

.footer-nav li a:hover::after {
    width: 100%;
}

/* 响应式布局 - 大屏幕 */
@media (max-width: 1200px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 1.5rem;
    }
    
    .footer-contact {
        grid-column: 1 / -1;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: flex-start;
        margin-top: 2rem;
    }
    
    .footer-contact .footer-heading {
        width: 100%;
    }
    
    .footer-qrcode {
        margin-right: 2rem;
    }
    
    .footer-contact-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .separator{
        padding: 8px 0;
    }
}

/* 响应式布局 - 平板 */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .footer-info {
        grid-column: 1 / -1;
        text-align: center;
        align-items: center;
    }
    
    .footer-description {
        max-width: 80%;
        margin: 0 auto;
    }
    
    .footer-contact {
        grid-column: 1 / -1;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-qrcode {
        margin-right: 0;
        margin-bottom: 1.5rem;
    }
    
    .main-footer {
        padding: 3rem 0 1.5rem;
    }
}

/* 响应式布局 - 手机 */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-links {
        text-align: center;
    }
    
    .footer-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .footer-nav li {
        margin-bottom: 0.5rem;
        margin-right: 0.5rem;
    }
    
    .footer-bottom-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
    }
    
    /* .footer-bottom-links .separator {
        display: inline-block;
        margin: 0 0.5rem;
    } */
    
    .copyright {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .footer-bottom-links a {
        margin: 0.3rem 0.5rem;
    }
    
    .footer-contact-info li {
        justify-content: center;
    }
    
    .main-footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-heading {
        margin-bottom: 0.75rem;
        font-size: 1rem;
    }
    
    .footer-description {
        max-width: 100%;
    }
   
}

/* 响应式布局 - 小手机 */
@media (max-width: 480px) {
    .footer-logo img {
        height: 32px;
    }
    
    .footer-qrcode img {
        width: 100px;
        height: 100px;
    }
    
    .footer-bottom {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
    
    .main-footer {
        padding: 1.5rem 0 1rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .footer-social.plain-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
    }
    
    .footer-social.plain-links a {
        margin: 0.2rem 0.5rem;
    }
    
    .footer-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .footer-nav li {
        margin: 0 0.3rem 0.3rem 0;
    }
}

/* 修复按钮活跃状态 */
.btn-active {
    background-color: #0062cc;
    border-color: #005cbf;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover, .btn-outline.btn-active {
    background-color: var(--primary-color);
    color: #fff;
}

/* 活跃导航项样式 */
.main-nav a.active {
    position: relative;
    color: var(--primary-color);
    font-weight: 600;
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

@media (max-width: 767px) {
    .main-nav a.active::after {
        display: none;
    }
    
    .main-nav a.active {
        background-color: rgba(0, 123, 255, 0.1);
        border-radius: 4px;
        padding-left: 10px !important;
    }
}

/* 移动视图导航补充 */
@media (max-width: 767px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        background-color: #fff;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        z-index: 999;
        padding: 70px 20px 20px;
        opacity: 0;
        visibility: hidden;
        transition: left 0.3s ease, opacity 0.2s ease, visibility 0.2s ease;
        overflow-y: auto;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-item {
        margin: 8px 0;
        width: 100%;
    }
    
    .nav-link {
        padding: 10px;
        width: 100%;
        font-size: 16px;
        border-radius: 4px;
    }
    
    .nav-link:hover {
        background-color: rgba(0, 123, 255, 0.05);
    }
    
    .nav-link.active {
        background-color: rgba(0, 123, 255, 0.1);
        padding-left: 15px;
    }
    
    .nav-link.active::after {
        display: none;
    }
    
    body.menu-open {
        overflow: hidden;
    }
}


