* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-decoration: none;
}

/* 渐变背景 */
body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 主容器 */
#app {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  background-color: #fff;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
  position: relative;
  min-height: 100vh;
  border-radius: 0 0 10px 10px;
}

/* 头部导航 */
#header {
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.logo {
  font-size: 1.75rem;
  font-weight: 800;
  color: white;
  display: flex;
  align-items: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logo-icon {
  margin-right: 10px;
  font-size: 2rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.post-btn {
  background-color: rgba(255, 255, 255, 0.2);
  color: black;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  padding: 0.75rem 1.5rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.post-btn a {
  color: white;
}

.post-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* 主体内容区域 - 关键布局 */
#body {
  display: flex;
  min-height: calc(100vh - 70px);
}

/* 左侧边栏 - 固定定位 */
#left-body {
  width: 280px;
  background-color: #fff;
  border-right: 1px solid #e9ecef;
  padding: 1.5rem;
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
  z-index: 50;
}

#left-body span {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: block;
  color: #495057;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #667eea;
}

.trending-item {
  padding: 1rem;
  border-bottom: 1px solid #f1f3f5;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.trending-item:hover {
  background-color: #f8f9fa;
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.trend-category {
  color: #868e96;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.trend-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #667eea;
  font-size: 1.05rem;
}

.trend-count {
  color: #868e96;
  font-size: 0.875rem;
}

/* 中间内容区域 - 可滚动 */
#middle-body {
  flex: 1;
  background-color: #fff;
  border-right: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 70px);
  overflow-y: auto;
}

/* 发布区域 */
#middle-body-text {
  padding: 1.5rem;
  border-bottom: 1px solid #f1f3f5;
  background-color: #fafbfc;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.post-header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.post-input {
  flex: 1;
  border: 2px solid #e9ecef;
  resize: none;
  outline: none;
  font-size: 1.25rem;
  padding: 1rem;
  min-height: 100px;
  line-height: 1.5;
  border-radius: 12px;
  background-color: white;
  transition: all 0.3s ease;
}

.post-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.post-input::placeholder {
  color: #adb5bd;
}

.post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #f1f3f5;
}

.action-icons {
  display: flex;
  gap: 1.5rem;
}

.action-icon {
  color: #667eea;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0.5rem;
  border-radius: 50%;
}

.action-icon img {
  width: 35px;
  height: 35px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.action-icon:hover {
  background-color: rgba(102, 126, 234, 0.1);
  transform: scale(1.1);
}

.post-submit {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.post-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* 帖子列表 */
.posts-container {
  flex: 1;
}

.post {
  padding: 1.5rem;
  border-bottom: 1px solid #f1f3f5;
  display: flex;
  transition: all 0.3s ease;
  background-color: white;
}

.post:hover {
  background-color: #fafbfc;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.post-avatar {
  margin-right: 1rem;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 1.125rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.avatar:hover {
  transform: scale(1.1);
}

.post-content {
  flex: 1;
}

.post-header-info {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.post-user {
  font-weight: 700;
  margin-right: 0.5rem;
  color: #495057;
  font-size: 1.05rem;
}

.post-handle,
.post-time {
  color: #868e96;
  margin-right: 0.5rem;
  font-size: 0.875rem;
}

.post-text {
  margin-bottom: 1rem;
  line-height: 1.7;
  color: #212529;
  font-size: 1rem;
}

.post-actions-bar {
  display: flex;
  justify-content: space-between;
  max-width: 450px;
  color: #868e96;
}

.post-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

.post-action:hover {
  color: #667eea;
  background-color: rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

/* 右侧边栏 - 固定定位 */
#right-body {
  width: 300px;
  background-color: #fff;
  padding: 1.5rem;
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
  z-index: 50;
}

#right-body span {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: block;
  color: #495057;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #667eea;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #f1f3f5;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.user-item:hover {
  background-color: #f8f9fa;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 700;
  color: #495057;
}

.user-handle {
  color: #868e96;
  font-size: 0.875rem;
}

.follow-btn {
  background-color: #fff;
  color: #667eea;
  border: 2px solid #667eea;
  border-radius: 50px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.follow-btn:hover {
  background-color: #667eea;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 响应式设计 */
@media (max-width: 1200px) {

  #left-body,
  #right-body {
    width: 250px;
  }
}

@media (max-width: 1024px) {

  #left-body,
  #right-body {
    display: none;
  }

  #middle-body {
    border: none;
  }
}

@media (max-width: 768px) {
  #header {
    padding: 1rem;
  }

  .nav-links {
    display: none;
  }

  #middle-body-text,
  .post {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .logo span {
    display: none;
  }

  .post-input {
    font-size: 1rem;
  }

  .action-icons {
    gap: 1rem;
  }

  .action-icon {
    font-size: 1rem;
  }
}

.tab-container {
  display: flex;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 1rem;
}

.tab {
  flex: 1;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  color: #6c757d;
  transition: all 0.2s ease;
}

.tab.active {
  color: #2c7be5;
  border-bottom: 2px solid #2c7be5;
}

.tab:hover {
  background-color: rgba(44, 123, 229, 0.05);
}

#messages-section .conversation-list {
  height: calc(100vh - 180px);
  overflow-y: auto;
}

#messages-section .message-input-area {
  position: sticky;
  bottom: 0;
  background-color: white;
  padding: 1rem;
  border-top: 1px solid #e9ecef;
}

.trending-item .trend-name input {
  width: 100%;
  border: none;
  border-bottom: 2px solid #667eea;
  background: transparent;
  padding: 0.5rem 0;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
}

.trending-item .trend-name input:focus {
  border-bottom-color: #764ba2;
}

.trending-item .trend-name input:hover {
  border-bottom-color: #5a6fd8;
}

.logout-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  cursor: pointer;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.logout-btn:hover {
  background-color: #c82333;
}

/* 确保登录按钮内的链接样式正确 */
.post-btn a {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
  height: 100%;
}

/* 新增的样式 */
.editable-input {
  background-color: white !important;
  color: #333 !important;
  border: 1px solid #2c7be5 !important;
  cursor: text !important;
}

.readonly-input {
  background-color: #f8f9fa !important;
  color: #666 !important;
  border: 1px solid #dee2e6 !important;
  cursor: default !important;
}

.message {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  padding: 12px 20px;
  border-radius: 5px;
  font-weight: bold;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  animation: fadeInOut 3s ease-in-out;
}

.message-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }

  10% {
    opacity: 1;
    transform: translateY(0);
  }

  90% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-cancel {
  background-color: #6c757d !important;
  color: white !important;
}

.btn-cancel:hover {
  background-color: #5a6268 !important;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}