/* ============ 全局重置 ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: #f5f7fa;
  color: #303133;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, li {
  list-style: none;
}

/* ============ 顶部导航栏 ============ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}

.navbar .logo {
  font-size: 22px;
  font-weight: 700;
  color: #ff6b6b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar .logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

.navbar .nav-links {
  display: flex;
  gap: 32px;
}

.navbar .nav-links a {
  font-size: 15px;
  color: #606266;
  transition: color 0.2s;
}

.navbar .nav-links a:hover,
.navbar .nav-links a.active {
  color: #ff6b6b;
}

.navbar .nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-primary {
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.35);
}

.btn-outline {
  background: transparent;
  border: 1px solid #dcdfe6;
  color: #606266;
}

.btn-outline:hover {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.btn-block {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

.btn-link {
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 14px;
}

.btn-link:hover {
  text-decoration: underline;
}

/* ============ 布局容器 ============ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ============ 卡片 ============ */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 20px;
}

/* ============ 动态卡片 ============ */
.dynamics-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dynamic-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 20px;
  transition: box-shadow 0.2s;
}

.dynamic-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.dynamic-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar.pink { background: linear-gradient(135deg, #ff6b6b, #ff8e53); }
.avatar.blue { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.avatar.green { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.avatar.purple { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.avatar.orange { background: linear-gradient(135deg, #fa709a, #fee140); }

.dynamic-user-info .username {
  font-weight: 600;
  font-size: 15px;
  color: #303133;
}

.dynamic-user-info .time {
  font-size: 12px;
  color: #909399;
  margin-top: 2px;
}

.dynamic-content {
  font-size: 15px;
  line-height: 1.7;
  color: #303133;
  margin-bottom: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.dynamic-images {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.dynamic-images.count-1 { grid-template-columns: 1fr; max-width: 320px; }
.dynamic-images.count-2,
.dynamic-images.count-4 { grid-template-columns: repeat(2, 1fr); }
.dynamic-images.count-3,
.dynamic-images.count-5,
.dynamic-images.count-6,
.dynamic-images.count-7,
.dynamic-images.count-8,
.dynamic-images.count-9 { grid-template-columns: repeat(3, 1fr); }

.dynamic-images .img-box {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
  position: relative;
}

.dynamic-images.count-1 .img-box { aspect-ratio: 4/3; }

.dynamic-images .img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dynamic-footer {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 12px;
  border-top: 1px solid #f2f3f5;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #909399;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.action-btn:hover {
  color: #ff6b6b;
  background: #fff5f5;
}

.action-btn.liked {
  color: #ff6b6b;
}

.action-btn.collected {
  color: #e6a23c;
}

.action-btn .icon {
  font-size: 16px;
}

/* ============ 登录页 ============ */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.auth-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  padding: 40px;
  text-align: center;
}

.auth-left h1 {
  font-size: 42px;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.auth-left p {
  font-size: 16px;
  opacity: 0.9;
  max-width: 380px;
  line-height: 1.8;
}

.auth-right {
  width: 480px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 50px;
}

.auth-right h2 {
  font-size: 26px;
  margin-bottom: 8px;
  color: #303133;
}

.auth-right .subtitle {
  color: #909399;
  font-size: 14px;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: #606266;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #dcdfe6;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-input:focus {
  border-color: #ff6b6b;
}

.form-textarea {
  width: 100%;
  min-height: 140px;
  padding: 12px 14px;
  border: 1px solid #dcdfe6;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s;
  line-height: 1.6;
}

.form-textarea:focus {
  border-color: #ff6b6b;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
  color: #909399;
}

/* ============ 发布页 ============ */
.publish-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 20px;
}

.publish-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  padding: 28px;
}

.publish-card h2 {
  font-size: 20px;
  margin-bottom: 24px;
  color: #303133;
}

.image-uploader {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.image-uploader .upload-item {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px dashed #dcdfe6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #909399;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  font-size: 12px;
  gap: 4px;
  background: #fafafa;
  position: relative;
  overflow: hidden;
}

.image-uploader .upload-item:hover {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.image-uploader .upload-item .plus {
  font-size: 28px;
  font-weight: 300;
}

.image-uploader .upload-item.has-image {
  border: none;
  padding: 0;
}

.image-uploader .upload-item.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-uploader .upload-item .remove-img {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}

.publish-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f2f3f5;
}

/* ============ 空状态 ============ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #909399;
}

.empty-state .empty-icon {
  font-size: 56px;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ============ 用户头像下拉 ============ */
.user-dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 20px;
  transition: background 0.2s;
}

.user-dropdown:hover {
  background: #f5f7fa;
}

.user-dropdown .avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.user-dropdown .user-name {
  font-size: 14px;
  color: #606266;
}

/* ============ 提示 Toast ============ */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .navbar .nav-links { display: none; }
  
  .auth-left { display: none; }
  .auth-right { width: 100%; padding: 40px 24px; }
  
  .image-uploader { grid-template-columns: repeat(3, 1fr); }
}
