:root {
  --brand-red: #a31f1f;
  --page-bg-image: url("../../小图/微信图片_20260414214619_122_535.jpg");
  --card-bg: rgba(255, 255, 255, 0.52);
  --text-main: #3f2920;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #e8e2d5;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #2f2520;
}

.page {
  max-width: 375px;
  min-height: 100vh;
  margin: 0 auto;
  background:
    linear-gradient(rgba(244, 239, 228, 0.84), rgba(244, 239, 228, 0.84)),
    var(--page-bg-image) center top / cover no-repeat;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 20px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--brand-red);
  color: #fff;
}

.topbar-main {
  height: calc(52px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
}

.back-btn {
  font-size: 28px;
  color: #fff;
  text-decoration: none;
  line-height: 1;
}

.centered-title {
  margin: 0;
  justify-self: center;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  color: #fff;
}

.content {
  padding: 14px 12px 18px;
}

.calendar-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px 10px 10px;
  border: 1px solid rgba(225, 212, 191, 0.75);
}

.calendar-header {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.calendar-header select {
  padding: 6px 12px;
  border: 1px solid #d9c89c;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  color: #713132;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.calendar-header select:focus {
  border-color: var(--brand-red);
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #713132;
  margin-bottom: 8px;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px 0;
}

.day {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #66292c;
}

.day.empty {
  visibility: hidden;
}

.day.has-diary .diary-icon {
  width: 21px;
  height: 21px;
  object-fit: contain;
}

.poster-wrap {
  margin-top: 12px;
  position: relative;
  width: min(90%, 320px);
  margin-left: auto;
  margin-right: auto;
}

.poster-wrap img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.poster-overlay {
  position: absolute;
  inset: 0;
}

.message-card {
  position: absolute;
  left: 19%;
  right: 9%;
  top: 16%;
}

.message-card {
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
}

.message-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--text-main);
  text-align: center;
}

.actions {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 41%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-btn {
  text-decoration: none;
  text-align: center;
  background: #a31f1f;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: 20px;
}

/* 日记列表样式 */
.diary-section {
  margin-top: 12px;
}

.diary-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.diary-date-group {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(225, 212, 191, 0.75);
}

.diary-date-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-red);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(225, 212, 191, 0.5);
}

.diary-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(225, 212, 191, 0.3);
  cursor: pointer;
  transition: background-color 0.2s;
}

.diary-item:hover {
  background-color: rgba(163, 31, 31, 0.05);
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
  margin-left: -8px;
  margin-right: -8px;
}

.diary-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.view-more {
  font-size: 12px;
  color: var(--brand-red);
  margin-top: 8px;
  text-align: right;
}

.diary-time {
  font-size: 12px;
  color: #9b8f82;
  margin-bottom: 4px;
}

.diary-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.diary-content {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #5a4a3a;
  white-space: pre-wrap;
}

.diary-images {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.diary-images img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

/* 底部导航栏 */
.bottom-tab {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(375px, 100vw);
  height: calc(60px + env(safe-area-inset-bottom));
  background: #f1ebdf;
  border-top: 1px solid #ded5c3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px 2px env(safe-area-inset-bottom);
}

.tab-item {
  text-decoration: none;
  color: #9fa3a9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
}

.tab-item .icon {
  font-size: 18px;
  line-height: 1;
}

.tab-item.active {
  color: #c8a24a;
  font-weight: 600;
}

