.study-room-page {
  overflow: hidden;
  background: #172522;
}

.study-room-background {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  background-color: #172522;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  transition: background-image 0.8s var(--ease-quiet);
}

.study-room-background::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 18, 16, 0.48), rgba(6, 18, 16, 0.12) 32%, rgba(6, 18, 16, 0.1) 68%, rgba(6, 18, 16, 0.34)),
    linear-gradient(180deg, rgba(5, 14, 13, 0.28), rgba(5, 14, 13, 0.12) 44%, rgba(5, 14, 13, 0.42));
}

.study-room-background .paper-grain {
  z-index: 2;
}

.study-room-background-video {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s var(--ease-quiet);
}

.study-room-background-video.is-visible {
  opacity: 1;
}

.theme-room-chat { position: fixed; z-index: 4; top: 104px; right: 24px; width: min(300px, calc(100vw - 48px)); max-height: calc(100vh - 128px); display: flex; flex-direction: column; padding: 16px; border-radius: 18px; background: rgba(9, 29, 24, 0.66); }
.theme-room-chat[hidden] { display: none; }
.theme-room-chat-heading { display:flex; justify-content:space-between; gap:12px; border-bottom:1px solid rgba(255,255,255,.16); padding-bottom:10px; }
.theme-room-chat-heading p { margin:0; color:rgba(255,246,232,.45); font-size:9px; letter-spacing:.1em; }.theme-room-chat-heading h2 { margin:4px 0 0; font-family:"STKaiti","KaiTi",serif; font-size:17px; font-weight:400; }.theme-room-chat-heading > span { color:rgba(255,246,232,.55); font-size:11px; }
.theme-room-materials-section { padding: 10px 0 8px; border-bottom: 1px solid rgba(255,255,255,.13); }.theme-room-section-heading { display:flex; justify-content:space-between; gap:10px; color:rgba(255,246,232,.5); font-family:"Microsoft YaHei","PingFang SC",sans-serif; font-size:9px; }.theme-room-section-heading h3 { margin:0; font:inherit; font-weight:500; }.theme-room-section-heading span { font-size:9px; }.theme-room-chat-section-heading { padding:10px 0 6px; }
.theme-room-materials { display:flex; flex-wrap:wrap; gap:5px; padding-top:7px; }.theme-room-materials button { max-width:100%; overflow:hidden; border:1px solid rgba(255,246,232,.22); border-radius:7px; color:rgba(255,246,232,.72); background:rgba(255,255,255,.06); font-size:10px; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }.theme-room-materials-empty { margin:0; color:rgba(255,246,232,.4); font-family:"STKaiti","KaiTi",serif; font-size:11px; }
.theme-room-chat-messages { display:grid; align-content:start; gap:7px; min-height:120px; overflow-y:auto; }.theme-room-message { display:grid; width:fit-content; max-width:85%; margin:0; padding:7px 9px; color:rgba(255,246,232,.82); background:rgba(255,255,255,.09); font-size:11px; line-height:1.5; }.theme-room-message small { color:rgba(255,246,232,.48); font-size:9px; }.theme-room-message.is-mine { justify-self:end; color:#17342d; background:rgba(255,246,232,.84); }
.theme-room-chat-form { display:grid; grid-template-columns:minmax(0,1fr) 28px 28px; gap:5px; margin-top:10px; }.theme-room-chat-form input { min-width:0; border:0; outline:0; color:var(--warm-text); background:rgba(255,255,255,.08); padding:7px; font-size:11px; }.theme-room-chat-form button { border:0; color:#17342d; background:rgba(255,246,232,.84); cursor:pointer; }
.theme-room-emoji-picker { display:flex; flex-wrap:wrap; gap:5px; padding-top:8px; }.theme-room-emoji-picker[hidden] { display:none; }.theme-room-emoji-picker button { width:28px; height:28px; padding:0; border:0; border-radius:7px; background:rgba(255,255,255,.08); cursor:pointer; font-size:15px; }
.theme-room-preview-modal { position:fixed; z-index:90; inset:0; display:grid; place-items:center; padding:24px; background:rgba(3,13,11,.66); backdrop-filter:blur(8px); }.theme-room-preview-modal[hidden] { display:none; }.theme-room-preview-dialog { width:min(880px,calc(100vw - 48px)); max-height:calc(100vh - 48px); display:flex; flex-direction:column; padding:18px; border-radius:18px; background:rgba(11,31,26,.92); }.theme-room-preview-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:12px; }.theme-room-preview-heading h2 { min-width:0; margin:0; overflow:hidden; color:var(--warm-text); font-family:"STKaiti","KaiTi",serif; font-size:18px; font-weight:400; text-overflow:ellipsis; white-space:nowrap; }.theme-room-preview-heading button { width:30px; height:30px; border:1px solid rgba(255,246,232,.32); border-radius:50%; color:var(--warm-text); background:rgba(255,255,255,.05); cursor:pointer; font-size:18px; }.theme-room-preview-dialog img { max-width:100%; max-height:calc(100vh - 170px); align-self:center; object-fit:contain; }.theme-room-preview-dialog iframe { width:100%; min-height:min(600px,calc(100vh - 170px)); border:0; background:#fff; }.theme-room-preview-fallback { display:grid; gap:8px; min-height:220px; place-content:center; color:rgba(255,246,232,.66); font-family:"STKaiti","KaiTi",serif; text-align:center; }.theme-room-preview-fallback strong { color:var(--warm-text); font-size:20px; font-weight:400; }.theme-room-preview-download { align-self:center; margin-top:14px; color:rgba(255,246,232,.82); font-family:"Microsoft YaHei","PingFang SC",sans-serif; font-size:11px; }

@media (min-width: 1081px) {
  .is-theme-room .timer-stage { left: calc(50% - 160px); }
}

.study-account-actions {
  gap: 8px;
}

.focus-settings-button {
  width: 44px;
  min-width: 44px;
  min-height: 40px;
  padding: 0;
  border-radius: 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
}

.study-exit-button {
  width: 44px;
  min-width: 44px;
  min-height: 40px;
  padding: 0;
  border-radius: 16px;
  font-family: "Segoe UI Symbol", "Segoe UI", sans-serif;
  font-size: 21px;
}

.study-room-main {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(380px, 1fr) minmax(250px, 300px);
  align-items: center;
  gap: 24px;
  padding: 112px 24px 24px;
}

.todo-panel {
  width: 100%;
  max-height: calc(100svh - 142px);
  align-self: start;
  padding: 20px;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(8, 22, 19, 0.12);
  backdrop-filter: blur(18px) saturate(0.84);
  -webkit-backdrop-filter: blur(18px) saturate(0.84);
  animation: study-panel-arrive 0.9s 0.15s var(--ease-quiet) both;
}

.todo-heading,
.study-settings-heading,
.study-setting-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.todo-heading p,
.todo-heading h2,
.study-settings-heading h2,
.study-setting-label h3 {
  margin: 0;
}

.todo-heading p {
  margin-bottom: 4px;
  color: rgba(255, 246, 232, 0.58);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 10px;
}

.todo-heading h2,
.study-settings-heading h2 {
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 22px;
  font-weight: 500;
}

.todo-heading > span {
  color: rgba(255, 246, 232, 0.66);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 11px;
}

.todo-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 7px;
  margin-top: 17px;
}

.todo-form input,
.study-custom-time input {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.38);
  outline: 0;
  background: rgba(7, 19, 16, 0.14);
  color: var(--warm-text);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.todo-form input {
  height: 38px;
  padding: 8px 11px;
  border-radius: 13px;
  font-size: 12px;
}

.todo-form input::placeholder,
.study-custom-time input::placeholder {
  color: rgba(255, 246, 232, 0.46);
}

.todo-form input:focus,
.study-custom-time input:focus {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.07);
}

.todo-form button,
.todo-remove,
.study-settings-heading button,
.study-custom-time button {
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.04);
  color: var(--warm-text);
  cursor: pointer;
  transition: background 0.35s var(--ease-quiet), border-color 0.35s var(--ease-quiet), transform 0.35s var(--ease-quiet);
}

.todo-form button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 17px;
}

.todo-form button:hover,
.todo-remove:hover,
.study-settings-heading button:hover,
.study-custom-time button:hover {
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.12);
}

.todo-list {
  max-height: calc(100svh - 270px);
  margin: 14px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: rgba(255, 255, 255, 0.32) transparent;
  scrollbar-width: thin;
}

.todo-item {
  min-height: 45px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.17);
}

.todo-check {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #b9d7f0;
  cursor: pointer;
}

.todo-text {
  min-width: 0;
  overflow-wrap: anywhere;
  color: rgba(255, 246, 232, 0.88);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12px;
  line-height: 1.5;
  transition: color 0.35s ease, opacity 0.35s ease;
}

.todo-item.is-done .todo-text {
  color: rgba(255, 246, 232, 0.48);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  opacity: 0.78;
}

.todo-remove {
  width: 25px;
  height: 25px;
  border-color: transparent;
  border-radius: 50%;
  opacity: 0;
  font-size: 15px;
}

.todo-item:hover .todo-remove,
.todo-remove:focus-visible {
  opacity: 1;
}

.todo-empty {
  margin: 18px 0 2px;
  color: rgba(255, 246, 232, 0.45);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 11px;
  text-align: center;
}

.todo-empty[hidden] {
  display: none;
}

.timer-stage {
  position: fixed;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: min(540px, calc(100vw - 48px));
  min-height: 340px;
  min-width: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  margin: 0;
  padding: 30px 24px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 24px;
  background: rgba(8, 22, 19, 0.055);
  box-shadow: 0 22px 58px rgba(4, 14, 12, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  text-align: center;
  transform: translate(-50%, -50%);
  animation: timer-arrive 1.1s 0.2s var(--ease-quiet) both;
}

.timer-stage[hidden] {
  display: none;
}

.study-exit-modal {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: rgba(4, 13, 12, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.28s var(--ease-quiet), visibility 0.28s var(--ease-quiet);
}

.study-exit-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.study-exit-dialog,
.study-completion {
  width: min(440px, calc(100vw - 48px));
  padding: 30px;
  border-radius: 22px;
  color: var(--warm-text);
  background: rgba(14, 35, 30, 0.76);
  box-shadow: 0 28px 86px rgba(1, 9, 7, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  text-align: center;
}

.study-exit-kicker {
  margin: 0;
  color: rgba(255, 246, 232, 0.48);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  letter-spacing: 0.14em;
}

.study-exit-dialog h2,
.study-completion h2 {
  margin: 12px 0 10px;
  font-family: "STZhongsong", "华文中宋", "STSong", "SimSun", serif;
  font-size: 30px;
  font-weight: 700;
}

.study-exit-dialog > p:not(.study-exit-kicker),
.study-completion > p:not(.study-exit-kicker) {
  margin: 0;
  color: rgba(255, 246, 232, 0.64);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 16px;
  line-height: 1.8;
}

.study-exit-actions,
.study-completion-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 25px;
}

.study-quiet-button,
.study-completion-actions a {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 246, 232, 0.34);
  border-radius: 13px;
  color: var(--warm-text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 14px;
  text-decoration: none;
}

.study-quiet-button:hover {
  background: rgba(255, 255, 255, 0.13);
}

.study-completion {
  position: fixed;
  z-index: 30;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.study-completion[hidden] {
  display: none;
}

.timer-display {
  width: 100%;
  min-height: 112px;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--warm-text);
  font-family: "Segoe UI Light", "Segoe UI", Arial, sans-serif;
  font-size: 92px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 8px 32px rgba(2, 10, 9, 0.35);
}

.timer-progress {
  width: 240px;
  height: 2px;
  overflow: hidden;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.22);
}

.timer-progress span {
  width: 100%;
  height: 100%;
  display: block;
  background: rgba(255, 255, 255, 0.88);
  transform-origin: left center;
  transition: transform 0.45s linear;
}

.timer-controls {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

.timer-control {
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 14px 34px rgba(6, 17, 15, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: var(--warm-text);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform 0.45s var(--ease-quiet), background 0.45s var(--ease-quiet), border-color 0.45s var(--ease-quiet);
}

.timer-control:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.12);
}

.timer-reset {
  width: 44px;
  height: 44px;
  font-size: 21px;
}

.timer-primary {
  width: 62px;
  height: 62px;
  font-size: 20px;
}

.study-settings-panel {
  position: fixed;
  z-index: 30;
  top: 102px;
  right: 24px;
  width: min(330px, calc(100vw - 32px));
  max-height: calc(100svh - 118px);
  padding: 20px;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  scrollbar-width: thin;
  border-radius: 22px;
  background: rgba(8, 22, 19, 0.3);
  backdrop-filter: blur(24px) saturate(0.82);
  -webkit-backdrop-filter: blur(24px) saturate(0.82);
  animation: settings-panel-open 0.45s var(--ease-quiet) both;
}

.study-settings-panel::-webkit-scrollbar {
  width: 5px;
}

.study-settings-panel::-webkit-scrollbar-track {
  background: transparent;
}

.study-settings-panel::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
}

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

.study-settings-heading button {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  font-size: 18px;
}

.study-setting-section {
  margin-top: 17px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.study-setting-label h3 {
  color: var(--warm-text);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 500;
}

.study-setting-label span {
  color: rgba(255, 246, 232, 0.58);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 10px;
}

.study-option-row,
.study-time-grid {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.study-option-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.study-time-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.study-option-row button,
.study-time-grid button {
  min-width: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 246, 232, 0.72);
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  transition: color 0.35s ease, background 0.35s ease, border-color 0.35s ease;
}

.study-option-row button span {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 11px;
}

.study-option-row button:hover,
.study-time-grid button:hover,
.study-option-row button[aria-pressed="true"],
.study-time-grid button[aria-pressed="true"] {
  color: var(--warm-text);
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.12);
}

.sound-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 12px;
}

.sound-mode-tabs button,
.sound-choice-grid button {
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  color: rgba(255, 246, 232, 0.7);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 12px;
  transition: color 0.3s var(--ease-quiet), background 0.3s var(--ease-quiet), border-color 0.3s var(--ease-quiet);
}

.sound-mode-tabs button[aria-selected="true"],
.sound-mode-tabs button:hover,
.sound-choice-grid button[aria-pressed="true"],
.sound-choice-grid button:hover {
  border-color: rgba(255, 246, 232, 0.78);
  color: var(--warm-text);
  background: rgba(255, 255, 255, 0.12);
}

.sound-option-group {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.sound-option-group[hidden] {
  display: none;
}

.sound-option-group > p {
  margin: 0 0 9px;
  color: rgba(255, 246, 232, 0.52);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 10px;
}

.sound-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.instrumental-track-list {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.instrumental-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  color: rgba(255, 246, 232, 0.58);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 10px;
}

.instrumental-list-heading small {
  font-size: 9px;
}

.instrumental-track-list > button {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: transparent;
  color: rgba(255, 246, 232, 0.7);
  cursor: pointer;
  text-align: left;
  transition: color 0.3s ease, background 0.3s ease;
}

.instrumental-track-list > button:hover,
.instrumental-track-list > button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.065);
  color: var(--warm-text);
}

.track-number,
.track-action {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
}

.track-number {
  color: rgba(255, 246, 232, 0.46);
}

.track-title {
  min-width: 0;
  overflow: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-action {
  justify-self: center;
  opacity: 0.38;
}

.instrumental-track-list > button[aria-pressed="true"] .track-action {
  opacity: 1;
}

.volume-control {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  color: rgba(255, 246, 232, 0.64);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
}

.volume-control input {
  width: 100%;
  accent-color: #f5f0e5;
}

.volume-control output {
  text-align: right;
}

.study-custom-time {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}

.study-custom-time[hidden] {
  display: none;
}

.study-custom-time input {
  height: 36px;
  padding: 7px 9px;
  border-radius: 12px;
}

.study-custom-time span {
  color: rgba(255, 246, 232, 0.6);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 10px;
}

.study-custom-time button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.study-balance-column {
  min-width: 0;
}

.timer-control:focus-visible,
.todo-form input:focus-visible,
.todo-form button:focus-visible,
.todo-check:focus-visible,
.todo-remove:focus-visible,
.study-settings-panel button:focus-visible,
.study-settings-panel input:focus-visible,
.focus-settings-button:focus-visible {
  outline: 2px solid rgba(255, 246, 232, 0.88);
  outline-offset: 3px;
}

.study-exit-button:focus-visible,
.study-quiet-button:focus-visible,
.study-completion-actions a:focus-visible {
  outline: 2px solid rgba(255, 246, 232, 0.88);
  outline-offset: 3px;
}

@keyframes timer-arrive {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes study-panel-arrive {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes settings-panel-open {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1080px) {
  .is-theme-room { overflow-y: auto; }

  .is-theme-room .theme-room-chat {
    position: relative;
    top: auto;
    right: auto;
    width: min(520px, calc(100vw - 48px));
    max-height: none;
    margin: 0 auto 24px;
  }

  .study-room-main {
    grid-template-columns: 250px minmax(360px, 1fr) 120px;
  }

  .timer-stage {
    position: relative;
    top: auto;
    left: auto;
    width: min(520px, 100%);
    justify-self: center;
    transform: none;
  }

  .timer-display {
    font-size: 82px;
  }
}

@media (max-width: 820px), (min-width: 821px) and (max-width: 1024px) and (orientation: portrait) {
  .study-room-page {
    overflow-y: auto;
  }

  .study-room-main {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 104px 14px 24px;
  }

  .timer-stage {
    min-height: 58svh;
    order: 1;
    margin: 0;
    padding: 32px 18px;
  }

  .todo-panel {
    max-height: none;
    order: 2;
  }

  .todo-list {
    max-height: 280px;
  }

  .study-balance-column {
    display: none;
  }

  .study-settings-panel {
    top: 96px;
    right: 14px;
  }
}

@media (max-width: 560px) {
  .study-account-actions {
    justify-content: flex-end;
  }

  .focus-settings-button {
    width: 40px;
    min-width: 40px;
  }

  .study-exit-button {
    width: 40px;
    min-width: 40px;
  }

  .timer-stage {
    min-height: 340px;
    border-radius: 22px;
  }

  .timer-display {
    min-height: 96px;
    font-size: 64px;
  }

  .timer-progress {
    width: 200px;
  }

  .timer-controls {
    margin-top: 20px;
  }

  .study-settings-panel {
    width: calc(100vw - 28px);
  }

  .study-exit-dialog,
  .study-completion {
    width: min(100%, 420px);
    padding: 26px 20px;
  }

  .study-exit-actions,
  .study-completion-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .todo-remove {
    opacity: 1;
  }
}
