:root {
  --brand-red: #a31f1f;
  --accent-gold: #c8a24a;
  --page-bg-image: url("../../小图/微信图片_20260414214619_122_535.jpg");
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #e8e2d5;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #2f2520;
}

button {
  font: inherit;
}

.page {
  max-width: 375px;
  min-height: 100vh;
  margin: 0 auto;
  background:
    linear-gradient(rgba(244, 239, 228, 0.76), rgba(244, 239, 228, 0.76)),
    var(--page-bg-image) center top / cover no-repeat;
  position: relative;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--brand-red);
  color: #fff;
}

.topbar-main {
  height: calc(50px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-btn {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  padding: 0;
}

.topbar h1 {
  margin: 0;
  text-align: center;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  color: #fff;
}

.right-actions {
  width: 86px;
  height: 32px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  font-size: 14px;
}

.right-actions .divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.2);
}

.content {
  padding: 40px 10px 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 50px);
}

.diary-card-wrap {
  position: relative;
  width: 100%;
  max-width: 340px;
  display: flex;
  justify-content: center;
}

.diary-frame {
  width: 100%;
  height: auto;
  display: block;
}

.diary-copy {
  position: absolute;
  inset: 85px 55px 95px 75px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.date-row {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 0;
}

.date-row strong {
  color: #453831;
  font-size: 32px;
  line-height: 0.85;
  font-weight: 700;
}

.year-month {
  color: #453831;
  font-size: 14px;
  line-height: 1;
  font-weight: 500;
}

.red-line {
  width: 28px;
  height: 3px;
  background: #b52323;
  margin: 8px 0 12px;
  align-self: flex-start;
  border-radius: 2px;
}

.text-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diary-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #453831;
  text-align: justify;
  letter-spacing: 0.3px;
}

.diary-copy .ending {
  width: 100%;
  margin-top: 10px;
  margin-bottom: 10px;
  text-align: center;
  font-size: 14px;
  color: #453831;
}

#go-diary-btn {
  margin-top: 0;
  width: 120px;
  min-height: 36px;
  border: 0;
  border-radius: 18px;
  background: #b52323;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(181, 35, 35, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bottom-tab {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(375px, 100vw);
  height: calc(70px + env(safe-area-inset-bottom));
  background: #f1ebdf;
  border-top: 1px solid #ded5c3;
  display: grid;
  grid-template-columns: repeat(4, 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: var(--accent-gold);
  font-weight: 600;
}
