:root {
  color-scheme: light;
  --bg: #f5f0ea;
  --surface: rgba(255, 252, 248, 0.76);
  --surface-solid: #fffaf5;
  --text: #463d39;
  --muted: #8d817a;
  --line: rgba(104, 85, 76, 0.13);
  --rose: #c98276;
  --rose-soft: #efd5cf;
  --sage: #789386;
  --sage-soft: #d8e4dc;
  --shadow: 0 24px 70px rgba(91, 70, 59, 0.1);
  font-family: "Noto Serif SC", "Songti SC", "Microsoft YaHei", serif;
  font-synthesis: none;
}

:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #242322;
  --surface: rgba(50, 47, 45, 0.8);
  --surface-solid: #35312f;
  --text: #f4ece5;
  --muted: #b9aaa1;
  --line: rgba(255, 238, 224, 0.11);
  --rose: #e1a297;
  --rose-soft: #624943;
  --sage: #a8c4b6;
  --sage-soft: #3f5349;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  color: var(--text);
  background: var(--bg);
  transition: color 300ms ease, background 500ms ease;
}

button,
input,
textarea {
  font: inherit;
}

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

button {
  color: inherit;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  width: 38vw;
  min-width: 340px;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.55;
  filter: blur(2px);
}

.orb-one {
  top: -22vw;
  left: -12vw;
  background: radial-gradient(circle, var(--rose-soft), transparent 68%);
}

.orb-two {
  right: -16vw;
  bottom: -24vw;
  background: radial-gradient(circle, var(--sage-soft), transparent 70%);
}

.star {
  position: absolute;
  color: var(--rose);
  opacity: 0.35;
}

.star-one {
  top: 20%;
  right: 7%;
  font-size: 24px;
}

.star-two {
  bottom: 17%;
  left: 5%;
  font-size: 18px;
}

.star-three {
  top: 52%;
  left: 2%;
  font-size: 40px;
}

.site-header,
main,
footer {
  width: min(1160px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 96px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: Inter, "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  color: var(--surface-solid);
  border-radius: 50%;
  background: var(--text);
  place-items: center;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle,
.search-button,
.install-button {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  gap: 8px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 8px 30px rgba(82, 65, 56, 0.05);
  font-size: 13px;
}

.install-button {
  color: var(--surface-solid);
  border-color: transparent;
  background: var(--text);
}

.search-button > span:first-child {
  font-family: Arial, sans-serif;
  font-size: 20px;
  line-height: 1;
}

.install-button[hidden] {
  display: none;
}

.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  min-height: 590px;
  padding: clamp(42px, 7vw, 82px);
  gap: clamp(38px, 8vw, 92px);
  border-radius: 42px;
}

.hero-copy {
  align-self: center;
}

.eyebrow,
.card-label {
  margin: 0;
  color: var(--muted);
  font-family: Inter, "Microsoft YaHei", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
}

.eyebrow span {
  width: 22px;
  height: 1px;
  background: var(--rose);
}

.greeting {
  margin: 38px 0 10px;
  color: var(--rose);
  font-size: 14px;
  letter-spacing: 0.1em;
}

h1 {
  margin: 0;
  font-size: clamp(48px, 7.2vw, 82px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.18;
}

h1 em {
  color: var(--rose);
  font-style: normal;
}

.intro {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 18px);
  letter-spacing: 0.06em;
  line-height: 2;
}

.hero-actions {
  display: flex;
  align-items: center;
  margin-top: 38px;
  gap: 22px;
}

.primary-button,
.note-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  color: var(--surface-solid);
  background: var(--text);
  text-decoration: none;
}

.primary-button {
  min-height: 48px;
  padding: 0 22px;
  gap: 16px;
  font-size: 14px;
}

.lab-status {
  display: flex;
  align-items: center;
  color: var(--muted);
  gap: 8px;
  font-size: 12px;
}

.lab-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7ead8d;
  box-shadow: 0 0 0 5px rgba(126, 173, 141, 0.12);
}

.clock-card {
  position: relative;
  align-self: center;
  min-height: 350px;
  padding: 38px 30px 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 150px 150px 32px 32px;
  background: linear-gradient(160deg, var(--surface-solid), var(--sage-soft));
  text-align: center;
}

.clock-glow {
  width: 110px;
  height: 110px;
  margin: 8px auto 24px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #fff8ee, var(--rose-soft) 45%, transparent 70%);
  box-shadow: 0 12px 35px rgba(124, 91, 75, 0.13);
}

.clock-card p,
.clock-card > span {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.clock-card strong {
  display: block;
  margin: 8px 0 2px;
  font-family: Georgia, serif;
  font-size: 38px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.clock-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.clock-footer b {
  color: var(--text);
  font-weight: 500;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 24px;
  gap: 24px;
}

.member-card,
.experiment-card {
  position: relative;
  min-height: 310px;
  padding: 34px;
  border-radius: 30px;
}

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

.avatar {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 28px;
  border-radius: 21px;
  place-items: center;
  font-size: 22px;
}

.avatar-axu {
  color: #9e6258;
  background: var(--rose-soft);
}

.avatar-shuhan {
  color: #567466;
  background: var(--sage-soft);
}

.member-card h2,
.experiment-card h2,
.section-heading h2 {
  margin: 7px 0 12px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.member-card div > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.member-tag {
  margin-top: auto;
  padding-top: 24px;
  color: var(--muted);
  font-family: Inter, "Microsoft YaHei", sans-serif;
  font-size: 9px;
  letter-spacing: 0.16em;
}

.experiment-card {
  display: flex;
  flex-direction: column;
  color: #f8f0e9;
  background: #514947;
}

.experiment-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.experiment-card .card-label {
  color: #cfc0b7;
}

.experiment-top > span {
  color: var(--rose-soft);
  font-size: 30px;
}

.experiment-text {
  margin: 24px 0;
  color: #ded3cc;
  font-size: 15px;
  line-height: 1.9;
}

.shuffle-button {
  align-self: flex-start;
  margin-top: auto;
  padding: 10px 0;
  cursor: pointer;
  color: #f1d4cc;
  border: 0;
  border-bottom: 1px solid rgba(241, 212, 204, 0.35);
  background: transparent;
  font-size: 12px;
}

.notes-section {
  margin-top: 24px;
  padding: clamp(34px, 6vw, 68px);
  border-radius: 38px;
}

.app-view[hidden] {
  display: none;
}

.app-view:not([hidden]) {
  animation: view-in 280ms ease-out both;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.section-heading h2 {
  margin-top: 13px;
  font-size: clamp(28px, 4vw, 42px);
}

.section-heading > p {
  max-width: 380px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.note-form {
  margin-top: 36px;
  padding: 18px 20px 15px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-solid);
}

.note-form textarea {
  display: block;
  width: 100%;
  min-height: 90px;
  resize: vertical;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  line-height: 1.7;
}

.note-form textarea::placeholder {
  color: var(--muted);
  opacity: 0.68;
}

.note-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: Inter, "Microsoft YaHei", sans-serif;
  font-size: 10px;
}

.note-form-footer b {
  font-weight: 500;
}

.note-form button {
  min-height: 40px;
  padding: 0 18px;
  gap: 10px;
  font-size: 12px;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 22px;
  gap: 16px;
}

.sticky-note {
  position: relative;
  min-height: 155px;
  padding: 24px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 22px 22px 22px 7px;
  background: var(--rose-soft);
}

.sticky-note:nth-child(3n + 2) {
  background: var(--sage-soft);
}

.sticky-note:nth-child(3n) {
  background: var(--surface-solid);
}

.sticky-note p {
  margin: 0 26px 28px 0;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sticky-note time {
  position: absolute;
  bottom: 18px;
  left: 22px;
  color: var(--muted);
  font-family: Inter, "Microsoft YaHei", sans-serif;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.delete-note {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--muted);
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.empty-notes {
  grid-column: 1 / -1;
  padding: 34px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 22px;
  text-align: center;
  font-size: 13px;
}

.diary-section {
  margin-top: 24px;
  padding: clamp(34px, 6vw, 68px);
  border-radius: 38px;
}

.diary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  margin-top: 36px;
  gap: 22px;
}

.diary-editor,
.diary-list-panel,
.backup-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface-solid);
}

.diary-editor {
  padding: 22px;
}

.diary-date-row,
.diary-form-footer,
.subsection-heading,
.backup-card,
.backup-actions,
.diary-actions {
  display: flex;
  align-items: center;
}

.diary-date-row {
  justify-content: space-between;
  padding-bottom: 16px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.diary-date-row input {
  max-width: 170px;
  padding: 9px 12px;
  color: var(--text);
  color-scheme: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--surface);
}

.mood-picker {
  margin: 18px 0 0;
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.mood-picker legend {
  margin-bottom: 12px;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
}

.mood-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.mood-options label {
  position: relative;
  display: grid;
  min-height: 66px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  place-items: center;
  align-content: center;
  gap: 3px;
}

.mood-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.mood-options label:has(input:checked) {
  border-color: var(--rose);
  background: var(--rose-soft);
  box-shadow: 0 8px 24px rgba(156, 104, 92, 0.1);
}

.mood-options span {
  font-size: 20px;
}

.mood-options small {
  color: var(--muted);
  font-size: 9px;
}

.diary-editor textarea {
  display: block;
  width: 100%;
  min-height: 300px;
  padding: 24px 2px;
  resize: vertical;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  line-height: 2;
}

.diary-editor textarea::placeholder {
  color: var(--muted);
  opacity: 0.68;
}

.diary-form-footer {
  justify-content: space-between;
  padding-top: 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: Inter, "Microsoft YaHei", sans-serif;
  font-size: 10px;
}

.diary-actions,
.backup-actions {
  gap: 10px;
}

.primary-action,
.secondary-button {
  min-height: 42px;
  padding: 0 18px;
  cursor: pointer;
  border-radius: 999px;
}

.primary-action {
  color: var(--surface-solid);
  border: 0;
  background: var(--text);
}

.secondary-button {
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface);
}

.danger-button,
.danger-outline {
  color: #b05f55;
  border-color: rgba(176, 95, 85, 0.28);
}

.diary-list-panel {
  min-height: 460px;
  padding: 22px;
}

.diary-calendar {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  margin-bottom: 16px;
  text-align: center;
}

.calendar-toolbar button {
  width: 34px;
  height: 34px;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-family: Arial, sans-serif;
  font-size: 22px;
}

.calendar-toolbar strong {
  font-size: 15px;
  font-weight: 500;
}

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

.calendar-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  text-align: center;
  font-size: 9px;
}

.calendar-day {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  cursor: pointer;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  place-items: center;
  font-family: Inter, "Microsoft YaHei", sans-serif;
  font-size: 11px;
}

.calendar-day.is-outside {
  color: var(--muted);
  opacity: 0.35;
}

.calendar-day.is-today {
  border-color: var(--sage);
}

.calendar-day.is-selected {
  color: var(--surface-solid);
  background: var(--text);
}

.calendar-day.has-diary::after {
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--rose);
  content: "";
}

.calendar-day.is-selected.has-diary::after {
  background: var(--surface-solid);
}

.subsection-heading {
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.subsection-heading h3,
.backup-card h3 {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 500;
}

.subsection-heading > span {
  color: var(--muted);
  font-size: 11px;
}

.diary-list {
  display: grid;
  margin-top: 14px;
  gap: 10px;
}

.diary-list-item .diary-list-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.diary-list-mood {
  font-size: 16px;
}

.diary-list-item {
  width: 100%;
  padding: 15px;
  cursor: pointer;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
}

.diary-list-item.is-selected {
  border-color: var(--rose);
  background: var(--rose-soft);
}

.diary-list-item strong,
.diary-list-item span {
  display: block;
}

.diary-list-item strong {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
}

.diary-list-item span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-diaries {
  padding: 28px 8px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
}

.backup-card {
  position: relative;
  justify-content: space-between;
  margin-top: 22px;
  padding: 24px;
  gap: 24px;
}

.backup-card > div:first-child {
  max-width: 540px;
}

.backup-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.backup-status {
  position: absolute;
  right: 24px;
  bottom: 5px;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(420px, calc(100% - 28px));
  padding: 7px;
  border-radius: 24px;
  transform: translateX(50%);
}

.bottom-nav-item {
  display: grid;
  min-height: 58px;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--muted);
  border: 0;
  border-radius: 18px;
  background: transparent;
  place-items: center;
  gap: 1px;
}

.bottom-nav-item > span {
  font-family: Arial, sans-serif;
  font-size: 22px;
  line-height: 1;
}

.bottom-nav-item small {
  font-size: 10px;
}

.bottom-nav-item.is-active {
  color: var(--surface-solid);
  background: var(--text);
}

.import-dialog {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
}

.import-dialog[hidden] {
  display: none;
}

.import-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 27, 25, 0.48);
  backdrop-filter: blur(6px);
}

.import-dialog-card {
  position: relative;
  width: min(520px, 100%);
  padding: 30px;
  border-radius: 28px;
}

.import-dialog-card h2 {
  margin: 18px 0 10px;
  font-size: 26px;
  font-weight: 500;
}

.import-dialog-card > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.import-options {
  display: grid;
  margin-top: 22px;
  gap: 10px;
}

.import-options .secondary-button {
  height: auto;
  padding: 16px 18px;
  border-radius: 18px;
  text-align: left;
}

.import-options strong,
.import-options span {
  display: block;
}

.import-options strong {
  margin-bottom: 5px;
}

.import-options span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.dialog-cancel {
  display: block;
  margin: 18px auto 0;
  padding: 8px 18px;
  cursor: pointer;
  color: var(--muted);
  border: 0;
  background: transparent;
}

.search-dialog {
  position: fixed;
  z-index: 45;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
}

.search-dialog[hidden] {
  display: none;
}

.search-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 27, 25, 0.42);
  backdrop-filter: blur(6px);
}

.search-dialog-card {
  position: relative;
  width: min(640px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  padding: 30px;
  overflow: auto;
  border-radius: 30px;
}

.search-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.search-dialog-heading h2 {
  margin: 13px 0 0;
  font-size: 28px;
  font-weight: 500;
}

.search-dialog-heading > button {
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-size: 20px;
}

.search-field {
  display: flex;
  align-items: center;
  margin-top: 24px;
  padding: 0 18px;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-solid);
}

.search-field > span {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 22px;
}

.search-field input {
  width: 100%;
  min-height: 54px;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}

.search-field input::placeholder {
  color: var(--muted);
  opacity: 0.68;
}

.search-hint {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 11px;
}

.search-results {
  display: grid;
  margin-top: 18px;
  gap: 10px;
}

.search-result {
  width: 100%;
  padding: 16px 18px;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-align: left;
}

.search-result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: Inter, "Microsoft YaHei", sans-serif;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.search-result p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-result mark {
  padding: 0 2px;
  color: inherit;
  border-radius: 3px;
  background: var(--rose-soft);
}

.empty-search {
  padding: 34px 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 18px;
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  color: var(--muted);
  gap: 18px;
  text-align: center;
}

footer span {
  color: var(--rose);
}

footer p,
footer small {
  margin: 0;
}

footer small {
  font-family: Inter, "Microsoft YaHei", sans-serif;
  font-size: 9px;
  letter-spacing: 0.15em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button,
a,
.panel {
  transition: transform 200ms ease, border-color 200ms ease, background 300ms ease;
}

button:hover,
.primary-button:hover {
  transform: translateY(-2px);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .clock-card {
    width: min(360px, 100%);
    margin-inline: auto;
  }

  .lab-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .experiment-card {
    grid-column: 1 / -1;
  }

  .diary-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .site-header,
  main,
  footer {
    width: min(100% - 28px, 1160px);
  }

  .site-header {
    height: 76px;
  }

  .brand > span:last-child,
  .theme-label,
  .search-label,
  .install-button span:last-child {
    display: none;
  }

  .theme-toggle,
  .search-button,
  .install-button {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
  }

  .hero {
    min-height: auto;
    padding: 38px 24px 26px;
    border-radius: 28px;
  }

  .greeting {
    margin-top: 28px;
  }

  h1 {
    font-size: clamp(43px, 14vw, 62px);
  }

  .intro br {
    display: none;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .clock-card {
    min-height: 325px;
  }

  .lab-grid,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .experiment-card {
    grid-column: auto;
  }

  .member-card,
  .experiment-card {
    min-height: 285px;
    padding: 28px;
    border-radius: 26px;
  }

  .notes-section {
    padding: 32px 20px;
    border-radius: 28px;
  }

  .diary-section {
    padding: 32px 20px;
    border-radius: 28px;
  }

  .diary-editor,
  .diary-list-panel {
    padding: 18px;
    border-radius: 22px;
  }

  .diary-editor textarea {
    min-height: 280px;
  }

  .mood-options {
    gap: 6px;
  }

  .mood-options label {
    min-height: 60px;
    border-radius: 14px;
  }

  .calendar-day {
    border-radius: 10px;
  }

  .backup-card {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .backup-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .backup-status {
    position: static;
    grid-column: 1 / -1;
  }

  .import-dialog {
    align-items: end;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .import-dialog-card {
    padding: 26px 22px;
    border-radius: 26px;
  }

  .search-dialog {
    align-items: end;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .search-dialog-card {
    max-height: min(760px, calc(100vh - 20px - env(safe-area-inset-bottom, 0px)));
    padding: 26px 22px;
    border-radius: 26px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  footer {
    flex-direction: column;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero,
  .lab-grid,
  .notes-section {
    animation: arrive 700ms ease-out both;
  }

  .lab-grid {
    animation-delay: 100ms;
  }

  .notes-section {
    animation-delay: 180ms;
  }

  .star-one,
  .star-two {
    animation: float 4s ease-in-out infinite;
  }
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  50% {
    opacity: 0.7;
    transform: translateY(-8px) rotate(8deg);
  }
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
