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

body {
  background-color: #0f0f0f;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ====== Form Views ====== */
.form-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  max-width: 360px;
  margin: 0 auto;
}

.logo-area { text-align: center; margin-bottom: 2.5rem; }
.logo-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.logo-area h1 { font-size: 1.5rem; font-weight: 300; letter-spacing: 0.3em; color: #e0e0e0; }
.logo-area p { font-size: 0.875rem; color: #888; margin-top: 0.5rem; }

form { width: 100%; }
input, textarea {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 0.875rem 1rem;
  color: #e0e0e0;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
input { margin-bottom: 0.75rem; }
input::placeholder, textarea::placeholder { color: #666; }
input:focus, textarea:focus { border-color: #a78bfa; }

button {
  border: none;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: opacity 0.2s;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }

form button[type="submit"] {
  width: 100%;
  background: #a78bfa;
  color: #fff;
  border-radius: 10px;
  padding: 0.875rem;
  margin-top: 0.5rem;
}
form button[type="submit"]:hover:not(:disabled) { opacity: 0.9; }

.error { color: #f87171; font-size: 0.8125rem; margin-bottom: 0.5rem; text-align: center; }
.switch-link { color: #888; font-size: 0.8125rem; margin-top: 1.5rem; text-align: center; }
.switch-link a { color: #a78bfa; text-decoration: none; }
.switch-link a:hover { text-decoration: underline; }

/* ====== Home View ====== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #2a2a2a;
  background: rgba(26, 26, 26, 0.5);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-left { display: flex; align-items: center; gap: 0.5rem; }
.header-icon { font-size: 1.125rem; }
.header-title { font-weight: 300; letter-spacing: 0.2em; }

.header-right { display: flex; align-items: center; gap: 1rem; font-size: 0.8125rem; }
.header-right span { color: #888; }
.header-right button {
  background: none;
  color: #888;
  font-size: 0.8125rem;
  padding: 0;
}
.header-right button:hover { color: #f87171; }

/* ====== Main Content ====== */
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.entry-form-area { margin-bottom: 2rem; }

.textarea-wrapper { position: relative; }
.textarea-wrapper textarea {
  resize: none;
  margin-bottom: 0;
  padding-right: 3rem;
}

.voice-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  color: #888;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.voice-btn:hover { background: #3a3a3a; color: #e0e0e0; }
.voice-btn.listening {
  background: #a78bfa;
  border-color: #a78bfa;
  color: #fff;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(167, 139, 250, 0); }
}

.voice-status {
  position: absolute;
  right: 52px;
  bottom: 16px;
  font-size: 0.75rem;
  color: #a78bfa;
  pointer-events: none;
}

.entry-form-area textarea {
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1.6;
}

.entry-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}
.char-count { font-size: 0.75rem; color: #666; }
.entry-form-footer button {
  background: #a78bfa;
  color: #fff;
  border-radius: 999px;
  padding: 0.5rem 1.5rem;
  font-size: 0.8125rem;
}
.entry-form-footer button:hover:not(:disabled) { opacity: 0.9; }

.success-msg {
  color: #a78bfa;
  font-size: 0.8125rem;
  text-align: center;
  margin-top: 0.75rem;
}

.empty-hint, .loading-hint {
  text-align: center;
  color: #666;
  font-size: 0.8125rem;
  margin-top: 2rem;
}

/* ====== Entry Cards ====== */
.entry-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 1rem 1.125rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.entry-card p.content {
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9375rem;
}

.entry-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}
.entry-meta .time { font-size: 0.75rem; color: #666; }
.entry-meta .delete-in {
  font-size: 0.75rem;
  color: #666;
  font-style: italic;
}
.entry-meta .delete-btn {
  background: none;
  color: #666;
  font-size: 0.75rem;
  padding: 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.entry-card:hover .delete-btn { opacity: 1; }
.delete-btn:hover { color: #f87171; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #1a1a1a; }
::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 2px; }

@media (max-width: 480px) {
  .form-container { padding: 1.5rem 1rem; }
  main { padding: 1rem 0.75rem 3rem; }
  header { padding: 0.75rem 1rem; }
}
