@import url("/assets/fonts/lxgw/lxgwwenkaiscreen.css");

@font-face {
  font-family: "LXGW";
  src: url("/assets/fonts/lxgw.woff2") format("woff2");
  font-display: swap;
}

:root {
  --main-background: #ffffff;
  --body-background: #f0f0f0;
  --music-background: #f7f7f7;
  --primary-background: #f7f7f7;
  --primary-background-hover: #dedede;
  --text-color: #333333;
  --text-sub-color: #555555;
  --line: rgb(243 244 246 / 1);
  --link: #576b95;
  --green: #07c160;
  --pj-modal-background: rgb(76 76 76);
  --pj-modal-color: #ffffff;
  --modal-background: #ffffff;
  --modal-input-background: #ffffff;
  color-scheme: light;
}

:root.dark {
  --main-background: #262626;
  --body-background: #181818;
  --music-background: #2a2a2a;
  --primary-background: #323232;
  --primary-background-hover: #434343;
  --text-color: #aaaaaa;
  --text-sub-color: #888888;
  --line: #333333;
  --modal-background: #666666;
  --modal-input-background: #777777;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

::-webkit-scrollbar {
  display: none;
}

html {
  scrollbar-width: none;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--body-background);
  color: var(--text-color);
  font-family: "LXGW WenKai Screen", "LXGW", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  text-wrap: pretty;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--link);
  text-decoration: none;
}

img,
video {
  max-width: 100%;
}

[x-cloak] {
  display: none !important;
}

.page-shell {
  position: relative;
  width: min(100%, 576px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--main-background);
  box-shadow: 0 0 22px rgb(0 0 0 / 0.06);
}

.top-nav {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 50%;
  width: min(100%, 576px);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: #ffffff;
  background: transparent;
  transform: translateX(-50%);
  transition-property: background-color, color, box-shadow;
  transition-duration: 180ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.top-nav.scrolled {
  color: #888888;
  background: var(--body-background);
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.06);
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-nav button,
.modal-close,
.post-more-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition-property: background-color, transform;
  transition-duration: 140ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.top-nav button:active,
.modal-close:active,
.post-more-button:active,
.primary-button:active,
.inline-comment-actions button:active {
  transform: scale(0.96);
}

.top-nav button:hover,
.modal-close:hover,
.post-more-button:hover {
  background: rgb(0 0 0 / 0.04);
}

.nav-title {
  color: inherit;
  font-size: 15px;
  opacity: 0;
  transform: translateY(-2px);
  transition-property: opacity, transform;
  transition-duration: 180ms;
}

.top-nav.scrolled .nav-title {
  opacity: 1;
  transform: translateY(0);
}

.wm-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wm-icon.tiny {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.header-container {
  position: relative;
  height: 320px;
  overflow: visible;
  background: #5f6a72;
}

.header-image,
.header-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background-position: center;
  background-size: cover;
}

.site-profile {
  position: absolute;
  right: 16px;
  bottom: -46px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.site-copy {
  padding-bottom: 52px;
  color: #ffffff;
  text-align: right;
  text-shadow: 0 1px 5px rgb(0 0 0 / 0.35);
}

.site-copy h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
  text-wrap: balance;
}

.site-copy p {
  margin: 4px 0 0;
  font-size: 13px;
}

.site-avatar {
  width: 60px;
  height: 60px;
  flex: 0 0 auto;
  border-radius: 5px;
  background: var(--main-background);
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.18);
  overflow: hidden;
}

.site-avatar img,
.post-avatar img,
.profile-card img,
.friend-link img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  outline: 1px solid rgb(0 0 0 / 0.1);
  outline-offset: -1px;
}

:root.dark .site-avatar img,
:root.dark .post-avatar img,
:root.dark .profile-card img,
:root.dark .friend-link img,
:root.dark .post-image img {
  outline-color: rgb(255 255 255 / 0.1);
}

.content-container {
  padding-top: 58px;
}

.header-container + .content-container {
  padding-top: 66px;
}

.post-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  padding: 18px 14px 14px;
  border-bottom: 1px solid var(--line);
}

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  overflow: hidden;
}

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

.post-head {
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.post-author {
  color: var(--link);
  font-weight: 700;
}

.post-badges {
  display: flex;
  gap: 4px;
  font-size: 11px;
  color: var(--text-sub-color);
}

.post-badges span {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--primary-background);
}

.post-title {
  margin: 6px 0 4px;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: 0;
  text-wrap: balance;
}

.post-content {
  margin-top: 4px;
  color: var(--text-color);
  overflow-wrap: anywhere;
}

.post-images {
  margin-top: 8px;
  display: grid;
  gap: 4px;
}

.post-images.grid {
  width: min(252px, 100%);
  grid-template-columns: repeat(3, 1fr);
}

.post-images.four {
  width: 168px;
  grid-template-columns: repeat(2, 80px);
}

.post-images.single {
  display: block;
}

.post-image {
  position: relative;
  display: block;
  width: 80px;
  height: 80px;
  overflow: hidden;
  background: var(--primary-background);
}

.post-images.single .post-image {
  width: min(240px, 80%);
  height: auto;
  max-height: 320px;
}

.post-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  outline: 1px solid rgb(0 0 0 / 0.1);
  outline-offset: -1px;
}

.post-images.single img {
  height: auto;
  max-height: 320px;
  object-fit: contain;
}

.post-image-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 24px;
  background: rgb(0 0 0 / 0.45);
}

.post-video {
  width: min(280px, 100%);
  margin-top: 8px;
  border-radius: 4px;
  background: #000000;
}

.share-card {
  width: min(320px, 100%);
  min-height: 56px;
  margin-top: 8px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 6px;
  border-radius: 5px;
  color: var(--text-color);
  background: var(--primary-background);
}

.share-card img {
  width: 44px;
  height: 44px;
  object-fit: cover;
}

.post-location {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--link);
  font-size: 13px;
}

.post-meta {
  position: relative;
  min-height: 32px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-time {
  color: var(--text-sub-color);
  font-size: 13px;
}

.post-time-comment-modal {
  position: absolute;
  right: 44px;
  top: 0;
  display: flex;
  overflow: hidden;
  border-radius: 4px;
  color: #ffffff;
  background: var(--pj-modal-background);
  box-shadow: 0 6px 16px rgb(0 0 0 / 0.18);
}

.post-time-comment-modal[hidden] {
  display: none;
}

.post-time-comment-modal button {
  min-width: 72px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  color: #ffffff;
  background: transparent;
  cursor: pointer;
}

.post-comment-container {
  position: relative;
  margin-top: 4px;
  padding: 7px 9px;
  border-radius: 3px;
  background: var(--primary-background);
}

.post-comment-container[hidden] {
  display: none;
}

.post-comment-container::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 12px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--primary-background);
}

.post-like-line {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--link);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.post-comment {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
}

.comment-text {
  min-height: 26px;
  padding: 0;
  border: 0;
  color: var(--text-color);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.comment-text a,
.comment-text b {
  color: var(--link);
}

.comment-delete {
  margin-left: auto;
  border: 0;
  color: var(--text-sub-color);
  background: transparent;
  cursor: pointer;
}

.inline-comment-form {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.inline-comment-form[hidden] {
  display: none;
}

.inline-comment-form textarea,
.inline-comment-form input,
.wm-modal-card input,
.wm-modal-card textarea,
.wm-modal-card select,
.standalone-auth input,
.admin-settings-form input,
.admin-settings-form textarea,
.admin-settings-form select,
.admin-inline-form input,
.admin-table select {
  width: 100%;
  border: 0;
  border-radius: 5px;
  padding: 10px 11px;
  color: var(--text-color);
  background: var(--modal-input-background);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08);
  outline: none;
  transition-property: box-shadow, background-color;
  transition-duration: 140ms;
}

.inline-comment-form textarea:focus,
.wm-modal-card input:focus,
.wm-modal-card textarea:focus,
.standalone-auth input:focus,
.admin-settings-form input:focus,
.admin-settings-form textarea:focus {
  box-shadow: inset 0 0 0 1px var(--green), 0 0 0 3px rgb(7 193 96 / 0.12);
}

.inline-comment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.inline-comment-actions button,
.primary-button,
.admin-panel button,
.bulk-actions button {
  min-height: 40px;
  border: 0;
  border-radius: 5px;
  padding: 0 14px;
  color: var(--text-color);
  background: var(--primary-background);
  cursor: pointer;
  transition-property: background-color, transform, opacity;
  transition-duration: 140ms;
}

.primary-button {
  width: 100%;
  color: #ffffff;
  background: var(--green);
}

.primary-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.wm-modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
}

.wm-modal-mask {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.45);
}

.wm-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(720px, 92vh);
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
  background: var(--modal-background);
  box-shadow: 0 18px 50px rgb(0 0 0 / 0.28);
}

.wm-modal-card h2,
.standalone-auth h1,
.plain-page h1,
.profile-card h1,
.admin-topbar h1 {
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
  text-wrap: balance;
}

.modal-close {
  position: absolute;
  right: 8px;
  top: 8px;
}

.auth-card form,
.standalone-auth form,
.admin-settings-form {
  display: grid;
  gap: 12px;
}

.auth-card label span,
.standalone-auth label span,
.admin-settings-form label span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-sub-color);
  font-size: 13px;
}

.auth-switch {
  margin: 14px 0 0;
  color: var(--text-sub-color);
  text-align: center;
}

.auth-switch button {
  border: 0;
  color: var(--link);
  background: transparent;
  cursor: pointer;
}

.settings-card {
  width: min(100%, 360px);
}

.setting-row {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.setting-row span {
  display: block;
  color: var(--text-sub-color);
  font-size: 13px;
}

.switch {
  position: relative;
  width: 52px;
  height: 32px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: var(--primary-background-hover);
  transition-property: background-color;
  transition-duration: 160ms;
}

.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.2);
  transition-property: transform;
  transition-duration: 160ms;
}

.switch input:checked + i {
  background: var(--green);
}

.switch input:checked + i::after {
  transform: translateX(20px);
}

.write-card {
  width: min(100%, 520px);
}

.write-card textarea[name="content"] {
  min-height: 140px;
  resize: vertical;
}

.write-count {
  color: var(--text-sub-color);
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.media-picker {
  display: grid;
  grid-template-columns: repeat(3, 80px);
  gap: 8px;
}

.media-add,
.media-preview {
  width: 80px;
  height: 80px;
  border: 0;
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: var(--text-sub-color);
  background: var(--primary-background);
  overflow: hidden;
}

.media-add span {
  font-size: 12px;
}

.media-preview {
  position: relative;
}

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

.media-preview button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: rgb(0 0 0 / 0.55);
}

.write-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text-sub-color);
  font-size: 13px;
}

.write-options label,
.write-options button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 5px;
  padding: 0 8px;
  background: var(--primary-background);
}

.links-grid {
  display: grid;
  gap: 10px;
}

.links-grid.full {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.friend-link {
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
  color: var(--text-color);
  background: var(--primary-background);
}

.friend-link img {
  width: 42px;
  height: 42px;
  border-radius: 5px;
}

.friend-link strong,
.friend-link small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-link small {
  color: var(--text-sub-color);
}

.plain-page,
.standalone-auth,
.profile-card {
  padding: 24px 18px;
}

.standalone-auth {
  max-width: 420px;
  margin: 0 auto;
}

.profile-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.profile-card img {
  width: 64px;
  height: 64px;
  border-radius: 6px;
}

.empty-state,
.feed-loading {
  padding: 28px 16px;
  color: var(--text-sub-color);
  text-align: center;
}

.site-footer {
  padding: 24px 16px;
  color: var(--text-sub-color);
  text-align: center;
  font-size: 12px;
}

.wm-dialog-root {
  position: fixed;
  z-index: 80;
  inset: 0;
  pointer-events: none;
}

.wm-dialog-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  pointer-events: auto;
  transition-property: opacity;
  transition-duration: 160ms;
}

.wm-dialog-layer.visible {
  opacity: 1;
}

.wm-dialog-layer.leaving {
  opacity: 0;
}

.wm-dialog-mask {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.35);
}

.wm-dialog-card {
  position: relative;
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  background: var(--modal-background);
  box-shadow: 0 18px 48px rgb(0 0 0 / 0.25);
  transform: translateY(8px);
  transition-property: transform;
  transition-duration: 160ms;
}

.wm-dialog-layer.visible .wm-dialog-card {
  transform: translateY(0);
}

.wm-dialog-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--link);
  font-weight: 700;
}

.wm-dialog-icon.danger {
  background: #d93025;
}

.wm-dialog-copy h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.wm-dialog-copy p {
  margin: 0;
  color: var(--text-sub-color);
}

.wm-dialog-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.wm-dialog-actions button {
  min-width: 72px;
  height: 38px;
  border: 0;
  border-radius: 5px;
  background: var(--primary-background);
}

.admin-body {
  background: var(--body-background);
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: var(--main-background);
  box-shadow: 1px 0 0 var(--line);
}

.admin-brand {
  display: block;
  margin-bottom: 18px;
  color: var(--text-color);
  font-size: 18px;
  font-weight: 700;
}

.admin-sidebar nav {
  display: grid;
  gap: 4px;
}

.admin-sidebar a {
  min-height: 40px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text-color);
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
  background: var(--primary-background);
}

.admin-main {
  padding: 22px;
}

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

.admin-topbar div {
  display: flex;
  gap: 12px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-stats div,
.admin-panel {
  border-radius: 8px;
  padding: 16px;
  background: var(--main-background);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.06);
}

.admin-stats strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.admin-stats span {
  color: var(--text-sub-color);
}

.trend-svg {
  width: 100%;
  height: 160px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table small {
  display: block;
  color: var(--text-sub-color);
}

.bulk-actions,
.admin-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-settings-form {
  max-width: 760px;
}

.admin-settings-form h2 {
  margin: 16px 0 0;
  font-size: 16px;
}

.bootstrap-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

@media (max-width: 720px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-sidebar nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-main {
    padding: 14px;
  }

  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .header-container {
    height: 300px;
  }

  .post-item {
    padding-left: 12px;
    padding-right: 12px;
  }

  .media-picker {
    grid-template-columns: repeat(3, 72px);
  }

  .media-add,
  .media-preview,
  .post-image {
    width: 72px;
    height: 72px;
  }

  .post-images.grid {
    width: 224px;
  }

  .post-images.four {
    width: 152px;
    grid-template-columns: repeat(2, 72px);
  }
}
