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

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 45%, #f093fb 100%);
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Microsoft YaHei', sans-serif;
  color: #fff;
  padding: 2rem 1rem 4rem;
  position: relative;
  overflow-x: hidden;
}

/* 背景光斑 */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}
.bg-orbs span:nth-child(1) {
  width: 400px;
  height: 400px;
  background: #ff9a9e;
  top: -100px;
  left: -100px;
  animation: float1 18s ease-in-out infinite;
}
.bg-orbs span:nth-child(2) {
  width: 500px;
  height: 500px;
  background: #a18cd1;
  bottom: -150px;
  right: -150px;
  animation: float2 22s ease-in-out infinite;
}
.bg-orbs span:nth-child(3) {
  width: 300px;
  height: 300px;
  background: #84fab0;
  top: 40%;
  left: 55%;
  animation: float3 20s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(80px, 60px); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-60px, -80px); }
}
@keyframes float3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-40px, 50px); }
}

/* 玻璃卡片 */
.glass-card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  padding: 1.75rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(31, 38, 135, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* 头部 */
.header {
  max-width: 860px;
  margin: 0 auto 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.header h1 {
  font-size: 1.6rem;
  letter-spacing: 0.5px;
}
.user-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
}

/* 额度条 */
.quota-bar {
  max-width: 860px;
  margin: 0 auto 1.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: 14px;
  font-size: 0.92rem;
  text-align: center;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.quota-bar.warning {
  background: rgba(255, 193, 7, 0.25);
  color: #fff8e1;
}
.quota-bar.blocked {
  background: rgba(244, 67, 54, 0.3);
  color: #ffebee;
}

/* 主体 */
main {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* 发帖区 */
.compose {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.compose h2 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}
.compose textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

/* 输入框 */
.glass-input {
  width: 100%;
  padding: 0.85rem 1.15rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: all 0.25s ease;
}
.glass-input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}
.glass-input:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

/* 按钮 */
.glass-button {
  display: inline-block;
  padding: 0.8rem 1.75rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 14px;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
  align-self: flex-start;
}
.glass-button:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.02);
}
.glass-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.glass-button.small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}
.glass-button.full {
  width: 100%;
  text-align: center;
  align-self: stretch;
}

/* 帖子列表 */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.post h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  word-break: break-word;
}
.post-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  opacity: 0.8;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.post-content {
  font-size: 0.98rem;
  line-height: 1.7;
  word-break: break-word;
  opacity: 0.95;
}
.empty {
  text-align: center;
  opacity: 0.85;
  padding: 2.5rem;
}
.loading {
  text-align: center;
  opacity: 0.8;
  padding: 2rem;
}

/* 提示信息 */
.msg {
  font-size: 0.88rem;
  min-height: 1.2em;
}
.msg.error {
  color: #ffcdd2;
}
.msg.success {
  color: #c8e6c9;
}

/* 登录页 */
.center-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 1rem;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.auth-card h1 {
  text-align: center;
  font-size: 1.5rem;
}
.tab-row {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.3rem;
}
.tab {
  flex: 1;
  padding: 0.6rem;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}
.tab.active {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.back-link {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.88rem;
  margin-top: 0.25rem;
}
.back-link:hover {
  color: #fff;
}

/* 响应式 */
@media (max-width: 600px) {
  body {
    padding: 1rem 0.75rem 3rem;
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  .glass-card {
    padding: 1.35rem;
    border-radius: 20px;
  }
  .header h1 {
    font-size: 1.3rem;
  }
}
/* 图片上传按钮 */
.upload-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.upload-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.upload-hint {
  font-size: 0.85rem;
  opacity: 0.75;
}

/* 上传预览 */
.image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.image-preview:empty {
  display: none;
}
.preview-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(244, 67, 54, 0.9);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-remove:hover {
  background: #f44336;
}

/* 帖子里的图片 */
.post-image {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 0.5rem 0;
  display: block;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* 帖子图片网格 */
.post-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.post-images .post-image {
  margin: 0;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

/* 帖子里的链接 */
.post-content a {
  color: #c8e6ff;
  text-decoration: underline;
  word-break: break-all;
}
.post-content a:hover {
  color: #fff;
}