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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  min-height: 100vh;
  color: #1a1a2e;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

header h1 {
  color: white;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.user-name {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.user-name:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn {
  background: white;
  color: #764ba2;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.photo-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.photo-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.photo-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  background: #e0e0e0;
}

.photo-caption {
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loading,
.empty {
  text-align: center;
  padding: 4rem 2rem;
  color: #888;
}

.empty p {
  font-size: 1.2rem;
}

.empty .sub {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  color: #aaa;
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  cursor: pointer;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.modal {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  width: 90%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal h2 {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
  color: #333;
}

.modal p {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 1.2rem;
}

.modal input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.modal input:focus {
  border-color: #764ba2;
}

.modal-btn {
  margin-top: 1rem;
  width: 100%;
  color: white;
  background: linear-gradient(135deg, #667eea, #764ba2);
}
