body {
  margin: 0;
  font-family: 'Noto Sans KR', sans-serif;
  background-color: #f8f9fa;
  color: #333;
}

.write-container {
  max-width: 900px;
  width: 90%;
  margin: 40px auto;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.write-header {
  background: linear-gradient(to right, #1a237e, #283593);
  color: white;
  padding: 30px;
  margin: -20px -20px 30px -20px;
  border-radius: 12px 12px 0 0;
  text-align: center;
}

h2 {
  font-size: 28px;
  margin: 0;
  font-weight: 700;
}

/* 사용자 정보 표시 영역 */
.user-info-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-name {
  font-size: 18px;
  font-weight: 600;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* 로그인 안내 영역 */
.login-prompt-container {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 25px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(252, 182, 159, 0.3);
}

.login-prompt p {
  margin: 0 0 20px 0;
  font-size: 16px;
  color: #8b4513;
  font-weight: 500;
}

.login-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.login-btn,
.register-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.login-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.register-btn {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.register-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4);
}

.form-group {
  margin-bottom: 25px;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #007bff;
  outline: none;
}

input[type="text"][readonly] {
  background-color: #f8f9fa;
  cursor: not-allowed;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

textarea {
  min-height: 200px;
  resize: vertical;
}

.content-length {
  margin-top: 8px;
  text-align: right;
  font-size: 14px;
  color: #666;
}

.btn-wrap {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.submit-btn,
.cancel-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.submit-btn {
  background: #007bff;
  color: white;
  border: none;
}

.cancel-btn {
  background: #f8f9fa;
  color: #333;
  border: 1px solid #ddd;
}

.submit-btn:hover {
  background: #0056b3;
}

.cancel-btn:hover {
  background: #e9ecef;
}

/* 반응형 미디어 쿼리 */
@media screen and (max-width: 768px) {
  .write-container {
    width: 95%;
    padding: 15px;
    margin: 20px auto;
  }

  .write-header {
    padding: 25px;
    margin: -15px -15px 25px -15px;
  }

  h2 {
    font-size: 24px;
  }

  /* 사용자 정보 영역 반응형 */
  .user-info-container {
    padding: 15px;
    margin-bottom: 20px;
  }

  .user-info {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .user-name {
    font-size: 16px;
  }

  .logout-btn {
    padding: 10px 20px;
    font-size: 13px;
  }

  /* 로그인 안내 영역 반응형 */
  .login-prompt-container {
    padding: 20px;
    margin-bottom: 20px;
  }

  .login-prompt p {
    font-size: 15px;
    margin-bottom: 15px;
  }

  .login-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .login-btn,
  .register-btn {
    width: 100%;
    padding: 15px 24px;
    font-size: 15px;
  }

  .form-group {
    padding: 15px;
    margin-bottom: 20px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 10px;
  }

  .btn-wrap {
    flex-direction: column;
    gap: 10px;
  }

  .submit-btn,
  .cancel-btn {
    width: 100%;
  }
}

@media screen and (max-width: 480px) {
  .write-container {
    width: 100%;
    padding: 10px;
    margin: 10px auto;
    border-radius: 0;
  }

  .write-header {
    padding: 20px;
    margin: -10px -10px 20px -10px;
    border-radius: 0;
  }

  h2 {
    font-size: 20px;
  }

  /* 사용자 정보 영역 모바일 */
  .user-info-container {
    padding: 15px;
    margin-bottom: 15px;
  }

  .user-name {
    font-size: 15px;
  }

  .logout-btn {
    padding: 8px 16px;
    font-size: 12px;
  }

  /* 로그인 안내 영역 모바일 */
  .login-prompt-container {
    padding: 15px;
    margin-bottom: 15px;
  }

  .login-prompt p {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .login-btn,
  .register-btn {
    padding: 12px 20px;
    font-size: 14px;
  }

  .form-group {
    padding: 12px;
    margin-bottom: 15px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 8px;
    font-size: 14px;
  }

  .btn-wrap {
    gap: 8px;
  }

  .submit-btn,
  .cancel-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}

.comment-delete {
  margin-left: 8px;
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
}
.comment-delete:hover {
  text-decoration: underline;
}