:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #25231f;
  background: #f6f4ef;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #f6f4ef;
}

button,
textarea,
input {
  font: inherit;
}

button {
  border: 1px solid #2f2c27;
  border-radius: 999px;
  padding: 0.68rem 1.15rem;
  color: #f9f8f4;
  background: #2f2c27;
  cursor: pointer;
}

button:hover {
  background: #161512;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid #6d675c;
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.page {
  width: min(100% - 2rem, 760px);
  margin: 0 auto;
  padding: 3rem 0 6rem;
}

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 3.5rem;
}

.brand {
  margin: 0;
  font-family: "Songti SC", STSong, serif;
  font-size: 1.35rem;
  letter-spacing: 0.12em;
}

.principle,
.section-note,
.feedback,
.result-meta,
time,
.observation-description {
  color: #777166;
}

.principle,
.section-note,
.feedback,
.result-meta p {
  margin: 0;
}

section {
  padding: 0 0 3.25rem;
  margin: 0 0 3.25rem;
  border-bottom: 1px solid #ddd9d0;
}

section:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

h1,
h2,
h3 {
  font-family: "Songti SC", STSong, serif;
  font-weight: 600;
}

h1,
h2 {
  margin: 0 0 1.25rem;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}

textarea {
  display: block;
  width: 100%;
  min-height: 6rem;
  resize: vertical;
  border: 1px solid #cfcbc1;
  border-radius: 12px;
  padding: 1rem;
  line-height: 1.75;
  color: inherit;
  background: #fbfaf7;
}

textarea::placeholder {
  color: #aaa398;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.4rem;
  padding-top: 0.8rem;
}

.voice-leave {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e4e0d8;
}

.voice-leave-title,
.text-leave-title,
.record-kind,
.transcription-state {
  color: #777166;
  font-size: 0.88rem;
}

.voice-leave-title,
.text-leave-title {
  margin: 0 0 0.8rem;
}

.recording-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.hold-to-record {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 4.4rem;
  gap: 0.65rem;
  border-radius: 14px;
  font-size: 1.08rem;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.microphone-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
  pointer-events: none;
}

.hold-to-record.is-recording {
  color: #f9f8f4;
  background: #8a433d;
  border-color: #8a433d;
  transform: scale(0.98);
}

.hold-to-record.is-recording:hover {
  color: #f9f8f4;
  background: #763832;
}

.feedback {
  min-height: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.error {
  color: #8a433d;
}

.records-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.record {
  scroll-margin-top: 1rem;
  padding: 1.35rem 0;
  border-top: 1px solid #e4e0d8;
}

.record:first-child {
  border-top: 0;
}

.record:target {
  border-radius: 8px;
  background: #eeebe3;
  box-shadow: 0 0 0 0.7rem #eeebe3;
}

time {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
}

.record-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.record-text {
  margin: 0;
  font-family: "Songti SC", STSong, serif;
  font-size: 1.08rem;
  line-height: 1.8;
}

.record-kind {
  margin: 0 0 0.45rem;
}

.transcription-state {
  margin: 0 0 0.65rem;
}

.record audio,
.evidence audio {
  display: block;
  width: min(100%, 28rem);
  height: 2.5rem;
  margin-top: 0.9rem;
}

.text-button {
  padding: 0;
  color: #5f594f;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.text-button:hover {
  color: #2f2c27;
  background: transparent;
}

.section-note {
  margin-top: -0.6rem;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.quick-ranges {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.secondary-button {
  color: #3c3933;
  background: transparent;
  border-color: #aaa398;
}

.secondary-button:hover {
  color: #1c1a17;
  background: #ebe8e0;
}

.custom-range {
  display: flex;
  align-items: end;
  gap: 0.75rem;
}

.range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 1;
  gap: 0.75rem;
}

.range-fields label {
  display: grid;
  gap: 0.4rem;
  color: #777166;
  font-size: 0.78rem;
}

input {
  width: 100%;
  border: 1px solid #cfcbc1;
  border-radius: 8px;
  padding: 0.65rem 0.7rem;
  color: #35322d;
  background: #fbfaf7;
}

#reveal-status {
  margin-top: 1rem;
}

.reveal-result {
  margin-top: 1.4rem;
}

.result-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  font-size: 0.82rem;
  border-bottom: 1px solid #ddd9d0;
}

.observation {
  padding: 1.8rem 0 0.5rem;
}

.observation + .observation {
  border-top: 1px solid #ddd9d0;
}

.observation h3 {
  margin: 0 0 0.55rem;
  font-size: 1.12rem;
}

.observation-description {
  max-width: 42rem;
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

.evidence-list {
  display: grid;
  gap: 0.85rem;
}

.evidence {
  margin: 0;
  padding: 1rem 1.1rem;
  border-left: 2px solid #777166;
  background: #fbfaf7;
}

.evidence-kind {
  margin: 0 0 0.45rem;
  color: #777166;
  font-size: 0.78rem;
}

.evidence-content {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Songti SC", STSong, serif;
  font-size: 1.06rem;
  line-height: 1.75;
}

.evidence-audio {
  margin-top: 0.85rem;
}

.empty-observations {
  margin: 1.5rem 0 0;
  color: #777166;
}

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

[hidden] {
  display: none !important;
}

@media (max-width: 620px) {
  .page {
    width: min(100% - 1.4rem, 760px);
    padding-top: 1.5rem;
  }

  .page-header {
    margin-bottom: 2.5rem;
  }

  section {
    padding-bottom: 2.5rem;
    margin-bottom: 2.5rem;
  }

  .quick-ranges,
  .custom-range,
  .result-meta,
  .recording-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-ranges button,
  .custom-range button,
  .recording-controls button {
    width: 100%;
  }

  .range-fields {
    grid-template-columns: 1fr;
  }
}
