:root {
  --color-paper: #ffffff;
  --color-canvas: #f4f8f8;
  --color-rail: #f8fbfb;
  --color-ink: #123f47;
  --color-ink-soft: #58727a;
  --color-teal: #2b8c91;
  --color-teal-dark: #1d7178;
  --color-teal-wash: #e5f1f1;
  --color-orange: #e97731;
  --color-line: #dce7e8;
  --color-line-strong: #cbdcde;
  --font-display: "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow-soft: 0 8px 24px rgba(18, 63, 71, 0.045);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

section,
article,
footer {
  scroll-margin-top: 88px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 5px;
  background: var(--color-ink);
  color: var(--color-paper);
  font-size: 13px;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(24px, 4vw, 56px);
  border-bottom: 1px solid var(--color-line);
  background: var(--color-paper);
}

.brand-lockup,
.header-note,
.brand-link {
  display: flex;
  align-items: center;
}

.brand-lockup {
  min-width: 0;
}

.brand-link {
  color: var(--color-ink);
}

.brand-name {
  font-family: var(--font-display);
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.brand-divider {
  width: 1px;
  height: 20px;
  margin: 0 20px;
  background: var(--color-line-strong);
}

.brand-tagline {
  color: var(--color-ink-soft);
  font-size: 13px;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.header-note {
  flex: 0 0 auto;
  gap: 12px;
  margin: 0;
  color: var(--color-ink-soft);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.header-note-line {
  display: block;
  width: 30px;
  height: 1px;
  background: var(--color-ink-soft);
}

.app-shell {
  display: grid;
  min-height: calc(100vh - 68px);
  grid-template-columns: 220px minmax(0, 1fr);
  background: var(--color-canvas);
}

.sidebar {
  position: sticky;
  top: 68px;
  display: flex;
  min-height: calc(100vh - 68px);
  flex-direction: column;
  padding: 32px 24px 28px;
  border-right: 1px solid var(--color-line);
  background: var(--color-rail);
}

.primary-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 15px;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.nav-item:hover {
  background: #edf5f5;
  color: var(--color-teal-dark);
}

.nav-item.is-active {
  background: var(--color-teal-wash);
  box-shadow: inset 4px 0 0 var(--color-orange);
  color: var(--color-teal-dark);
}

.nav-item:focus-visible,
.brand-link:focus-visible {
  outline: 3px solid rgba(233, 119, 49, 0.36);
  outline-offset: 3px;
}

.nav-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.sidebar-signature {
  display: flex;
  margin-top: auto;
  flex-direction: column;
  align-items: flex-start;
  color: #769298;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.1em;
  line-height: 1.8;
}

.sidebar-signature p {
  margin: 8px 0 5px;
}

.sidebar-signature > span {
  font-family: var(--font-body);
  font-size: 15px;
}

.leaf-mark {
  width: 38px;
  height: 78px;
  fill: none;
  stroke: #8fb2b0;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.2;
}

.content {
  min-width: 0;
  max-width: 1540px;
  padding: 20px clamp(20px, 3.2vw, 54px) 46px;
}

.surface {
  border: 1px solid rgba(203, 220, 222, 0.74);
  background: var(--color-paper);
  box-shadow: var(--shadow-soft);
}

.today-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(285px, 320px);
  grid-template-rows: auto auto;
  gap: 16px;
}

.today-card {
  grid-row: 1 / span 2;
  min-height: 502px;
  padding: 34px 30px 30px;
  border-radius: 6px;
}

.today-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
}

.today-card h1 {
  margin-bottom: 10px;
  font-size: clamp(30px, 3vw, 39px);
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.entry-date {
  margin-bottom: 0;
  color: var(--color-ink-soft);
  font-size: 16px;
  letter-spacing: 0.04em;
}

.entry-date span {
  margin-left: 11px;
}

.day-note {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin: 7px 0 0;
  color: var(--color-orange);
  font-size: 14px;
  white-space: nowrap;
}

.day-note svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.read-only-entry {
  margin-top: 30px;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 5px;
  background: #fcfdfd;
}

.entry-toolbar {
  display: flex;
  min-height: 45px;
  align-items: center;
  gap: 19px;
  padding: 0 18px;
  border-bottom: 1px solid var(--color-line);
  color: #526e75;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.toolbar-bold {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.toolbar-italic {
  font-style: italic;
}

.toolbar-quote {
  font-size: 24px;
  line-height: 1;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--color-line-strong);
}

.toolbar-list,
.toolbar-list.numbered {
  display: grid;
  width: 16px;
  gap: 3px;
}

.toolbar-list i {
  display: block;
  position: relative;
  height: 2px;
  margin-left: 5px;
  background: currentColor;
}

.toolbar-list i::before {
  position: absolute;
  top: -1px;
  left: -5px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.toolbar-list.numbered i::before {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: currentColor;
  content: "·";
  font-family: var(--font-body);
  font-size: 9px;
  line-height: 1;
  transform: translateY(-1px);
}

.toolbar-link,
.toolbar-image {
  position: relative;
  display: block;
  width: 17px;
  height: 13px;
}

.toolbar-link::before,
.toolbar-link::after {
  position: absolute;
  width: 9px;
  height: 5px;
  border: 1.5px solid currentColor;
  border-radius: 5px;
  content: "";
  transform: rotate(-42deg);
}

.toolbar-link::before {
  top: 1px;
  left: 0;
}

.toolbar-link::after {
  right: 0;
  bottom: 1px;
}

.toolbar-image {
  overflow: hidden;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.toolbar-image::before {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.toolbar-image::after {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 9px;
  height: 6px;
  border-top: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  content: "";
  transform: skew(-35deg) rotate(-20deg);
}

.entry-content {
  min-height: 250px;
  padding: 24px 21px 28px;
  color: #63777d;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.04em;
  line-height: 2;
}

.entry-content p {
  max-width: 720px;
  margin-bottom: 18px;
}

.entry-content p:last-child {
  margin-bottom: 0;
}

.calendar-card {
  min-height: 294px;
  padding: 24px 23px 20px;
  border-radius: 6px;
}

.calendar-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-heading h2,
.section-heading h2 {
  margin-bottom: 0;
  font-size: 25px;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.calendar-arrows {
  display: flex;
  gap: 18px;
  color: var(--color-ink);
  font-family: Georgia, serif;
  font-size: 28px;
  line-height: 1;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
}

.calendar-weekdays {
  margin-top: 21px;
  color: var(--color-ink-soft);
  font-size: 12px;
}

.calendar-days {
  margin-top: 11px;
  align-items: center;
  color: var(--color-ink);
  font-size: 13px;
  row-gap: 10px;
}

.calendar-days time {
  display: grid;
  width: 30px;
  height: 30px;
  margin: 0 auto;
  place-items: center;
  border-radius: 50%;
}

.calendar-days .is-muted {
  color: #aab9bd;
}

.calendar-days .is-selected {
  background: var(--color-orange);
  color: var(--color-paper);
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(233, 119, 49, 0.23);
}

.memory-card {
  display: grid;
  min-height: 192px;
  grid-template-columns: minmax(0, 1.05fr) minmax(125px, 0.95fr);
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 6px;
  background: var(--color-paper);
}

.memory-copy {
  position: relative;
  z-index: 1;
  padding: 25px 18px 22px 24px;
}

.memory-copy h2 {
  margin-bottom: 12px;
  font-size: 23px;
  letter-spacing: 0.07em;
  line-height: 1.3;
}

.memory-rule {
  display: block;
  width: 28px;
  height: 1px;
  margin-bottom: 14px;
  background: var(--color-ink-soft);
}

.memory-copy p {
  margin-bottom: 0;
  color: var(--color-ink-soft);
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.75;
}

.memory-image {
  min-width: 0;
  overflow: hidden;
}

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

.recent-section {
  margin-top: 16px;
  padding: 25px 18px 17px;
  border-radius: 6px;
}

.section-heading {
  padding: 0 2px 19px;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.note-card {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 94px;
  grid-template-rows: 1fr auto;
  gap: 14px;
  padding: 17px 16px 13px;
  border: 1px solid var(--color-line);
  border-radius: 5px;
  background: var(--color-paper);
}

.note-copy {
  min-width: 0;
}

.note-date {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 11px;
  color: var(--color-ink-soft);
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.note-card h3 {
  margin-bottom: 8px;
  font-size: 18px;
  letter-spacing: 0.05em;
  line-height: 1.4;
}

.note-excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 0;
  color: var(--color-ink-soft);
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.note-media {
  width: 94px;
  height: 108px;
  margin: 0;
  overflow: hidden;
  border-radius: 4px;
}

.note-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.note-footer {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--color-line);
  color: var(--color-ink-soft);
  font-size: 12px;
}

.note-type {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.note-type svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 24px 0 0;
  color: #8ba0a4;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.footer-signature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.site-footer p {
  margin-bottom: 0;
}

.footer-line {
  width: 30px;
  height: 1px;
  background: var(--color-line-strong);
}

.site-filing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  max-width: 100%;
  color: #7c989b;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0;
  line-height: 1.5;
  text-align: center;
}

.site-filing a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.site-filing a:hover {
  color: var(--color-teal-dark);
}

.site-filing a:focus-visible {
  outline: 3px solid rgba(233, 119, 49, 0.36);
  outline-offset: 3px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .sidebar {
    padding-right: 18px;
    padding-left: 18px;
  }

  .content {
    padding-right: 24px;
    padding-left: 24px;
  }

  .today-layout {
    grid-template-columns: minmax(0, 1fr) 285px;
  }

  .today-card {
    padding-right: 25px;
    padding-left: 25px;
  }

  .note-card {
    grid-template-columns: minmax(0, 1fr) 78px;
  }

  .note-media {
    width: 78px;
    height: 102px;
  }
}

@media (max-width: 880px) {
  .header-note {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    min-height: auto;
    padding: 10px 20px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--color-line);
  }

  .primary-nav {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .primary-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 8px 14px;
  }

  .sidebar-signature {
    display: none;
  }
}

@media (max-width: 700px) {
  .site-header {
    min-height: 62px;
    padding: 0 18px;
  }

  .brand-divider,
  .brand-tagline {
    display: none;
  }

  .app-shell {
    min-height: calc(100vh - 62px);
  }

  .content {
    padding: 16px 12px 34px;
  }

  .today-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .today-card {
    min-height: auto;
    padding: 27px 19px 22px;
  }

  .today-heading-row {
    flex-direction: column;
    gap: 15px;
  }

  .day-note {
    margin-top: 0;
  }

  .read-only-entry {
    margin-top: 23px;
  }

  .entry-toolbar {
    gap: 15px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .entry-content {
    min-height: 220px;
    padding: 20px 17px 23px;
    font-size: 15px;
  }

  .calendar-card {
    min-height: 0;
    padding: 22px 18px 19px;
  }

  .calendar-days {
    row-gap: 8px;
  }

  .memory-card {
    min-height: 0;
  }

  .recent-section {
    margin-top: 14px;
    padding: 23px 13px 16px;
  }

  .note-grid {
    grid-template-columns: 1fr;
  }

  .note-card {
    grid-template-columns: minmax(0, 1fr) 98px;
  }

  .note-media {
    width: 98px;
    height: 112px;
  }
}

@media (max-width: 460px) {
  .brand-name {
    font-size: 20px;
  }

  .sidebar {
    padding-right: 12px;
    padding-left: 12px;
  }

  .nav-item {
    gap: 10px;
    padding-right: 12px;
    padding-left: 12px;
    font-size: 15px;
  }

  .nav-icon {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }

  .today-card h1 {
    font-size: 30px;
  }

  .entry-date {
    font-size: 14px;
  }

  .entry-toolbar {
    gap: 12px;
  }

  .toolbar-link,
  .toolbar-image {
    display: none;
  }

  .memory-card {
    display: flex;
    flex-direction: column;
  }

  .memory-copy {
    padding: 23px 21px 20px;
  }

  .memory-image {
    height: 142px;
  }

  .note-card {
    grid-template-columns: minmax(0, 1fr) 84px;
    gap: 11px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .note-media {
    width: 84px;
    height: 106px;
  }

  .note-card h3 {
    font-size: 17px;
  }

  .note-excerpt {
    font-size: 11px;
  }

  .site-footer {
    gap: 10px;
    font-size: 11px;
  }

  .footer-line {
    width: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
