/* QQ 空间风格 - 蓝色主题 + 卡片化 */
:root {
  --qz-blue: #2b80c4;
  --qz-blue-deep: #1a6daa;
  --qz-blue-light: #e8f3fc;
  --qz-orange: #ff9c00;
  --qz-yellow: #ffd166;
  --qz-bg: #cfe6f7;
  --qz-text: #333;
  --qz-muted: #888;
  --qz-card: #ffffff;
  --qz-border: #d8e8f3;
  --qz-shadow: 0 2px 12px rgba(43, 128, 196, 0.08);
  --qz-shadow-hover: 0 6px 20px rgba(43, 128, 196, 0.18);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #b3d9f2 0%, #cfe6f7 200px, #e8f3fc 400px);
  background-attachment: fixed;
  color: var(--qz-text);
  font-size: 14px;
  min-height: 100vh;
}

/* ========== 顶部导航 ========== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  background: linear-gradient(180deg, var(--qz-blue) 0%, var(--qz-blue-deep) 100%);
  display: flex;
  align-items: center;
  padding: 0 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.logo {
  display: flex; align-items: center; gap: 8px;
  color: #fff; font-size: 18px; font-weight: 600;
  margin-right: 48px;
}

.logo-icon {
  display: inline-block;
  width: 32px; height: 32px;
  background: var(--qz-yellow);
  color: var(--qz-blue-deep);
  border-radius: 50%;
  text-align: center; line-height: 32px;
  font-size: 18px;
}

.nav { display: flex; gap: 4px; flex: 1; }

.nav-item {
  padding: 8px 18px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 14px;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, 0.2); color: #fff; font-weight: 600; }

.btn-publish {
  background: var(--qz-orange);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(255, 156, 0, 0.4);
}

.btn-publish:hover { background: #ff8c00; transform: translateY(-1px); }

/* ========== 封面 ========== */
.cover {
  position: relative;
  min-height: 220px;
  max-height: 480px;
  overflow: hidden;
  margin-bottom: 24px;
  background: #1a3950;
}

/* 模糊背景：用同一张图放大铺满，柔化边缘 */
.cover::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--cover-bg, none);
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.55);
  transform: scale(1.15);
  z-index: 0;
}

.cover img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-height: 480px;
  height: auto;
  object-fit: contain;
}

.cover-mask {
  position: absolute; inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
}

.cover-info {
  position: relative;
  z-index: 3;
  margin-top: -64px;
  padding: 0 48px 20px;
  display: flex; align-items: flex-end; gap: 20px;
  color: #fff;
}

.avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--qz-yellow);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.info-text h1 {
  font-size: 24px; font-weight: 600;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  margin-bottom: 6px;
}

.info-text p {
  font-size: 14px; opacity: 0.95;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ========== 主体布局 ========== */
.main {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  padding: 0 16px 40px;
}

.sidebar { display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--qz-card);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--qz-shadow);
  border: 1px solid var(--qz-border);
}

.card h3 {
  font-size: 14px;
  color: var(--qz-blue-deep);
  border-bottom: 1px solid var(--qz-border);
  padding-bottom: 10px;
  margin-bottom: 12px;
  font-weight: 600;
}

.menu { list-style: none; }

.menu-item {
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
  color: #555;
  transition: all 0.15s;
  margin-bottom: 4px;
}

.menu-item:hover { background: var(--qz-blue-light); color: var(--qz-blue); }
.menu-item.active { background: var(--qz-blue); color: #fff; }

.stats { display: flex; justify-content: space-around; }
.stat-item { display: flex; flex-direction: column; align-items: center; }
.stat-item b { font-size: 22px; color: var(--qz-blue); font-weight: 700; }
.stat-item span { font-size: 12px; color: var(--qz-muted); margin-top: 4px; }

.mood-card p { color: var(--qz-muted); font-size: 13px; line-height: 1.6; }

/* ========== 内容区 ========== */
.content { min-width: 0; }

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

/* 动态流 */
#feed-list { display: flex; flex-direction: column; gap: 16px; }

.feed-item {
  background: var(--qz-card);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--qz-shadow);
  border: 1px solid var(--qz-border);
  transition: all 0.2s;
}

.feed-item:hover { box-shadow: var(--qz-shadow-hover); }

.feed-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}

.feed-avatar { width: 40px; height: 40px; border-radius: 50%; }
.feed-author { font-weight: 600; color: var(--qz-blue-deep); font-size: 14px; }
.feed-time { color: var(--qz-muted); font-size: 12px; }

.feed-text {
  font-size: 14px; line-height: 1.7; color: #333;
  margin-bottom: 12px; white-space: pre-wrap; word-break: break-word;
}

.feed-media {
  display: grid; gap: 4px;
  margin-bottom: 12px;
  border-radius: 6px; overflow: hidden;
}

.feed-media.count-1 { grid-template-columns: 1fr; max-width: 480px; }
.feed-media.count-2 { grid-template-columns: 1fr 1fr; max-width: 480px; }
.feed-media.count-3 { grid-template-columns: repeat(3, 1fr); max-width: 480px; }
.feed-media.count-4 { grid-template-columns: repeat(2, 1fr); max-width: 360px; }
.feed-media.count-many { grid-template-columns: repeat(3, 1fr); max-width: 480px; }

.feed-media img,
.feed-media video {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  cursor: pointer; transition: transform 0.2s;
  background: #f0f0f0;
}

.feed-media.count-1 img,
.feed-media.count-1 video { aspect-ratio: auto; max-height: 480px; object-fit: contain; background: #000; }

.feed-media img:hover { transform: scale(1.02); }

.feed-media .video-cell {
  position: relative;
}

.feed-media .video-cell::after {
  content: '▶';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 32px;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.feed-actions {
  display: flex; gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--qz-border);
  font-size: 13px;
}

.feed-action {
  display: flex; align-items: center; gap: 4px;
  cursor: pointer; color: var(--qz-muted);
  padding: 4px 8px; border-radius: 4px;
  transition: all 0.15s;
}

.feed-action:hover { color: var(--qz-blue); background: var(--qz-blue-light); }
.feed-action.liked { color: #e74c3c; }
.feed-action.delete { margin-left: auto; }
.feed-action.delete:hover { color: #e74c3c; background: #fde8e6; }

.comments {
  margin-top: 12px; padding: 12px;
  background: var(--qz-blue-light);
  border-radius: 6px; font-size: 13px;
}

.comment-item { padding: 4px 0; line-height: 1.6; }
.comment-item .user { color: var(--qz-blue-deep); font-weight: 600; margin-right: 6px; }
.comment-item .time { color: var(--qz-muted); font-size: 11px; margin-left: 8px; }

.comment-input {
  display: flex; gap: 8px; margin-top: 10px;
}

.comment-input input {
  flex: 1; padding: 6px 10px;
  border: 1px solid var(--qz-border);
  border-radius: 4px; font-size: 13px;
  outline: none;
}

.comment-input input:focus { border-color: var(--qz-blue); }

.comment-input button {
  padding: 6px 14px;
  background: var(--qz-blue);
  color: #fff; border: none;
  border-radius: 4px; cursor: pointer; font-size: 13px;
}

.comment-input button:hover { background: var(--qz-blue-deep); }

/* ========== 相册 / 视频墙 ========== */
.album-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.album-header h3 { border: none; padding: 0; margin: 0; }

.muted { color: var(--qz-muted); font-size: 13px; }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.album-grid img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  border-radius: 6px; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  background: #fff;
}

.album-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.video-grid .vcard {
  background: var(--qz-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--qz-shadow);
  border: 1px solid var(--qz-border);
}

.video-grid video {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #000;
  display: block;
}

.video-grid .vinfo {
  padding: 10px 12px;
  font-size: 13px; color: #555;
}

/* ========== 发说说弹窗 ========== */
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}

.modal.hidden { display: none; }

.modal-card {
  background: #fff; border-radius: 10px;
  width: 100%; max-width: 560px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  animation: pop 0.2s ease;
}

@keyframes pop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

.modal-head h3 { color: var(--qz-blue-deep); font-size: 16px; }

.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: var(--qz-muted); width: 28px; height: 28px;
  border-radius: 4px;
}
.modal-close:hover { background: #f0f0f0; color: #333; }

#publish-text {
  width: 100%;
  min-height: 110px;
  border: 1px solid var(--qz-border);
  border-radius: 6px;
  padding: 10px;
  font-size: 14px; font-family: inherit;
  resize: vertical; outline: none;
}

#publish-text:focus { border-color: var(--qz-blue); }

.file-preview {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 12px;
}

.file-preview .preview-item {
  position: relative;
  width: 80px; height: 80px;
  border-radius: 6px; overflow: hidden;
  background: #f0f0f0;
}

.file-preview img,
.file-preview video {
  width: 100%; height: 100%; object-fit: cover;
}

.file-preview .remove {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 12px;
}

.modal-actions {
  display: flex; gap: 8px; align-items: center;
  margin-top: 14px;
}

.btn-file {
  padding: 6px 12px;
  background: var(--qz-blue-light);
  color: var(--qz-blue-deep);
  border-radius: 4px; cursor: pointer;
  font-size: 13px;
  border: 1px solid var(--qz-border);
  transition: all 0.15s;
}

.btn-file:hover { background: #d6e9f7; }

.spacer { flex: 1; }

.btn-cancel {
  padding: 7px 16px; border: 1px solid var(--qz-border);
  background: #fff; color: #666; border-radius: 4px; cursor: pointer; font-size: 13px;
}

.btn-submit {
  padding: 7px 18px; border: none;
  background: var(--qz-orange); color: #fff;
  border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.btn-submit:hover { background: #ff8c00; }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.progress {
  margin-top: 12px;
  height: 22px; background: #f0f0f0; border-radius: 11px;
  position: relative; overflow: hidden;
}
.progress.hidden { display: none; }
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--qz-blue), var(--qz-orange));
  transition: width 0.2s;
}
.progress-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #333;
}

/* ========== 大图查看器 ========== */
.viewer {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  display: flex; align-items: center; justify-content: center;
}

.viewer.hidden { display: none; }

.viewer img,
.viewer video {
  max-width: 92vw; max-height: 88vh;
  border-radius: 4px;
}

.viewer-close {
  position: absolute; top: 20px; right: 20px;
  width: 40px; height: 40px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff; border: none; border-radius: 50%;
  font-size: 22px; cursor: pointer;
  transition: background 0.2s;
}
.viewer-close:hover { background: rgba(255, 255, 255, 0.3); }

.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff; border: none; border-radius: 50%;
  font-size: 28px; cursor: pointer;
  transition: background 0.2s;
}
.viewer-nav:hover { background: rgba(255, 255, 255, 0.3); }
.viewer-nav.prev { left: 20px; }
.viewer-nav.next { right: 20px; }

/* ========== 底部 ========== */
.footer {
  text-align: center;
  padding: 24px 0;
  color: var(--qz-muted);
  font-size: 12px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .main { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .top-bar { padding: 0 16px; }
  .nav-item { padding: 8px 12px; font-size: 13px; }
  .cover-info { left: 20px; }
  .avatar { width: 72px; height: 72px; }
  .info-text h1 { font-size: 18px; }
}

.empty {
  text-align: center; padding: 60px 20px;
  color: var(--qz-muted); font-size: 14px;
}

.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

/* ========== 编辑资料按钮 ========== */
.cover-edit-btn {
  position: absolute;
  top: 16px; right: 24px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 14px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 13px;
  backdrop-filter: blur(4px);
  transition: all 0.2s;
}
.cover-edit-btn:hover { background: rgba(0, 0, 0, 0.65); }

.avatar-wrap {
  position: relative;
  width: 96px; height: 96px;
}

.avatar-edit-btn {
  position: absolute;
  right: 0; bottom: 0;
  width: 28px; height: 28px;
  background: var(--qz-blue);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.avatar-edit-btn:hover { background: var(--qz-blue-deep); transform: scale(1.1); }

.profile-edit-btn {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 4px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 12px;
  backdrop-filter: blur(4px);
  transition: all 0.2s;
}
.profile-edit-btn:hover { background: rgba(255, 255, 255, 0.35); }

/* ========== 资料编辑表单 ========== */
.profile-form { display: flex; flex-direction: column; gap: 14px; }

.form-row {
  display: flex; flex-direction: column; gap: 6px;
}

.form-label {
  font-size: 13px;
  color: var(--qz-blue-deep);
  font-weight: 500;
}

.form-row input[type="text"],
.form-row textarea {
  width: 100%;
  border: 1px solid var(--qz-border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: vertical;
}

.form-row input[type="text"]:focus,
.form-row textarea:focus { border-color: var(--qz-blue); }

.image-picker {
  display: flex; align-items: center; gap: 12px;
}

.image-picker img {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0f0f0;
  border: 2px solid var(--qz-border);
}

.image-picker img.cover-preview {
  width: 160px; height: 64px;
  border-radius: 6px;
}
