:root {
  color-scheme: light;
  --page: #fffaf0;
  --paper: #fffdf8;
  --ink: #30271e;
  --muted: #756553;
  --line: #e9decd;
  --orange: #ffc15d;
  --orange-dark: #9d5f29;
  --green: #3e694d;
  font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid #ae6a39;
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
.icon { width: 20px; height: 20px; display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner {
  max-width: 1128px;
  margin: 0 auto;
  min-height: 71px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.wordmark {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: .06em;
  white-space: nowrap;
}
.brand-icon {
  width: 36px;
  height: 36px;
  background: #ffdc91;
  border: 1px solid #ebad61;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.brand-icon i {
  width: 20px;
  height: 20px;
  background: #8d4b2f;
  clip-path: polygon(40% 0,60% 0,60% 10%,70% 10%,70% 20%,80% 20%,80% 30%,90% 30%,90% 40%,100% 40%,100% 55%,85% 55%,85% 100%,60% 100%,60% 68%,40% 68%,40% 100%,15% 100%,15% 55%,0 55%,0 40%,10% 40%,10% 30%,20% 30%,20% 20%,30% 20%,30% 10%,40% 10%);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #ede2d1;
  border-radius: 13px;
  background: #f8f1e5;
}
.site-nav[hidden] { display: none; }
.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 100px;
  min-height: 40px;
  padding: 6px 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
}
.nav-button.active { color: #723f19; background: #ffe3ad; }
.nav-button .icon { width: 18px; height: 18px; }
.profile { display: flex; gap: 9px; align-items: center; justify-self: end; font-size: .88rem; font-weight: 700; }
.profile .avatar { width: 35px; height: 35px; border-radius: 10px; }
.profile-button { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0; border: 0; background: transparent; font-weight: inherit; }
.notification-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}
.notification-button:hover { background: #faf0d9; }
.notification-badge {
  position: absolute;
  top: 3px;
  right: 0;
  min-width: 18px;
  padding: 2px 4px;
  border-radius: 10px;
  background: #ac4a41;
  color: white;
  font-size: .62rem;
  line-height: 1.1;
}

.main-content { max-width: 1128px; margin: 0 auto; padding: 39px 28px 52px; }
.shared-gate {
  max-width: 440px;
  margin: 30px auto 0;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.shared-gate p { margin-top: 10px; color: var(--muted); line-height: 1.55; }
.shared-gate button { margin-top: 15px; }
.account-form { display: grid; gap: 14px; margin-top: 18px; }
.account-form label { display: grid; gap: 6px; color: var(--ink); font-size: .92rem; font-weight: 700; }
.account-form input { min-width: 0; width: 100%; min-height: 46px; padding: 8px 12px; color: var(--ink); background: #fffcf6; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; }
.account-form .account-error { margin: 0; color: #9a393d; font-size: .88rem; }
.account-form .wake-button { margin-top: 0; }
.account-settings { margin: 0; padding: 19px; }
.account-id { color: var(--muted); font-size: .9rem; }
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 22px;
}
.page-heading h1 {
  font-size: clamp(1.85rem, 3.5vw, 2.45rem);
  line-height: 1.13;
  letter-spacing: -.04em;
  font-weight: 850;
}
.page-date {
  margin-top: 8px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.quiet-button, .wake-button, .wake-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  font-weight: 700;
  font-size: .92rem;
  white-space: nowrap;
}
.quiet-button:hover { background: #f9f0e0; }
.quiet-button .icon { width: 18px; height: 18px; }
.today-grid { display: grid; grid-template-columns: minmax(0, 1.53fr) minmax(0, 1fr); gap: 20px; }
.wake-card {
  min-height: 357px;
  display: flex;
  align-items: center;
  padding: 24px clamp(24px, 4vw, 44px) 40px;
  overflow: hidden;
  border: 1px solid #e8d39c;
  border-radius: 23px;
  background: #faedc1 url("./assets/cottage-dawn.png") center bottom / cover no-repeat;
}
.wake-copy { position: relative; isolation: isolate; }
.wake-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .86rem;
  font-weight: 750;
  color: #775323;
}
.wake-label .icon { width: 16px; height: 16px; }
.wake-card h2 {
  margin-top: 10px;
  color: #39291c;
  font-size: clamp(2.1rem, 4.5vw, 3.5rem);
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: -.08em;
}
.wake-card h2 span { color: #a25d35; }
.wake-card p {
  margin-top: 11px;
  color: #6b5032;
  font-size: .99rem;
  line-height: 1.45;
}
.wake-button {
  background: var(--orange);
  color: #3f2b16;
  border: 1px solid #b3783b;
  box-shadow: 0 3px 0 #a36535;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.wake-button:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 #a36535; }
.wake-button:not(:disabled):hover { background: #ffd07b; }
.wake-button:disabled { opacity: .53; box-shadow: none; }
.wake-card .wake-button, .wake-done {
  margin-top: 23px;
  min-height: 54px;
  padding: 9px 22px;
  font-size: 1.05rem;
}
.wake-card .wake-button .icon { width: 22px; height: 22px; }
.wake-done { color: #31583d; border-color: #9daa77; background: #f2f3d9; }
.wake-done span { font-size: .77rem; margin-left: 3px; }
.history-panel, .members-panel {
  min-width: 0;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--paper);
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 15px; }
.panel-heading h2 { font-size: 1.18rem; font-weight: 790; }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 49px;
  border-top: 1px solid var(--line);
}
.history-day { display: flex; align-items: center; gap: 8px; font-size: .94rem; }
.history-time { color: var(--green); font-size: 1.05rem; font-variant-numeric: tabular-nums; font-weight: 750; }
.history-today { background: #f6edd7; color: #755228; padding: 3px 6px; border-radius: 6px; font-size: .75rem; }
.history-empty { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.members-panel { display: flex; flex-direction: column; }
.member-count { font-size: .83rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.member-count b { color: var(--green); }
.member-grid {
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 10px;
  flex: 1;
}
.member {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 11px 5px 10px;
  gap: 6px;
  background: var(--member-tone);
  border: 1px solid color-mix(in srgb, var(--member-tone), #8d725f 12%);
  border-radius: 13px;
  text-align: center;
}
.avatar {
  display: inline-block;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background-color: #f8ead6;
  background-image: url("./assets/character-lineup-v1.png");
  background-repeat: no-repeat;
  background-size: 400%;
  background-position: var(--avatar-x) var(--avatar-y);
  image-rendering: pixelated;
}
.avatar--yewen { --avatar-x: 16.7%; --avatar-y: 4%; }
.avatar--xiaohan { --avatar-x: 78%; --avatar-y: 6.4%; }
.avatar--xiaoxue { --avatar-x: 16.7%; --avatar-y: 72%; }
.avatar--xiuyu { --avatar-x: 83%; --avatar-y: 72%; }
.member-avatar {
  position: relative;
  width: 59px;
  height: 59px;
  border-radius: 13px;
  box-shadow: 0 0 0 2px rgb(255 255 255 / .55);
}
.member-avatar.avatar--xiaohan::after {
  content: "";
  position: absolute;
  inset: auto -7px -4px auto;
  width: 24px;
  height: 24px;
  border: 1px solid #fffdf8;
  border-radius: 7px;
  background: #e1eddc url("./assets/character-lineup-v1.png") 91% 35% / 780% no-repeat;
}
.member-detail { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.member-name { font-weight: 780; font-size: .94rem; line-height: 1.2; white-space: nowrap; }
.self-label { margin-left: 4px; font-size: .67rem; color: #73563d; font-weight: 550; }
.member-status { color: #6c5c51; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.member-status.awake { color: #35583b; font-variant-numeric: tabular-nums; }
.member-status i, .calendar-day i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  vertical-align: 2px;
  border-radius: 50%;
  background: #61976b;
}
.journal-teaser {
  display: flex;
  align-self: start;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  background: #f4ecfa;
  border: 1px solid #e5d6ed;
  border-radius: 17px;
}
.book-icon {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: #e8d9f1;
  color: #744b89;
}
.journal-teaser h2 { font-size: 1.02rem; font-weight: 800; }
.journal-teaser p { margin-top: 4px; color: #715f79; font-size: .86rem; }
.write-button { color: #654a78; border-color: #e2d1eb; background: #fffaff; }
.write-button:hover { background: #f3e9f8; }
.journal-teaser .write-button { margin-left: auto; }
.feed-wrap { max-width: 680px; margin: 0 auto; }
.feed-heading { align-items: center; }
.feed-tools { display: flex; gap: 8px; }
.filter-active { background: #fff0cb; border-color: #e8d39c; }
.feed-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
  font-size: .9rem;
  font-weight: 700;
}
.day-heading { color: var(--muted); font-size: .88rem; margin: 23px 0 9px; font-weight: 700; }
.post, .empty-state {
  padding: 17px 19px;
  margin-bottom: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 17px;
}
.post-header { display: flex; align-items: center; gap: 10px; }
.post-header h3 { font-size: .98rem; font-weight: 780; }
.post-header time { color: var(--muted); font-size: .79rem; font-variant-numeric: tabular-nums; }
.post-type {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #79501d;
  background: #fff0cb;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: .75rem;
  white-space: nowrap;
}
.post-type .icon { width: 14px; height: 14px; }
.post-copy { margin-top: 12px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.post-actions { display: flex; gap: 10px; padding-top: 5px; }
.post-actions button, .text-button {
  border: 0;
  min-height: 42px;
  padding: 4px 7px;
  background: transparent;
  color: var(--muted);
  font-size: .9rem;
  border-radius: 7px;
}
.post-actions button:hover, .text-button:hover { background: #f9f0e0; }
.post-actions button[aria-pressed="true"] { color: #a43e42; }
.post-actions button[aria-pressed="true"] svg { fill: #f0aeaa; }
.post-actions .icon { width: 17px; height: 17px; }
.text-button { padding: 0; min-height: 32px; text-decoration: underline; text-underline-offset: 3px; }
.empty-state { color: var(--muted); }
.post-feedback { background: #faf3e8; border-radius: 10px; padding: 10px 11px; }
.post-feedback > * + * { margin-top: 9px; }
.post-likes {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #91454a;
  font-size: .9rem;
  font-weight: 650;
}
.post-likes .icon { width: 16px; height: 16px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.post-likes + .comment-list { border-top: 1px solid var(--line); padding-top: 9px; }
.comment-list li { display: flex; gap: 7px; font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.comment-list li + li { margin-top: 5px; }
.comment-list strong { color: #775335; flex: 0 0 auto; }
.comment-form { display: flex; gap: 7px; }
.comment-form input {
  min-width: 0;
  width: 100%;
  padding: 8px 11px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}
.modal {
  width: min(440px, calc(100% - 28px));
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 19px;
  box-shadow: 0 18px 54px rgb(53 36 18 / .21);
}
.modal::backdrop { background: rgb(52 38 24 / .33); }
.calendar, .compose-form, .history-dialog { padding: 19px; }
.history-dialog .history-list { margin-top: 10px; max-height: min(60vh, 480px); overflow: auto; }
.modal-heading, .month-heading, .compose-footer { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.modal-heading h2 { font-size: 1.3rem; }
.notification-center { padding: 19px; }
.notification-list { list-style: none; margin: 8px 0 0; padding: 0; }
.notification-list li + li { margin-top: 6px; }
.notification-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  text-align: left;
}
.notification-row:hover, .notification-row.unread { background: #fff1d0; }
.notification-copy { display: grid; min-width: 0; gap: 3px; font-size: .92rem; }
.notification-copy time, .notification-empty { color: var(--muted); font-size: .85rem; }
.notification-empty { margin: 12px 0; }
.notification-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-dot { flex: 0 0 7px; height: 7px; margin-left: auto; border-radius: 50%; background: #ac4a41; }
.post:focus { outline: 2px solid #a96636; outline-offset: 2px; }
.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover { background: #f7edde; }
.compose-author { display: flex; gap: 9px; align-items: center; margin: 10px 0 12px; font-weight: 750; }
.compose-author .avatar { width: 35px; height: 35px; }
.compose-form textarea {
  display: block;
  width: 100%;
  min-height: 154px;
  resize: vertical;
  padding: 12px;
  line-height: 1.6;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffcf6;
}
.compose-footer { margin-top: 13px; }
.compose-footer > span { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.compose-footer .wake-button { min-width: 88px; }
.month-heading { margin: 9px 0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.week-label { color: var(--muted); font-size: .82rem; padding-bottom: 5px; }
.calendar-day {
  position: relative;
  min-height: 42px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  font-variant-numeric: tabular-nums;
}
.calendar-day:hover { background: #faf0d9; }
.calendar-day[aria-current="date"] { background: #fff1cf; font-weight: 800; }
.calendar-day[aria-pressed="true"] { background: #ffe0a4; box-shadow: inset 0 0 0 1px #bd884e; font-weight: 800; }
.calendar-day i { position: absolute; left: calc(50% - 2px); bottom: 4px; width: 4px; height: 4px; }
.toast {
  position: fixed;
  z-index: 3;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 10px 14px;
  border-radius: 10px;
  background: #343027;
  color: #fff8e5;
  font-size: .88rem;
  text-align: center;
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 740px) {
  .header-inner { min-height: 60px; grid-template-columns: 1fr 1fr; padding: 0 18px; }
  .site-nav {
    position: fixed;
    z-index: 2;
    inset: auto 0 0;
    justify-content: center;
    gap: 12px;
    padding: 6px 18px max(7px, env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: #fffdf9;
  }
  .nav-button { min-height: 48px; flex: 1; max-width: 230px; flex-direction: column; gap: 2px; padding: 5px; font-size: .76rem; }
  .nav-button .icon { width: 19px; height: 19px; }
  .main-content { max-width: 560px; padding: 20px 16px calc(84px + env(safe-area-inset-bottom)); }
  .page-heading { margin-bottom: 14px; }
  .page-date { margin-top: 5px; }
  .today-grid { grid-template-columns: 1fr; gap: 12px; }
  .wake-card { min-height: 292px; align-items: flex-start; padding: 24px 22px; background-size: 100% auto; }
  .wake-card h2 { font-size: clamp(2.05rem, 8.8vw, 2.9rem); margin-top: 8px; }
  .wake-card p { font-size: .9rem; margin-top: 8px; }
  .wake-card .wake-button, .wake-done { margin-top: 16px; min-height: 49px; padding-inline: 14px; }
  .history-panel, .members-panel { padding: 13px; }
  .panel-heading { margin-bottom: 10px; }
  .panel-heading h2 { font-size: 1.05rem; }
  .member-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .member { padding: 8px 2px; gap: 5px; border-radius: 10px; }
  .member-avatar { width: 43px; height: 43px; border-radius: 9px; }
  .member-avatar.avatar--xiaohan::after { width: 18px; height: 18px; inset: auto -5px -3px auto; }
  .member-name { font-size: .83rem; }
  .member-status { font-size: .75rem; }
  .journal-teaser { padding: 10px 11px; gap: 8px; }
  .journal-teaser p { font-size: .8rem; }
  .journal-teaser .write-button { padding-inline: 9px; font-size: .84rem; }
  .feed-tools .quiet-button { padding-inline: 9px; }
  .book-icon { width: 39px; height: 39px; }
  .post { padding: 13px 14px; }
  .toast { bottom: calc(73px + env(safe-area-inset-bottom)); }
}
@media (max-width: 355px) {
  .main-content { padding-inline: 11px; }
  .wake-card { min-height: 265px; }
  .wordmark { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* The shared study room */
.study-wrap { width: min(100%, 760px); margin-inline: auto; }
.study-heading .page-date b { color: var(--green); }
.study-room {
  overflow: hidden;
  border: 1px solid #d9bd98;
  border-radius: 20px;
  background: #efd9bb;
  box-shadow: 0 3px 0 #ebd7b9;
}
.study-zone-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.study-zone-head h2 {
  padding: 5px 10px;
  border-radius: 3px;
  background: #fff7e5;
  color: #60452e;
  font-size: .83rem;
  box-shadow: 2px 2px 0 #d7b791;
}
.study-zone-head > span { color: #624832; font-size: .8rem; font-weight: 700; }
.study-work-zone, .study-rest-zone {
  position: relative;
  isolation: isolate;
  padding: 14px clamp(12px, 3vw, 25px);
  background: repeating-linear-gradient(0deg, #c48c5c24 0 2px, transparent 2px 23px), #f0d6ae;
}
.study-work-zone { padding-bottom: 15px; }
.study-work-zone::before, .study-rest-zone::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 83px;
  border-bottom: 5px solid #c48e62;
  background: repeating-linear-gradient(90deg, #d4936413 0 2px, transparent 2px 20px), #f8e8c9;
}
.study-room-wall {
  position: relative;
  height: 39px;
  margin: 0 auto;
  max-width: 440px;
  pointer-events: none;
}
.study-room-wall i { position: absolute; display: block; }
.room-window {
  top: -22px;
  left: calc(50% - 40px);
  width: 80px;
  height: 56px;
  border: 5px solid #a9724d;
  box-shadow: 0 4px 0 2px #d7a675, inset 0 3px #a6cbd9;
  background: linear-gradient(90deg, transparent 47%, #a9724d 47% 53%, transparent 53%),
    linear-gradient(0deg, #a5b879 0 27%, #c1d395 27% 40%, #d9eef0 40%);
}
.room-bookshelf {
  bottom: 12px;
  left: 12%;
  width: 47px;
  height: 20px;
  border-bottom: 5px solid #aa744b;
  background: linear-gradient(90deg, #a8b187 0 14%, #b97f78 14% 32%, #f2c16e 32% 51%, #91a89d 51% 63%, #ba8e66 63% 78%, transparent 78%);
  box-shadow: 0 3px 0 #cfaa7f;
  transform: rotate(-1deg);
}
.room-plant {
  bottom: 5px;
  right: 10%;
  width: 21px;
  height: 23px;
  border-bottom: 8px solid #b87858;
  background: #7f9b69;
  clip-path: polygon(0 0, 34% 0, 34% 16%, 66% 16%, 66% 0, 100% 0, 100% 40%, 67% 40%, 67% 60%, 95% 60%, 82% 100%, 18% 100%, 5% 60%, 34% 60%, 34% 40%, 0 40%);
}
.study-desks {
  max-width: 590px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px clamp(8px, 4vw, 42px);
}
.study-desk { position: relative; height: 116px; min-width: 0; }
.study-desk-art {
  position: absolute;
  inset: 42px 8px auto;
  margin-inline: auto;
  width: min(140px, calc(100% - 16px));
  height: 28px;
  border: 3px solid #886044;
  border-bottom-width: 6px;
  border-radius: 3px;
  background: #d7a16c;
  box-shadow: inset 0 3px #efc293, 0 8px #79513324;
}
.study-desk-art::before, .study-desk-art::after { content: ''; position: absolute; z-index: -1; top: 17px; width: 7px; height: 27px; background: #966446; }
.study-desk-art::before { left: 4px; }
.study-desk-art::after { right: 4px; }
.study-desk-art i { position: absolute; display: block; }
.desk-monitor {
  left: calc(50% - 18px);
  top: -20px;
  width: 36px;
  height: 25px;
  border: 3px solid #51463e;
  border-radius: 2px;
  background: #64706c;
  box-shadow: 0 4px 0 -1px #786e62;
}
.occupied .desk-monitor {
  background: linear-gradient(135deg, #e0ecbc 0 30%, #a9c288 30% 58%, #8da476 58%);
  box-shadow: 0 4px 0 -1px #786e62, 0 0 9px #f9f1c6;
}
.desk-lamp {
  left: 13px;
  top: -10px;
  width: 10px;
  height: 18px;
  background: #f5cf7b;
  clip-path: polygon(24% 0, 76% 0, 100% 45%, 58% 45%, 58% 85%, 82% 85%, 82% 100%, 20% 100%, 20% 85%, 42% 85%, 42% 45%, 0 45%);
}
.desk-books {
  top: 6px;
  right: 8px;
  width: 17px;
  height: 8px;
  background: linear-gradient(#a86a60 0 40%, #fef0ce 40% 68%, #8a6951 68%);
}
.desk-chair {
  left: calc(50% - 17px);
  top: 23px;
  width: 34px;
  height: 34px;
  background: #b88a63;
  border: 3px solid #7c5946;
  border-radius: 5px;
  box-shadow: 0 4px #84543729, inset 0 -5px #a57555;
}
.occupied .desk-chair { background: #88a483; border-color: #5c7360; box-shadow: 0 4px #84543729, inset 0 -5px #728d73; }
.study-seat-empty {
  position: absolute;
  left: 50%;
  top: 66px;
  min-width: 66px;
  min-height: 44px;
  transform: translateX(-50%);
  padding-inline: 9px;
  border: 1px solid #b38d66;
  border-radius: 8px;
  background: #fff5df;
  color: #6d4e32;
  font-size: .83rem;
  font-weight: 780;
  box-shadow: 0 2px 0 #b3875b;
}
.study-seat-empty:not(:disabled):hover { background: #ffe5a9; }
.study-seat-empty:disabled { border-color: #d5b793; background: #f7e6cb; box-shadow: none; }
.study-seat-person {
  position: absolute;
  inset: 0 0 auto;
  margin: 0 auto;
  width: 100%;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: end;
  flex-direction: column;
  border: 0;
  border-radius: 6px;
  background: transparent;
}
.study-bubble {
  position: absolute;
  inset: 0 auto auto 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 1px;
  width: max-content;
  max-width: calc(100% - 8px);
  padding: 4px 8px;
  border: 1px solid #c7a172;
  border-radius: 6px;
  background: #fff9eb;
  font-size: .72rem;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 2px 2px 0 #ae865c35;
}
.study-bubble::after {
  content: '';
  position: absolute;
  left: calc(50% - 3px);
  bottom: -4px;
  width: 5px;
  height: 5px;
  background: inherit;
  border-right: 1px solid #c7a172;
  border-bottom: 1px solid #c7a172;
  transform: rotate(45deg);
}
.study-bubble strong { overflow: hidden; text-overflow: ellipsis; }
.study-bubble > span { color: #4a654a; }
.study-character.avatar { width: 44px; height: 44px; border: 2px solid #fff4dc; border-radius: 8px; }
.desk-person-name { margin-top: 3px; padding: 1px 5px; border-radius: 4px; background: #fff5df; color: #5e432d; font-size: .73rem; font-weight: 800; }
.study-rest-zone {
  min-height: 99px;
  border-top: 5px solid #c29d79;
  background-color: #edcfaa;
}
.study-rest-zone::before { height: 41px; background-color: #f2dfbd; border-bottom-width: 3px; }
.study-lounge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 61px;
  margin-top: -2px;
}
.study-seating { display: grid; place-items: center; min-width: 82px; }
.study-sofa {
  position: relative;
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  min-height: 44px;
  border: 3px solid #715646;
  border-radius: 9px 9px 4px 4px;
  background: linear-gradient(90deg, #b78777 0 10%, transparent 10% 90%, #b78777 90%), #d59f89;
  box-shadow: inset 0 -9px #bb826f, 0 5px #96634827;
}
.study-sofa::after { content: ''; position: absolute; inset: 19px 9px auto; height: 2px; background: #a77465; }
button.study-sofa:hover { border-color: #a4583a; background-color: #e4aa8f; }
.study-resting { grid-area: 1 / 1; z-index: 1; display: flex; align-items: center; gap: 3px; min-width: 0; padding-inline: 6px; }
.study-resting:empty { display: none; }
.study-resting button {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  padding: 4px 3px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: .69rem;
  font-weight: 700;
}
.study-resting button > span:last-child { padding: 1px 3px; border-radius: 3px; background: #fae8cd; }
.study-resting .study-character { width: 33px; height: 33px; }
.study-tea-table {
  width: 42px;
  height: 20px;
  flex: 0 0 42px;
  border: 3px solid #96704f;
  border-radius: 3px;
  background: radial-gradient(circle at 62% 45%, #fff8e9 0 4px, transparent 5px), #d7ae7b;
  box-shadow: 2px 4px #96704f33;
}
.study-member-strip, .study-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.study-member-strip { justify-content: space-between; }
.study-member-strip button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 4px 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: .81rem;
  font-weight: 730;
}
.study-member-strip button:hover { background: #f6eddb; }
.study-member-strip .avatar { width: 28px; height: 28px; border-radius: 5px; }
.study-control { justify-content: space-between; margin: 0 0 12px; }
.study-control-status { display: flex; align-items: center; gap: 7px; min-width: 0; }
.study-control-status div { display: grid; min-width: 0; gap: 2px; }
.study-control-status div > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .78rem; }
.study-control-status strong { color: var(--green); font-variant-numeric: tabular-nums; font-size: 1.2rem; }
.study-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #5b8b63; flex: 0 0 8px; }
.study-status-dot.resting { background: #9d7648; }
.study-control-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.study-control-actions .quiet-button { padding-inline: clamp(7px, 2vw, 13px); font-size: .81rem; }
.study-control-actions .icon { width: 15px; }
.study-finish-button { color: #7f4825; background: #fff0d5; border-color: #ead4b0; }
.post-type-study { color: #3f634d; background: #e9f1e3; }
.study-dialog { padding: 18px 19px; }
.study-form { display: grid; gap: 10px; }
.study-form label { display: flex; align-items: center; gap: 7px; font-weight: 750; }
.study-form label span, .study-form-hint { color: var(--muted); font-size: .83rem; font-weight: 500; }
.study-form input, .study-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf1;
  color: var(--ink);
}
.study-form textarea { min-height: 100px; resize: vertical; }
.study-form-actions { display: flex; justify-content: end; gap: 8px; margin-top: 5px; }
.study-error { color: #9a393d; font-size: .88rem; }
.study-detail-person { display: flex; align-items: center; gap: 9px; margin-top: 8px; }
.study-detail-person div { display: grid; gap: 3px; }
.study-detail-person div > span { color: var(--muted); font-size: .83rem; }
.study-details { display: grid; gap: 2px; margin-bottom: 3px; }
.study-details > div { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 9px; font-size: .9rem; }
.study-details dt { color: var(--muted); }
.study-details dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.study-details .study-detail-total { margin-bottom: 4px; border-radius: 9px; padding-block: 11px; color: var(--green); background: #eef3e7; }
.study-saved-summary { padding: 13px 0; color: var(--green); font-size: 1.12rem; }
.history-list.daily-history > li { display: block; }
.daily-wake { margin-left: auto; color: var(--green); white-space: nowrap; }
.daily-wake time { font-variant-numeric: tabular-nums; font-weight: 760; }
.daily-study-total { display: flex; align-items: center; gap: 5px; margin-top: 9px; color: var(--green); font-size: .86rem; }
.daily-study-total .icon { width: 16px; height: 16px; }
.daily-study-record, .daily-journal { margin-top: 6px; padding: 7px 10px; border-radius: 8px; background: #f7f2e8; font-size: .87rem; line-height: 1.5; overflow-wrap: anywhere; }
.daily-study-record > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.daily-study-record > p, .daily-shared, .daily-journal > span { color: var(--muted); font-size: .8rem; }
.daily-study-record .study-note { color: var(--ink); white-space: pre-wrap; }
.daily-study-record .text-button { flex-shrink: 0; }
.daily-journal p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; white-space: pre-wrap; }
.history-dialog .daily-journal p { display: block; }

@media (max-width: 740px) {
  .site-nav { gap: 5px; padding-inline: 14px; }
  .nav-button { min-width: 0; }
  .study-zone-head h2 { padding: 4px 8px; }
  .study-member-strip { gap: 2px; padding-inline: 5px; }
  .study-member-strip button { flex-direction: column; gap: 2px; }
  .study-member-strip .avatar { width: 29px; height: 29px; }
  .modal:has(.study-dialog) { position: fixed; inset: auto 0 0; margin: 0 auto; width: min(480px, 100%); max-width: 100%; border-radius: 19px 19px 0 0; }
  .study-dialog { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}
@media (max-width: 355px) {
  .study-control-actions .icon { display: none; }
  .study-seating { min-width: 64px; }
  .study-tea-table { flex-basis: 27px; }
}
