:root {
  --ink: #202322;
  --muted: #626a67;
  --line: rgba(33, 40, 37, 0.14);
  --paper: rgba(255, 253, 248, 0.86);
  --paper-strong: rgba(255, 253, 248, 0.96);
  --sage: #5f806c;
  --sage-dark: #385b4b;
  --coral: #c96f5f;
  --blue: #6f92a5;
  --amber: #c19752;
  --shadow: 0 24px 70px rgba(29, 37, 34, 0.22);
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color: var(--ink);
  background: #eff3ee;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(247, 249, 244, 0.94), rgba(247, 249, 244, 0.64)),
    url("./assets/calm-reading-nook.png") center / cover fixed;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 42px);
}

.workspace {
  min-height: calc(100vh - clamp(36px, 6vw, 84px));
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(246, 249, 244, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.masthead,
.panel-heading,
.history-heading,
.journal-actions,
.range-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.masthead {
  margin-bottom: clamp(18px, 3vw, 30px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--sage-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4.5vw, 4.2rem);
  line-height: 0.96;
  font-weight: 850;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.25;
}

.date {
  min-width: 11rem;
  margin: 0;
  color: var(--muted);
  text-align: right;
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(280px, 1.05fr) minmax(280px, 1fr);
  gap: 16px;
}

.panel,
.history-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(42, 54, 50, 0.09);
}

.panel {
  padding: clamp(16px, 2vw, 24px);
}

.checkin-panel,
.journal-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.quote-panel,
.breathing-panel {
  min-height: 350px;
}

.journal-panel {
  grid-column: span 2;
}

.mood-score {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: var(--sage-dark);
  color: #fffaf0;
  font-size: 1.55rem;
  font-weight: 850;
}

.range-label {
  margin-bottom: -8px;
  color: var(--muted);
  font-size: 0.86rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--sage-dark);
}

.chip-group,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact {
  margin-top: 18px;
}

.chip,
.tab,
.ghost-button,
.primary-button,
.text-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.chip,
.tab {
  padding: 0 12px;
}

.chip[aria-pressed="true"],
.tab[aria-selected="true"] {
  border-color: rgba(56, 91, 75, 0.52);
  background: rgba(95, 128, 108, 0.16);
  color: var(--sage-dark);
  font-weight: 800;
}

.ghost-button,
.primary-button,
.text-button {
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  border-color: var(--sage-dark);
  background: var(--sage-dark);
  color: #fffaf0;
}

.ghost-button:hover,
.chip:hover,
.tab:hover,
.text-button:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 91, 75, 0.35);
  background: rgba(255, 255, 255, 0.95);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: #2f4d40;
}

.quote-card {
  margin-top: 22px;
  padding: clamp(18px, 2vw, 28px);
  border-left: 5px solid var(--coral);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 247, 237, 0.82)),
    rgba(255, 255, 255, 0.74);
}

.quote-source {
  margin-bottom: 14px;
  color: var(--sage-dark);
  font-weight: 850;
}

blockquote {
  margin-bottom: 18px;
  color: #262b29;
  font-size: clamp(1.3rem, 2.6vw, 2.05rem);
  line-height: 1.45;
  font-weight: 800;
}

.quote-action {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.quote-note,
.breath-tip {
  margin: 14px 0 0;
  color: #707773;
  font-size: 0.82rem;
  line-height: 1.6;
}

.breath-stage {
  display: grid;
  min-height: 225px;
  place-items: center;
}

.breath-circle {
  display: grid;
  width: min(220px, 70vw);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), rgba(111, 146, 165, 0.18)),
    rgba(95, 128, 108, 0.13);
  border: 1px solid rgba(56, 91, 75, 0.18);
  box-shadow: inset 0 0 0 18px rgba(255, 255, 255, 0.28);
  transform: scale(0.86);
  transition: transform 900ms ease-in-out;
}

.breath-circle span {
  align-self: end;
  color: var(--sage-dark);
  font-weight: 850;
}

.breath-circle strong {
  align-self: start;
  color: var(--ink);
  font-size: 1.65rem;
}

.breath-circle.expand {
  transform: scale(1);
}

.breath-circle.hold {
  transform: scale(1);
}

.breath-circle.release {
  transform: scale(0.78);
}

.breath-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  text-align: center;
}

label {
  color: var(--sage-dark);
  font-size: 0.92rem;
  font-weight: 850;
}

textarea {
  width: 100%;
  min-height: 104px;
  margin-top: -8px;
  padding: 13px 14px;
  resize: vertical;
  border: 1px solid rgba(33, 40, 37, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  line-height: 1.55;
}

textarea:focus,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(201, 111, 95, 0.35);
  outline-offset: 2px;
}

.history-strip {
  margin-top: 16px;
  padding: clamp(16px, 2vw, 24px);
  background: var(--paper-strong);
}

.entry-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.entry {
  min-height: 150px;
  padding: 14px;
  border: 1px solid rgba(33, 40, 37, 0.12);
  border-radius: 8px;
  background: rgba(247, 250, 248, 0.9);
}

.entry time {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.entry strong {
  display: block;
  margin-bottom: 8px;
  color: var(--sage-dark);
}

.entry p {
  margin-bottom: 8px;
  color: var(--ink);
  line-height: 1.55;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.support-note {
  max-width: 860px;
  margin: 18px 0 0;
  color: #4e5552;
  font-size: 0.88rem;
  line-height: 1.7;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-panel,
  .breathing-panel,
  .journal-panel {
    grid-column: span 1;
  }

  .entry-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 720px) {
  body {
    background:
      linear-gradient(180deg, rgba(247, 249, 244, 0.97), rgba(247, 249, 244, 0.78)),
      url("./assets/calm-reading-nook.png") center / cover fixed;
  }

  .app-shell {
    padding: 0;
  }

  .workspace {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .masthead,
  .panel-heading,
  .history-heading,
  .journal-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .date {
    min-width: 0;
    text-align: left;
  }

  .layout,
  .entry-list {
    grid-template-columns: 1fr;
  }

  .quote-panel,
  .breathing-panel {
    min-height: auto;
  }

  .ghost-button,
  .primary-button,
  .text-button {
    width: 100%;
  }
}
