:root {
  --brand-red: #a31f1f;
  --page-bg-image: url("../../小图/微信图片_20260414214619_122_535.jpg");
  --card-bg: rgba(255, 255, 255, 0.54);
  --rail: rgba(149, 114, 82, 0.45);
  --text-main: #3f2920;
  --text-sub: #8f7e72;
}

* {
  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.78), rgba(244, 239, 228, 0.78)),
    var(--page-bg-image) center top / cover no-repeat;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 80px;
}

.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;
}

.topbar h1.centered-title {
  margin: 0;
  justify-self: center;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  color: #fff;
}

.content {
  padding: 14px 12px 0;
}

.diary-stream {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.stream-item {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 8px;
  align-items: start;
}

.time-rail {
  position: relative;
  color: var(--text-sub);
}

.day-big {
  font-size: 54px;
  font-weight: 700;
  color: rgba(82, 70, 65, 0.5);
  line-height: 1;
}

.ym-small {
  margin-top: 3px;
  font-size: 16px;
  font-weight: 600;
  color: rgba(82, 70, 65, 0.62);
}

.time-small {
  margin-top: 3px;
  font-size: 15px;
  color: rgba(82, 70, 65, 0.7);
}

.rail-line {
  position: absolute;
  left: 24px;
  top: 92px;
  bottom: -8px;
  width: 1px;
  background: var(--rail);
}

.card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 9px 9px 10px;
  border: 1px solid rgba(229, 217, 195, 0.85);
}

.tag-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.tag {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 2px;
  line-height: 1.2;
  white-space: nowrap;
}

.t-orange {
  background: #ffeec2;
  color: #b08100;
}

.t-blue {
  background: #d7e8ff;
  color: #0056b3;
}

.t-green {
  background: #e0ffd7;
  color: #2d8a00;
}

.t-purple {
  background: #f3d7ff;
  color: #7a00b3;
}

.text {
  font-size: 15px;
  line-height: 1.72;
  color: var(--text-main);
  text-align: justify;
  margin-bottom: 9px;
}

.img-row {
  display: grid;
  gap: 8px;
}

.img-row.two {
  grid-template-columns: repeat(2, 1fr);
}

.img-row.three {
  grid-template-columns: repeat(3, 1fr);
}

.img-row img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

.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(3, 1fr);
  padding: 6px 2px env(safe-area-inset-bottom);
  z-index: 20;
}

.tab-item {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #8c7e75;
  font-size: 12px;
}

.tab-item.active {
  color: #a08d7a;
}

.tab-item .icon {
  font-size: 24px;
}

