.moment-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
}

.moment-actions {
  position: relative;
  margin-left: auto;
}

.more-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #f7f7f7;
  color: #58709d;
  line-height: 1;
}

.more-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.moment-actions.open .more-button {
  border-color: transparent;
  background: #f7f7f7;
}

.action-popover {
  position: absolute;
  right: 38px;
  top: -3px;
  z-index: 5;
  display: flex;
  width: max-content;
  overflow: hidden;
  border-radius: 7px;
  background: #4c4c4c;
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}

.moment-actions.open .action-popover {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.action-popover form { margin: 0; }
.action-item {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 74px;
  height: 38px;
  justify-content: center;
  padding: 0 9px;
  border-radius: 0;
  background: transparent;
  color: #fff;
  white-space: nowrap;
  font-size: 13px;
}
.action-item + .action-item,
.action-popover form + .action-item { border-left: 1px solid #666; }
.action-item:hover { background: #424242; }
.action-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.action-item.liked { color: #fff; }

.comment-form.collapsed { display: none; }
.comment-form.expanded { display: flex; }
.reaction-heart { width: 20px; height: 20px; vertical-align: -4px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.like-link,
.like-link.liked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #58709d !important;
  font-size: 16px;
  font-weight: 400 !important;
  line-height: 1.45;
}
.like-link .reaction-heart,
.like-link.liked .reaction-heart {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #58709d;
  stroke-width: 1.8;
  vertical-align: middle;
}

body {
  color: #202124;
  font-family: "Microsoft YaHei", "Microsoft YaHei UI", sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}
.admin-page .panel > h1,
.admin-page .panel > h2 {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
}
button,
input,
textarea,
select { font-family: inherit; }
.moment-text { font-weight: 400; }
.link-card-title { font-weight: 600; }
.link-card-desc {
  color: #999;
  font-weight: 400;
}

/* Neutral controls shared by the public pages and admin panel. */
.comment-form button,
.admin-page button:not(.danger),
.admin-page .button {
  background: #f2f3f5;
  color: #4b4b4b;
  padding: 4px 8px;
  border-radius: 5px;
}
.comment-form button:hover,
.admin-page button:not(.danger):hover,
.admin-page .button:hover {
  background: #e7e9ed;
}
.admin-page a { text-decoration: none; }
.admin-page a:not(.button) { color: #666; }
.admin-page .form-grid button:not(.danger) {
  padding: 4px 0;
  border-radius: 0;
  background: transparent;
  color: #666;
}
.admin-page .form-grid button:not(.danger):hover {
  background: transparent;
  color: #333;
}
.admin-page form[action="/admin/settings"] button:not(.danger),
.admin-page form[action="/admin/weather-settings"] button:not(.danger) {
  padding: 4px 8px;
  border-radius: 5px;
  background: #f2f3f5;
  color: #4b4b4b;
}
.admin-page form[action="/admin/settings"] button:not(.danger):hover,
.admin-page form[action="/admin/weather-settings"] button:not(.danger):hover {
  background: #e7e9ed;
}
.admin-page form.panel.form-grid:not([action]) > .wide:last-child button {
  margin-right: 16px;
}
.admin-page button.danger {
  padding: 4px 8px;
  border-radius: 5px;
  background: #e56b6f;
  color: #fff;
}
.admin-page button.danger:hover { background: #d95d62; }

.moment-name,
.comment-name {
  color: #58709d;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
}
.moment-text {
  margin-top: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}
.moment-name-row { line-height: 24px; }
.moment-meta {
  color: #aaa;
  font-size: 13px;
}
.react-bubble {
  color: #242424;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
}
.comment-row { font-size: 16px; font-weight: 400; }
.side-card { color: #333; }
.side-title, .side-profile p, .bio { font-weight: 400; }

.weather-card .side-title {
  margin-bottom: 14px;
  color: #aaa;
  font-size: 14px;
  font-weight: 400;
}
.weather-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  border-radius: 13px;
  background: #f7f8fa;
}
.weather-icon {
  display: grid;
  flex: 0 0 54px;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(111, 132, 165, .12);
  border-radius: 17px;
  background: #e7ebf2;
}
.weather-icon svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: #8292aa;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.35;
}
.weather-reading { min-width: 0; }
.weather-reading > div { white-space: nowrap; }
.weather-reading strong {
  color: #202124;
  font-size: 31px;
  font-weight: 400;
  line-height: 1;
}
.weather-reading span { color: #777; font-size: 14px; }
.weather-reading b { color: #333; font-size: 15px; font-weight: 500; }
.weather-reading p {
  margin: 7px 0 0;
  overflow: hidden;
  color: #aaa;
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.weather-retry {
  width: 100%;
  margin-top: 10px;
  padding: 7px 10px;
  background: #eef1f6;
  color: #58709d;
  font-size: 13px;
}
.weather-source {
  display: block;
  margin-top: 8px;
  color: #bbb;
  font-size: 10px;
  text-align: right;
  text-decoration: none;
}

/* Softer separators, matching the reference theme. */
.moment { border-top: 0; }
.side-article,
.side-nav a { border-bottom-color: rgba(0, 0, 0, .045); }
.react-divider { background: rgba(0, 0, 0, .055); }
.like-row { border: 0; }

.archive-row {
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 10px 0 0;
  border-bottom: 0;
}
.archive-day {
  padding-top: 0;
  line-height: 1;
}
.archive-day small {
  margin-top: 5px;
  line-height: 1.2;
}
.archive-entry {
  display: block;
  min-height: 74px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(0, 0, 0, .045);
}
.archive-text { vertical-align: top; }

/* Compact desktop proportions matching the reference layout. */
@media (min-width: 1101px) {
  .site-shell {
    width: min(1128px, calc(100% - 32px));
    grid-template-columns: 240px 600px 240px;
    gap: 24px;
  }
  .main-card { width: 600px; }
  .cover, .archive-head { height: 340px; }
  .profile { right: 18px; bottom: -30px; gap: 10px; font-size: 18px; }
  .profile img, .archive-profile img { width: 64px; height: 64px; }
  .bio, .archive-bio { padding: 40px 18px 14px; }
  .moment { gap: 10px; padding: 18px 22px; }
  .moment-avatar { width: 48px; height: 48px; }
  .moment-name, .moment-text { font-size: 16px; }
  .side-card { padding: 18px 17px; border-radius: 14px; }
  .side-profile img { width: 62px; height: 62px; }
  .side-article, .side-nav a, .social-link { padding-top: 7px; padding-bottom: 7px; font-size: 14px; }
  .content-shell {
    width: min(864px, calc(100% - 32px));
    grid-template-columns: 600px 240px;
    gap: 24px;
  }
  .reader-card { padding: 26px 34px; }
  .reader-card > h1 { font-size: 25px; }
  .reader-content h1 { font-size: 20px; }
  .reader-content h2 { font-size: 19px; }
  .reader-content h3 { font-size: 18px; }
  .reader-content { font-size: 17px; }
  .archive-list { padding-left: 18px; padding-right: 18px; }
  .more-button { width: 30px; height: 30px; }
  .more-button svg { width: 15px; height: 15px; }
  .action-popover { right: 36px; top: -4px; }
  .action-item { width: 70px; height: 38px; padding: 0 8px; font-size: 13px; }
  .action-icon { width: 15px; height: 15px; }
}

.reader-content p { margin: .55em 0; }
.reader-content h1,
.reader-content h2,
.reader-content h3 {
  margin: .8em 0 .35em;
  font-weight: 600;
  line-height: 1.4;
}
.reader-content h1,
.reader-content h2 {
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(0, 0, 0, .07);
}
.reader-content img {
  display: block;
  margin: .45em 0;
}
.reader-content a {
  color: #00b96b;
  text-decoration: none;
}
.reader-content a:hover { color: #009a59; }

.reader-card > h1 {
  margin: 30px 0 8px;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.45;
}
.reader-card,
.reader-card button,
.reader-card input,
.reader-card textarea {
  font-family: "Microsoft YaHei", "Microsoft YaHei UI", sans-serif;
}
.reader-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: #aaa;
  font-size: 13px;
  line-height: 1.6;
}
.original-badge {
  flex: none;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f1f1;
  color: #aaa;
  font-size: 11px;
  line-height: 1.5;
}
.reader-content {
  font-family: "Microsoft YaHei", "Microsoft YaHei UI", sans-serif;
  font-size: 17px;
  line-height: 1.9;
}
.reader-content > :first-child { margin-top: 0; }

@media (max-width: 767px) {
  .comment-form {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }
  .comment-form input,
  .comment-form button {
    box-sizing: border-box;
    height: 40px;
    margin: 0;
  }
  .comment-form input[name="name"] {
    width: 86px;
    flex: none;
  }
  .comment-form input[name="content"] {
    flex: 1;
    min-width: 0;
  }
  .comment-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    padding: 0 10px;
    white-space: nowrap;
  }
  .reader-card > h1 { margin-top: 26px; font-size: 21px; }
  .reader-meta { gap: 6px; margin-bottom: 12px; font-size: 12px; }
  .original-badge { padding: 1px 5px; font-size: 10px; }
}

@media (max-width: 767px) {
  .moment-footer { min-height: 28px; }
  .more-button {
    width: 28px;
    height: 28px;
    border-width: 1px;
    border-radius: 4px;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
  }
  .more-button svg {
    width: 14px;
    height: 14px;
  }
  .action-popover {
    right: 33px;
    top: -4px;
    border-radius: 5px;
  }
  .action-item {
    gap: 4px;
    width: 66px;
    height: 35px;
    padding: 0 7px;
    font-size: 13px;
  }
  .action-icon {
    width: 15px;
    height: 15px;
  }
}
