:root {
  --bg: #f4f1ea;
  --panel: #ffffff;
  --ink: #20242b;
  --muted: #73787f;
  --line: #e3ddd2;
  --accent: #f04f5f;
  --blue: #3d7eff;
  --green: #0d9b6d;
  --link: #576b95;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 6%, rgba(255, 214, 91, 0.14), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(77, 126, 255, 0.1), transparent 30%),
    var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.top-icons {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #4b4f55;
  font-size: 17px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  line-height: 1;
}

.icon-btn:hover {
  background: #f4f2ed;
}

.refresh-btn.spinning {
  animation: spin 0.7s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.day-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.meta-item {
  text-align: right;
}

.meta-item strong {
  display: block;
  font-size: 16px;
  line-height: 1;
}

.meta-item span {
  font-size: 11px;
  color: var(--muted);
}

.day-switch {
  border: 0;
  background: #20242b;
  color: #fff;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0;
}

.day-switch.ghost {
  background: #fff;
  color: #5b6067;
  border: 1px solid var(--line);
}

.day-switch:hover {
  background: #11141a;
}

.day-switch.ghost:hover {
  background: #f7f5f0;
}

.cover {
  position: relative;
  width: 100%;
  height: 260px;
  overflow: hidden;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  display: block;
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.34));
  pointer-events: none;
}

.cover-avatar {
  position: absolute;
  right: 28px;
  bottom: 20px;
  z-index: 2;
  width: 76px;
  height: 76px;
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.cover-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 28px 70px;
  display: grid;
  grid-template-columns: 220px minmax(0, 620px) 260px;
  justify-content: center;
  gap: 26px;
}

.rail {
  position: sticky;
  top: 90px;
  align-self: start;
  min-width: 0;
}

.rail h2 {
  font-size: 14px;
  margin: 0 0 12px;
  letter-spacing: 0;
}

.persona-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-bottom: 1px dashed var(--line);
  min-width: 0;
  cursor: pointer;
  border-radius: 8px;
}

.persona-row:hover {
  background: rgba(255, 255, 255, 0.7);
}

.persona-row:last-child {
  border-bottom: 0;
}

.persona-row strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.persona-row span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  margin-left: auto;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.hot-list {
  display: grid;
  gap: 10px;
}

.hot-item {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.hot-item p {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hot-item span {
  font-size: 11px;
  color: var(--muted);
}

.rank-list {
  gap: 8px;
}

.rank-item {
  display: grid;
  grid-template-columns: 20px 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.rank-item p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rank-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.rank-no {
  color: var(--muted);
  font-weight: 900;
  font-size: 13px;
}

.rank-like {
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}

.rank-view {
  color: var(--link);
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}

.moments {
  min-width: 0;
}

.feed-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.feed-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.feed-title h2 {
  font-size: 17px;
  margin: 0;
  white-space: nowrap;
  letter-spacing: 0;
}

.feed-title span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: #5b6067;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  letter-spacing: 0;
}

.chip:hover {
  border-color: #c4bcae;
}

.chip.active {
  background: #20242b;
  color: #fff;
  border-color: #20242b;
}

.feed {
  display: grid;
  gap: 16px;
}

.post {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(32, 36, 43, 0.04);
}

.post-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.avatar-img {
  object-fit: cover;
  display: block;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  flex: 0 0 auto;
}

.avatar-img.avatar-lg {
  width: 46px;
  height: 46px;
}

.avatar-img.avatar-sm {
  width: 30px;
  height: 30px;
}

.avatar {
  display: grid;
  place-items: center;
  font-weight: 900;
  flex: 0 0 auto;
  color: #fff;
}

.avatar.human-avatar {
  background: linear-gradient(135deg, #fbbf24, #ea580c);
}

.avatar.typing-avatar {
  background: #d1d5db;
  color: #6b7280;
}

.post-body {
  flex: 1;
  min-width: 0;
}

.post-author {
  color: var(--link);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.post-author:hover {
  text-decoration: underline;
}

.post-text {
  font-size: 15px;
  line-height: 1.72;
  margin: 6px 0 8px;
  white-space: pre-line;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}

.post-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.post-meta-row time {
  font-size: 12px;
  color: var(--muted);
}

.more-btn {
  border: 0;
  background: transparent;
  color: #8a8f96;
  font-size: 18px;
  letter-spacing: 2px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
}

.more-btn:hover {
  background: #f4f2ed;
}

.post-media {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #1f2937;
  margin: 10px 0 0 58px;
}

.post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%),
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.18), transparent 32%);
}

.music-box {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #faf8f4;
  border-radius: 8px;
  padding: 9px 11px;
  margin: 10px 0 0 58px;
}

.music-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #20242b;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
  flex: 0 0 auto;
}

.music-info {
  flex: 1;
  min-width: 0;
}

.music-info strong {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

audio {
  width: 100%;
  height: 32px;
}

.interaction-bubble {
  margin: 12px 0 0 58px;
  background: #f7f7f7;
  border-radius: 8px;
  padding: 10px 12px;
}

.bubble-like {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ececec;
}

.bubble-like .like-mark {
  color: var(--accent);
  font-size: 15px;
}

.bubble-like .like-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.bubble-comments {
  padding-top: 6px;
}

.bubble-comment {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  line-height: 1.6;
  padding: 5px 0;
}

.bubble-comment strong {
  color: var(--link);
  white-space: nowrap;
}

.bubble-comment.mine strong {
  color: #9a6700;
}

.bubble-actions {
  display: flex;
  gap: 2px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #ececec;
}

.action-btn {
  border: 0;
  background: transparent;
  color: #656b72;
  border-radius: 8px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  letter-spacing: 0;
}

.action-btn:hover {
  background: #eceae4;
}

.action-btn.liked {
  color: var(--accent);
}

.reply-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.reply-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
  color: var(--ink);
  outline: none;
}

.reply-form input:focus {
  border-color: #b6ac9c;
}

.reply-form button {
  border: 0;
  background: #20242b;
  color: #fff;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: 0;
}

.reply-form button:hover {
  background: #0d1117;
}

.empty {
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

.empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.empty code {
  background: #eceae4;
  border-radius: 5px;
  padding: 2px 5px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: #20242b;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 90;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.messages-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 65;
  width: 360px;
  max-width: 92vw;
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.16);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  padding: 18px;
  overflow-y: auto;
}

.messages-panel.open {
  transform: translateX(0);
}

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

.panel-head strong {
  font-size: 17px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px;
}

.message-list {
  display: grid;
  gap: 12px;
}

.message-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfaf7;
}

.message-item .message-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef2ff;
  color: #4f46e5;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.message-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.message-item time {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.mask {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.35);
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 23, 28, 0.58);
}

.modal-card {
  width: min(720px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.persona-posts {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.persona-post {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfaf7;
}

.persona-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.persona-post-head strong {
  font-size: 14px;
}

.persona-post-head time {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.persona-post-text {
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
}

.persona-post-comments {
  border-top: 1px solid #ececec;
  padding-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: #4b5563;
}

.post-menu {
  position: fixed;
  z-index: 80;
  min-width: 150px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.post-menu button {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  padding: 10px 16px;
  text-align: left;
  color: var(--ink);
}

.post-menu button:hover {
  background: #f4f2ed;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  min-width: 150px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.account-menu button {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  padding: 10px 16px;
  text-align: left;
  color: var(--ink);
}

.account-menu button:hover {
  background: #f4f2ed;
}

.account-menu button.danger {
  color: var(--red);
}

.skeleton {
  min-height: 220px;
}

.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: #e9e5dc;
  margin-bottom: 10px;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-line.short {
  width: 38%;
}

.skeleton-media {
  height: 150px;
  border-radius: 8px;
  background: #e3ded3;
  margin: 14px 0 0 58px;
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: minmax(0, 680px);
  }

  .rail {
    display: none;
  }
}

@media (max-width: 640px) {
  .app-top {
    padding: 10px 14px;
    align-items: flex-start;
  }

  .day-meta {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .day-meta .meta-item {
    display: none;
  }

  .cover {
    height: 170px;
  }

  .cover-avatar {
    right: 16px;
    bottom: 14px;
    width: 62px;
    height: 62px;
    border-radius: 10px;
  }

  .app-shell {
    padding: 16px 14px 60px;
  }

  .feed-top {
    flex-direction: column;
    align-items: stretch;
  }

  .post {
    padding: 14px;
  }

  .post-media,
  .music-box,
  .interaction-bubble {
    margin-left: 0;
  }

  .post-actions {
    justify-content: space-between;
  }

  .action-btn {
    padding: 8px 7px;
    font-size: 13px;
  }
}

.composer {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(32, 36, 43, 0.04);
}

.composer-avatar {
  width: 46px;
  height: 46px;
  border-radius: 8px;
}

.composer-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.composer-body input,
.composer-body textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfaf7;
  color: var(--ink);
  outline: none;
  font: inherit;
}

.composer-body input:focus,
.composer-body textarea:focus {
  border-color: #b6ac9c;
  background: #fff;
}

.composer-body textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.65;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.composer-actions span {
  font-size: 12px;
  color: var(--muted);
}

.composer-actions button {
  border: 0;
  background: #20242b;
  color: #fff;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 800;
  white-space: nowrap;
}

.composer-actions button:hover {
  background: #0d1117;
}

@media (max-width: 640px) {
  .composer {
    padding: 14px;
  }
}

.admin-link {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #4b4f55;
  text-decoration: none;
  font-size: 13px;
}

.admin-link:hover {
  background: #f4f2ed;
}

#cover {
  cursor: pointer;
}

#coverAvatar {
  cursor: pointer;
}

.feed-views {
  display: flex;
  gap: 8px;
}

.auth-card {
  display: grid;
  gap: 12px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1eee7;
}

.auth-tab {
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.auth-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fbfaf7;
  color: var(--ink);
  outline: none;
}

.auth-card input:focus {
  border-color: #b6ac9c;
  background: #fff;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.auth-btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #eceae4;
  color: #4b4f55;
  font-weight: 800;
}

.auth-btn.primary {
  background: #20242b;
  color: #fff;
}

.composer-avatar {
  cursor: default;
}

#loginBtn {
  background: #eceae4;
  color: #4b4f55;
}

#registerBtn {
  background: #20242b;
  color: #fff;
}

.auth-forgot {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.change-bg-btn {
  position: absolute;
  right: 28px;
  top: 20px;
  z-index: 3;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 999px;
  background: rgba(20,23,28,0.45);
  color: #fff;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.change-bg-btn:hover {
  background: rgba(20,23,28,0.7);
}

@media (max-width: 640px) {
  .change-bg-btn {
    right: 16px;
    top: 12px;
    padding: 7px 11px;
  }
}
