/* 
 * 轻论坛 - 基础样式
 * 轻量、清新、雅致的设计风格
 */

:root {
  --primary-color: #4a90e2;
  --primary-light: #5faae3;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-bg: #f8f9fa;
  --dark-bg: #343a40;
  --border-color: #dee2e6;
  --text-dark: #212529;
  --text-gray: #6c757d;
  --white: #ffffff;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.15);
  --radius: 8px;
  --transition: all 0.3s ease;
}

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

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

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

/* 头部样式 */
.header {
  background-color: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.logo h1 a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 1.8rem;
}

.nav ul {
  display: flex;
  list-style: none;
}

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

.nav ul li a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: var(--transition);
  padding: 5px 10px;
  border-radius: var(--radius);
}

.nav ul li a:hover,
.nav ul li a.active {
  color: var(--primary-color);
  background-color: rgba(74, 144, 226, 0.1);
}

.nav ul li a.active {
  font-weight: bold;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--white);
  min-width: 150px;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  z-index: 100;
}

.nav ul li:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown li {
  margin: 0;
  width: 100%;
}

.dropdown li a {
  display: block;
  padding: 10px 15px;
  margin: 0;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--text-dark);
  margin: 3px 0;
  transition: var(--transition);
}

/* 主要内容区域 */
.main-content {
  min-height: calc(100vh - 160px);
  padding: 30px 0;
}

/* 欢迎横幅 */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: var(--white);
  padding: 60px 0;
  text-align: center;
  margin-bottom: 40px;
  border-radius: var(--radius);
}

.welcome-banner h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.welcome-banner p {
  font-size: 1.2rem;
  margin-bottom: 25px;
  opacity: 0.9;
}

.btn-primary {
  background-color: var(--white);
  color: var(--primary-color);
  border: none;
  padding: 12px 30px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--white);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

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

/* 区块标题 */
.section {
  margin-bottom: 40px;
}

.section h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--text-dark);
  position: relative;
  padding-bottom: 10px;
}

.section h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.section-header a:hover {
  text-decoration: underline;
}

/* 分类网格 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.category-card {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-dark);
  display: block;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.category-card h4 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

.category-card p {
  color: var(--text-gray);
  font-size: 0.9rem;
}

/* 帖子列表 */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-card {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-dark);
  display: block;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.post-card h4 {
  margin-bottom: 10px;
  color: var(--text-dark);
  font-size: 1.2rem;
}

.post-meta {
  display: flex;
  gap: 15px;
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.post-stats {
  display: flex;
  gap: 15px;
  color: var(--text-gray);
  font-size: 0.9rem;
}

.post-excerpt {
  color: var(--text-gray);
  margin: 15px 0;
  line-height: 1.6;
}

/* 公告板 */
.notice-board {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.notice-item {
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.notice-item h4 {
  color: var(--primary-color);
  margin-bottom: 8px;
}

.notice-item p {
  color: var(--text-gray);
  margin-bottom: 5px;
}

.notice-item small {
  color: var(--text-gray);
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group small {
  color: var(--text-gray);
  font-size: 0.85rem;
  display: block;
  margin-top: 5px;
}

/* 认证容器 */
.auth-container {
  max-width: 450px;
  margin: 40px auto;
  background-color: var(--white);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-container h2 {
  text-align: center;
  margin-bottom: 25px;
  color: var(--text-dark);
}

.auth-links {
  text-align: center;
  margin-top: 20px;
}

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

.auth-links a:hover {
  text-decoration: underline;
}

/* 用户中心 */
.user-center-container {
  display: flex;
  gap: 30px;
  margin-top: 20px;
}

.sidebar {
  flex: 0 0 250px;
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow);
  align-self: flex-start;
}

.user-profile-card {
  text-align: center;
  margin-bottom: 25px;
}

.user-profile-card img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  border: 3px solid var(--primary-light);
}

.user-profile-card h3 {
  margin-bottom: 5px;
  color: var(--text-dark);
}

.user-profile-card p {
  color: var(--text-gray);
  font-size: 0.9rem;
}

.avatar-upload {
  position: relative;
  display: inline-block;
}

.upload-label {
  display: block;
  margin-top: 10px;
  background-color: var(--primary-color);
  color: var(--white);
  padding: 8px 15px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.upload-label:hover {
  background-color: var(--primary-light);
}

#avatar-input {
  display: none;
}

.user-nav ul {
  list-style: none;
}

.user-nav ul li {
  margin-bottom: 5px;
}

.user-nav ul li a {
  display: block;
  padding: 12px 15px;
  text-decoration: none;
  color: var(--text-dark);
  border-radius: var(--radius);
  transition: var(--transition);
}

.user-nav ul li a:hover,
.user-nav ul li a.active {
  background-color: rgba(74, 144, 226, 0.1);
  color: var(--primary-color);
}

.tab-content {
  flex: 1;
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.tab-pane h3 {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

/* 帖子详情 */
.post-detail-container {
  max-width: 800px;
  margin: 0 auto;
}

.post-detail {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.post-detail h1 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: var(--text-dark);
}

.post-meta-detail {
  display: flex;
  gap: 20px;
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
}

.post-content {
  line-height: 1.8;
  color: var(--text-dark);
  margin: 20px 0;
}

.comments-section {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.comments-section h3 {
  margin-bottom: 20px;
}

.comment-form {
  margin-bottom: 30px;
}

.comment-form textarea {
  width: 100%;
  margin-bottom: 15px;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  resize: vertical;
  min-height: 100px;
}

.comments-list {
  margin-top: 30px;
}

.comment-item {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.comment-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.comment-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
}

.comment-author {
  font-weight: 600;
  color: var(--text-dark);
}

.comment-date {
  color: var(--text-gray);
  font-size: 0.85rem;
  margin-left: 15px;
}

.comment-content {
  color: var(--text-dark);
  line-height: 1.6;
  padding-left: 50px;
}

.reply-form {
  margin-top: 15px;
  padding-left: 50px;
}

.reply-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  resize: vertical;
  min-height: 80px;
  margin-bottom: 10px;
}

.reply-form button {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 8px 15px;
  border-radius: var(--radius);
  cursor: pointer;
}

.replies {
  margin-top: 20px;
  padding-left: 50px;
  border-left: 2px solid var(--border-color);
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 8px 15px;
  text-decoration: none;
  border-radius: var(--radius);
  background-color: var(--white);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  transition: var(--transition);
}

.pagination a:hover,
.pagination .active {
  background-color: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

/* 页脚 */
.footer {
  background-color: var(--dark-bg);
  color: var(--white);
  text-align: center;
  padding: 20px 0;
  margin-top: 50px;
}

/* 页面标题 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.page-header h2 {
  color: var(--text-dark);
}

.filter-section {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-section input,
.filter-section select,
.filter-section button {
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
}

.filter-section button {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.filter-section button:hover {
  background-color: var(--primary-light);
}

/* 响应式提示 */
@media screen and (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .filter-section {
    flex-direction: column;
  }
  
  .filter-section input,
  .filter-section select,
  .filter-section button {
    width: 100%;
  }
}