:root {
  --bg: #faf6f1;
  --bg-card: #ffffff;
  --bg-card-hover: #fefcfa;
  --text: #3d3229;
  --text-light: #8a7d72;
  --accent: #c9a87c;
  --accent-hover: #b8956a;
  --accent-soft: #e8ddd0;
  --border: #ebe3d9;
  --shadow: 0 2px 12px rgba(61, 50, 41, 0.06);
  --shadow-hover: 0 4px 20px rgba(61, 50, 41, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Noto Serif SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== Lock Screen ===== */
.lock-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(160deg, #faf6f1 0%, #f0e6d8 100%);
}

.lock-screen[hidden] {
  display: none;
}

.lock-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 380px;
  width: 100%;
}

.lock-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.lock-card h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.lock-card > p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 28px;
}

#password-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#nickname-input,
#password-input {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
}

#password-input {
  letter-spacing: 4px;
}

#nickname-input:focus,
#password-input:focus {
  border-color: var(--accent);
}

#password-form button {
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

#password-form button:hover {
  background: var(--accent-hover);
}

#password-form button:active {
  transform: scale(0.98);
}

.error-msg {
  color: #c45c4a;
  font-size: 13px;
  margin-top: 12px;
}

/* ===== Main Content ===== */
.main-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 60px 20px 40px;
}

header {
  text-align: center;
  margin-bottom: 48px;
}

header h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-light);
  font-size: 15px;
}

/* ===== Date Group ===== */
.date-group {
  margin-bottom: 36px;
}

.date-label {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  padding-left: 4px;
}

/* ===== Recording Card ===== */
.recording-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.recording-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.card-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.card-duration {
  font-size: 13px;
  color: var(--text-light);
  white-space: nowrap;
}

.card-description {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ===== Audio Player ===== */
.player {
  display: flex;
  align-items: center;
  gap: 12px;
}

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
}

.play-btn:hover {
  background: var(--accent-hover);
}

.play-btn:active {
  transform: scale(0.93);
}

.play-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.progress-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--accent-soft);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  margin-top: 60px;
  padding: 20px;
  color: var(--text-light);
  font-size: 13px;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .main-content {
    padding: 40px 16px 30px;
  }

  header h1 {
    font-size: 26px;
  }

  .lock-card {
    padding: 36px 28px;
  }

  .recording-card {
    padding: 18px 18px;
  }
}

/* ===== Animation ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.main-content:not([hidden]) {
  animation: fadeIn 0.4s ease-out;
}

.recording-card {
  animation: fadeIn 0.3s ease-out both;
}

.date-group:nth-child(1) .recording-card:nth-child(2) { animation-delay: 0.05s; }
.date-group:nth-child(1) .recording-card:nth-child(3) { animation-delay: 0.1s; }
.date-group:nth-child(2) .recording-card:nth-child(2) { animation-delay: 0.15s; }
.date-group:nth-child(2) .recording-card:nth-child(3) { animation-delay: 0.2s; }

/* ===== Comments ===== */
.comments-section {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.comments-toggle {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s;
}

.comments-toggle:hover {
  color: var(--accent);
}

.comments-list {
  margin-top: 12px;
}

.comment {
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  animation: fadeIn 0.2s ease-out;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.comment-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.comment-time {
  font-size: 11px;
  color: var(--text-light);
  margin-left: auto;
}

.comment-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  padding-left: 34px;
}

.comment-actions {
  padding-left: 34px;
  margin-top: 4px;
}

.reply-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.2s;
}

.reply-btn:hover {
  color: var(--accent);
}

/* Replies (nested) */
.replies {
  margin-left: 34px;
  margin-top: 6px;
  border-left: 2px solid var(--accent-soft);
  padding-left: 12px;
}

.replies .comment {
  background: transparent;
  padding: 6px 0;
  margin-bottom: 4px;
}

.replies .comment-body {
  padding-left: 34px;
}

.replies .comment-actions {
  padding-left: 34px;
}

/* Comment input */
.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: flex-end;
}

.comment-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  font-family: inherit;
  line-height: 1.4;
}

.comment-input:focus {
  border-color: var(--accent);
}

.comment-input::placeholder {
  color: var(--text-light);
}

.comment-submit {
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}

.comment-submit:hover {
  background: var(--accent-hover);
}

.comment-submit:active {
  transform: scale(0.96);
}

.reply-form {
  margin-top: 8px;
  margin-left: 34px;
}

.reply-form .comment-form {
  margin-top: 0;
}

.reply-hint {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reply-cancel {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 12px;
  cursor: pointer;
}

.reply-cancel:hover {
  color: #c45c4a;
}

.no-comments {
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  padding: 8px 0;
}
