* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ========== 认证页面 ========== */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.auth-card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.auth-card h1 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 24px;
}

.auth-card h2 {
  text-align: center;
  font-size: 1.25rem;
  margin-bottom: 20px;
  color: #555;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-card input {
  padding: 12px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.auth-card input:focus {
  border-color: #4f46e5;
}

.btn-primary {
  padding: 12px;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #4338ca;
}

.auth-switch {
  text-align: center;
  margin-top: 16px;
  color: #666;
}

.auth-switch a {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-error {
  text-align: center;
  color: #ef4444;
  margin-top: 12px;
  font-size: 0.875rem;
}

/* ========== 应用页面 ========== */
.container {
  max-width: 580px;
  margin: 0 auto;
  padding: 40px 16px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.app-header h1 {
  font-size: 2rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info span {
  font-size: 0.875rem;
  color: #666;
}

.btn-logout {
  padding: 6px 14px;
  background: #f3f4f6;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: #e5e7eb;
}

#todo-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

#todo-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

#todo-input:focus {
  border-color: #4f46e5;
}

#todo-form button {
  padding: 12px 24px;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

#todo-form button:hover {
  background: #4338ca;
}

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  justify-content: center;
}

.filter-btn {
  padding: 6px 16px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: white;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.filter-btn.active {
  background: #4f46e5;
  color: white;
  border-color: #4f46e5;
}

#todo-list {
  list-style: none;
}

#todo-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border-radius: 8px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: opacity 0.3s;
}

#todo-list li.completed .todo-title {
  text-decoration: line-through;
  color: #aaa;
}

.todo-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #4f46e5;
  flex-shrink: 0;
}

.todo-content {
  flex: 1;
  min-width: 0;
}

.todo-title {
  font-size: 1rem;
  display: block;
  word-break: break-word;
}

.todo-meta {
  font-size: 0.75rem;
  color: #999;
  margin-top: 4px;
  display: block;
}

.todo-delete {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px;
  flex-shrink: 0;
}

.todo-delete:hover {
  color: #ef4444;
}

.footer {
  text-align: center;
  margin-top: 16px;
  color: #999;
  font-size: 0.875rem;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #999;
}

/* ========== 响应式 ========== */
@media (max-width: 480px) {
  .app-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
