:root {
  --text: rgba(255, 255, 255, 0.94);
  --soft: rgba(255, 255, 255, 0.68);
  --faint: rgba(255, 255, 255, 0.42);
  --glass: rgba(22, 24, 27, 0.28);
  --glass-strong: rgba(20, 22, 25, 0.48);
  --line: rgba(255, 255, 255, 0.18);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --accent: #ffffff;
  --warm: #f1c98b;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--text);
  background: #242424;
  font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #272727;
}

.scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  filter: saturate(0.95) contrast(0.96);
  transition: opacity 520ms ease, filter 320ms ease, transform 900ms ease;
}

body.lamp-on .scene img {
  filter: saturate(1.02) contrast(0.98) brightness(1.12);
}

.shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(34, 34, 34, 0.62) 0 24%, rgba(34, 34, 34, 0.08) 43%, rgba(34, 34, 34, 0.1) 63%, rgba(30, 30, 30, 0.72) 100%),
    radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.36) 70%);
  pointer-events: none;
}

.rain-layer {
  position: absolute;
  inset: -40px 0;
  display: none;
  opacity: 0.38;
  background-image: repeating-linear-gradient(105deg, transparent 0 18px, rgba(255, 255, 255, 0.22) 19px 20px);
  animation: rain 580ms linear infinite;
  pointer-events: none;
}

body.scene-rain .rain-layer {
  display: block;
}

@keyframes rain {
  to {
    transform: translate3d(-34px, 52px, 0);
  }
}

.glass {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), var(--glass));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.25);
}

.topbar {
  position: fixed;
  top: max(22px, env(safe-area-inset-top));
  left: 50%;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1180px, calc(100% - 40px));
  transform: translateX(-50%);
}

.brand,
.topnav,
.top-actions,
.glass-button,
.topnav button,
.dock-button,
.tiny-pill,
.wide-action {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}

.brand svg {
  width: 18px;
  height: 18px;
}

.topnav {
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
}

.topnav button,
.glass-button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.topnav button {
  padding: 0 14px;
}

.topnav button.active,
.topnav button:hover,
.glass-button:hover {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.top-actions {
  justify-content: end;
  gap: 10px;
}

.glass-button {
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.12);
}

.workspace {
  position: relative;
  z-index: 5;
  width: min(1180px, calc(100% - 40px));
  height: 100svh;
  margin: 0 auto;
  pointer-events: none;
}

.timer-card {
  position: absolute;
  left: 0;
  bottom: clamp(112px, 16vh, 170px);
  width: min(330px, 42vw);
  padding: 18px;
  border-radius: 20px;
  pointer-events: auto;
}

.focus-summary-button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease;
}

.focus-summary-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.18);
}

.focus-summary-button b {
  color: var(--warm);
  font-size: 12px;
}

.timer-head,
.session-line,
.panel-head,
.stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.timer-head span,
.room-note span,
.quote-card span,
.panel-head span,
.breath span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tiny-pill {
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  font-size: 12px;
}

.clock-wrap {
  display: grid;
  place-items: center;
  padding: 16px 0 12px;
}

.clock-ring {
  display: grid;
  place-items: center;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(20, 22, 25, 0.34) 0 61%, transparent 62%),
    conic-gradient(white var(--progress, 0deg), rgba(255, 255, 255, 0.18) 0);
}

.clock-ring strong {
  font-size: clamp(40px, 5vw, 54px);
  line-height: 1;
  font-weight: 800;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.34);
}

.session-line {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--soft);
  font-size: 12px;
}

.session-line span:first-child {
  color: white;
  font-weight: 800;
}

.quote-card,
.room-note {
  position: absolute;
  right: 0;
  width: min(320px, 32vw);
  padding: 18px;
  border-radius: 18px;
  pointer-events: auto;
}

.quote-card {
  top: 22%;
}

.room-note {
  bottom: clamp(118px, 17vh, 178px);
}

.quote-card p,
.room-note p {
  margin: 10px 0 0;
  color: var(--soft);
  line-height: 1.75;
}

.room-note b {
  color: white;
}

.bottom-dock {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 18px;
  align-items: center;
  width: min(760px, calc(100% - 40px));
  padding: 12px;
  border-radius: 999px;
  transform: translateX(-50%);
}

.dock-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-left: 12px;
}

.dock-group label {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

input[type="range"] {
  width: 100%;
  accent-color: white;
}

.dock-actions {
  display: flex;
  gap: 8px;
}

.dock-button {
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease;
}

.dock-button:hover,
.scene-card:hover,
.tool-grid button:hover,
.wide-action:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.2);
}

.icon-only {
  justify-content: center;
  width: 42px;
  padding: 0;
}

svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.panel {
  position: fixed;
  top: 94px;
  right: 28px;
  z-index: 25;
  width: min(360px, calc(100% - 40px));
  max-height: calc(100svh - 180px);
  overflow: auto;
  padding: 18px;
  border-radius: 22px;
  opacity: 0;
  transform: translateX(18px) scale(0.98);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.panel.open {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.focus-panel {
  width: min(820px, calc(100% - 40px));
}

.close-panel,
.task-form button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.scene-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.scene-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, background 160ms ease;
}

.scene-card.active {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.2);
}

.scene-card img {
  grid-row: 1 / span 2;
  width: 88px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
}

.scene-card span,
.tool-grid span {
  font-weight: 800;
}

.scene-card small {
  color: var(--soft);
}

.mixer {
  display: grid;
  gap: 18px;
  margin: 20px 0;
}

.mixer label {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 10px;
}

.mixer span {
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

.wide-action {
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-weight: 800;
}

.task-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 18px 0 12px;
}

.task-form input {
  min-height: 42px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  outline: 0;
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.task-form input::placeholder {
  color: rgba(255, 255, 255, 0.46);
}

.task-list {
  display: grid;
  gap: 8px;
  min-height: 136px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
}

.task-list input {
  width: 18px;
  height: 18px;
  accent-color: white;
}

.task-list button {
  border: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.task-list li.done span {
  color: var(--faint);
  text-decoration: line-through;
}

.stats {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.stats span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.stats b {
  display: block;
  color: white;
  font-size: 24px;
}

.focus-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 16px 0;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.focus-tabs button,
.week-range button,
.distribution-head button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font-weight: 800;
}

.focus-tabs button {
  min-height: 34px;
}

.focus-tabs button.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.focus-view {
  display: none;
}

.focus-view.active {
  display: block;
}

.week-range {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.week-range strong {
  text-align: center;
  font-size: clamp(18px, 3vw, 26px);
}

.week-range button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.1);
}

.week-calendar {
  display: grid;
  grid-template-columns: 42px repeat(7, minmax(68px, 1fr));
  height: min(560px, calc(100svh - 260px));
  min-height: 430px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
}

.time-axis {
  display: grid;
  grid-template-rows: 58px repeat(13, 1fr);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.time-axis span {
  display: grid;
  align-items: start;
  justify-content: center;
  padding-top: 4px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

.day-column {
  position: relative;
  display: grid;
  grid-template-rows: 58px 1fr;
  min-width: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.day-column:last-child {
  border-right: 0;
}

.day-head {
  display: grid;
  place-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.day-head span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.day-head strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.day-column.today .day-head strong {
  background: rgba(241, 201, 139, 0.92);
  color: #201813;
}

.day-track {
  position: relative;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(100% / 13 - 1px),
    rgba(255, 255, 255, 0.09) calc(100% / 13)
  );
}

.focus-block {
  position: absolute;
  left: 7px;
  right: 7px;
  min-height: 24px;
  padding: 7px;
  overflow: hidden;
  border-radius: 10px;
  color: rgba(17, 19, 23, 0.88);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric-grid article,
.today-card,
.distribution-card,
.month-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
}

.metric-grid article {
  min-width: 0;
  padding: 15px;
}

.metric-grid span,
.today-card span,
.distribution-head span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 900;
}

.metric-grid strong {
  display: block;
  margin-top: 9px;
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0;
}

.metric-grid small,
.today-card small,
.month-card small {
  color: var(--soft);
  font-size: 12px;
}

.metric-grid article:last-child strong {
  font-size: clamp(25px, 2.7vw, 36px);
}

.today-card,
.distribution-card,
.month-card {
  margin-top: 10px;
  padding: 15px;
}

.today-card strong {
  display: block;
  margin: 9px 0 4px;
  font-size: clamp(28px, 3.6vw, 38px);
  line-height: 1.08;
  white-space: nowrap;
}

.distribution-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.distribution-head button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
}

.donut {
  width: 164px;
  height: 164px;
  border-radius: 50%;
  background: conic-gradient(#7cc8ec 0 180deg, #deddd8 180deg 300deg, #91d5cd 300deg 360deg);
  box-shadow: inset 0 0 0 38px rgba(26, 28, 31, 0.78), 0 18px 48px rgba(0, 0, 0, 0.24);
}

.donut-wrap strong {
  display: block;
  margin-bottom: 9px;
  font-size: 16px;
  line-height: 1.25;
}

.legend {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legend li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.legend b {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.month-bars {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  align-items: end;
  gap: 6px;
  height: 120px;
  margin-top: 18px;
}

.month-bar {
  display: grid;
  align-items: end;
  justify-items: center;
  height: 100%;
  gap: 5px;
}

.month-bar i {
  width: 100%;
  min-height: 4px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(124, 200, 236, 0.72));
}

.month-bar span {
  color: var(--faint);
  font-size: 10px;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.tool-grid button {
  display: grid;
  gap: 10px;
  min-height: 92px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.ai-note {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
}

.ai-note span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ai-note p {
  margin: 8px 0 0;
  color: var(--soft);
  line-height: 1.7;
}

.breath {
  display: grid;
  place-items: center;
  min-height: 118px;
  margin-top: 14px;
  border-radius: 18px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.26), transparent 58%),
    rgba(255, 255, 255, 0.08);
}

.breath strong {
  font-size: 30px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 104px;
  z-index: 50;
  max-width: min(420px, calc(100% - 40px));
  padding: 13px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(20, 22, 25, 0.72);
  color: white;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translate(-50%, 18px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.focused .brand,
body.focused .topnav,
body.focused .quote-card,
body.focused .room-note,
body.focused .panel {
  opacity: 0;
  pointer-events: none;
}

body.focused .timer-card {
  left: 50%;
  bottom: 50%;
  transform: translate(-50%, 50%) scale(1.08);
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
    width: calc(100% - 24px);
  }

  .topnav {
    position: fixed;
    top: 52px;
    left: 50%;
    display: flex;
    width: min(382px, calc(100vw - 24px));
    justify-content: center;
    transform: translateX(-50%);
  }

  .topnav button {
    flex: 1;
    padding: 0 8px;
  }

  .workspace {
    width: calc(100% - 24px);
  }

  .timer-card {
    left: 12px;
    bottom: 178px;
    width: min(310px, calc(100% - 24px));
  }

  .quote-card,
  .room-note {
    display: none;
  }

  .bottom-dock {
    grid-template-columns: 1fr;
    width: calc(100% - 24px);
    border-radius: 28px;
  }

  .dock-group {
    grid-template-columns: 1fr;
    padding: 0 8px;
  }

  .dock-actions {
    display: grid;
    grid-template-columns: 1fr 44px 44px 1fr;
  }

  .dock-button {
    min-width: 0;
    padding: 0 10px;
  }

  .dock-button span {
    display: none;
  }

  .panel {
    top: auto;
    right: 12px;
    bottom: 178px;
    width: calc(100% - 24px);
    max-height: 54svh;
  }

  .focus-panel {
    max-height: 68svh;
  }

  .week-calendar {
    grid-template-columns: 34px repeat(7, minmax(46px, 1fr));
    min-height: 390px;
    height: 48svh;
  }

  .focus-block {
    left: 3px;
    right: 3px;
    padding: 5px;
    border-radius: 8px;
    font-size: 10px;
  }

  .metric-grid,
  .donut-wrap {
    grid-template-columns: 1fr;
  }

  .donut {
    justify-self: center;
  }
}
