:root {
  color-scheme: light;
  --bg-top: #f6efe4;
  --bg-bottom: #d7e7ef;
  --card: rgba(255, 252, 247, 0.9);
  --card-border: rgba(51, 67, 82, 0.12);
  --ink: #17212b;
  --muted: #5a6674;
  --accent: #c3562f;
  --teal: #1f6775;
  --danger: #b73333;
  --cream: #fff8ee;
  --shadow: 0 18px 40px rgba(34, 47, 61, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang TC", "Noto Sans TC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.72), transparent 32%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

button,
input { font: inherit; }

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 20px 14px 48px;
}

.card {
  backdrop-filter: blur(12px);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

.hero {
  padding-top: 24px;
  background: linear-gradient(135deg, rgba(255,248,238,0.95), rgba(233,244,247,0.9)), var(--card);
}

.eyebrow {
  margin: 0 0 8px;
  color: #8b381d;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 700;
}

h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 0.95; letter-spacing: -0.04em; }
h2 { font-size: 1.06rem; }
.intro { margin-top: 12px; color: var(--muted); line-height: 1.55; }

.stack,
.project-list,
.notes-list,
.transcript-list { display: grid; gap: 14px; }

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

.section-head,
.note-top,
.note-actions,
.inline-actions,
.project-head,
.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.empty-state,
.note-card,
.transcript-item,
.project-card,
.player-card {
  border: 1px solid rgba(23, 33, 43, 0.08);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.empty-state,
.helper,
.note-map,
.transcript-time,
.project-meta {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.project-card.active {
  border-color: rgba(31, 103, 117, 0.28);
  background: rgba(242, 249, 250, 0.95);
}

button {
  border: 0;
  border-radius: 18px;
  min-height: 52px;
  padding: 12px 16px;
  cursor: pointer;
}

button:active { transform: scale(0.98); }

.primary { background: var(--teal); color: white; font-weight: 700; }
.secondary { background: rgba(31, 103, 117, 0.12); color: var(--teal); font-weight: 700; }
.ghost {
  background: rgba(23, 33, 43, 0.06);
  color: var(--ink);
  min-height: 40px;
  border-radius: 14px;
}
.danger { color: var(--danger); }

.pill,
.time-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.86rem;
}

.pill { background: rgba(31, 103, 117, 0.12); color: var(--teal); }
.pill.muted { background: rgba(23, 33, 43, 0.07); color: var(--muted); }
.time-chip {
  background: var(--cream);
  color: #8b381d;
  border: 1px solid rgba(195, 86, 47, 0.16);
  font-variant-numeric: tabular-nums;
}

audio { display: none; }

.player-card { gap: 14px; display: grid; }
.time-readout {
  display: flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
}

.seek-slider {
  width: 100%;
  margin: 0;
  accent-color: var(--teal);
}

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

.icon-btn {
  width: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.capture-wrap {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.capture-btn {
  width: 96px;
  height: 96px;
  min-height: 96px;
  padding: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #cf5c38, #933727);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 36px rgba(147, 55, 39, 0.24);
}

.capture-btn.recording {
  background: linear-gradient(135deg, #1f6775, #154b56);
}

.capture-icon {
  font-size: 2rem;
  line-height: 1;
}

.center { text-align: center; }

.note-text {
  margin-top: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.transcript-item.active {
  border-color: rgba(195, 86, 47, 0.35);
  background: rgba(255, 248, 238, 0.94);
}

@media (max-width: 640px) {
  .section-head,
  .inline-actions,
  .note-top,
  .note-actions,
  .project-head,
  .player-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .transport-grid {
    grid-template-columns: 1fr 1fr;
  }
}
