:root {
  --bg: #f7f7f7;
  --paper: #ffffff;
  --text: #242424;
  --muted: #9aa0a6;
  --line: #e8e8e8;
  --accent: #54a8ca;
  --accent-dark: #3389ac;
  --danger: #c75252;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.11);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding-top: 47px;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  --topbar-side-offset: max(88px, calc((100vw - 1240px) / 2 + 60px));
  display: flex;
  align-items: center;
  justify-content: center;
  height: 47px;
  background: #fff;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
}

.top-actions {
  position: absolute;
  right: var(--topbar-side-offset);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
}

.small-icon-button {
  width: 40px;
  height: 40px;
}

.line-icon-button {
  color: #111;
}

.line-icon-button svg,
.hamburger-button svg,
.search-panel button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hamburger-button {
  position: absolute;
  left: var(--topbar-side-offset);
  color: #111;
  font-size: 0;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #3d3d3d;
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0;
}

.brand-logo {
  width: auto;
  max-width: min(520px, 52vw);
  height: 43px;
  object-fit: contain;
}

.brand span {
  color: #8d8d8d;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
}

.icon-button:hover {
  background: #f0f7fa;
}

.icon-button.line-icon-button,
.icon-button.hamburger-button {
  color: #111;
}

.menu-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}

.menu-panel {
  position: absolute;
  top: 54px;
  right: 22px;
  width: min(420px, calc(100vw - 32px));
  max-height: 560px;
  overflow: auto;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: var(--shadow);
}

.menu-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  min-height: 86px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  font-size: 20px;
}

.menu-row:last-child {
  border-bottom: 0;
}

.menu-symbol {
  color: #9a9a9a;
  font-size: 26px;
}

.switch {
  width: 48px;
  height: 28px;
  padding: 3px;
  border-radius: 18px;
  background: #9fa3a6;
}

.switch span {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
}

.content {
  width: min(960px, calc(100vw - 32px));
  margin: 78px auto 120px;
}

.compact-content {
  width: min(720px, calc(100vw - 28px));
  margin-top: 42px;
}

.list-heading {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  margin: 0 0 18px;
  color: #000;
}

.list-heading h1 {
  grid-column: 1;
  margin: 0;
  color: #333;
  font-size: 24px;
  font-weight: 500;
}

.list-heading h1:empty {
  display: none;
}

.list-count {
  grid-column: 2;
  color: #000;
  font-size: 16px;
  font-weight: 400;
}

.timeline {
  display: grid;
  gap: 28px;
}

.compact-timeline {
  gap: 16px;
}

.entry-card {
  position: relative;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 26px;
  min-height: 236px;
  padding: 34px 44px;
  background: var(--paper);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.09);
}

.compact-entry-card {
  grid-template-columns: 1fr;
  min-height: 152px;
  padding: 22px 26px 18px;
}

.entry-card:focus,
.entry-card:hover {
  outline: 2px solid rgba(84, 168, 202, 0.25);
}

.entry-date-rail {
  min-width: 0;
}

.entry-meta-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.entry-main {
  position: relative;
  min-width: 0;
}

.entry-day {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
}

.entry-meta {
  margin-top: 7px;
  color: var(--muted);
  font-size: 20px;
  font-weight: 600;
}

.entry-title {
  margin: 0 0 14px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
}

.entry-body {
  white-space: pre-wrap;
  color: #252525;
  font-family: DengXian, "Microsoft YaHei", sans-serif;
  font-size: 12pt;
  line-height: 1.8;
}

.rich-summary {
  max-height: none;
  overflow: visible;
}

.rich-summary * {
  max-width: 100%;
}

.diary-image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.diary-photo {
  display: block;
  width: 136px;
  height: 136px;
  border-radius: 8px;
  object-fit: cover;
  cursor: url("./assets/cursor-zoom.svg") 14 14, zoom-in;
}

.entry-delete-link {
  position: absolute;
  top: 30px;
  right: 34px;
  padding: 4px 0;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
}

.entry-delete-link:hover {
  color: var(--danger);
}

.delete-popover {
  position: absolute;
  top: 58px;
  right: 24px;
  z-index: 12;
  width: 188px;
  padding: 14px;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.16);
  color: #333;
  font-size: 15px;
  line-height: 1.5;
}

.delete-popover::before {
  position: absolute;
  top: -7px;
  right: 28px;
  width: 12px;
  height: 12px;
  content: "";
  transform: rotate(45deg);
  border-left: 1px solid #e1e1e1;
  border-top: 1px solid #e1e1e1;
  background: #fff;
}

.delete-popover-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.delete-popover-actions button {
  flex: 1;
  height: 32px;
  border-radius: 6px;
  background: #f1f3f4;
  color: #444;
  font-size: 14px;
}

.delete-popover-actions button:first-child {
  background: #fff0f0;
  color: var(--danger);
}

.entry-footer {
  margin-top: 64px;
  color: var(--muted);
  font-size: 19px;
}

.entry-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 10.5pt;
}

.entry-count-meta {
  color: #8b9298;
  font-size: 10.5pt;
}

.entry-actions {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  white-space: nowrap;
}

.entry-actions button,
.entry-more-menu button {
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 10.5pt;
}

.entry-actions button:hover,
.entry-more-menu button:hover {
  color: var(--accent-dark);
}

.more-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 20px;
  border-radius: 50%;
  color: #8b9298 !important;
  font-size: 0 !important;
  line-height: 1;
}

.more-button::before {
  content: "•••";
  color: #9da1a4;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1;
}

.entry-more-menu {
  position: absolute;
  right: 0;
  bottom: 38px;
  z-index: 10;
  display: grid;
  gap: 10px;
  width: 132px;
  padding: 12px 14px;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.trash-entry-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pin-mark {
  display: inline-block;
  margin-top: 0;
  padding: 2px 7px;
  border-radius: 4px;
  background: #fff1ee;
  color: #b33a2f;
  font-size: 13px;
}

.action-popover {
  top: auto;
  right: 0;
  bottom: 44px;
}

.side-drawer {
  position: fixed;
  top: 84px;
  left: max(16px, calc((100vw - 960px) / 2 - 118px));
  z-index: 19;
  display: grid;
  gap: 4px;
  width: 210px;
  padding: 12px;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.side-drawer button {
  height: 44px;
  padding: 0 14px;
  border-radius: 6px;
  background: transparent;
  color: #333;
  text-align: left;
  font-size: 16px;
}

.side-drawer button:hover {
  background: #f5f7f8;
}

.search-panel {
  position: fixed;
  top: 96px;
  left: 50%;
  z-index: 18;
  width: min(720px, calc(100vw - 32px));
  transform: translateX(-50%);
}

.search-panel input {
  width: 100%;
  height: 48px;
  padding: 0 54px 0 18px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 18px;
}

.search-panel button {
  position: absolute;
  top: 50%;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: transparent;
  color: #6f7478;
}

.search-panel button:hover {
  background: #f1f3f4;
  color: #222;
}

.calendar-panel {
  position: fixed;
  top: 165px;
  left: max(24px, calc(50vw + 380px));
  z-index: 18;
  width: min(260px, calc(100vw - 48px));
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.pagination button {
  min-width: 76px;
  height: 36px;
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.pagination button:disabled {
  cursor: default;
  opacity: 0.42;
}

.calendar-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  padding: 20px 22px 18px;
  border-radius: 10px 10px 0 0;
  background: #55a9c9;
  color: #fff;
}

.calendar-hero-year {
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12pt;
  font-weight: 700;
}

.calendar-hero-date {
  font-size: 14pt;
  font-weight: 700;
  line-height: 1;
}

.calendar-today-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  color: #fff;
}

.calendar-today-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calendar-body {
  padding: 16px 16px 22px;
  background: #fff;
}

.calendar-head {
  display: grid;
  grid-template-columns: 24px 1fr 24px 24px 1fr 24px;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.calendar-head button {
  min-width: 0;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  color: #111;
  font-size: 12pt;
  font-weight: 500;
}

.calendar-head [data-calendar-month],
.calendar-head [data-calendar-year] {
  font-size: 12pt;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px 4px;
}

.calendar-weekdays {
  margin-bottom: 8px;
  color: #9a9a9a;
  text-align: center;
  font-size: 12pt;
}

.calendar-day,
.calendar-choice-grid button {
  position: relative;
  height: 32px;
  border-radius: 7px;
  background: #fff;
  color: #111;
  font-size: 12pt;
}

.calendar-day:hover,
.calendar-choice-grid button:hover {
  background: #f3f8fb;
  color: var(--accent-dark);
}

.calendar-day.today,
.calendar-day.selected,
.calendar-choice-grid button.selected {
  background: #55a9c9;
  color: #fff;
}

.calendar-day.empty {
  pointer-events: none;
}

.entry-dot {
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 7px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: #55a9c9;
}

.calendar-day.selected .entry-dot,
.calendar-day.today .entry-dot {
  background: #fff;
}

.calendar-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 14px;
}

.calendar-month-grid {
  padding: 8px 10px 6px;
}

.calendar-month-grid button {
  height: 44px;
  font-size: 12pt;
}

.calendar-year-grid {
  position: relative;
  padding: 2px 28px 0;
  gap: 12px 12px;
}

.calendar-year-grid button {
  height: 30px;
  font-size: 12pt;
}

.calendar-choice-grid button.selected {
  color: #fff;
  font-weight: 700;
}

.calendar-page-button {
  position: absolute !important;
  top: 50%;
  width: 28px;
  height: 28px !important;
  transform: translateY(-50%);
  background: transparent !important;
  color: #111 !important;
  font-size: 22px !important;
}

.calendar-page-prev {
  left: 8px;
}

.calendar-page-next {
  right: 8px;
}

.calendar-caption {
  position: absolute;
  top: calc(100% + 26px);
  left: 0;
  width: 100%;
  color: #333;
  text-align: center;
  font-size: 12pt;
  background: transparent;
}

.calendar-caption:hover {
  color: var(--accent-dark);
}

.image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 38px 20px 80px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.42);
}

.image-preview-dialog {
  width: min(840px, calc(100vw - 56px));
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.image-preview-dialog img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  background: #fff;
}

.image-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 32px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 12pt;
}

.image-preview-actions button,
.image-preview-actions a {
  background: transparent;
  color: var(--accent-dark);
  text-decoration: none;
}

.entry-card-focus {
  outline: 2px solid rgba(84, 168, 202, 0.5);
  box-shadow: 0 4px 18px rgba(84, 168, 202, 0.25);
}

.viewer-shell {
  min-height: 100vh;
  padding: 88px 20px 80px;
  background: #fff;
}

.viewer-article {
  width: min(820px, 100%);
  margin: 0 auto;
}

.viewer-date {
  color: var(--muted);
  font-size: 18px;
}

.viewer-article h1 {
  margin: 18px 0 28px;
  text-align: center;
  font-size: 30px;
}

.viewer-content {
  color: #222;
  font-size: 21px;
  line-height: 1.8;
}

.lock-screen {
  position: relative;
  display: grid;
  align-items: center;
  justify-items: center;
  min-height: 100vh;
  padding: 62px 0 86px;
  background: #f7f7f7;
}

.lock-reset-link {
  position: fixed;
  top: 52px;
  right: max(28px, calc((100vw - 647px) / 2));
  background: transparent;
  color: #9aa0a6;
  font-size: 16px;
}

.lock-reset-link:hover {
  color: var(--accent-dark);
}

.lock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: min(647px, calc(100vw - 56px));
  min-height: 496px;
  padding: 124px 118px 98px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.12);
  text-align: center;
}

.lock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  margin-bottom: 100px;
  color: var(--accent);
}

.lock-icon svg {
  width: 84px;
  height: 84px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lock-pin-wrap {
  position: relative;
  --pin-index: 0;
  width: 360px;
  max-width: 100%;
  height: 64px;
}

.lock-card input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  outline: 0;
  text-indent: -999px;
  color: transparent;
  caret-color: transparent;
}

.lock-pin-cells {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: end;
}

.lock-pin-cell {
  position: relative;
  display: block;
  height: 64px;
}

.lock-pin-cell::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  content: "";
  background: #eeeeee;
}

.lock-pin-cell[data-filled="true"]::after {
  background: #34bde1;
}

.lock-pin-cell[data-filled="true"]::before {
  position: absolute;
  left: 50%;
  bottom: 24px;
  width: 7px;
  height: 7px;
  content: "";
  transform: translateX(-50%);
  border-radius: 50%;
  background: #b4b7ba;
}

.lock-pin-cell[data-active="true"] {
  animation: none;
}

.lock-pin-cell[data-active="true"]::before {
  position: absolute;
  left: 0;
  bottom: 11px;
  width: 2px;
  height: 48px;
  content: "";
  background: #aeb4b8;
  animation: lock-caret-blink 1s steps(1, end) infinite;
}

@keyframes lock-caret-blink {
  50% {
    opacity: 0;
  }
}

.lock-submit {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.lock-card p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.fab,
.save-fab {
  position: fixed;
  right: max(28px, calc((100vw - 960px) / 2 - 98px));
  z-index: 15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 51px;
  height: 51px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
}

.fab {
  right: auto;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
}

.save-fab {
  top: 22px;
  right: max(18px, calc((100vw - min(56vw, 680px)) / 2 - 56px));
  z-index: 25;
  width: 38px;
  height: 38px;
  font-size: 20px;
}

.fab:hover,
.save-fab:hover {
  background: var(--accent-dark);
}

.editor-shell {
  min-height: 100vh;
  padding-top: 70px;
  padding-bottom: 0;
  background: #fff;
}

.editor-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  background: #fff;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
}

.editor-date {
  color: #404040;
  font-family: DengXian, "Microsoft YaHei", sans-serif;
  font-size: 10.5pt;
  font-weight: 700;
}

.editor-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 40px;
  color: #5f6368;
  font-size: 22px;
}

.mood-picker-wrap {
  position: relative;
  margin-left: 18px;
}

.mood-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 42px;
  padding: 0 7px;
  border-radius: 6px;
  background: transparent;
  color: #4a4a4a;
}

.mood-trigger:hover {
  background: #f5f7f8;
}

.mood-trigger .mood-face {
  width: 28px;
  height: 28px;
}

.mood-caret {
  color: #777;
  font-size: 18px;
}

.mood-panel {
  position: absolute;
  top: 48px;
  left: 50%;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 78px);
  gap: 26px 32px;
  width: 440px;
  padding: 28px 24px 24px;
  transform: translateX(-50%);
  border: 1px solid #eeeeee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.14);
}

.mood-panel[hidden] {
  display: none;
}

.mood-option {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: #111;
}

.mood-option:hover,
.mood-option.selected {
  background: #f6f7f8;
}

.mood-face {
  width: 44px;
  height: 44px;
  color: #050505;
}

.mood-option span {
  color: #555;
  font-size: 15px;
  line-height: 1;
}

.mood-option:last-child {
  grid-column: 2 / span 2;
  justify-self: center;
  width: 78px;
}

.back-button {
  position: fixed;
  top: 22px;
  left: max(18px, calc((100vw - min(56vw, 680px)) / 2 - 72px));
  z-index: 26;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent url("./assets/icon-back-arrow.svg") center / 30px 30px no-repeat;
  color: #2f3336;
  font-size: 0;
}

.back-button::before {
  content: "";
}

.editor {
  width: min(56vw, 680px);
  margin: 50px auto 0;
}

.format-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 26px 0 12px;
  padding: 10px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: #fbfbfb;
}

.format-toolbar select,
.tool-button {
  height: 36px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #fff;
  color: #444;
  font-size: 15px;
}

.format-toolbar select {
  min-width: 108px;
  padding: 0 10px;
  outline: 0;
}

.tool-button {
  min-width: 38px;
  padding: 0 12px;
  font-weight: 700;
}

.tool-button:hover,
.format-toolbar select:hover {
  border-color: rgba(84, 168, 202, 0.6);
}

.underline-tool {
  text-decoration: underline;
}

.body-input {
  display: block;
  width: 100%;
  min-height: 360px;
  margin-top: 0;
  padding: 22px 4px;
  resize: none;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: #222;
  font-family: DengXian, "Microsoft YaHei", sans-serif;
  font-size: 12pt;
  line-height: 1.58;
}

.rich-editor {
  overflow: visible;
  white-space: normal;
}

.rich-editor p,
.rich-editor div {
  margin: 0;
}

.rich-editor br {
  line-height: 1;
}

.rich-editor:empty::before {
  content: "写点什么...";
  color: #b8b8b8;
}

.rich-editor font[size="2"] {
  font-size: 18px;
}

.rich-editor font[size="3"] {
  font-size: 22px;
}

.rich-editor font[size="4"] {
  font-size: 27px;
}

.rich-editor font[size="5"] {
  font-size: 34px;
}

.editor-image-strip {
  margin: 18px 0 36px;
}

.editor-image-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

.editor-image-thumb,
.editor-image-add {
  position: relative;
  width: 136px;
  height: 136px;
  border-radius: 8px;
  overflow: hidden;
  flex: 0 0 auto;
}

.editor-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-image-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eeeeee;
  color: #9aa0a6;
  font-size: 34px;
  line-height: 1;
}

.editor-image-add:hover {
  background: #e7e7e7;
  color: #7f878d;
}

.editor-image-remove {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 0 8px 0 18px;
  background: rgba(238, 238, 238, 0.9);
  color: #111;
  font-size: 28px;
  line-height: 1;
}

.image-file-input {
  display: none;
}

.body-input:focus {
  border-color: transparent;
}

.editor-footer {
  position: fixed;
  right: 0;
  bottom: 22px;
  left: 0;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 0 18px;
  color: var(--muted);
  font-size: 17px;
  pointer-events: none;
}

.editor-bottom-panel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: min(820px, calc(100vw - 36px));
  min-height: 52px;
  padding: 9px 16px;
  border: 1px solid #eeeeee;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.14);
  pointer-events: auto;
}

.editor-bottom-panel select,
.editor-bottom-panel .tool-button {
  height: 34px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #fff;
  color: #444;
  font-size: 15px;
}

.editor-bottom-panel select {
  min-width: 104px;
  padding: 0 10px;
  outline: 0;
}

.divider {
  width: 1px;
  height: 22px;
  background: #ddd;
}

.weather-select {
  width: auto;
  min-width: 86px;
  max-width: 118px;
  height: 34px;
  padding: 0 4px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
}

.editor-bottom-panel .weather-select {
  border: 1px solid #dadce0;
  background: #fff;
  font-size: 15px;
}

.mood-select {
  min-width: 104px;
  max-width: 132px;
}

.auth-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: #fff;
}

.auth-card {
  width: min(420px, calc(100vw - 34px));
  padding: 34px;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-title {
  margin: 0 0 28px;
  text-align: center;
  color: #444;
  font-size: 30px;
  font-weight: 300;
}

.auth-logo {
  display: block;
  width: min(520px, 100%);
  height: 76px;
  margin: 0 auto;
  object-fit: contain;
}

.auth-card label {
  display: block;
  margin: 18px 0 8px;
  color: #6d6d6d;
}

.auth-card input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: 0;
}

.primary-button {
  width: 100%;
  height: 48px;
  margin-top: 24px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
}

.secondary-button {
  background: transparent;
  color: var(--accent);
  font-size: 18px;
}

.empty-state {
  margin: 110px auto;
  text-align: center;
  color: var(--muted);
  font-size: 20px;
}

.status {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  transform: translateX(-50%);
  max-width: calc(100vw - 40px);
  padding: 12px 18px;
  border-radius: 7px;
  background: rgba(36, 36, 36, 0.88);
  color: #fff;
  font-size: 15px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.modal {
  width: min(460px, 100%);
  padding: 28px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.modal p {
  color: #666;
  line-height: 1.7;
}

.modal input {
  width: 100%;
  height: 46px;
  margin: 8px 0 16px;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions button {
  flex: 1;
  height: 44px;
  border-radius: 6px;
}

@media (max-width: 720px) {
  .app-shell {
    padding-top: 51px;
  }

  .topbar {
    --topbar-side-offset: 18px;
    height: 51px;
  }

  .lock-screen {
    justify-items: center;
    padding: 70px 18px 40px;
  }

  .lock-reset-link {
    top: 22px;
    right: 18px;
    font-size: 14px;
  }

  .lock-card {
    width: min(100%, 520px);
    min-height: 460px;
    padding: 90px 36px 70px;
  }

  .lock-icon {
    width: 76px;
    height: 76px;
    margin-bottom: 76px;
  }

  .lock-icon svg {
    width: 76px;
    height: 76px;
  }

  .lock-pin-wrap {
    width: min(320px, 100%);
  }

  .lock-pin-cells {
    gap: 10px;
  }

  .top-actions {
    gap: 0;
  }

  .small-icon-button {
    width: 38px;
    height: 38px;
  }

  .brand {
    font-size: 24px;
  }

  .brand-logo {
    width: auto;
    max-width: min(260px, 52vw);
    height: 33px;
    transform: translateX(-20px);
  }

  .content {
    width: calc(100vw - 22px);
    margin-top: 34px;
  }

  .calendar-panel {
    top: 47px;
    left: 12px;
    width: calc(100vw - 24px);
  }

  .calendar-hero {
    min-height: 92px;
    padding: 18px 20px 16px;
  }

  .calendar-hero-date {
    font-size: 14pt;
  }

  .calendar-body {
    padding: 18px 18px 24px;
  }

  .entry-card {
    grid-template-columns: 1fr;
    gap: 14px;
    min-height: 190px;
    padding: 42px 20px 25px;
  }

  .entry-delete-link {
    top: 14px;
    right: 20px;
    font-size: 15px;
  }

  .delete-popover {
    top: 38px;
    right: 12px;
  }

  .entry-day {
    font-size: 28px;
  }

  .entry-meta,
  .entry-footer {
    font-size: 15px;
  }

  .entry-meta-line {
    font-size: 13px;
  }

  .diary-photo,
  .editor-image-thumb,
  .editor-image-add {
    width: 108px;
    height: 108px;
  }

  .image-preview-overlay {
    padding: 28px 12px 58px;
  }

  .image-preview-dialog {
    width: calc(100vw - 24px);
  }

  .entry-title {
    margin-top: 18px;
    font-size: 20px;
  }

  .entry-body {
    font-family: DengXian, "Microsoft YaHei", sans-serif;
    font-size: 12pt;
  }

  .fab {
    right: auto;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 43px;
    height: 43px;
    font-size: 24px;
  }

  .editor-date {
    font-family: DengXian, "Microsoft YaHei", sans-serif;
    font-size: 10.5pt;
  }

  .editor-tools {
    margin-left: 8px;
    gap: 6px;
    font-size: 16px;
  }

  .mood-picker-wrap {
    margin-left: 6px;
  }

  .mood-trigger {
    height: 38px;
    gap: 4px;
    font-size: 15px;
  }

  .mood-trigger .mood-face {
    width: 24px;
    height: 24px;
  }

  .mood-panel {
    left: auto;
    right: -12px;
    grid-template-columns: repeat(4, 64px);
    gap: 20px 12px;
    width: min(332px, calc(100vw - 24px));
    padding: 22px 18px;
    transform: none;
  }

  .mood-face {
    width: 38px;
    height: 38px;
  }

  .mood-option:last-child {
    width: 64px;
  }

  .editor {
    width: calc(100vw - 36px);
    margin-top: 42px;
  }

  .format-toolbar {
    gap: 8px;
  }

  .format-toolbar select {
    flex: 1 1 120px;
  }

  .body-input {
    min-height: 320px;
    font-size: 12pt;
  }

  .editor-footer {
    bottom: 14px;
    width: 100%;
    padding: 0 12px;
    font-size: 15px;
  }

  .editor-bottom-panel {
    flex-wrap: wrap;
    gap: 8px;
    width: min(100%, 520px);
    padding: 8px 10px;
  }

  .weather-select {
    min-width: 82px;
    max-width: 118px;
    font-size: 15px;
  }
}
