/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调系统 */
    --primary-color: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    
    /* 辅助色彩 */
    --secondary-color: #1e3a8a;
    --accent-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* 文字颜色层次 */
    --text-primary: #444444;
    --text-secondary: #4b5563;
    --text-light: #9ca3af;
    --text-white: #ffffff;
    
    /* 背景颜色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-light: #f3f4f6;
    --bg-accent: #f0f9ff;
    --bg-custom:#f0f2f4;
    
    /* 边框和分割线 */
    --border-default: #e5e7eb;
    --border-light: #f3f4f6;
    --border-primary: var(--primary-100);
    --border-focus: var(--primary-color);
    
    /* 阴影系统 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    
    /* 过渡动画 */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-custom) 0%, var(--bg-accent) 100%);
    min-height: 100vh;
}

.container {
   
    margin: 0 auto;
   
}

.post-section {
    background-color: var(--bg-primary);
    width:95%;
    margin: 1rem auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    align-items: start;
    padding: 0.5rem;
    transition: all var(--transition-fast);
}

.post-section:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(2px);
}

/* 头部样式 */
.header {
    background: #ffffff;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-default);
    padding: 0rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-direction: row;
    width: 90%;
    max-width: 1200px;
    padding: 0 2rem;
}

.header-content {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

/* Logo区域样式 */
.logo-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.5rem 0;
}

.logo-image {
    width: 40px;
    height: auto;
    vertical-align: middle;
}

.text-image {
    width: 100px;
    height: auto;
    vertical-align: middle;
}

/* 右侧按钮样式 */
.right-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
    padding: 0.5rem 0;
    margin-left: auto;
}

.header nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

/* 头部导航链接样式 - 纯文字链接 */
.header .nav-link {
    padding: 0.5rem 1rem;
    background: transparent;
    color:#444;
    
    border-radius: 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem; /* 调整字号 */
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-block;
    box-shadow: none;
    position: relative;
}

.header .nav-link:hover {
    background: transparent;
    color: var(--primary-dark);
    transform: none;
    box-shadow: none;
    text-decoration: none;
}
.header .nav-btn    {
    font-size: 1rem;
}
/* 登录和注册按钮样式 */
#loginBtn, #registerBtn, #userWelcome {
    padding: 0.5rem 0;
    background: transparent;
    color: #666666;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-weight: normal;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-block;
    box-shadow: none;
    position: relative;
    margin: 0 0.5rem;
}


/* 登录按钮hover效果 */
#loginBtn:hover, #registerBtn:hover, #userWelcome:hover {
    background: transparent;
    color: var(--primary-color);
    transform: none;
    box-shadow: none;
    text-decoration: none;
}

/* 确保用户菜单切换按钮悬停时只有文字颜色变化 */
.user-menu-toggle:hover {
    background-color: transparent;
}

/* 发布新主题链接保持纯文字样式 */
#newTopicNavBtn {
    background: transparent;
    color: var(--primary-color);
    border: none;
    box-shadow: none;
}

/* 用户菜单样式 */
.user-menu-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: color var(--transition-fast);
}

.user-menu-toggle:hover {
    /* 移除背景色变化，只保留颜色变化 */
}

.user-menu-arrow {
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.user-menu-toggle:hover .user-menu-arrow {
    color: var(--primary-color);
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% - 1rem);
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    min-width: 180px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}



/* 用户信息区域样式 */
.user-info-section {
    padding: 1rem;
    text-align: center;
   
}

.user-info-username {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.user-info-role {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-color); /* 普通用户蓝色背景 */
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.user-info-role.admin {
    background-color: var(--error-color); /* 管理员红色背景 */
}

/* 分隔线样式 */
.dropdown-divider {
    height: 1px;
    background-color: var(--border-light);
    margin: 0;
}

.user-menu-container:hover .user-menu-dropdown {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    text-align: center;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: var(--primary-50);
    color: var(--primary-color);
}

.dropdown-item:first-child {
    border-bottom: 1px solid var(--border-light);
}

#newTopicNavBtn:hover {
    background: transparent;
    color: var(--primary-dark);
    box-shadow: none;
    text-decoration: none;
}

/* 主要内容区域 */
main {
    margin: 0 0 1.875rem 0; /* 顶部无边距，底部保持原有间距 */
}

/* 栏目标签导航样式 */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 0 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding: 0 0 8px 0;
    border-bottom: 2px solid var(--border-default);
    position: relative;
    margin-top: 0rem;
    flex: 1;
    min-width: 200px;
}

/* 隐藏滚动条 */
.category-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.category-tab {
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-bottom: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 700; /* 加粗 */
    color: var(--text-light); 
    transition: all var(--transition-fast);
    white-space: nowrap;
    border-radius: var(--radius-md) var(--radius-md) 0 0; /* 上方圆角，下方直角 */
}

.category-tab:hover {
    color: var(--text-white); 
    font-weight: 700; /* 加粗 */
    background-color: var(--primary-dark); /* 激活状态下悬停背景变深蓝色 */
    background-color: var( --primary-500); /* 鼠标滑过背景保持白色 */
}

.category-tab.active {
    background-color: var(--primary-color); /* 点击时背景变蓝色 */
    color: var(--text-white); /* 点击时文字变白色 */
    font-weight: 700; /* 加粗 */
    border-color: var(--primary-color);
    background-color: var(--primary-dark); /* 激活状态下悬停背景变深蓝色 */
    box-shadow: var(--shadow-md);
}

.category-tab.active:hover {
    color: var(--text-white); /* 激活状态下悬停文字保持白色 */
    background-color: var(--primary-color); /* 点击时背景变蓝色 */
}

/* 表格样式 */
.topics-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-primary);
    margin-bottom: 2rem;
    border-left: none;
    border-right: none;
}

.topics-table th,
.topics-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-default);
    border-left: none;
    border-right: none;
    vertical-align: top;
    font-size: 1.1rem;
}

/* 标题列设置为表格的主要宽度，确保标题能够正确截断 */
.topics-table th:nth-child(2),
.topics-table td:nth-child(2) {
    min-width: 400px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

/* 确保时间列和其他列有足够空间，不换行 */
.topics-table th:nth-child(5),
.topics-table td:nth-child(5) {
    white-space: nowrap;
    min-width: 120px;
    width: auto;
}

.topics-table th:nth-child(3),
.topics-table td:nth-child(3),
.topics-table th:nth-child(4),
.topics-table td:nth-child(4) {
    white-space: nowrap;
    min-width: 80px;
    width: auto;
}

.topics-table th {
    background-color: var(--bg-light);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.875rem;
    position: relative;
    white-space: nowrap;
}

/* 移除渐变下划线 */

.topics-table tr:last-child td {
    border-bottom: none;
}

.topics-table tr {
    transition: background-color var(--transition-fast);
}

.topics-table tr:hover {
    background-color: var(--primary-50);
}

/* 未登录用户悬停在需要登录才能查看的主题行时的样式 */
.topics-table tr.restricted-topic-row:hover {
    background-color: #F8D7DA;
}



.topic-title {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: normal;
    position: relative;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 分类标签样式 */
.topic-category {
    color: #333;
    font-weight: normal;
}

/* 置顶标识样式 - 颜色更偏红，图标更小 */
.topic-top {
    background-color: #ff4444;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 5px;
}

/* 草稿主题标记样式 */
.topic-draft {
    background-color: #6c757d;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 5px;
}

/* 新主题标记样式 */
.topic-new {
    background-color: #079d23;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 5px;
}

/* 主题标题文本样式 */
.topic-title-text {
    color: var(--text-primary);
    font-weight: normal;
}

/* 置顶主题标题加粗 */
.topic-top + .topic-title-text {
    font-weight: 600;
}

.topic-title:hover {
    color: var(--text-primary);
}

.topic-preview {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    gap: 0.5rem;
    padding: 1rem;
    
}

.pagination-numbers {
    display: flex;
    gap: 0.25rem;
    margin: 0 0.5rem;
}

.pagination-btn {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.8rem;
    min-width: 1.8rem;
    text-align: center;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-white);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.pagination-btn:disabled {
    background: var(--bg-light);
    color: var(--text-light);
    cursor: not-allowed;
    border-color: var(--border-light);
    transform: none;
    box-shadow: none;
}

.pagination-btn:disabled:hover {
    background: var(--bg-light);
    color: var(--text-light);
    border-color: var(--border-light);
    transform: none;
}

/* 分页容器 */
.pagination-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    margin:0rem 0;
    flex-wrap: wrap;
}

/* 分页信息 */
.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0.5rem;
    
    margin: 0;
    text-align: center;
}

/* 受限主题样式 */
.result-item.restricted {
    opacity: 0.7;
    cursor: pointer;
}

.result-content.restricted {
    filter: blur(3px);
    -webkit-filter: blur(3px);
}

.result-item.restricted:hover {
    opacity: 0.9;
}

.restricted-title {
    color: var(--text-light);
}

.topic-title.restricted {
    color: var(--text-light);
    text-decoration: none;
    cursor: pointer;
}

.topic-summary.restricted {
    filter: blur(3px);
    -webkit-filter: blur(3px);
    color: var(--text-light);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9) translateY(2rem);
    transition: all var(--transition-normal);
    max-height: 100vh;
    overflow-y: auto;
    padding: 2rem;
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    
    padding: 0 0 0.5rem;
    border-bottom: none;
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-lg) var(--radius-xl) 0 0;
    position: relative;
}

.modal-header .close {
    position: absolute;
    right: -10px;
    top: -15px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex;
    
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-header .close:hover {
    background: var(--primary-color);
    color: white;
}

/* 登录/注册标签 */
.auth-tabs {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    justify-content: center;
    padding: 0;
    border-bottom: none;
}

.auth-tab {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.5rem 0;
    border-radius: 0;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    position: relative;
    background-color: white;
}

.auth-tab:hover {
    color: var(--primary-color);
    background-color: white;
}

.auth-tab.active {
    color: var(--primary-color);
    background-color: white;
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* 登录/注册内容 */
.auth-content {
    display: none;
}

.auth-content.active {
    display: block;
}

/* 验证码容器样式 */
.captcha-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

/* 修改资料内容 */
.edit-profile-content {
    display: block;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.close {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    transform-origin: center center;
}

.close:hover {
    background-color: rgba(239, 68, 68, 0.9);
    transform: rotate(90deg) scale(1.1);
}

.close svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: all var(--transition-fast);
}

.form-group {
    margin-bottom: 1.5rem;
    padding: 0;
    position: relative;
}

.form-group:not(.checkbox) label {
    display: none;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    font-size: 1rem;
  
    transition: all 0.3s;
    height: auto;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: white;
    transform: translateY(0);
}

.form-group input::placeholder {
    color: var(--text-light);
}

.form-group input:focus::placeholder {
    color: var(--text-secondary);
}

/* 输入框包装器 */
.input-wrapper {
    position: relative;
    width: 100%;
}

/* 隐藏浏览器自带的密码眼睛图标 */
.input-wrapper input[type="password"]::-ms-reveal,
.input-wrapper input[type="password"]::-ms-clear {
    display: none;
}

.input-wrapper input[type="password"]::-webkit-contacts-auto-fill-button,
.input-wrapper input[type="password"]::-webkit-credentials-auto-fill-button,
.input-wrapper input[type="password"]::-webkit-password-toggle-button {
    display: none;
    -webkit-appearance: none;
}

.input-wrapper input[type="password"] {
    -webkit-text-security: disc;
}

/* 清除按钮样式 */
.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: var(--text-light);
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
}

/* 当输入框有内容时显示清除按钮 */
.input-wrapper input:not(:placeholder-shown) + .clear-btn {
    opacity: 1;
    visibility: visible;
}

/* 清除按钮悬停效果 */
.clear-btn:hover {
    background: var(--bg-light);
    color: var(--text-primary);
    transform: translateY(-50%) scale(1.1);
}

/* 输入框聚焦时清除按钮的样式 */
.input-wrapper input:focus + .clear-btn {
    color: var(--primary-color);
}

.form-group.checkbox {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
    margin-bottom: 0;
}

.form-group.checkbox input {
    width: auto;
    margin-right: 8px;
    padding: 0;
    border-radius: 0;
    background-color: white;
    appearance: auto;
    -webkit-appearance: checkbox;
    -moz-appearance: checkbox;
}

.form-group.checkbox label {
    display: inline-block;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

/* 表单行布局 */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    margin-bottom: 1rem;
}

/* 表单链接 */
.form-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s;
}

.form-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.link-separator {
    color: var(--text-light);
}

.form-actions {
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 1.5rem;
}

.form-actions button, .form-actions a.btn {
    padding: 14px 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
    max-width: none;
    font-size: 1rem;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.form-actions button[type="submit"], .form-actions a.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.form-actions button[type="submit"]:hover, .form-actions a.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 6px rgba(59, 130, 246, 0.4);
}

.form-actions button[type="button"], .form-actions a.btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.form-actions button[type="button"]:hover, .form-actions a.btn-secondary:hover {
    background-color: var(--bg-light);
}

/* 危险按钮样式 */
.btn-danger {
    background-color: var(--error-color);
    color: white;
    border: none;
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* 确保非form-actions中的按钮也有基本样式 */
.btn {
    display: inline-block;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.form-footer {
    padding: 1rem 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 4px;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* 页脚样式 */
.footer {
    
    padding: 1rem 0 1.5rem;
    margin-top: 3rem;
    text-align: center;
    position: relative;
    font-size: 0.85rem;
}

.footer a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.footer a:hover {
    text-decoration: none;
    color: var(--primary-color);
}

/* 关于本站模态框样式 */
.about-modal-content {
    max-width: 800px;
    max-height: 90vh;
    padding: 2rem;
}

.about-content {
    padding: 1rem 0;
    display: flex;
    gap: var(--primary-100);
    align-items: flex-start;
}

/* 左侧图片区域 */
.about-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.about-image {
    width: 100%;
    
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-sm);
    overflow: hidden;
    
    transition: all var(--transition-fast);  
}

.about-image:hover {
    transform: translateY(-2px);
    
}

.about-image img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

/* 右侧内容区域 */
.about-right {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* 诗歌样式 */
.about-poem {
    background-color: var(--primary-50);
    border-radius: var(--radius-sm);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.poem-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-700);
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: 0.1rem;
}

.poem-content {
   
    font-size: 1.0rem;
    line-height: 1.8;
    text-indent: 2em;
    color: var(--text-primary);
    
}

.poem-content p {
    margin: 0.5rem 0;
    padding: 0;
}

.about-actions {
    text-align: center;
    margin: 1rem 0;
    width: 100%;
}

.about-actions .btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.about-actions .btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.about-footer {
    text-align: center;
    padding-top: 1.5rem;
    margin-top: 0.1rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.85rem;
    color: var(--text-light);
}

/* 关于模态框的模态头样式 */
.about-modal-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 0.5rem;
    margin: 0;
    border-bottom: none;
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-lg) var(--radius-xl) 0 0;
    position: relative;
}

.about-modal-content .modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* 移除特定关闭按钮样式，使用通用样式 */

/* 蓝色主题细节 */
.topic-stats {
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.topic-author {
    font-weight: 500;
    color: #777;
}

.topic-date {
    color: var(--text-light);
    font-size: 0.8rem;
}

/* 内容布局样式 */
.content-wrapper {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 1rem;
    align-items: stretch;

}

/* 搜索和分类导航容器 */
.search-category-wrapper {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: sticky;
    top: 0rem;
    height: fit-content;
    
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 0rem;
}

/* 侧边栏组件优化 */
.featured-topics-carousel,
.latest-topics-carousel {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 0px solid var(--border-light);
    overflow: visible; /* 确保圆角不会被裁剪 */
    padding: 0;
    margin: 0;
}

.latest-topics-carousel {
    margin-top: 5px;
}

.featured-topics-carousel > h3 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* 头部右侧功能区 */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

/* 搜索框样式 */
.search-box {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
    width: 300px;
}

.search-box .input-wrapper {
    flex: 1;
    display: flex;
    
    align-items: center;
}

/* 搜索输入框样式 */
.search-input {
    flex: 1;
    padding: 10px 40px 10px 10px;
    border: none;
    outline: none;
    font-size: 1rem;
}
/* 添加搜索输入框焦点样式 */
.search-input:focus {
    outline: 0px solid var(--primary-color);
   
}
/* 搜索按钮样式 */
.search-btn {
    padding: 10px 8px;
    background: transparent;
    color: var(--primary-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
}

/* 发布新主题按钮样式 */
.new-topic-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: #eee;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

/* 登录注册按钮样式 */
.right-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 分隔符样式 */
.separator {
    color: var(--text-light);
    font-size: 0.9rem;
}



/* 轮播和图库组件样式优化 */
.carousel-container,
.latest-carousel-container {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    margin-top: 0;
}

.carousel-item {
    text-align: center;
    width: 100%;
    height: 100%;
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    isolation: isolate; /* 创建新的层叠上下文 */
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease;
    cursor: pointer;
}

.carousel-item.active {
    opacity: 1;
    z-index: 1;
}

.carousel-item .image-wrapper {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}

.carousel-item .image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: var(--radius-md);
    margin: 0;
    padding: 0;
}



.carousel-item p {
    margin: 10px 0 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 轮播箭头按钮 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 100;
    opacity: 1;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 15px;
}

.next-btn {
    right: 15px;
}

/* SVG图标样式 */
.carousel-btn svg {
    width: 28px;
    height: 28px;
    fill: white;
    stroke: white;
}

/* 轮播指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 12px;
    z-index: 10;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.carousel-indicator.active {
    width: 20px;
    height: 4px;
    background: white;
    opacity: 1;
    border-radius: 2px;
    
}

.carousel-indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* 轮播项信息 - 叠加在图片上 */
.carousel-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 35px;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.8));
    color: white;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 5;
}

/* 标题样式 */
.carousel-item-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding: 0;
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* 标题 hover 效果 */
.carousel-item-title:hover {
    color: white;
}

/* 鼠标悬停时，整个缩略图的文字都变亮 */
.carousel-item:hover .carousel-item-title {
    color: white;
    transition: color var(--transition-fast);
}

.carousel-item:hover .carousel-item-meta span {
    color: white;
    transition: color var(--transition-fast);
}

.carousel-item:hover .carousel-item-meta span::before {
    color: white;
    transition: color var(--transition-fast);
}

/* 确保轮播中的主题标题链接显示为白色且无下划线 */
.carousel-item-info .topic-title {
    color: white !important;
    text-decoration: none !important;
}

/* 确保轮播中的主题标题文本显示为白色 */
.carousel-item-info .topic-title-text {
    color: white !important;
}

/* 确保所有轮播中的链接都无下划线 */
.carousel-item-info a {
    text-decoration: none !important;
    transition: color var(--transition-fast);
}

/* 确保所有轮播中的链接在 hover 时显示为白色 */
.carousel-item-info a:hover {
    color: white !important;
}

/* 元信息样式 */
.carousel-item-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #666;
    margin-top: auto;
    justify-content: center;
    width: 100%;
}

.carousel-item-meta span {
    display: flex;
    align-items: center;
}

.carousel-item-meta .author::before {
    content: "作者：";
    color: #666;
    
}

.carousel-item-meta .replies::before {
    content: "回复：";
   color: #666;
}

.carousel-item-meta .views::before {
    content: "浏览：";
    color: #666;
}

/* 最新主题展示区样式 */
.latest-topics-section {
    margin-top: 1.5rem;
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 0px solid var(--border-light);
    overflow: visible;
}

.latest-topics-container {
    width: 100%;
}

.latest-topics-header {
    margin-bottom: 1rem;
}

.latest-topics-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--primary-color);
}

.latest-topics-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.latest-topic-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.latest-topic-item:hover {
    background: var(--bg-accent);
    border-color: var(--border-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.latest-topic-image {
    flex-shrink: 0;
   width: 100%;
    height: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border-light);
}

.latest-topic-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.latest-topic-info {
    flex: 1;
    min-width: 0;
}

.latest-topic-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
}

.latest-topic-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.latest-author::before {
    content: "作者：";
    color: var(--text-light);
}

.latest-time::before {
    content: "时间：";
    color: var(--text-light);
}

.loading-latest {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* SPA相关样式 */
.spa-container {
    min-height: 400px;
    transition: all 0.3s ease-in-out;
}

/* 页面切换动画 */
.spa-container.loading {
    opacity: 0.5;
    transform: translateY(10px);
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 18px;
    color: #666;
}

/* 错误信息 */
.error-message {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 18px;
    color: #e74c3c;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 20px;
}

/* 左右内容布局优化 */
.left-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 1rem;
    height: 100%;
    
}

.right-content {
  
    min-width: 0;
}

/* 上传图片显示样式 - 宽度为容器的80% */
.topic-content img, .post-section img, .content-wrapper img {
    width: 80%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

/* 图片悬停效果 */
.topic-content img:hover, .post-section img:hover, .content-wrapper img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* 手机端适配 (486dp以下) */
@media screen and (max-width: 486px) {
    /* 隐藏banner */
    .banner-section {
        display: none;
    }
    
    /* 隐藏左侧边栏的缩略图区域 */
    .left-sidebar {
        display: none;
    }
    
    /* 调整内容布局，让右侧内容占满宽度 */
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    /* 调整容器宽度 */
    .container {
        width: 100%;
        padding: 0;
    }
    
    /* 调整post-section宽度 */
    .post-section {
        width: 100%;
        margin: 0.5rem auto;
        padding: 0.25rem;
    }
    
    /* 调整表格样式，确保在小屏幕上显示正常 */
    .topics-table {
        font-size: 0.75rem;
    }
    
    .topics-table th,
    .topics-table td {
        padding: 0.5rem;
        font-size: 0.7rem;
    }
    
    /* 调整标题样式 */
    .topic-title {
        font-size: 0.8rem;
    }
    
    /* 隐藏主题分类标签 */
    .topic-category {
        display: none;
    }
    
    /* 调整header布局，搜索功能置于logo之下 */
    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0 0.5rem;
    }
    
    /* 调整logo区域 */
    .logo-section {
        justify-content: center;
        padding: 0.5rem 0;
    }
    
    /* 调整header右侧功能区，将欢迎用户和搜索功能位置互换 */
    .header-right {
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem; /* 减小间距 */
        margin-left: 0;
    }
    
    /* 调整右侧按钮区域（登录注册/欢迎用户） */
    .right-buttons {
        order: 1;
        justify-content: center;
        margin: 0 auto;
        gap: 0.25rem; /* 减小内部间距 */
    }
    
    /* 调整搜索框位置、宽度和布局，确保放大镜显示 */
    .search-box {
        order: 2;
        width: 100%;
        max-width: 100%;
        display: flex;
        align-items: center;
        gap: 0;
    }
    
    /* 调整输入框包装器，确保不挤压搜索按钮 */
    .search-box .input-wrapper {
        flex: 1;
        max-width: calc(100% - 40px); /* 给搜索按钮预留空间 */
    }
    
    /* 调整搜索输入框 */
    .search-input {
        width: 100%;
        padding-right: 30px; /* 给清除按钮预留空间 */
    }
    
    /* 调整搜索按钮，确保放大镜显示 */
    .search-btn {
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        padding: 8px;
        margin: 0;
        border-radius: 0 8px 8px 0;
        background-color: var(--primary-50);
    }
    
    /* 调整搜索按钮内的SVG大小 */
    .search-btn svg {
        width: 20px;
        height: 20px;
    }
    
    /* 关于本站模态框样式调整 - 手机端 */
    .about-modal-content {
        padding: 1rem;
    }
    
    /* 调整关于内容布局，从上至下排列 */
    .about-content {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    /* 调整左侧图片区域，占满宽度 */
    .about-left {
        flex: none;
        width: 100%;
        align-items: center;
    }
    
    /* 调整右侧内容区域，占满宽度 */
    .about-right {
        flex: none;
        width: 100%;
    }
    
    /* 调整诗歌样式 */
    .poem-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .poem-content {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    /* 调整按钮位置 */
    .about-actions {
        margin: 1rem 0;
    }
    
    /* 确保关闭按钮显示在右上角 */
    .about-modal-content .modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 0 0.5rem;
        margin: 0;
        border-bottom: none;
        position: relative;
    }
    
    /* 确保关闭按钮显示在右上角 */
    .about-modal-content .modal-header .close {
        position: absolute;
        right: -10px;
        top: -15px;
        background: transparent;
        color: var(--text-secondary);
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        width: 2rem;
        height: 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.3s;
    }
    
    /* 重新排列元素顺序，实现BLF图片 -> 文字内容 -> 二维码 -> 扫一扫文字 -> 关闭按钮的布局 */
    /* 使用grid布局精确控制元素位置 */
    .about-content {
        display: grid;
        grid-template-areas: 
            "blf-image"
            "text-content"
            "qrcode-image"
            "scan-text"
            "close-btn";
        gap: 1rem;
        align-items: center;
        justify-items: center;
        width: 100%;
    }
    
    /* 将BLF图片放在最上面 */
    .about-left .about-image:first-child {
        grid-area: blf-image;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    /* 将文字内容放在中间 */
    .about-right {
        grid-area: text-content;
        width: 100%;
    }
    
    /* 将二维码图片放在文字内容之后 */
    .about-left .about-image:last-child {
        grid-area: qrcode-image;
        width: 100px; /* 固定二维码宽度 */
        height: auto;
    }
    
    /* 将"扫一扫，加微信好友"文字放在二维码图片之后 */
    .about-left > p {
        grid-area: scan-text;
        font-size: 0.8rem;
        text-align: center;
        width: 100%;
        margin: 0;
    }
    
    /* 将关闭按钮放在最下面 */
    .about-actions {
        grid-area: close-btn;
        margin: 0;
        padding: 0;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    /* 调整关闭按钮样式 */
    .about-actions .btn-primary {
        width: auto;
        padding: 0.75rem 2rem;
        font-size: 1rem;
    }
    
    /* 确保about-left容器不会影响布局 */
    .about-left {
        display: contents;
    }
    
    /* 确保所有元素不叠加 */
    .about-content > * {
        z-index: auto;
        position: relative;
    }
    
    /* 调整发布新主题按钮位置和间距 */
    .new-topic-btn {
        order: 3;
        width: 100%;
        text-align: center;
        margin-top: 0.2rem; /* 减小顶部间距 */
    }
    
    /* 调整分隔符样式，减小间距 */
    .separator {
        margin: 0 0.2rem;
    }
    
    /* 调整栏目导航标签样式，适应手机端 */
    .category-tabs {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
        padding-bottom: 8px;
        flex-wrap: nowrap;
        width: 100%;
    }
    
    /* 隐藏滚动条 */
    .category-tabs::-webkit-scrollbar {
        display: none; /* Chrome, Safari and Opera */
    }
    
    .category-tab {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
        flex-shrink: 0;
    }
    
    /* 主题列表只显示20个字，超出用...代替 */
    .topic-title-text {
        display: inline-block;
        max-width: 20em; /* 1em约等于1个汉字宽度 */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: top;
    }
    
    /* 隐藏浏览列 */
    .topics-table th:first-child,
    .topics-table td:first-child {
        display: none;
    }
    
    /* 隐藏回复/字数、作者、发布时间列，只显示标题列 */
    .topics-table th:nth-child(3),
    .topics-table th:nth-child(4),
    .topics-table th:nth-child(5),
    .topics-table td:nth-child(3),
    .topics-table td:nth-child(4),
    .topics-table td:nth-child(5) {
        display: none;
    }
    
    /* 确保标题列占满整个宽度 */
    .topics-table td:nth-child(2) {
        width: 100%;
    }
}

