/* Amber diary — moon pearl lace */

.amber-page {
  min-height: 100vh;
  background: none;
  padding: 0 0 120px;
  position: relative;
  overflow-x: hidden;
}
.amber-page::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: var(--amber-wall, var(--wall-image));
  background-size: cover;
  background-position: center;
  pointer-events: none;
}
.amber-moon { display: none;
  position: absolute; top: -20px; left: -30px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, var(--bg) 0%, var(--solid-bar) 55%, var(--solid-bar) 100%);
  box-shadow: 0 0 30px var(--glow), inset -12px -10px 20px var(--glow);
  opacity: 0.82; z-index: 0;
}
.amber-pearls { display: none;
  position: absolute; top: 60px; left: 52px;
  flex-direction: column; gap: 10px; z-index: 1;
}
.amber-pearls .p {
  width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0%, var(--solid-bar) 50%, var(--solid-bar) 100%);
  box-shadow: 0 1px 4px var(--glow);
}
.amber-pearls .p:nth-child(2) { width: 10px; height: 10px; margin-left: 4px; }
.amber-pearls .p:nth-child(4) { width: 7px; height: 7px; margin-left: -2px; }
.amber-pearls .p-drop {
  width: 12px; height: 16px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #ece4f6 50%, #d8cce8 100%);
  box-shadow: 0 2px 6px var(--glow);
  margin-left: 2px;
}
.amber-menu-btn {
  position: absolute; top: 52px; right: 16px; z-index: 50;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.5); border: 1px solid var(--hairline);
  backdrop-filter: blur(8px); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 18px;
}
.amber-title-area { text-align: center; padding: 80px 20px 0; display: flex; flex-direction: column; align-items: center; position: relative; z-index: 2; }
.amber-title {
  font-family: "Pinyon Script", "Cormorant Garamond", Georgia, cursive;
  font-size: 34px; font-weight: 400; color: var(--accent);
  letter-spacing: 2px; margin-bottom: 6px;
}
.amber-ribbon { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0; opacity: 0.5; }
.amber-ribbon svg { width: 120px; height: 16px; }
.amber-subtitle { font-size: 11px; letter-spacing: 2px; color: var(--text-dim); margin-top: 6px; }
.amber-avatars { display: none;
  display: flex; justify-content: center; gap: 20px;
  padding: 18px 0 8px; position: relative; z-index: 2;
}
.amber-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid var(--hairline);
  background: var(--card-bg) no-repeat center / cover;
  object-fit: cover; box-shadow: 0 2px 10px var(--glow);
}
.amber-week {
  margin: 16px auto; padding: 14px 12px;
  background: rgba(255,255,255,0.55); backdrop-filter: blur(10px);
  border: 1px solid var(--hairline); border-radius: 16px;
  max-width: 360px; position: relative; z-index: 2;
}
.amber-week-head {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 12px; color: var(--text-dim);
  margin-bottom: 8px; letter-spacing: 1px;
}
.amber-week-days {
  display: grid; grid-template-columns: repeat(7, 1fr); text-align: center;
}
.amber-week-day {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 15px; color: var(--text); padding: 4px 0;
  cursor: pointer;
}
.amber-week-day.today .amber-day-num {
  background: var(--accent); color: #fff; border-radius: 50%;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
}
.amber-week-day.selected .amber-day-num {
  border: 1.5px solid var(--accent); border-radius: 50%;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
}
.amber-week-day.has-entry::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-top: 2px;
}
.amber-day-num { font-size: 15px; font-weight: 500; }
.amber-cards-wrap {
  position: relative; z-index: 2;
  margin: 16px auto; max-width: 380px; padding: 0 12px;
}
.amber-cards {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  gap: 0; padding: 0;
}
.amber-cards::-webkit-scrollbar { display: none; }
.amber-card {
  flex: 0 0 100%; scroll-snap-align: start;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(14px);
  border: 1px solid var(--hairline);
  border-radius: 18px; padding: 20px 16px;
  display: flex; gap: 14px; min-height: 200px;
  position: relative; overflow: hidden;
  box-shadow: 0 2px 12px var(--glow);
  background-size: cover; background-position: center;
}
.amber-card::after {
  content: ""; position: absolute; bottom: -2px; right: -2px;
  width: 90px; height: 90px; pointer-events: none; opacity: 0.7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cpath d='M90 0 C60 20 40 50 20 90 M90 15 C65 30 50 55 35 90 M90 30 C70 42 60 60 50 90' fill='none' stroke='%23d4c8e8' stroke-width='0.6'/%3E%3Ccircle cx='75' cy='75' r='3' fill='%23e8e0f4'/%3E%3Ccircle cx='60' cy='82' r='2.5' fill='%23ece5f5'/%3E%3Ccircle cx='80' cy='60' r='2' fill='%23ece5f5'/%3E%3C/svg%3E");
  background-size: cover;
}
.amber-card-date {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-width: 56px;
  border-right: 1px solid var(--hairline); padding-right: 12px;
}
.amber-card-month { font-size: 12px; color: var(--text-dim); letter-spacing: 1px; }
.amber-card-day { font-size: 36px; font-weight: 300; color: var(--accent); line-height: 1.2; }
.amber-card-weekday { font-size: 11px; color: var(--accent); margin-top: 2px; }
.amber-card-body { flex: 1; display: flex; flex-direction: column; }
.amber-card-time { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; }
.amber-card-time .heart { color: var(--accent); }
.amber-card-text {
  font-size: 14px; line-height: 2.2; color: var(--text);
  white-space: pre-wrap; flex: 1;
}
.amber-card-mood {
  display: inline-block; font-size: 11px; color: var(--accent);
  background: var(--glow); border: 1px solid rgba(140,100,180,0.15);
  border-radius: 999px; padding: 2px 10px; margin-bottom: 6px;
}
.amber-dots { display: flex; justify-content: center; gap: 6px; padding: 12px 0; }
.amber-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--solid-bar); transition: background 0.2s;
}
.amber-dot.active { background: var(--accent); }
.amber-empty { text-align: center; padding: 50px 20px; color: var(--text-dim); width: 100%; display: flex; flex-direction: column; align-items: center; }
.amber-empty p:first-child { font-size: 28px; margin-bottom: 10px; opacity: 0.5; }
.amber-empty p:last-child { font-size: 12px; letter-spacing: 1.5px; }
.amber-fab {
  position: fixed; bottom: calc(96px + env(safe-area-inset-bottom));
  right: 28px; width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent)); border: none;
  color: white; font-size: 24px; font-weight: 300; cursor: pointer;
  box-shadow: 0 4px 16px var(--accent-soft); z-index: 20;
}
.amber-fab:active { transform: scale(0.92); }
/* editor overlay */
.amber-editor-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px); z-index: 200;
  display: none; align-items: flex-end; justify-content: center;
}
.amber-editor-overlay.open { display: flex; }
.amber-editor {
  width: 100%; max-width: 420px;
  background: var(--solid-card); border-radius: 20px 20px 0 0;
  padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  animation: amberSlide 0.25s ease-out;
}
@keyframes amberSlide { from { transform: translateY(100%); } to { transform: translateY(0); } }
.amber-editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.amber-editor-head h3 { font-family: Georgia, serif; font-size: 15px; font-weight: 400; color: var(--accent); }
.amber-close { background: none; border: none; font-size: 20px; color: var(--text-dim); cursor: pointer; padding: 4px 8px; }
.amber-moods { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.amber-mood-btn {
  background: none; border: 1px solid var(--hairline);
  border-radius: 999px; padding: 4px 11px; font-size: 12px;
  cursor: pointer; color: var(--text-dim);
}
.amber-mood-btn.on { border-color: var(--accent); color: var(--accent); background: var(--glow); }
.amber-editor textarea {
  width: 100%; min-height: 100px;
  border: 1px solid var(--hairline); border-radius: 12px;
  padding: 12px 14px; font-size: 14px; line-height: 1.9;
  color: var(--text); background: rgba(255,255,255,0.6);
  resize: none; outline: none; font-family: inherit;
}
.amber-editor textarea:focus { border-color: var(--accent); }
.amber-editor textarea::placeholder { color: var(--text-dim); }
.amber-save {
  width: 100%; margin-top: 12px; padding: 11px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent));
  color: white; font-size: 14px; letter-spacing: 0.5px;
  cursor: pointer; font-family: inherit;
}
.amber-save:active { opacity: 0.85; }
/* settings panel */
.amber-settings-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.25);
  backdrop-filter: blur(3px); z-index: 300;
  display: none; align-items: flex-start; justify-content: flex-end;
}
.amber-settings-overlay.open { display: flex; }
.amber-settings {
  width: 280px; max-width: 80vw; height: 100%;
  background: var(--solid-card); padding: 60px 18px 30px;
  box-shadow: -4px 0 20px rgba(0,0,0,0.08);
  overflow-y: auto; animation: amberSlideR 0.2s ease-out;
}
@keyframes amberSlideR { from { transform: translateX(100%); } to { transform: translateX(0); } }
.amber-settings h3 {
  font-family: Georgia, serif; font-size: 16px; font-weight: 400;
  color: var(--accent); margin-bottom: 20px;
}
.amber-set-group { margin-bottom: 22px; }
.amber-set-label { font-size: 12px; color: var(--text-dim); letter-spacing: 1px; margin-bottom: 8px; }
.amber-set-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.amber-set-btn {
  background: rgba(255,255,255,0.6); border: 1px solid var(--hairline);
  border-radius: 10px; padding: 8px 14px; font-size: 12px;
  color: var(--accent); cursor: pointer; font-family: inherit;
}
.amber-set-btn:active { background: var(--glow); }
.amber-set-color {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--hairline); cursor: pointer;
}
.amber-set-close {
  position: absolute; top: 18px; right: 18px;
  background: none; border: none; font-size: 20px;
  color: var(--text-dim); cursor: pointer;
}
.amber-card-del {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,0.7); border: 1px solid var(--hairline);
  color: var(--text-dim); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); line-height: 1;
}
.amber-card-del:active { background: var(--glow); }
.amber-set-input {
  flex: 1; min-width: 0; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--hairline); font-size: 13px;
  color: var(--text); background: rgba(255,255,255,0.6);
  outline: none; font-family: inherit;
}
.amber-set-input:focus { border-color: var(--accent); }
.amber-set-input::placeholder { color: var(--text-dim); }
/* year-month row */
.amber-ym-row {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; padding: 4px 0 10px;
}
.amber-ym {
  font-size: 14px; color: var(--accent); letter-spacing: 1px;
  cursor: pointer; font-weight: 500;
}
.amber-ym-arr {
  background: none; border: none; font-size: 18px;
  color: var(--text-dim); cursor: pointer; padding: 2px 8px;
}
/* month grid */
.amber-month-grid { padding: 8px 0 4px; }
.amber-mg-head {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 11px; color: var(--accent);
  margin-bottom: 6px;
}
.amber-mg-body {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; gap: 4px 0;
}
.amber-mg-empty { height: 32px; }
.amber-mg-day {
  height: 32px; line-height: 32px; font-size: 13px;
  color: var(--text); border-radius: 50%; cursor: pointer;
  position: relative;
}
.amber-mg-day.today {
  background: var(--accent); color: #fff;
}
.amber-mg-day.selected:not(.today) {
  border: 1.5px solid var(--accent);
}
.amber-mg-day.has-entry::after {
  content: ; position: absolute; bottom: 2px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.amber-mg-day.today.has-entry::after { background: #fff; }


/* week day nav arrows */
.amber-week-nav {
  display: flex; align-items: center; gap: 4px;
}
.amber-week-nav .amber-week-days { flex: 1; }
.amber-day-arr {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,0.6); border: 1px solid var(--hairline);
  backdrop-filter: blur(4px); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 16px; flex-shrink: 0;
}
.amber-day-arr:active { background: var(--glow); }

/* ── 聊天热力:周历圆圈按当天聊天量填充,数字下方显示条数 ── */
.amber-day-num {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.amber-week-day.h1 .amber-day-num { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.amber-week-day.h2 .amber-day-num { background: color-mix(in srgb, var(--accent) 34%, transparent); }
.amber-week-day.h3 .amber-day-num { background: color-mix(in srgb, var(--accent) 58%, transparent); }
.amber-week-day.h4 .amber-day-num { background: color-mix(in srgb, var(--accent) 88%, transparent); }
.amber-week-day.h1 .amber-day-num, .amber-week-day.h2 .amber-day-num { color: inherit; }
.amber-week-day.h3 .amber-day-num, .amber-week-day.h4 .amber-day-num { color: #fff; }
/* 今天保留一圈描边;今天 0 条时仍是原 accent 实心圆(前方规则),有热力色时被上面覆盖 */
.amber-week-day.today .amber-day-num { box-shadow: inset 0 0 0 1.5px var(--accent); }
.amber-day-count {
  font-size: 10px; line-height: 1; min-height: 10px;
  color: var(--text-dim); font-weight: 400;
}
.amber-week-day.today .amber-day-count { color: var(--accent); font-weight: 600; }

/* ── 月网格聊天热力:圆底按当天聊天量着色(档位与周历条一致) ── */
.amber-mg-day.h1 { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.amber-mg-day.h2 { background: color-mix(in srgb, var(--accent) 34%, transparent); }
.amber-mg-day.h3 { background: color-mix(in srgb, var(--accent) 58%, transparent); }
.amber-mg-day.h4 { background: color-mix(in srgb, var(--accent) 88%, transparent); }
.amber-mg-day.h3, .amber-mg-day.h4 { color: #fff; }
.amber-mg-day.h1, .amber-mg-day.h2 { color: var(--text); }
/* 今天在热力底上保留描边标识;今天 0 条时仍是原 accent 实心圆 */
.amber-mg-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.amber-mg-day.today.h1.has-entry::after, .amber-mg-day.today.h2.has-entry::after { background: var(--accent); }

/* ── 月网格改版:正圆热力底 + 日期下方条数(清掉外层椭圆底,全部移进内层圆) ── */
.amber-mg-day {
  background: transparent; border: none; box-shadow: none;
  height: auto; line-height: normal;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.amber-mg-day.today { background: transparent; color: var(--text); box-shadow: none; }
.amber-mg-day.selected:not(.today) { border: none; box-shadow: none; }
.amber-mg-day.h1, .amber-mg-day.h2, .amber-mg-day.h3, .amber-mg-day.h4 { background: transparent; }
.amber-mg-num {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1;
}
.amber-mg-day.h1 .amber-mg-num { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.amber-mg-day.h2 .amber-mg-num { background: color-mix(in srgb, var(--accent) 34%, transparent); }
.amber-mg-day.h3 .amber-mg-num { background: color-mix(in srgb, var(--accent) 58%, transparent); }
.amber-mg-day.h4 .amber-mg-num { background: color-mix(in srgb, var(--accent) 88%, transparent); }
.amber-mg-day.h3 .amber-mg-num, .amber-mg-day.h4 .amber-mg-num { color: #fff; }
.amber-mg-day.h1 .amber-mg-num, .amber-mg-day.h2 .amber-mg-num { color: var(--text); }
.amber-mg-day.today .amber-mg-num { background: var(--accent); color: #fff; box-shadow: inset 0 0 0 1.5px var(--accent); }
.amber-mg-day.selected:not(.today) .amber-mg-num { box-shadow: inset 0 0 0 1.5px var(--accent); }
.amber-mg-count {
  font-size: 10px; line-height: 12px; min-height: 12px;
  color: var(--text-dim); font-weight: 400;
}
.amber-mg-day.today .amber-mg-count { color: var(--accent); font-weight: 600; }
/* 有日记的小圆点挪到数字圆右上角(顺手修了上游 content 为空的坏规则,之前圆点根本没渲染);
   原来在圆底下,现在那儿是条数 */
.amber-mg-day.has-entry::after {
  content: ""; position: absolute; top: 1px; bottom: auto; left: calc(50% + 13px);
  transform: none; width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.amber-mg-day.today.has-entry::after { background: var(--accent); }
