:root {
  --ink: #2a261f;
  --ink-soft: #5a5348;
  --paper: #f3ead6;
  --paper-edge: #c9b89a;
  --moss: #3f5343;
  --cinnabar: #9a3b2f;
  --cream: #f7f1e4;
}

* {
  box-sizing: border-box;
}

html,
body,
#map {
  margin: 0;
  height: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: #1e221c;
}

h1,
h2,
#record-clock,
.brand-place,
.sheet-kicker {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  font-weight: 600;
}

.mist {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(30, 34, 28, 0.42) 0%, transparent 22%),
    linear-gradient(0deg, rgba(30, 34, 28, 0.28) 0%, transparent 26%);
}

.top,
.sheet,
.dock,
#toast,
dialog {
  position: absolute;
  z-index: 2;
}

.paper {
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(90, 70, 40, 0.05) 0.6px, transparent 0.7px),
    linear-gradient(180deg, rgba(255, 252, 245, 0.55), transparent 42%);
  background-size: 3px 3px, auto;
  border: 1px solid var(--paper-edge);
  box-shadow:
    0 1px 0 rgba(255, 250, 240, 0.7) inset,
    0 18px 40px rgba(20, 16, 10, 0.22);
}

.top {
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: calc(16px + env(safe-area-inset-top)) 20px 12px;
  color: var(--cream);
}

.brand-place {
  margin: 0 0 2px;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  opacity: 0.72;
}

.top h1 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: 0.18em;
  font-weight: 600;
}

.top #loc-status {
  margin: 8px 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

.text-btn {
  appearance: none;
  margin-top: 1.4rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cream);
  font: inherit;
  letter-spacing: 0.2em;
  cursor: pointer;
  border-bottom: 1px solid rgba(247, 241, 228, 0.45);
}

.dock {
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  padding: 14px 18px 16px;
  background-color: rgba(243, 234, 214, 0.94);
}

.sheet {
  left: 16px;
  right: 16px;
  bottom: calc(118px + env(safe-area-inset-bottom));
  padding: 14px 18px 12px;
  background-color: rgba(243, 234, 214, 0.92);
}

.sheet-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  color: var(--cinnabar);
}

.sheet h2,
dialog h2 {
  margin: 6px 0 4px;
  font-size: 1.35rem;
  letter-spacing: 0.12em;
}

#sheet-meta,
.hint,
.listen-label,
#play-time {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.hint {
  margin-bottom: 12px;
}

.listen {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(90, 70, 40, 0.16);
}

.sheet-links,
.dock-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.sheet-links {
  justify-content: space-between;
}

.sheet-links a,
.sheet-links button,
.text-action {
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  letter-spacing: 0.12em;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid var(--paper-edge);
}

.text-action[aria-disabled='true'] {
  opacity: 0.4;
  cursor: not-allowed;
}

.orb {
  appearance: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 1.05rem;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  cursor: pointer;
}

.record-orb {
  background: var(--cinnabar);
  color: var(--cream);
  border-color: #7c2c23;
  box-shadow: 0 0 0 6px rgba(154, 59, 47, 0.12);
}

.listen-orb {
  width: 48px;
  height: 48px;
  background: var(--moss);
  color: var(--cream);
  border-color: #2d3d31;
}

.listen-orb.on {
  box-shadow: 0 0 0 7px rgba(63, 83, 67, 0.16);
}

.orb:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

dialog {
  inset: auto 20px 28%;
  width: calc(100% - 40px);
  max-width: 400px;
  padding: 22px 22px 18px;
}

dialog::backdrop {
  background: rgba(24, 22, 18, 0.46);
}

#record-clock {
  font-variant-numeric: tabular-nums;
  font-size: 2.4rem;
  letter-spacing: 0.08em;
  margin: 10px 0 6px;
}

#record-hint {
  min-height: 1.2em;
  margin: 0 0 14px;
}

label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

input[type='text'] {
  width: 100%;
  margin: 8px 0 18px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--paper-edge);
  border-radius: 0;
  font: inherit;
  background: transparent;
  color: var(--ink);
}

input[type='text']:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

#toast {
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.marker {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(63, 83, 67, 0.92);
  border: 1.5px solid #f3ead6;
  box-shadow: 0 0 0 5px rgba(63, 83, 67, 0.18);
  cursor: pointer;
}

.marker-badge {
  position: absolute;
  top: -7px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--cinnabar);
  color: var(--cream);
  font-size: 0.65rem;
  line-height: 18px;
  text-align: center;
  border: 1.5px solid #f3ead6;
  letter-spacing: 0;
}

.sound-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  max-height: 140px;
  overflow-y: auto;
}

.sound-list li {
  margin: 0;
  border-bottom: 1px solid rgba(90, 70, 40, 0.12);
}

.sound-list button {
  width: 100%;
  padding: 10px 4px;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  letter-spacing: 0.04em;
}

.sound-list button.on {
  color: var(--cinnabar);
}

.sound-list .when {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

#sheet-list-label {
  margin: 0 0 6px;
}

.marker.me {
  width: 12px;
  height: 12px;
  background: var(--cinnabar);
  border-color: #f3ead6;
  box-shadow: 0 0 0 7px rgba(154, 59, 47, 0.2);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(154, 59, 47, 0.35);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(154, 59, 47, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(154, 59, 47, 0);
  }
}

.amap-container {
  background: #d5d2c6;
}

audio {
  display: none;
}
